3 title C to PARSER interface
4 ;-------------------------------------------------------------------
8 ; PURPOSE: Supplies an interface between C programs and
12 ; parse(&inregs,&outregs);
16 ;-------------------------------------------------------------------
22 ;-------------------------------------------------------------------
23 FarSW equ
0 ; make sysparse be a NEAR proc
24 TimeSW equ
0 ; Check time format
25 FileSW equ
0 ; Check file specification
26 CAPSW equ
0 ; Perform CAPS if specified
27 CmpxSW equ
0 ; Check complex list
28 NumSW equ
1 ; Check numeric value
29 KeySW equ
0 ; Support keywords
30 SwSW equ
1 ; Support switches
31 Val1SW equ
1 ; Support value definition 1
32 Val2SW equ
1 ; Support value definition 2
33 Val3SW equ
0 ; Support value definition 3
34 DrvSW equ
0 ; Support drive only format
35 QusSW equ
0 ; Support quoted string format
36 ;-------------------------------------------------------------------
41 _TEXT
SEGMENT BYTE PUBLIC 'CODE'
43 _DATA
SEGMENT WORD PUBLIC 'DATA'
45 CONST
SEGMENT WORD PUBLIC 'CONST'
47 _BSS
SEGMENT WORD PUBLIC 'BSS'
51 DGROUP GROUP CONST
, _BSS
, _DATA
54 _DATA
segment word public 'DATA'
61 ;-------------------------------------------------------------------
63 include parse
.asm
; include the parser
65 ;-------------------------------------------------------------------
96 _TEXT
segment byte public 'CODE'
105 push bp ; save user's base pointer
106 mov bp,sp ; set bp to current sp
107 push di ; save some registers
110 ; copy C inregs into proper registers
112 mov di,[bp+4] ; fix di (arg 0)
114 ;-------------------------------------------------------------------
116 mov ax,[di+0ah] ; load di
117 push ax ; the di value from inregs is now on stack
119 mov ax,[di+00] ; get inregs.x.ax
120 mov bx,[di+02] ; get inregs.x.bx
121 mov cx,[di+04] ; get inregs.x.cx
122 mov dx,[di+06] ; get inregs.x.dx
123 mov si,[di+08] ; get inregs.x.si
124 pop di ; get inregs.x.di from stack
126 push bp ; save base pointer
128 ;-------------------------------------------------------------------
129 ;-------------------------------------------------------------------
131 call CallParser
; call the parser
133 ;-------------------------------------------------------------------
134 ;-------------------------------------------------------------------
136 pop bp ; restore base pointer
137 push di ; the di value from call is now on stack
138 mov di,[bp+6] ; fix di (arg 1)
140 mov [di+00],ax ; load outregs.x.ax
141 mov [di+02],bx ; load outregs.x.bx
142 mov [di+04],cx ; load outregs.x.cx
143 mov [di+06],dx ; load outregs.x.dx
144 mov [di+08],si ; load outregs.x.si
147 lahf ; get flags into ax
148 mov [di+0ch],ax ; load outregs.x.cflag
150 pop ax ; get di from stack
151 mov [di+0ah],ax ; load outregs.x.di
153 ;-------------------------------------------------------------------
155 pop si ; restore registers
157 mov sp,bp ; restore sp
158 pop bp ; restore user's bp
163 _TEXT ends
; end code segment