summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/BACKUP/_PARSE.ASM
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/CMD/BACKUP/_PARSE.ASM')
-rw-r--r--v4.0/src/CMD/BACKUP/_PARSE.ASM121
1 files changed, 121 insertions, 0 deletions
diff --git a/v4.0/src/CMD/BACKUP/_PARSE.ASM b/v4.0/src/CMD/BACKUP/_PARSE.ASM
new file mode 100644
index 0000000..0c13826
--- /dev/null
+++ b/v4.0/src/CMD/BACKUP/_PARSE.ASM
@@ -0,0 +1,121 @@
1page 60,132
2name _parse
3title C to PARSER interface
4;-------------------------------------------------------------------
5;
6; MODULE: _parse
7;
8; PURPOSE: Supplies an interface between C programs and
9; the DOS 3.30 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 include version.inc
23
24;-------------------------------------------------------------------
25FarSW equ 0 ; make sysparse be a NEAR proc
26TimeSW equ 1 ; Check time format
27FileSW equ 1 ; Check file specification
28CAPSW equ 1 ; Perform CAPS if specified
29CmpxSW equ 0 ; Check complex list
30NumSW equ 0 ; Check numeric value
31KeySW equ 0 ; Support keywords
32SwSW equ 1 ; Support switches
33Val1SW equ 0 ; Support value definition 1
34Val2SW equ 0 ; Support value definition 2
35if ibmcopyright
36Val3SW equ 0 ; Support value definition 3
37else
38Val3SW equ 1 ; Support value definition 3
39endif
40DrvSW equ 1 ; Support drive only format
41QusSW equ 0 ; Support quoted string format
42IncSW equ 0 ; Dont include PSDATA, I just did it
43BaseSW equ 1 ; DS points to data
44;-------------------------------------------------------------------
45
46DGROUP GROUP _DATA
47PGROUP GROUP _TEXT
48
49_DATA segment byte public 'DATA'
50include psdata.inc
51_DATA ends
52
53_TEXT segment byte public 'CODE'
54
55 ASSUME CS: PGROUP
56 ASSUME DS: DGROUP
57
58;-------------------------------------------------------------------
59.xlist
60include parse.asm ; include the parser
61.list
62;-------------------------------------------------------------------
63
64_parse proc near
65
66 push bp ; save user's base pointer
67 mov bp,sp ; set bp to current sp
68 push di ; save some registers
69 push si
70
71; copy C inregs into proper registers
72
73 mov di,[bp+4] ; fix di (arg 0)
74
75;-------------------------------------------------------------------
76
77 mov ax,[di+0ah] ; load di
78 push ax ; the di value from inregs is now on stack
79
80 mov ax,[di+00] ; get inregs.x.ax
81 mov bx,[di+02] ; get inregs.x.bx
82 mov cx,[di+04] ; get inregs.x.cx
83 mov dx,[di+06] ; get inregs.x.dx
84 mov si,[di+08] ; get inregs.x.si
85 pop di ; get inregs.x.di from stack
86
87 push bp ; save base pointer
88;-------------------------------------------------------------------
89 call sysparse ; call the parser
90;-------------------------------------------------------------------
91 pop bp ; restore base pointer
92 push di ; the di value from call is now on stack
93 mov di,[bp+6] ; fix di (arg 1)
94
95 mov [di+00],ax ; load outregs.x.ax
96 mov [di+02],bx ; load outregs.x.bx
97 mov [di+04],cx ; load outregs.x.cx
98 mov [di+06],dx ; load outregs.x.dx
99 mov [di+08],si ; load outregs.x.si
100
101 lahf ; get flags into ax
102 mov al,ah ; move into low byte
103 mov [di+0ch],ax ; load outregs.x.cflag
104
105 pop ax ; get di from stack
106 mov [di+0ah],ax ; load outregs.x.di
107
108;-------------------------------------------------------------------
109
110 pop si ; restore registers
111 pop di
112 mov sp,bp ; restore sp
113 pop bp ; restore user's bp
114 ret
115
116_parse endp
117
118_TEXT ends ; end code segment
119 end
120
121 \ No newline at end of file