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