diff options
Diffstat (limited to 'v4.0/src/CMD/FDISK/_MSGRET.ASM')
| -rw-r--r-- | v4.0/src/CMD/FDISK/_MSGRET.ASM | 263 |
1 files changed, 263 insertions, 0 deletions
diff --git a/v4.0/src/CMD/FDISK/_MSGRET.ASM b/v4.0/src/CMD/FDISK/_MSGRET.ASM new file mode 100644 index 0000000..c19108f --- /dev/null +++ b/v4.0/src/CMD/FDISK/_MSGRET.ASM | |||
| @@ -0,0 +1,263 @@ | |||
| 1 | page 60,132 | ||
| 2 | name _msgret | ||
| 3 | title C to Message Retriever | ||
| 4 | ;------------------------------------------------------------------- | ||
| 5 | ; | ||
| 6 | ; MODULE: _msgret | ||
| 7 | ; | ||
| 8 | ; PURPOSE: Supplies an interface between C programs and | ||
| 9 | ; the DOS 3.3 message retriever | ||
| 10 | ; | ||
| 11 | ; CALLING FORMAT: | ||
| 12 | ; msgret(&inregs,&outregs); | ||
| 13 | ; | ||
| 14 | ; DATE: 5-21-87 | ||
| 15 | ; | ||
| 16 | ;------------------------------------------------------------------- | ||
| 17 | |||
| 18 | INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AC010; | ||
| 19 | |||
| 20 | MSG_UTILNAME <FDISK> ;IDENTIFY THE COMPONENT ;AC010; | ||
| 21 | |||
| 22 | ;------------------------------------------------------------------- | ||
| 23 | ;------------------------------------------------------------------- | ||
| 24 | |||
| 25 | |||
| 26 | _TEXT SEGMENT BYTE PUBLIC 'CODE' ;AC010; | ||
| 27 | _TEXT ENDS ;AC010; | ||
| 28 | _DATA SEGMENT WORD PUBLIC 'DATA' ;AC010; | ||
| 29 | _DATA ENDS ;AC010; | ||
| 30 | CONST SEGMENT WORD PUBLIC 'CONST' ;AC010; | ||
| 31 | CONST ENDS ;AC010; | ||
| 32 | _BSS SEGMENT WORD PUBLIC 'BSS' ;AC010; | ||
| 33 | _BSS ENDS ;AC010; | ||
| 34 | |||
| 35 | DGROUP GROUP CONST, _BSS, _DATA ;AC010; | ||
| 36 | ASSUME CS: DGROUP, DS: DGROUP, SS: DGROUP, ES: NOTHING ;AC010; | ||
| 37 | |||
| 38 | public data_sysloadmsg ;AC010; | ||
| 39 | public data_sysdispmsg ;AC010; | ||
| 40 | public data_sysgetmsg ;AC010; | ||
| 41 | |||
| 42 | _DATA SEGMENT ;AC010; | ||
| 43 | |||
| 44 | MSG_SERVICES <MSGDATA> ;AC010; | ||
| 45 | MSG_SERVICES <LOADmsg,FARmsg> ;AC010; | ||
| 46 | MSG_SERVICES <DISPLAYmsg,GETmsg,CHARmsg,NUMmsg> ;AC010; | ||
| 47 | MSG_SERVICES <FDISK.CLA,FDISK.CLB,FDISK.CL1,FDISK.CL2,FDISK.CTL> ;AC010; ;AC010; | ||
| 48 | |||
| 49 | |||
| 50 | data_sysloadmsg proc far | ||
| 51 | |||
| 52 | push bp ; save user's base pointer ;AC010; | ||
| 53 | mov bp,sp ; set bp to current sp ;AC010; | ||
| 54 | push di ; save some registers ;AC010; | ||
| 55 | push si ;AC010; | ||
| 56 | |||
| 57 | ; copy C inregs into proper registers | ||
| 58 | |||
| 59 | mov di,[bp+4+4] ; fix di (arg 0) ;AC010; | ||
| 60 | |||
| 61 | ;------------------------------------------------------------------- | ||
| 62 | |||
| 63 | mov ax,[di+0ah] ; load di ;AC010; | ||
| 64 | push ax ; the di value from inregs is now on stack ;AC010; | ||
| 65 | |||
| 66 | mov ax,[di+00] ; get inregs.x.ax ;AC010; | ||
| 67 | mov bx,[di+02] ; get inregs.x.bx ;AC010; | ||
| 68 | mov cx,[di+04] ; get inregs.x.cx ;AC010; | ||
| 69 | mov dx,[di+06] ; get inregs.x.dx ;AC010; | ||
| 70 | mov si,[di+08] ; get inregs.x.si ;AC010; | ||
| 71 | pop di ; get inregs.x.di from stack ;AC010; | ||
| 72 | |||
| 73 | push bp ; save base pointer ;AC010; | ||
| 74 | |||
| 75 | ;------------------------------------------------------------------- | ||
| 76 | |||
| 77 | call sysloadmsg ; call the message retriever ;AC010; | ||
| 78 | |||
| 79 | ;------------------------------------------------------------------- | ||
| 80 | |||
| 81 | pop bp ; restore base pointer ;AC010; | ||
| 82 | push di ; the di value from call is now on stack ;AC010; | ||
| 83 | mov di,[bp+6+4] ; fix di (arg 1) ;AC010; | ||
| 84 | |||
| 85 | mov [di+00],ax ; load outregs.x.ax ;AC010; | ||
| 86 | mov [di+02],bx ; load outregs.x.bx ;AC010; | ||
| 87 | mov [di+04],cx ; load outregs.x.cx ;AC010; | ||
| 88 | mov [di+06],dx ; load outregs.x.dx ;AC010; | ||
| 89 | mov [di+08],si ; load outregs.x.si ;AC010; | ||
| 90 | |||
| 91 | lahf ; get flags into ax ;AC010; | ||
| 92 | mov al,ah ; move into low byte ;AC010; | ||
| 93 | mov [di+0ch],ax ; load outregs.x.cflag ;AC010; | ||
| 94 | |||
| 95 | pop ax ; get di from stack ;AC010; | ||
| 96 | mov [di+0ah],ax ; load outregs.x.di ;AC010; | ||
| 97 | |||
| 98 | ;------------------------------------------------------------------- | ||
| 99 | |||
| 100 | pop si ; restore registers ;AC010; | ||
| 101 | pop di ;AC010; | ||
| 102 | mov sp,bp ; restore sp ;AC010; | ||
| 103 | pop bp ; restore user's bp ;AC010; | ||
| 104 | ret | ||
| 105 | |||
| 106 | data_sysloadmsg endp ;AC010; | ||
| 107 | |||
| 108 | |||
| 109 | data_sysdispmsg proc far ;AC010; | ||
| 110 | |||
| 111 | push bp ; save user's base pointer ;AC010; | ||
| 112 | mov bp,sp ; set bp to current sp ;AC010; | ||
| 113 | push di ; save some registers ;AC010; | ||
| 114 | push si ;AC010; | ||
| 115 | |||
| 116 | ; copy C inregs into proper registers | ||
| 117 | |||
| 118 | mov di,[bp+4+4] ; fix di (arg 0) ;AC010; | ||
| 119 | |||
| 120 | ;------------------------------------------------------------------- | ||
| 121 | |||
| 122 | mov ax,[di+0ah] ; load di ;AC010; | ||
| 123 | push ax ; the di value from inregs is now on stack ;AC010; | ||
| 124 | |||
| 125 | mov ax,[di+00] ; get inregs.x.ax ;AC010; | ||
| 126 | mov bx,[di+02] ; get inregs.x.bx ;AC010; | ||
| 127 | mov cx,[di+04] ; get inregs.x.cx ;AC010; | ||
| 128 | mov dx,[di+06] ; get inregs.x.dx ;AC010; | ||
| 129 | mov si,[di+08] ; get inregs.x.si ;AC010; | ||
| 130 | pop di ; get inregs.x.di from stack ;AC010; | ||
| 131 | |||
| 132 | push bp ; save base pointer ;AC010; | ||
| 133 | |||
| 134 | ;------------------------------------------------------------------- | ||
| 135 | |||
| 136 | call sysdispmsg ;AC010; | ||
| 137 | |||
| 138 | ;------------------------------------------------------------------- | ||
| 139 | |||
| 140 | pop bp ; restore base pointer ;AC010; | ||
| 141 | push di ; the di value from call is now on stack ;AC010; | ||
| 142 | mov di,[bp+6+4] ; fix di (arg 1) ;AC010; | ||
| 143 | |||
| 144 | mov [di+00],ax ; load outregs.x.ax ;AC010; | ||
| 145 | mov [di+02],bx ; load outregs.x.bx ;AC010; | ||
| 146 | mov [di+04],cx ; load outregs.x.cx ;AC010; | ||
| 147 | mov [di+06],dx ; load outregs.x.dx ;AC010; | ||
| 148 | mov [di+08],si ; load outregs.x.si ;AC010; | ||
| 149 | |||
| 150 | lahf ; get flags into ax ;AC010; | ||
| 151 | mov al,ah ; move into low byte ;AC010; | ||
| 152 | mov [di+0ch],ax ; load outregs.x.cflag ;AC010; | ||
| 153 | |||
| 154 | pop ax ; get di from stack ;AC010; | ||
| 155 | mov [di+0ah],ax ; load outregs.x.di ;AC010; | ||
| 156 | |||
| 157 | ;------------------------------------------------------------------- | ||
| 158 | |||
| 159 | pop si ; restore registers ;AC010; | ||
| 160 | pop di ;AC010; | ||
| 161 | mov sp,bp ; restore sp ;AC010; | ||
| 162 | pop bp ; restore user's bp ;AC010; | ||
| 163 | ret ;AC010; | ||
| 164 | |||
| 165 | data_sysdispmsg endp ;AC010; | ||
| 166 | |||
| 167 | |||
| 168 | data_sysgetmsg proc far ;AC010; | ||
| 169 | |||
| 170 | push bp ; save user's base pointer ;AC010; | ||
| 171 | mov bp,sp ; set bp to current sp ;AC010; | ||
| 172 | push di ; save some registers ;AC010; | ||
| 173 | push si ;AC010; | ||
| 174 | |||
| 175 | ; copy C inregs into proper registers | ||
| 176 | |||
| 177 | mov di,[bp+4+4] ; fix di (arg 0) ;AC010; | ||
| 178 | |||
| 179 | ;------------------------------------------------------------------- | ||
| 180 | |||
| 181 | mov ax,[di+0ah] ; load di ;AC010; | ||
| 182 | push ax ; the di value from inregs is now on stack ;AC010; | ||
| 183 | |||
| 184 | mov ax,[di+00] ; get inregs.x.ax ;AC010; | ||
| 185 | mov bx,[di+02] ; get inregs.x.bx ;AC010; | ||
| 186 | mov cx,[di+04] ; get inregs.x.cx ;AC010; | ||
| 187 | mov dx,[di+06] ; get inregs.x.dx ;AC010; | ||
| 188 | mov si,[di+08] ; get inregs.x.si ;AC010; | ||
| 189 | pop di ; get inregs.x.di from stack ;AC010; | ||
| 190 | |||
| 191 | push bp ; save base pointer ;AC010; | ||
| 192 | |||
| 193 | ;------------------------------------------------------------------- | ||
| 194 | |||
| 195 | call sysgetmsg ; call the message retriever ;AC010; | ||
| 196 | |||
| 197 | ;------------------------------------------------------------------- | ||
| 198 | |||
| 199 | pop bp ; restore base pointer ;AC010; | ||
| 200 | push di ; the di value from call is now on stack ;AC010; | ||
| 201 | mov di,[bp+6+4] ; fix di (arg 1) ;AC010; | ||
| 202 | |||
| 203 | push ax ; save ax ;AC010; | ||
| 204 | mov [di+00],es ; load segregs.es ;AC010; | ||
| 205 | mov [di+06],ds ; load outregs.ds ;AC010; | ||
| 206 | pop ax ; restore ax ;AC010; | ||
| 207 | |||
| 208 | pop di ; restore di ;AC010; | ||
| 209 | push di ; save it ;AC010; | ||
| 210 | mov di,[bp+8+4] ; fix di (arg 2) ;AC010; | ||
| 211 | mov [di+00],ax ; load outregs.x.ax ;AC010; | ||
| 212 | mov [di+02],bx ; load outregs.x.bx ;AC010; | ||
| 213 | mov [di+04],cx ; load outregs.x.cx ;AC010; | ||
| 214 | mov [di+06],dx ; load outregs.x.dx ;AC010; | ||
| 215 | mov [di+08],si ; load outregs.x.si ;AC010; | ||
| 216 | |||
| 217 | lahf ; get flags into ax ;AC010; | ||
| 218 | mov al,ah ; move into low byte ;AC010; | ||
| 219 | mov [di+0ch],ax ; load outregs.x.cflag ;AC010; | ||
| 220 | |||
| 221 | pop ax ; get di from stack ;AC010; | ||
| 222 | mov [di+0ah],ax ; load outregs.x.di ;AC010; | ||
| 223 | |||
| 224 | ;------------------------------------------------------------------- | ||
| 225 | |||
| 226 | pop si ; restore registers ;AC010; | ||
| 227 | pop di ;AC010; | ||
| 228 | mov sp,bp ; restore sp ;AC010; | ||
| 229 | pop bp ; restore user's bp ;AC010; | ||
| 230 | ret ;AC010; | ||
| 231 | |||
| 232 | data_sysgetmsg endp ;AC010; | ||
| 233 | |||
| 234 | |||
| 235 | _DATA ends ; end code segment ;AC010; | ||
| 236 | |||
| 237 | _TEXT SEGMENT ;AC010; | ||
| 238 | |||
| 239 | assume cs:_TEXT ;AC010; | ||
| 240 | |||
| 241 | public _sysdispmsg ;AC010; | ||
| 242 | public _sysloadmsg ;AC010; | ||
| 243 | public _sysgetmsg ;AC010; | ||
| 244 | |||
| 245 | _sysdispmsg proc near ;AC010; | ||
| 246 | call data_sysdispmsg ;AC010; | ||
| 247 | ret ;AC010; | ||
| 248 | _sysdispmsg endp ;AC010; | ||
| 249 | |||
| 250 | _sysloadmsg proc near ;AC010; | ||
| 251 | call data_sysloadmsg ;AC010; | ||
| 252 | ret ;AC010; | ||
| 253 | _sysloadmsg endp ;AC010; | ||
| 254 | |||
| 255 | _sysgetmsg proc near ;AC010; | ||
| 256 | call data_sysgetmsg ;AC010; | ||
| 257 | ret ;AC010; | ||
| 258 | _sysgetmsg endp ;AC010; | ||
| 259 | |||
| 260 | _TEXT ENDS ;AC010; | ||
| 261 | end ;AC010; | ||
| 262 | |||
| 263 | \ No newline at end of file | ||