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.

645 lines
19 KiB

  1. page ,132
  2. ; SCCSID = @(#)tcmd2b.asm 4.1 85/09/22
  3. ; SCCSID = @(#)tcmd2b.asm 4.1 85/09/22
  4. TITLE PART5 COMMAND Transient routines.
  5. ;/*
  6. ; * Microsoft Confidential
  7. ; * Copyright (C) Microsoft Corporation 1991
  8. ; * All Rights Reserved.
  9. ; */
  10. .xlist
  11. .xcref
  12. include comsw.asm
  13. include dossym.inc
  14. include syscall.inc
  15. include pdb.inc
  16. include mult.inc
  17. include comseg.asm
  18. include comequ.asm
  19. include cmdsvc.inc
  20. .list
  21. .cref
  22. ;;CODERES SEGMENT PUBLIC BYTE ;AC000;
  23. ;; EXTRN LODCOM1:NEAR
  24. ;;CODERES ENDS
  25. DATARES SEGMENT PUBLIC BYTE ;AC000;
  26. EXTRN crit_msg_off:word ;AC000;
  27. EXTRN crit_msg_seg:word ;AC000;
  28. EXTRN IO_SAVE:WORD
  29. EXTRN OldTerm:DWORD
  30. EXTRN PARENT:WORD
  31. ;AD060; EXTRN pars_msg_off:word ;AC000;
  32. ;AD060; EXTRN pars_msg_seg:word ;AC000;
  33. EXTRN PERMCOM:BYTE ;AN045;
  34. EXTRN RetCode:WORD
  35. EXTRN SingleCom:word
  36. extrn TrnLodCom1_Trap:far
  37. DATARES ENDS
  38. TRANDATA SEGMENT PUBLIC BYTE ;AC000;
  39. EXTRN ACRLF_PTR:WORD ;AN007;
  40. EXTRN baddev_ptr:word
  41. EXTRN CP_active_Ptr:word
  42. EXTRN CP_not_all_Ptr:word
  43. EXTRN CP_not_set_Ptr:word
  44. EXTRN Extend_buf_ptr:word ;AN000;
  45. EXTRN Extend_buf_sub:byte ;AN000;
  46. EXTRN inv_code_page:word ;AC000;
  47. EXTRN msg_disp_class:byte ;AN000;
  48. EXTRN NLSFUNC_Ptr:word ;AC000;
  49. EXTRN parse_chcp:byte ;AC000;
  50. EXTRN parse_chdir:byte ;AC000;
  51. EXTRN parse_ctty:byte ;AC000;
  52. EXTRN string_buf_ptr:word ;AC000;
  53. extrn NoCntry_Ptr:word ;M045
  54. TRANDATA ENDS
  55. TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
  56. EXTRN COMBUF:BYTE
  57. EXTRN parse_last:word ;AN018;
  58. EXTRN parse1_addr:dword ;AC000;
  59. EXTRN parse1_type:byte ;AC000;
  60. EXTRN RESSEG:WORD
  61. EXTRN srcbuf:byte
  62. EXTRN srcxname:byte ;AC000;
  63. EXTRN string_ptr_2:word
  64. EXTRN system_cpage:word
  65. EXTRN TRAN_TPA:WORD
  66. TRANSPACE ENDS
  67. TRANCODE SEGMENT PUBLIC BYTE
  68. ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
  69. ;---------------
  70. TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
  71. EXTRN arg:byte ; the arg structure!
  72. TRANSPACE ENDS
  73. ;---------------
  74. EXTRN cerror:near
  75. extrn TCommand:near
  76. PUBLIC $exit
  77. PUBLIC chcp
  78. PUBLIC ctty
  79. PUBLIC parse_check_eol ;AN000;
  80. PUBLIC parse_with_msg ;AN018;
  81. PUBLIC setup_parse_error_msg ;AN018;
  82. PUBLIC truename ;AN000;
  83. break Ctty
  84. assume ds:trangroup,es:trangroup
  85. ; ****************************************************************
  86. ; *
  87. ; * ROUTINE: CTTY - Change console
  88. ; *
  89. ; * SYNTAX: CTTY device
  90. ; *
  91. ; * FUNCTION: If a valid console device is specified, CTTY will
  92. ; * duplicate the device handle to STDIN, STDOUT and
  93. ; * STDERR. This routine returns to LODCOM1.
  94. ; *
  95. ; * INPUT: command line at offset 81H
  96. ; *
  97. ; * OUTPUT: none
  98. ; *
  99. ; ****************************************************************
  100. CTTY:
  101. push ds ;AN000; Get local ES
  102. pop es ;AN000;
  103. mov si,81H ;AC000; Get command argument for CTTY
  104. mov di,offset trangroup:parse_ctty ;AC000; Get adderss of PARSE_CTTY
  105. xor cx,cx ;AC000; clear cx,dx
  106. xor dx,dx ;AC000;
  107. invoke cmd_parse ;AC000; call parser
  108. cmp ax,end_of_line ;AN000; are we at end of line?
  109. jz ctty_error ;AN000; yes - error
  110. cmp ax,result_no_error ;AN000; did an error occur
  111. jnz ctty_error ;AN000; YES -ERROR
  112. push si ;AN000; save position in line
  113. lds si,parse1_addr ;AN000; get address of filespec
  114. mov di,offset trangroup:srcbuf ;AN000; get address of srcbuf
  115. ctty_move_filename: ;AN000; put filespec in srcbuf
  116. lodsb ;AN000; get a char from buffer
  117. stosb ;AN000; store in srcbuf
  118. cmp al,end_of_line_out ;AN000; it char a terminator?
  119. jnz ctty_move_filename ;AN000; no - keep moving
  120. pop si ;AN000; get line position back
  121. mov di,offset trangroup:parse_ctty ;AC000; Get adderss of PARSE_CTTY
  122. ifndef NEC_98
  123. call parse_check_eol ;AN000; are we at end of line?
  124. else ;NEC_98
  125. ; call parse_check_eol ;AN000; are we at end of line? ; NEC01 91/07/31 Del
  126. xor dx,dx ;AN000; ; NEC01 91/07/31
  127. mov [parse_last],si ;AN018; save start of parameter ; NEC01 91/07/31
  128. invoke cmd_parse ;AN000; call parser ; NEC01 91/07/31
  129. cmp al,end_of_line ;AN000; Are we at end of line? ; NEC01 91/07/31
  130. endif ;NEC_98
  131. jz nocolon ;AN000; yes - continue
  132. ctty_error:
  133. jmp short isbaddev ;AC000; yes - exit
  134. nocolon:
  135. mov dx,offset trangroup:srcbuf ;AN000; get address of srcbuf
  136. MOV AX,(OPEN SHL 8) OR 2 ; Read and write
  137. INT 21h ; Open new device
  138. JC ISBADDEV
  139. MOV BX,AX
  140. MOV AX,IOCTL SHL 8
  141. INT 21h
  142. TEST DL,80H
  143. JNZ DEVISOK
  144. CLOSEDEV: ;AN007;
  145. MOV AH,CLOSE ; Close initial handle
  146. INT 21h
  147. ISBADDEV:
  148. MOV DX,OFFSET TRANGROUP:BADDEV_ptr
  149. invoke std_printf
  150. JMP SHORT RESRET
  151. DEVISOK:
  152. push dx ;AN007; save device info
  153. mov ax,acrlf_ptr ;AN021; get message number for 0d, 0a
  154. mov dh,util_msg_class ;AN021; this is a utility message
  155. push bx ;AN021; save handle
  156. invoke Tsysgetmsg ;AN021; get the address of the message
  157. mov dx,si ;AN021; get address into dx
  158. mov ax,(write shl 8) ;AN007; write to device
  159. mov cx,2 ;AN007; write two bytes
  160. int 21h ;AN007;
  161. pop bx ;AN021; get back handle
  162. pop dx ;AN007; get back device info
  163. jc closedev ;AN007; if error, quit
  164. XOR DH,DH
  165. OR DL,3 ; Make sure has CON attributes
  166. MOV AX,(IOCTL SHL 8) OR 1
  167. INT 21h
  168. PUSH BX ; Save handle
  169. MOV CX,3
  170. XOR BX,BX
  171. ICLLOOP: ; Close basic handles
  172. MOV AH,CLOSE
  173. INT 21h
  174. INC BX
  175. LOOP ICLLOOP
  176. POP BX ; Get handle
  177. MOV AH,XDUP
  178. INT 21h ; Dup it to 0
  179. MOV AH,XDUP
  180. INT 21h ; Dup to 1
  181. MOV AH,XDUP
  182. INT 21h ; Dup to 2
  183. MOV AH,CLOSE ; Close initial handle
  184. INT 21h
  185. RESRET:
  186. MOV DS,[RESSEG]
  187. ASSUME DS:RESGROUP
  188. PUSH DS
  189. MOV AX,WORD PTR DS:[PDB_JFN_Table] ; Get new 0 and 1
  190. MOV [IO_SAVE],AX
  191. MOV AX,OFFSET DATARES:TrnLodCom1_Trap
  192. PUSH AX
  193. ZMMMM PROC FAR
  194. RET ; Force header to be checked
  195. ZMMMM ENDP
  196. break Chcp
  197. ;****************************************************************
  198. ;*
  199. ;* ROUTINE: CHCP - Change code page internal command
  200. ;* (added DOS 3.30 07/21/86)
  201. ;*
  202. ;* SYNTAX: CHCP [xxx]
  203. ;* where xxx is a valid code page
  204. ;*
  205. ;* FUNCTION: If xxx is specified, CHCP will use INT 21H function
  206. ;* 6402H to set the code page to xxxx. If no parameters
  207. ;* are specified, CHCP will use INT 21H function 6401H
  208. ;* to get global code page and display it to the user.
  209. ;*
  210. ;* INPUT: command line at offset 81H
  211. ;*
  212. ;* OUTPUT: none
  213. ;*
  214. ;****************************************************************
  215. NLSFUNC_installed equ 0ffh
  216. set_global_cp equ 2
  217. get_global_cp equ 1
  218. assume ds:trangroup,es:trangroup
  219. CHCP:
  220. push ds ;AN000; Get local ES
  221. pop es ;AN000;
  222. mov si,81H ;AC000; Get command argument for CHCP
  223. mov di,offset trangroup:parse_chcp ;AN000; Get adderss of PARSE_CHCP
  224. xor cx,cx ;AC000; clear cx,dx
  225. xor dx,dx ;AC000;
  226. call parse_with_msg ;AC018; call parser
  227. cmp ax,end_of_line ;AN000; are we at end of line?
  228. ;; jnz setcp ;AC000; no go get number & set code page
  229. jz getcp ;AC000; yes - no parm - get code page
  230. setcp:
  231. cmp ax,result_no_error ;AN000; did we have an error?
  232. jne cp_error ;AC018; yes - go issue message
  233. push cx ;AN000; save positional count
  234. mov bx,offset trangroup:parse1_addr ;AN000; get number returned
  235. mov cx,word ptr [bx] ;AN000; into cx
  236. mov system_cpage,cx ;AN000; save user input number
  237. pop cx ;AC000; restore positional count
  238. mov di,offset trangroup:parse_chcp ;AN000; Get adderss of PARSE_CHCP
  239. call parse_check_eol ;AN000; are we at end of line?
  240. jnz cp_error ;AC000; no - exit
  241. okset:
  242. mov ah,NLSFUNC ;AN000; see if NLSFUNC installed
  243. mov al,0 ;AN000;
  244. int 2fh ;AN000;
  245. cmp al,NLSFUNC_installed ;AN000;
  246. jz got_NLS ;AN000; Yes - continue
  247. mov dx,offset trangroup:NLSFUNC_ptr ;AN000; no - set up error message
  248. jmp short cp_error ;AN000; error exit
  249. got_NLS:
  250. mov bx,system_cpage ;AN000; get user input code page
  251. mov ah,getsetcdpg ;get/set global code page function
  252. mov al,set_global_cp ;minor - set
  253. int 21h
  254. jnc chcp_return ;no error - exit
  255. ;
  256. ;added for p716
  257. ;
  258. cmp ax,error_file_not_found ;p716 was the error file not found?
  259. jnz chcp_other_error ;no - country.sys was found
  260. mov ah,GetExtendedError ;p850 see if error is invalid data
  261. xor bx,bx ; which is file was found but CP
  262. int 21h ; information was not found.
  263. cmp ax,error_invalid_data ;AC000; invalid code page
  264. jnz no_countrysys ;no - use file not found
  265. mov dx,offset trangroup:inv_code_page ;AN000; get message
  266. jmp short cp_error ;AC000; error exit
  267. no_countrysys:
  268. ;M045; mov msg_disp_class,ext_msg_class ;AN000; set up extended error msg class
  269. ;M045; mov dx,offset TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
  270. ;M045; mov Extend_Buf_ptr,error_file_not_found ;AN000; get message number in control block
  271. mov dx,offset TRANGROUP:NoCntry_Ptr ;M045
  272. jmp short cp_error ;AC000; error exit
  273. chcp_other_error:
  274. ;
  275. ; end of p716
  276. ;
  277. mov ah,GetExtendedError ;error - see what it is
  278. xor bx,bx
  279. int 21h
  280. cmp ax,65 ;was it access denied?
  281. jnz none_set ;no - assume all failed
  282. mov dx,offset trangroup:cp_not_all_ptr ;set up message
  283. jmp short cp_error ;AC000; error exit
  284. none_set:
  285. mov dx,offset trangroup:cp_not_set_ptr ;set up message
  286. cp_error: ;AN000;
  287. jmp cerror ;exit
  288. getcp:
  289. mov ah,getsetcdpg ;get/set global code page function
  290. mov al,get_global_cp ;minor - get
  291. int 21h
  292. mov system_cpage,bx ;get active cp for output
  293. mov dx,offset trangroup:cp_active_ptr
  294. invoke std_printf ;print it out
  295. chcp_return:
  296. RET
  297. break TRUENAME ;AN000;
  298. ; ****************************************************************
  299. ; *
  300. ; * ROUTINE: TRUENAME
  301. ; *
  302. ; * FUNCTION: Entry point for the internal TRUENAME command.
  303. ; * Parses the command line. If a path is found, set
  304. ; * SRCXNAME to path. If only a drive letter is
  305. ; * found, set SRCXNAME to the drive letter. If
  306. ; * no path is found, set the path of SRCXNAME to
  307. ; * dot (.) for current directory. Use the NAME
  308. ; * TRANSLATE system call to get the real name and
  309. ; * then display the real name. If an error occurs
  310. ; * issue an error message and transfer control to
  311. ; * CERROR.
  312. ; *
  313. ; * INPUT: command line at offset 81H
  314. ; *
  315. ; * OUTPUT: none
  316. ; *
  317. ; ****************************************************************
  318. assume ds:trangroup,es:trangroup ;AN000;
  319. TRUENAME: ;AN000; TRUENAME entry point
  320. push ds ;AN000; Get local ES
  321. pop es ;AN000;
  322. mov si,81H ;AN000; Get command line
  323. mov di,offset trangroup:parse_chdir ;AN000; Get adderss of PARSE_CHDIR
  324. xor cx,cx ;AN000; clear cx,dx
  325. xor dx,dx ;AN000;
  326. call parse_with_msg ;AC018; call parser
  327. mov di,offset trangroup:srcxname ;AN000; get address of srcxname
  328. cmp ax,end_of_line ;AN000; are we at end of line?
  329. je tn_eol ;AN000; yes - go process
  330. cmp ax,result_no_error ;AN000; did we have an error?
  331. jne tn_parse_error ;AN000; yes - go issue message
  332. cmp parse1_type,result_drive ;AN000; was a drive entered?
  333. je tn_drive ;AN000; yes - go process
  334. jmp short tn_filespec ;AN000; nothing else - must be filespec
  335. tn_eol: ;AN000; no parameters on line
  336. mov ah,end_of_line_out ;AN000; set buffer to .
  337. mov al,dot_chr ;AN000; for current dir
  338. stosw ;AN000; store in srcxname
  339. jmp short tn_doit ;AN000; go do command
  340. tn_drive: ;AN000; a drive was entered
  341. push si ;AN000; save position in line
  342. mov si,offset trangroup:parse1_addr ;AN000; get address of drive
  343. lodsb ;AN000; get the drive number
  344. add al,"A"-1 ;AN000; convert it to char
  345. stosb ;AN000; store it in srcxname
  346. mov ax,dot_colon ;AN000; get colon and . and
  347. stosw ;AN000; store in srcxname
  348. mov al,end_of_line_out ;AN000; put a terminator char
  349. stosb ;AN000;
  350. pop si ;AN000; get line position back
  351. jmp short tn_check_eol ;AN000; check to make sure eol
  352. tn_filespec: ;AN000; a filespec was entered
  353. push si ;AN000; save position in line
  354. lds si,parse1_addr ;AN000; get address of filespec
  355. tn_move_filename: ;AN000; put filespec in srcxname
  356. lodsb ;AN000; get a char from buffer
  357. stosb ;AN000; store in srcxname
  358. cmp al,end_of_line_out ;AN000; it char a terminator?
  359. jnz tn_move_filename ;AN000; no - keep moving
  360. pop si ;AN000; get line position back
  361. tn_check_eol: ;AN000; make sure no extra parms
  362. mov di,offset trangroup:parse_chdir ;AN000; get address of parse_chdir
  363. call parse_check_eol ;AN000; are we at end of line?
  364. je tn_doit ;AN000; Yes - do the command
  365. tn_parse_error: ;AN000; A parse error occurred
  366. jmp cerror ;AN000; Go to error routine
  367. tn_doit: ;AN000;
  368. mov si,offset trangroup:srcxname ;AN000; set up srcxname as source
  369. mov di,offset trangroup:combuf ;AN000; set up combuf as target (need big target)
  370. mov ah,xnametrans ;AN000; do name translate call
  371. int 21h ;AN000;
  372. jnc tn_print_xname ;AN000; If no error - print result
  373. invoke Set_ext_error_msg ;AN000; get extended message
  374. mov string_ptr_2,offset trangroup:srcxname ;AN000; get address of failed string
  375. mov Extend_buf_sub,one_subst ;AN000; put number of subst in control block
  376. jmp cerror ;AN000; Go to error routine
  377. tn_print_xname: ;AN000;
  378. mov string_ptr_2,offset Trangroup:combuf ;AN000; Set up address of combuf
  379. mov dx,offset trangroup:string_buf_ptr ;AN000; Set up address of print control block
  380. invoke crlf2 ;AN000; print a crlf
  381. invoke printf_crlf ;AN000; print it out
  382. ret ;AN000;
  383. break $Exit
  384. assume ds:trangroup,es:trangroup
  385. $EXIT:
  386. push ds ;AN000; save data segment
  387. mov ds,[resseg] ;AN000; get resident data segment
  388. assume ds:resgroup ;AN000;
  389. cmp [permcom],0 ;AN045; is this a permanent COMMAND?
  390. jz free_com ;AN045; no - free everything
  391. ; We're a permanent command.
  392. ; Unless this is a singlecom (int 2Eh), don't deallocate transient.
  393. cmp [singlecom],-1 ;M034
  394. je no_reset ;M034 ;exit singlecom
  395. ; jmp TCommand ;permanent command, recycle
  396. ;Sudeepb 05-Jul-1991; Removed above jmp to terminate the top level
  397. ; command.com.
  398. CMDSVC SVC_CMDEXITVDM ; Never returns
  399. ;AD060; mov ah,multdos ;AN000; reset parse message pointers
  400. ;AD060; mov al,message_2f ;AN000; call for message retriever
  401. ;AD060; mov dl,set_parse_msg ;AN000; set up parse message address
  402. ;AD060; mov di,pars_msg_off ;AN000; old offset of parse messages
  403. ;AD060; mov es,pars_msg_seg ;AN000; old segment of parse messages
  404. ;AD060; int 2fh ;AN000; go set it
  405. ;AD060; mov ah,multdos ;AN000; set up to call DOS through int 2fh
  406. ;AD060; mov al,message_2f ;AN000; call for message retriever
  407. free_com:
  408. mov ax,(multdos shl 8 or message_2f);AN060; reset parse message pointers
  409. mov dl,set_critical_msg ;AN000; set up critical error message address
  410. mov di,crit_msg_off ;AN000; old offset of critical messages
  411. mov es,crit_msg_seg ;AN000; old segment of critical messages
  412. int 2fh ;AN000; go set it
  413. no_reset: ;AN045;
  414. pop ds ;AN000; restore local data segment
  415. assume ds:trangroup ;AN000;
  416. ;
  417. ;M040
  418. ; Restore user directory if the restore flag is set. RestUDir1 checks for
  419. ;this, restores user dir if flag is set and resets the flag.
  420. ;
  421. invoke RestUDir1 ;restore user dir if needed ;M040
  422. MOV ES,[RESSEG]
  423. assume es:resgroup
  424. MOV AX,[PARENT]
  425. MOV WORD PTR ES:[PDB_Parent_PID],AX
  426. MOV AX,WORD PTR OldTerm
  427. MOV WORD PTR ES:[PDB_Exit],AX
  428. MOV AX,WORD PTR OldTerm+2
  429. MOV WORD PTR ES:[PDB_Exit+2],AX
  430. PUSH ES
  431. MOV ES,[TRAN_TPA]
  432. MOV AH,DEALLOC
  433. INT 21h ; Now running in "free" space
  434. POP ES
  435. MOV AH,Exit
  436. MOV AL,BYTE PTR RetCode
  437. INT 21h
  438. ; ****************************************************************
  439. ; *
  440. ; * ROUTINE: PARSE_CHECK_EOL
  441. ; *
  442. ; * FUNCTION: Calls parser to see if end of line occurred.
  443. ; * If not end of line, set up to print parse
  444. ; * error message. ASSUMES NO MORE PARAMETERS ARE
  445. ; * EXPECTED!
  446. ; *
  447. ; * INPUT: DS:SI last output from parser
  448. ; * ES:DI points to parse block
  449. ; * CX last output from parser
  450. ; *
  451. ; * OUTPUT: AX parser return code
  452. ; *
  453. ; * if end of line found
  454. ; * zero flag set
  455. ; * else
  456. ; * MSG_DISPLAY_CLASS set to parse error
  457. ; *
  458. ; ****************************************************************
  459. ASSUME CS:TRANGROUP,DS:TRANGROUP,ES:NOTHING ;AN000;
  460. parse_check_eol Proc near ;AN000;
  461. xor dx,dx ;AN000;
  462. mov [parse_last],si ;AN018; save start of parameter
  463. invoke cmd_parse ;AN000; call parser
  464. cmp al,end_of_line ;AN000; Are we at end of line?
  465. jz parse_good_eol ;AN000; yes - no problem
  466. cmp ax,result_no_error ;AN018; was any error found?
  467. jnz ok_to_setup_pmsg ;AN018; yes - continue
  468. inc ax ;AN018; set AX to 1 and turn off zero flag
  469. ok_to_setup_pmsg:
  470. call setup_parse_error_msg ;AN018; go set up error message
  471. parse_good_eol:
  472. ret ;AN000;
  473. parse_check_eol endp ;AN000;
  474. ; ****************************************************************
  475. ; *
  476. ; * ROUTINE: PARSE_WITH_MSG
  477. ; *
  478. ; * FUNCTION: Calls parser. If an error occurred, the error
  479. ; * message is set up.
  480. ; *
  481. ; * INPUT: DS:SI last output from parser
  482. ; * ES:DI points to parse block
  483. ; * CX last output from parser
  484. ; *
  485. ; * OUTPUT: AX parser return code
  486. ; *
  487. ; * if no error
  488. ; * outputs from parser
  489. ; * else
  490. ; * MSG_DISPLAY_CLASS set to parse error
  491. ; * error message set up for STD_PRINTF
  492. ; *
  493. ; ****************************************************************
  494. ASSUME CS:TRANGROUP,DS:TRANGROUP,ES:NOTHING ;AN018;
  495. parse_with_msg Proc near ;AN018;
  496. mov [parse_last],si ;AN018; save start of parameter
  497. invoke cmd_parse ;AN018; call parser
  498. cmp al,end_of_line ;AN018; Are we at end of line?
  499. jz parse_msg_good ;AN018; yes - no problem
  500. cmp ax,result_no_error ;AN018; did an error occur
  501. jz parse_msg_good ;AN018; yes - no problem
  502. call setup_parse_error_msg ;AN018; go set up error message
  503. parse_msg_good:
  504. ret ;AN018;
  505. parse_with_msg endp ;AN018;
  506. ; ****************************************************************
  507. ; *
  508. ; * ROUTINE: SETUP_PARSE_ERROR_MSG
  509. ; *
  510. ; * FUNCTION: Calls parser. If an error occurred, the error
  511. ; * message is set up.
  512. ; *
  513. ; * INPUT: AX Parse error number
  514. ; * SI Set to past last parameter
  515. ; * Parse_last Set to start of last parameter
  516. ; *
  517. ; * OUTPUT: MSG_DISPLAY_CLASS set to parse error
  518. ; * error message set up for STD_PRINTF
  519. ; *
  520. ; ****************************************************************
  521. ASSUME CS:TRANGROUP,DS:TRANGROUP,ES:NOTHING ;AN018;
  522. SETUP_PARSE_ERROR_MSG Proc near ;AN018;
  523. mov msg_disp_class,parse_msg_class ;AC018; Set up parse message class
  524. mov dx,offset TranGroup:Extend_Buf_ptr ;AC018; get extended message pointer
  525. mov byte ptr [si],end_of_line_out ;AC018; terminate the parameter string
  526. mov Extend_Buf_ptr,ax ;AC018; get message number in control block
  527. cmp ax,lessargs_ptr ;AC018; if required parameter missing
  528. jz Setup_parse_msg_ret ;AN018; no subst
  529. mov si,[parse_last] ;AC018; get start of parameter
  530. mov string_ptr_2,si ;AC018; get address of failed string
  531. mov Extend_buf_sub,one_subst ;AC018; put number of subst in control block
  532. setup_parse_msg_ret:
  533. inc si ;AN018; make sure zero flag not set
  534. ret ;AC018;
  535. SETUP_PARSE_ERROR_MSG Endp ;AN018;
  536. trancode ends
  537. end
  538.