diff options
| author | 2024-04-25 21:24:10 +0100 | |
|---|---|---|
| committer | 2024-04-25 22:32:27 +0000 | |
| commit | 2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch) | |
| tree | 80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/CMD/RESTORE/_PARSE.ASM | |
| parent | Merge pull request #430 from jpbaltazar/typoptbr (diff) | |
| download | ms-dos-main.tar.gz ms-dos-main.tar.xz ms-dos-main.zip | |
Diffstat (limited to 'v4.0/src/CMD/RESTORE/_PARSE.ASM')
| -rw-r--r-- | v4.0/src/CMD/RESTORE/_PARSE.ASM | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/v4.0/src/CMD/RESTORE/_PARSE.ASM b/v4.0/src/CMD/RESTORE/_PARSE.ASM new file mode 100644 index 0000000..9685fe6 --- /dev/null +++ b/v4.0/src/CMD/RESTORE/_PARSE.ASM | |||
| @@ -0,0 +1,115 @@ | |||
| 1 | page 60,132 | ||
| 2 | name _parse | ||
| 3 | title C to PARSER interface | ||
| 4 | ;------------------------------------------------------------------- | ||
| 5 | ; | ||
| 6 | ; MODULE: _parse | ||
| 7 | ; | ||
| 8 | ; PURPOSE: Supplies an interface between C programs and | ||
| 9 | ; the DOS 3.3 parser | ||
| 10 | ; | ||
| 11 | ; CALLING FORMAT: | ||
| 12 | ; parse(&inregs,&outregs); | ||
| 13 | ; | ||
| 14 | ; DATE: 5-21-87 | ||
| 15 | ; | ||
| 16 | ;------------------------------------------------------------------- | ||
| 17 | |||
| 18 | ; extrn sysparse:far | ||
| 19 | |||
| 20 | public _parse | ||
| 21 | |||
| 22 | ;------------------------------------------------------------------- | ||
| 23 | FarSW equ 0 ; make sysparse be a NEAR proc | ||
| 24 | TimeSW equ 1 ; Check time format | ||
| 25 | FileSW equ 1 ; Check file specification | ||
| 26 | CAPSW equ 1 ; Perform CAPS if specified | ||
| 27 | CmpxSW equ 0 ; Check complex list | ||
| 28 | NumSW equ 0 ; Check numeric value | ||
| 29 | KeySW equ 0 ; Support keywords | ||
| 30 | SwSW equ 1 ; Support switches | ||
| 31 | Val1SW equ 0 ; Support value definition 1 | ||
| 32 | Val2SW equ 0 ; Support value definition 2 | ||
| 33 | Val3SW equ 0 ; Support value definition 3 | ||
| 34 | DrvSW equ 1 ; Support drive only format | ||
| 35 | QusSW equ 0 ; Support quoted string format | ||
| 36 | IncSW equ 0 ; Dont include PSDATA, I just did it | ||
| 37 | BaseSW equ 1 ; DS points to data | ||
| 38 | ;------------------------------------------------------------------- | ||
| 39 | |||
| 40 | DGROUP GROUP _DATA | ||
| 41 | PGROUP GROUP _TEXT | ||
| 42 | |||
| 43 | _DATA segment byte public 'DATA' | ||
| 44 | include psdata.inc | ||
| 45 | _DATA ends | ||
| 46 | |||
| 47 | _TEXT segment byte public 'CODE' | ||
| 48 | |||
| 49 | ASSUME CS: PGROUP | ||
| 50 | ASSUME DS: DGROUP | ||
| 51 | |||
| 52 | ;------------------------------------------------------------------- | ||
| 53 | .xlist | ||
| 54 | include parse.asm ; include the parser | ||
| 55 | .list | ||
| 56 | ;------------------------------------------------------------------- | ||
| 57 | |||
| 58 | _parse proc near | ||
| 59 | |||
| 60 | push bp ; save user's base pointer | ||
| 61 | mov bp,sp ; set bp to current sp | ||
| 62 | push di ; save some registers | ||
| 63 | push si | ||
| 64 | |||
| 65 | ; copy C inregs into proper registers | ||
| 66 | |||
| 67 | mov di,[bp+4] ; fix di (arg 0) | ||
| 68 | |||
| 69 | ;------------------------------------------------------------------- | ||
| 70 | |||
| 71 | mov ax,[di+0ah] ; load di | ||
| 72 | push ax ; the di value from inregs is now on stack | ||
| 73 | |||
| 74 | mov ax,[di+00] ; get inregs.x.ax | ||
| 75 | mov bx,[di+02] ; get inregs.x.bx | ||
| 76 | mov cx,[di+04] ; get inregs.x.cx | ||
| 77 | mov dx,[di+06] ; get inregs.x.dx | ||
| 78 | mov si,[di+08] ; get inregs.x.si | ||
| 79 | pop di ; get inregs.x.di from stack | ||
| 80 | |||
| 81 | push bp ; save base pointer | ||
| 82 | ;------------------------------------------------------------------- | ||
| 83 | call sysparse ; call the parser | ||
| 84 | ;------------------------------------------------------------------- | ||
| 85 | pop bp ; restore base pointer | ||
| 86 | push di ; the di value from call is now on stack | ||
| 87 | mov di,[bp+6] ; fix di (arg 1) | ||
| 88 | |||
| 89 | mov [di+00],ax ; load outregs.x.ax | ||
| 90 | mov [di+02],bx ; load outregs.x.bx | ||
| 91 | mov [di+04],cx ; load outregs.x.cx | ||
| 92 | mov [di+06],dx ; load outregs.x.dx | ||
| 93 | mov [di+08],si ; load outregs.x.si | ||
| 94 | |||
| 95 | lahf ; get flags into ax | ||
| 96 | mov al,ah ; move into low byte | ||
| 97 | mov [di+0ch],ax ; load outregs.x.cflag | ||
| 98 | |||
| 99 | pop ax ; get di from stack | ||
| 100 | mov [di+0ah],ax ; load outregs.x.di | ||
| 101 | |||
| 102 | ;------------------------------------------------------------------- | ||
| 103 | |||
| 104 | pop si ; restore registers | ||
| 105 | pop di | ||
| 106 | mov sp,bp ; restore sp | ||
| 107 | pop bp ; restore user's bp | ||
| 108 | ret | ||
| 109 | |||
| 110 | _parse endp | ||
| 111 | |||
| 112 | _TEXT ends ; end code segment | ||
| 113 | end | ||
| 114 | |||
| 115 | \ No newline at end of file | ||