summaryrefslogtreecommitdiff
path: root/v4.0/src/MAPPER/WCHSTRA.ASM
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/MAPPER/WCHSTRA.ASM')
-rw-r--r--v4.0/src/MAPPER/WCHSTRA.ASM115
1 files changed, 115 insertions, 0 deletions
diff --git a/v4.0/src/MAPPER/WCHSTRA.ASM b/v4.0/src/MAPPER/WCHSTRA.ASM
new file mode 100644
index 0000000..2f42822
--- /dev/null
+++ b/v4.0/src/MAPPER/WCHSTRA.ASM
@@ -0,0 +1,115 @@
1;
2page 60,132
3;
4title CP/DOS VioWrtCharStrAtt mapper
5;
6vioxxx segment byte public 'vio'
7 assume cs:vioxxx,ds:nothing,es:nothing,ss:nothing
8;
9; ************************************************************************* *
10; *
11; * MODULE: viowrtcharstratt Write character string with attribute
12; *
13; * FILE NAME: wchstra.asm
14; *
15; * CALLING SEQUENCE:
16; *
17; * push@ dword char_str
18; * push word length
19; * push word row
20; * push word column
21; * push@ dword attribute
22; * push word vio handle
23; * call viowrtcharstr
24; *
25; *
26; * MODULES CALLED: BIOS int 10h
27; *
28; *************************************************************************
29
30 public viowrtcharstratt
31 .sall
32 .xlist
33 include macros.inc
34 .list
35
36full_scr_err equ 0001h
37error_bvs_parameter equ 0002h
38
39str struc
40old_bp dw ?
41return dd ?
42handle dw ? ; vio handle
43attr dd ? ; attribute pointer
44column dw ? ; column number
45row dw ? ; starting position for output
46lngth dw ? ; length of the string
47addr dd ? ; string to be written (pointer)
48str ends
49
50viowrtcharstratt proc far
51 Enter viowrtcharstratt ; push registers
52
53 sub bh,bh
54 sub ax,ax ; Start with clean error condition
55 mov dx,[bp].column ; get column number
56 cmp dl,80 ; check for upper boundry
57 jg error ; branch if illegal number
58
59 mov ax,[bp].row ; get row number
60 cmp al,25 ; check for upper boundry
61 jg error ; branch if illegal number
62 mov dh,al
63 mov ah,02h
64 pushal ; Save registers in case int 10h
65 ; messes them up
66 int 10h ; Set start cursor position
67
68 popal
69 lds si,[bp].attr ; Set up attribute in BL
70 mov bl,byte ptr ds:[si]
71 lds si,[bp].addr ; DS:SI is pointer to string
72 mov di,[bp].lngth
73 ; ****************************
74; cmp bl,15 ; ** assume good attribute! **
75; jg error ; ****************************
76
77top: mov al,byte ptr [si]
78 mov ah,09h ; set write char/attrib function code
79 mov cx,1 ; write only one character
80 pushal ; Save registers in case int 10h
81 ; messes them up
82 int 10h ; Output one character
83
84 popal ; restore registers
85 inc si
86 dec di
87 inc dl
88 cmp dl,80 ; Handle end of line condition
89 jne around ; |
90 inc dh ; |
91 mov dl,00 ; V
92 cmp dh,25 ; Handle end of screen condition
93 jne around ; |
94 mov ax,full_scr_err ; Error in AX
95 jmp exit
96
97around: mov ah,02h
98 pushal ; Save registers in case int 10h
99 ; messes them up
100 int 10h ; Increment cursor position
101
102 popal
103 cmp di,0 ; check if complete string is written
104 jne top ; else, go and write next character
105
106 sub ax,ax ; set no error code
107
108error: mov ax,error_bvs_parameter
109
110exit: Mexit ; return
111 ret size str - 6
112;
113viowrtcharstratt endp
114vioxxx ends
115 end