Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:15
CP/DOS VioWrtCharStrAtt mapper                              Page     1-1


				;
				page 60,132
				;
				title CP/DOS VioWrtCharStrAtt mapper
				;
 0000				vioxxx  segment byte public 'vio'
				        assume  cs:vioxxx,ds:nothing,es:nothing,ss:nothing
				;
				; ************************************************************************* *
				; *
				; *      MODULE:  viowrtcharstratt     Write character string with attribute
				; *
				; *      FILE NAME:  wchstra.asm
				; *
				; *      CALLING SEQUENCE:
				; *
				; *             push@   dword   char_str
				; *             push    word    length
				; *             push    word    row
				; *             push    word    column
				; *             push@   dword   attribute
				; *             push    word    vio handle
				; *             call    viowrtcharstr
				; *
				; *
				; *      MODULES CALLED:  BIOS int 10h
				; *
				; *************************************************************************
				
				        public  viowrtcharstratt
				        .sall
				        .list
				
 = 0001				full_scr_err equ 0001h
 = 0002				error_bvs_parameter     equ 0002h
				
				str     struc
 0000  0000			old_bp  dw      ?
 0002  00000000			return  dd      ?
 0006  0000			handle  dw      ?       ; vio handle
 0008  00000000			attr    dd      ?       ; attribute pointer
 000C  0000			column  dw      ?       ; column number
 000E  0000			row     dw      ?       ; starting position for output
 0010  0000			lngth   dw      ?       ; length of the string
 0012  00000000			addr    dd      ?       ; string to be written (pointer)
 0016				str     ends
				
 0000				viowrtcharstratt proc   far
				        Enter   viowrtcharstratt         ; push registers
				
 000C  2A FF			        sub     bh,bh
 000E  2B C0			        sub     ax,ax                    ; Start with clean error condition
 0010  8B 56 0C			        mov     dx,[bp].column           ; get column number
 0013  80 FA 50			        cmp     dl,80                    ; check for upper boundry
 0016  7F 7A			        jg      error                    ; branch if illegal number
				
Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:15
CP/DOS VioWrtCharStrAtt mapper                              Page     1-2


 0018  8B 46 0E			        mov     ax,[bp].row              ; get row number
 001B  3C 19			        cmp     al,25                    ; check for upper boundry
 001D  7F 73			        jg      error                    ; branch if illegal number
 001F  8A F0			        mov     dh,al
 0021  B4 02			        mov     ah,02h
				        pushal                           ; Save registers in case int 10h
				                                         ;   messes them up
 002C  CD 10			        int     10h                      ; Set start cursor position
				
				        popal
 0037  C5 76 08			        lds     si,[bp].attr             ; Set up attribute in BL
 003A  8A 1C			        mov     bl,byte ptr ds:[si]
 003C  C5 76 12			        lds     si,[bp].addr             ; DS:SI is pointer to string
 003F  8B 7E 10			        mov     di,[bp].lngth
				                                         ;  ****************************
				;       cmp     bl,15                    ;  ** assume good attribute! **
				;       jg      error                    ;  ****************************
				
 0042  8A 04			top:    mov     al,byte ptr [si]
 0044  B4 09			        mov     ah,09h                   ; set write char/attrib function code
 0046  B9 0001			        mov     cx,1                     ; write only one character
				        pushal                           ; Save registers in case int 10h
				                                         ;   messes them up
 0052  CD 10			        int     10h                      ; Output one character
				
				        popal                            ; restore registers
 005D  46			        inc     si
 005E  4F			        dec     di
 005F  FE C2			        inc     dl
 0061  80 FA 50			        cmp     dl,80                    ; Handle end of line condition
 0064  75 0F			        jne     around                   ;    |
 0066  FE C6			        inc     dh                       ;    |
 0068  B2 00			        mov     dl,00                    ;    V
 006A  80 FE 19			        cmp     dh,25                    ; Handle end of screen condition
 006D  75 06			        jne     around                   ;    |
 006F  B8 0001			        mov     ax,full_scr_err          ; Error in AX
 0072  EB 21 90			        jmp     exit
				
 0075  B4 02			around: mov     ah,02h
				        pushal                           ; Save registers in case int 10h
				                                         ;   messes them up
 0080  CD 10			        int     10h                      ; Increment cursor position
				
				        popal
 008B  83 FF 00			        cmp     di,0                     ; check if complete string is written
 008E  75 B2			        jne     top                      ; else, go and write next character
				
 0090  2B C0			        sub     ax,ax                    ; set no error code
				
 0092  B8 0002			error:  mov     ax,error_bvs_parameter
				
 0095				exit:   Mexit                            ; return
 00A1  CA 0010			        ret     size str - 6
				;
 00A4				viowrtcharstratt endp
 00A4				vioxxx  ends
Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:15
CP/DOS VioWrtCharStrAtt mapper                              Page     1-3


				        end

Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:15
CP/DOS VioWrtCharStrAtt mapper                              Symbols-1


Macros:

		N a m e			Lines

ENTER  . . . . . . . . . . . . .  	   3
MEXIT  . . . . . . . . . . . . .  	   3
POPAL  . . . . . . . . . . . . .  	   9
PUSHAL . . . . . . . . . . . . .  	   9

Structures and Records:

                N a m e                 Width   # fields
                                        Shift   Width   Mask    Initial

STR  . . . . . . . . . . . . . .  	0016	0008
  OLD_BP . . . . . . . . . . . .  	0000
  RETURN . . . . . . . . . . . .  	0002
  HANDLE . . . . . . . . . . . .  	0006
  ATTR . . . . . . . . . . . . .  	0008
  COLUMN . . . . . . . . . . . .  	000C
  ROW  . . . . . . . . . . . . .  	000E
  LNGTH  . . . . . . . . . . . .  	0010
  ADDR . . . . . . . . . . . . .  	0012

Segments and Groups:

                N a m e         	Length	 Align	Combine Class

VIOXXX . . . . . . . . . . . . .  	00A4	BYTE	PUBLIC	'VIO'

Symbols:            

                N a m e         	Type	 Value	 Attr

AROUND . . . . . . . . . . . . .  	L NEAR	0075	VIOXXX

ERROR  . . . . . . . . . . . . .  	L NEAR	0092	VIOXXX
ERROR_BVS_PARAMETER  . . . . . .  	NUMBER	0002	
EXIT . . . . . . . . . . . . . .  	L NEAR	0095	VIOXXX

FULL_SCR_ERR . . . . . . . . . .  	NUMBER	0001	

TOP  . . . . . . . . . . . . . .  	L NEAR	0042	VIOXXX

viowrtcharstratt . . . . . . . .  	F PROC	0000	VIOXXX	Global	Length = 00A4

@CPU . . . . . . . . . . . . . .  	TEXT  0101h		
@FILENAME  . . . . . . . . . . .  	TEXT  wchstra		
@VERSION . . . . . . . . . . . .  	TEXT  510		

Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:15

CP/DOS VioWrtCharStrAtt mapper                              Symbols-2






    161 Source  Lines
    239 Total   Lines
     27 Symbols

  47368 + 268453 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
