Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
3.9 KiB

  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.30 parser
  10. ;
  11. ; CALLING FORMAT:
  12. ; parse(&inregs,&outregs);
  13. ;
  14. ; DATE: 5-21-87
  15. ;
  16. ;-------------------------------------------------------------------
  17. ; extrn sysparse:far
  18. public _parse
  19. ;-------------------------------------------------------------------
  20. ; SET FOR SUBST
  21. ; -------------
  22. FarSW equ 0 ; make sysparse be a NEAR proc
  23. TimeSW equ 0 ; Check time format
  24. FileSW equ 1 ; Check file specification
  25. CAPSW equ 1 ; Perform CAPS if specified
  26. CmpxSW equ 0 ; Check complex list
  27. NumSW equ 0 ; Check numeric value
  28. KeySW equ 0 ; Support keywords
  29. SwSW equ 1 ; Support switches
  30. Val1SW equ 0 ; Support value definition 1
  31. Val2SW equ 0 ; Support value definition 2
  32. Val3SW equ 0 ; Support value definition 3
  33. DrvSW equ 1 ; Support drive only format
  34. QusSW equ 0 ; Support quoted string format
  35. ;-------------------------------------------------------------------
  36. _DATA segment byte public 'DATA'
  37. _DATA ends
  38. _TEXT segment byte public 'CODE'
  39. ASSUME CS: _TEXT
  40. ASSUME DS: _DATA
  41. ;-------------------------------------------------------------------
  42. include parse.asm ; include the parser
  43. ;-------------------------------------------------------------------
  44. _parse proc near
  45. push bp ; save user's base pointer
  46. mov bp,sp ; set bp to current sp
  47. push di ; save some registers
  48. push si
  49. ; copy C inregs into proper registers
  50. mov di,[bp+4] ; fix di (arg 0)
  51. ;-------------------------------------------------------------------
  52. mov ax,[di+0ah] ; load di
  53. push ax ; the di value from inregs is now on stack
  54. mov ax,[di+00] ; get inregs.x.ax
  55. mov bx,[di+02] ; get inregs.x.bx
  56. mov cx,[di+04] ; get inregs.x.cx
  57. mov dx,[di+06] ; get inregs.x.dx
  58. mov si,[di+08] ; get inregs.x.si
  59. pop di ; get inregs.x.di from stack
  60. push bp ; save base pointer
  61. ; int 3 ; debugger
  62. ;-------------------------------------------------------------------
  63. call sysparse ; call the parser
  64. ;-------------------------------------------------------------------
  65. ; int 3 ; debugger
  66. pop bp ; restore base pointer
  67. push di ; the di value from call is now on stack
  68. mov di,[bp+6] ; fix di (arg 1)
  69. mov [di+00],ax ; load outregs.x.ax
  70. mov [di+02],bx ; load outregs.x.bx
  71. mov [di+04],cx ; load outregs.x.cx
  72. mov [di+06],dx ; load outregs.x.dx
  73. mov [di+08],si ; load outregs.x.si
  74. xor ax,ax ; clear ax
  75. lahf ; get flags into ax
  76. mov [di+0ch],ax ; load outregs.x.cflag
  77. pop ax ; get di from stack
  78. mov [di+0ah],ax ; load outregs.x.di
  79. ;-------------------------------------------------------------------
  80. pop si ; restore registers
  81. pop di
  82. mov sp,bp ; restore sp
  83. pop bp ; restore user's bp
  84. ret
  85. _parse endp
  86. _TEXT ends ; end code segment
  87. end
  88.