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.

921 lines
44 KiB

  1. ;/*
  2. ; * Microsoft Confidential
  3. ; * Copyright (C) Microsoft Corporation 1988 - 1991
  4. ; * All Rights Reserved.
  5. ; */
  6. ;************************************************************
  7. ;**
  8. ;** NAME: Support for HP PCL printers added to GRAPHICS.
  9. ;**
  10. ;** DESCRIPTION: I restructured the procedure PARSE_GRAPHICS so it can handle
  11. ;** the keywords LOWCOUNT, HIGHCOUNT, the new keywords COUNT and
  12. ;** DATA, and the escape sequence bytes in any order.
  13. ;**
  14. ;** BUG NOTES: The following bug was fixed for the pre-release
  15. ;** version Q.01.02.
  16. ;**
  17. ;** BUG (mda003)
  18. ;** ------------
  19. ;**
  20. ;** NAME: GRAPHICS prints a CR & LF after each scan line unless it is
  21. ;** loaded twice.
  22. ;**
  23. ;** FILES & PROCEDURES AFFECTED: GRLOAD3.ASM - PARSE_GRAPHICS
  24. ;** GRCOMMON.ASM - END_PRT_LINE
  25. ;** GRSHAR.STR - N/A
  26. ;**
  27. ;** CAUSES: The local variables LOWCOUNT_FOUND, HIGHCOUNT_FOUND CR_FOUND and
  28. ;** LF_FOUND used for loading, were incorrectly being used as global
  29. ;** variables during printing.
  30. ;**
  31. ;** FIX: Created a new variable Printer_Needs_CR_LF in GRSHAR.STR, which
  32. ;** is used to determine in GRCOMMON.ASM if it's necessary to
  33. ;** manually send a CR & LF to the printer at print time. The
  34. ;** variable is set at load time in GRLOAD3.ASM, if the variables
  35. ;** Data_Found and Build_State are set.
  36. ;**
  37. ;** DOCUMENTATION NOTES: This version of GRLOAD3.ASM differs from the previous
  38. ;** version only in terms of documentation.
  39. ;**
  40. ;**
  41. ;************************************************************
  42. PAGE ,132 ;AN000;
  43. TITLE DOS - GRAPHICS Command - Profile Load Modules #2 ;AN000;
  44. ;AN000;
  45. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  46. ;; DOS - GRAPHICS Command
  47. ;;
  48. ;; ;AN000;
  49. ;; File Name: GRLOAD.ASM ;AN000;
  50. ;; ---------- ;AN000;
  51. ;; ;AN000;
  52. ;; Description: ;AN000;
  53. ;; ------------ ;AN000;
  54. ;; This file contains the modules used to load the ;AN000;
  55. ;; GRAPHICS profile into resident memory. ;AN000;
  56. ;; ;AN000;
  57. ;; ************* The EGA Dynamic Save Area will be built (by ;AN000;
  58. ;; ** NOTE ** CHAIN_INTERRUPTS in file GRINST.ASM) over top of these ;AN000;
  59. ;; ************* modules to avoid having to relocate this save just before ;AN000;
  60. ;; terminating. This is safe since the maximum memory used is ;AN000;
  61. ;; 288 bytes and the profile loading modules are MUCH larger than ;AN000;
  62. ;; this. So GRLOAD.ASM MUST be linked before GRINST.ASM and after ;AN000;
  63. ;; GRPRINT.ASM. ;AN000;
  64. ;; ;AN000;
  65. ;; ;AN000;
  66. ;; Documentation Reference: ;AN000;
  67. ;; ------------------------ ;AN000;
  68. ;; PLACID Functional Specifications ;AN000;
  69. ;; OASIS High Level Design ;AN000;
  70. ;; OASIS GRAPHICS I1 Overview ;AN000;
  71. ;; ;AN000;
  72. ;; Procedures Contained in This File: ;AN000;
  73. ;; ---------------------------------- ;AN000;
  74. ;; LOAD_PROFILE - Main module for profile loading ;AN000;
  75. ;; ;AN000;
  76. ;; Include Files Required: ;AN000;
  77. ;; ----------------------- ;AN000;
  78. ;; ?????????? - Externals for profile loading modules ;AN000;
  79. ;; ;AN000;
  80. ;; External Procedure References: ;AN000;
  81. ;; ------------------------------ ;AN000;
  82. ;; None ;AN000;
  83. ;; ;AN000;
  84. ;; Linkage Instructions: ;AN000;
  85. ;; --------------------- ;AN000;
  86. ;; Refer to GRAPHICS.ASM ;AN000;
  87. ;; ;AN000;
  88. ;; Change History: ;AN000;
  89. ;; --------------- ;AN000;
  90. ;; ;AN000;
  91. ;; ;AN000;
  92. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  93. ;; ;AN000;
  94. ;; ;AN000;
  95. CODE SEGMENT PUBLIC 'CODE' BYTE ;; ;AN000;
  96. ;; ;AN000;
  97. INCLUDE STRUC.INC ;; ;AN000;
  98. INCLUDE GRINST.EXT ;; Bring in external declarations ;AN000;
  99. ;; for transient command processing ;AN000;
  100. INCLUDE GRSHAR.STR ;; ;AN000;
  101. INCLUDE GRMSG.EQU ;; ;AN000;
  102. INCLUDE GRINST.EXT ;; ;AN000;
  103. INCLUDE GRLOAD.EXT ;; ;AN000;
  104. INCLUDE GRLOAD2.EXT ;; ;AN000;
  105. INCLUDE GRPARSE.EXT ;; ;AN000;
  106. INCLUDE GRPATTRN.STR ;; ;AN000;
  107. INCLUDE GRPATTRN.EXT ;; ;AN000;
  108. ;; ;AN000;
  109. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  110. ;; ;AN000;
  111. ;; Public Symbols ;AN000;
  112. ;; ;AN000;
  113. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  114. ;; ;AN000;
  115. PUBLIC PARSE_GRAPHICS ;; ;AN000;
  116. PUBLIC PARSE_COLORSELECT ;; ;AN000;
  117. PUBLIC PARSE_COLORPRINT ;; ;AN000;
  118. PUBLIC PARSE_DARKADJUST ;; ;AN000;
  119. PUBLIC LIMIT ;; ;AN000;
  120. ;; ;AN000;
  121. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  122. ;; ;AN000;
  123. ASSUME CS:CODE,DS:CODE ;; ;AN000;
  124. ;; ;AN000;
  125. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  126. ;; ;AN000;
  127. ;; ;AN000;
  128. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  129. ;; ;AN000;
  130. ;; Profile Load Variables ;AN000;
  131. ;; ;AN000;
  132. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  133. ;; ;AN000;
  134. NO EQU 0 ;; ;AN000;
  135. YES EQU 1 ;; ;AN000;
  136. ;; ;AN000;
  137. RESULT_BUFFER LABEL BYTE ;; general purpose result buffer ;AN000;
  138. DB ? ;; operand type ;AN000;
  139. RESULT_TAG DB 0 ;; operand tag ;AN000;
  140. DW ? ;; pointer to synonym/keyword ;AN000;
  141. RESULT_VAL DB ?,?,?,? ;; returned numeric value ;AN000;
  142. ;; ;AN000;
  143. ;; ;AN000;
  144. ;; ;AN000;
  145. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  146. ;; ;AN000;
  147. ;; Module Name: ;AN000;
  148. ;; PARSE_GRAPHICS ;AN000;
  149. ;; ;AN000;
  150. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  151. ;; ;AN000;
  152. GRAPHICS_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
  153. DW GRAPHICS_P ;; ;AN000;
  154. DB 2 ;; # of lists ;AN000;
  155. DB 0 ;; # items in delimeter list ;AN000;
  156. DB 1 ;; # items in end-of-line list ;AN000;
  157. DB ';' ;; ';' used for comments ;AN000;
  158. ;; ;AN000;
  159. GRAPHICS_P DB 0,1 ;; Required, max parms ;AN000;
  160. DW GRAPHICS_P1 ;; ;AN000;
  161. DB 0 ;; # Switches ;AN000;
  162. DB 0 ;; # keywords ;AN000;
  163. ;; ;AN000;
  164. GRAPHICS_P1 DW 0A000H ;; Numeric OR string ;AN000;
  165. DW 2 ;; Capitalize ;AN000;
  166. DW RESULT_BUFFER ;; Result buffer ;AN000;
  167. DW GRAPHICS_P1V ;; Value list ;AN000;
  168. DB 0 ;; Synomyms ;AN000;
  169. ;; ;AN000;
  170. ;; ;AN000;
  171. GRAPHICS_P1V DB 3 ;; # of value lists ;AN000;
  172. DB 1 ;; # of range numerics ;AN000;
  173. DB 1 ;; tag ;AN000;
  174. DD 0,255 ;; range 0..255 ;AN000;
  175. DB 0 ;; 0 - no actual numerics ;AN000;
  176. ;\/ ~~mda(001) -----------------------------------------------------------------------
  177. ; Changed the # of string values from 2 to 4 because of the new
  178. ; keywords COUNT and DATA.
  179. DB 4 ;; 4 STRING VALUES ;AN000;
  180. ;/\ ~~mda(001) -----------------------------------------------------------------------
  181. DB 2 ;; tag ;AN000;
  182. DW LOWCOUNT_STR ;; ptr ;AN000;
  183. DB 3 ;; tag ;AN000;
  184. DW HIGHCOUNT_STR ;; ptr ;AN000;
  185. ;\/ ~~mda(001) -----------------------------------------------------------------------
  186. ; Added the following valid string values because of the new
  187. ; keywords COUNT and DATA.
  188. DB 4 ; tag
  189. DW COUNT_STR ; ptr
  190. DB 5 ; tag
  191. DW DATA_STR ; ptr
  192. COUNT_STR DB 'COUNT',0 ;
  193. DATA_STR DB 'DATA',0 ;
  194. ;
  195. ;/\ ~~mda(001) -----------------------------------------------------------------------
  196. ;; ;AN000;
  197. lowcount_str db 'LOWCOUNT',0 ;; ;AN000;
  198. HIGHcount_str db 'HIGHCOUNT',0 ;; ;AN000;
  199. ;; ;AN000;
  200. ;; ;AN000;
  201. LOWCOUNT_FOUND DB NO ;; ;AN000;
  202. HIGHCOUNT_FOUND DB NO ;; ;AN000;
  203. ;\/ ~~mda(001) -----------------------------------------------------------------------
  204. ; Added the following so know when get COUNT and DATA.
  205. COUNT_FOUND DB NO ;
  206. DATA_FOUND DB NO ;
  207. ;
  208. ;/\ ~~mda(001) -----------------------------------------------------------------------
  209. ;; ;AN000;
  210. ;; ;AN000;
  211. PARSE_GRAPHICS PROC ;; ;AN000;
  212. ;; ;AN000;
  213. MOV CUR_STMT,GR ;; ;AN000;
  214. .IF <BIT STMTS_DONE NAND DISP> ;; ;AN000;
  215. OR STMT_ERROR,MISSING ;; ;AN000;
  216. MOV PARSE_ERROR,YES ;; ;AN000;
  217. MOV BUILD_STATE,NO ;; ;AN000;
  218. .ENDIF ;; ;AN000;
  219. ;; ;AN000;
  220. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  221. MOV DI,BLOCK_START ;; ;AN000;
  222. MOV AX,BLOCK_END ;; ;AN000;
  223. MOV [BP+DI].GRAPHICS_ESC_PTR,AX ;; Set pointer to GRAPHICS seq ;AN000;
  224. MOV [BP+DI].NUM_GRAPHICS_ESC,0 ;; Init sequence size ;AN000;
  225. MOV [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA,0 ;;~~mda(001) Init sequence size ;AN000;
  226. .ENDIF ;; ;AN000;
  227. ;; ;AN000;
  228. MOV LOWCOUNT_FOUND,NO ;; Flags to indicate whether the LOW ;AN000;
  229. MOV HIGHCOUNT_FOUND,NO ;; and HIGHCOUNT parms were found ;AN000;
  230. MOV COUNT_FOUND,NO ;;~~mda(001) Flags to indicate the COUNT
  231. MOV DATA_FOUND,NO ;;~~mda(001) and DATA parms were found ;AN000;
  232. ;;
  233. OR STMTS_DONE,GR ;; Indicate GRAPHICS found ;AN000;
  234. ;; ;AN000;
  235. MOV AX,PREV_STMT ;; Terminate any preceeding groups ;AN000;
  236. OR GROUPS_DONE,AX ;; ;AN000;
  237. ;; ;AN000;
  238. MOV DI,OFFSET GRAPHICS_PARSE_PARMS ;; parse parms ;AN000;
  239. ;; SI => the line to parse ;AN000;
  240. XOR DX,DX ;; ;AN000;
  241. .REPEAT ;; ;AN000;
  242. XOR CX,CX ;; ;AN000;
  243. CALL SYSPARSE ;; ;AN000;
  244. ;; ;AN000;
  245. .IF <AX EQ 0> NEAR ;; If PARM is valid ;AN000;
  246. MOV BL,RESULT_TAG ;; ;AN000;
  247. .SELECT ;; ;AN000;
  248. .WHEN <BL EQ 1> ;; Escape byte ;AN000;
  249. PUSH AX ;; ;AN000;
  250. ;\/ ~~mda(001) -----------------------------------------------------------------------
  251. ; Changed the 1 to a 2 in the following instruction cause
  252. ; need an extra byte in the sequence to hold the tag that
  253. ; corresponds to esc seq., so during printing we know what to
  254. ; send and in what order.
  255. MOV AX,2 ;; Add a byte to the sequence ;AN000;
  256. ;/\ ~~mda(001) -----------------------------------------------------------------------
  257. CALL GROW_SHARED_DATA ;; Update block end ;AN000;
  258. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  259. PUSH DI ;; ;AN000;
  260. MOV DI,BLOCK_START ;; ;AN000;
  261. ;\/ ~~mda(001) -----------------------------------------------------------------------
  262. ; During printing we need to know how many things (things being
  263. ; esc #s, count, lowcount, or highcount) come before
  264. ; the data and how many things go after the data, - not just
  265. ; how many bytes are in the sequence. So check if dealing with
  266. ; things that come before the data.
  267. .IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
  268. INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
  269. .ELSE ; Bump # of things in seq. that
  270. INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
  271. .ENDIF
  272. ;/\ ~~mda(001) -----------------------------------------------------------------------
  273. MOV DI,BLOCK_END ;; ;AN000;
  274. MOV BYTE PTR [BP+DI-2],ESC_NUM_CODE;
  275. MOV AL,RESULT_VAL ;; Get esc byte from result buffer ;AN000;
  276. MOV [BP+DI-1],AL ;; Store at end of sequence ;AN000;
  277. POP DI ;; ;AN000;
  278. .ENDIF ;; ;AN000;
  279. POP AX ;; ;AN000;
  280. .WHEN <BL EQ 2> ;; LOWCOUNT ;AN000;
  281. CMP LOWCOUNT_FOUND,NO ;; ~~mda(001) If no LOWCOUNT or COUNT ;AN000;
  282. JNE LOWCNT_ERROR ; ~~mda(001) then proceed. Not using
  283. CMP COUNT_FOUND,NO ; ~~mda(001) .IF macro cause jump is
  284. JNE LOWCNT_ERROR ; ~~mda(001) out of range
  285. MOV LOWCOUNT_FOUND,YES ;; ;AN000;
  286. PUSH AX ;; ;AN000;
  287. MOV AX,2 ;; ~~mda(001) Changed a 1 to a 2 cause ;AN000;
  288. ; ~~mda(001) need extra byte for tag
  289. CALL GROW_SHARED_DATA ;; Update block end ;AN000;
  290. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  291. PUSH DI ;; ;AN000;
  292. MOV DI,BLOCK_START ;; ;AN000;
  293. ;\/ ~~mda(001) -----------------------------------------------------------------------
  294. .IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
  295. INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
  296. .ELSE ; Bump # of things in seq. that
  297. INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
  298. .ENDIF
  299. ;/\ ~~mda(001) -----------------------------------------------------------------------
  300. MOV DI,BLOCK_END ;; ~~mda(001) Put BLOCK_END in DI not AX.;AN000;
  301. ;\/ ~~mda(001) -----------------------------------------------------------------------
  302. ; No longer need following 3 instruction cause will have COUNT
  303. ; at a known fixed location in the SHARED_DATA_AREA.
  304. ;
  305. ;; DEC AX ;; Save pointer to low byte ;AN000;
  306. ;; MOV [BP+DI].LOW_BYT_COUNT_PTR,AX ;AN000;
  307. ;; MOV DI,AX ;; ;AN000;
  308. ;/\ ~~mda(001) -----------------------------------------------------------------------
  309. MOV BYTE PTR [BP+DI-2],LOWCOUNT_CODE;
  310. MOV BYTE PTR[BP+DI-1],0 ;; ~~mda(001) Added the -1. Store 0 in ;AN000;
  311. POP DI ;; in place of count ;AN000;
  312. .ENDIF ;; ;AN000;
  313. POP AX ;; ;AN000;
  314. JMP CK_NEXT_PARM ;~~mda(001) Added jump since can't use .IF macro
  315. LOWCNT_ERROR: ;;~~mda(001) Added label since can't use .IF macro
  316. OR STMT_ERROR,INVALID ;; Duplicate LOWCOUNT parms ;AN000;
  317. MOV PARSE_ERROR,YES ;;~~mda(001) or combo of LOWCOUNT & COUNT;AN000;
  318. MOV BUILD_STATE,NO ;; ;AN000;
  319. .WHEN <BL EQ 3> ;; HIGHCOUNT ;AN000;
  320. CMP HIGHCOUNT_FOUND,NO ;; ~~mda(001) If no HIGHCOUNT or COUNT ;AN000;
  321. JNE HIGHCNT_ERROR ; ~~mda(001) then proceed. Not using
  322. CMP COUNT_FOUND,NO ; ~~mda(001) .IF macro cause jump is
  323. JNE HIGHCNT_ERROR ; ~~mda(001) out of range
  324. MOV HIGHCOUNT_FOUND,YES ;; ;AN000;
  325. PUSH AX ;; ;AN000;
  326. MOV AX,2 ;; ~~mda(001) Changed a 1 to a 2 cause ;AN000;
  327. ; ~~mda(001) need extra byte for tag
  328. CALL GROW_SHARED_DATA ;; Update block end ;AN000;
  329. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  330. PUSH DI ;; ;AN000;
  331. MOV DI,BLOCK_START ;; ;AN000;
  332. ;\/ ~~mda(001) -----------------------------------------------------------------------
  333. .IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
  334. INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
  335. .ELSE ; Bump # of things in seq. that
  336. INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
  337. .ENDIF
  338. ;/\ ~~mda(001) -----------------------------------------------------------------------
  339. MOV DI,BLOCK_END ;; ~~mda(001) Put BLOCK_END in DI not AX. ;AN000;
  340. ;\/ ~~mda(001) -----------------------------------------------------------------------
  341. ; No longer need following 3 instructions cause will have COUNT
  342. ; at a known fixed location in the SHARED_DATA_AREA.
  343. ;
  344. ;; DEC AX ;; Save pointer to low byte ;AN000;
  345. ;; MOV [BP+DI].LOW_BYT_COUNT_PTR,AX ;AN000;
  346. ;; MOV DI,AX ;; ;AN000;
  347. ;/\ ~~mda(001) -----------------------------------------------------------------------
  348. MOV BYTE PTR [BP+DI-2],HIGHCOUNT_CODE;
  349. MOV BYTE PTR[BP+DI-1],0 ;; ~~mda(001) Added the -1. Store 0 in ;AN000;
  350. POP DI ;; place of count ;AN000;
  351. .ENDIF ;; ;AN000;
  352. POP AX ;; ;AN000;
  353. JMP CK_NEXT_PARM ;~~mda(001) Added jump since can't use .IF macro
  354. HIGHCNT_ERROR: ;;~~mda(001) Added label cause can't use .IF macro. ;AN000;
  355. OR STMT_ERROR,INVALID ;; Duplicate HIGHCOUNT parms
  356. MOV PARSE_ERROR,YES ;; ~~mda(001) or combo of HIGHCOUNT and ;AN000;
  357. MOV BUILD_STATE,NO ;; ~~mda(001) COUNT parms ;AN000;
  358. ;\/ ~~mda(001) -----------------------------------------------------------------------
  359. ; Added the following two cases for when have COUNT or DATA on
  360. ; GRAPHICS line.
  361. .WHEN <BL EQ 4> ;; COUNT
  362. .IF <COUNT_FOUND EQ NO> AND ; If haven't found a type of count
  363. .IF <LOWCOUNT_FOUND EQ NO> AND;;then proceed.
  364. .IF <HIGHCOUNT_FOUND EQ NO> ;
  365. ;
  366. MOV COUNT_FOUND,YES ;;
  367. PUSH AX ;;
  368. MOV AX,2 ;; Add 2 bytes to the seq. cause
  369. ; need extra byte for tag
  370. CALL GROW_SHARED_DATA ;; Update block end
  371. .IF <BUILD_STATE EQ YES> ;;
  372. PUSH DI ;;
  373. MOV DI,BLOCK_START ;;
  374. .IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
  375. INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
  376. .ELSE ; Bump # of things in seq. that
  377. INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
  378. .ENDIF
  379. MOV DI,BLOCK_END ;;
  380. MOV BYTE PTR [BP+DI-2],COUNT_CODE;
  381. MOV BYTE PTR[BP+DI-1],0 ;; Store 0 in place of count
  382. POP DI ;;
  383. .ENDIF ;;
  384. POP AX ;;
  385. .ELSE ;;
  386. OR STMT_ERROR,INVALID ;; Duplicate COUNT parms or combo of
  387. MOV PARSE_ERROR,YES ;; COUNT, LOWCOUNT or HIGHCOUNT parms
  388. MOV BUILD_STATE,NO ;;
  389. .ENDIF ;;
  390. .WHEN <BL EQ 5> ;; DATA
  391. .IF <DATA_FOUND EQ NO> ; If haven't found data then proceed
  392. MOV DATA_FOUND,YES ;;
  393. PUSH AX ;;
  394. MOV AX,2 ;; Add 2 bytes to the seq. cause
  395. ; need extra byte for tag
  396. CALL GROW_SHARED_DATA ;; Update block end
  397. .IF <BUILD_STATE EQ YES> ;;
  398. PUSH DI ;;
  399. MOV DI,BLOCK_END ;;
  400. MOV BYTE PTR [BP+DI-2],DATA_CODE;
  401. MOV BYTE PTR[BP+DI-1],0 ;; Store 0 in place of data
  402. POP DI ;;
  403. .ENDIF ;;
  404. POP AX ;;
  405. .ELSE ;;
  406. OR STMT_ERROR,INVALID ;; Duplicate DATA parms
  407. MOV PARSE_ERROR,YES ;;
  408. MOV BUILD_STATE,NO ;;
  409. .ENDIF ;;
  410. ;/\ ~~mda(001) -----------------------------------------------------------------------
  411. .ENDSELECT ;; ;AN000;
  412. .ELSE NEAR ;; ;AN000;
  413. .IF <AX NE -1> ;; ;AN000;
  414. OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
  415. MOV PARSE_ERROR,YES ;; ;AN000;
  416. MOV BUILD_STATE,NO ;; ;AN000;
  417. .ENDIF ;; ;AN000;
  418. .ENDIF ;; ;AN000;
  419. CK_NEXT_PARM: ;~~mda(001) Added label since can't use
  420. ;~~mda(001) .IF macro.
  421. .UNTIL <AX EQ -1> NEAR ;; ;AN000;
  422. ;\/ ~~mda(003) -----------------------------------------------------------------------
  423. .IF <DATA_FOUND EQ NO> ;; We have a printer that requires a ;AN000;
  424. .IF <BUILD_STATE EQ YES> ;;
  425. MOV [BP].PRINTER_NEEDS_CR_LF,YES; CR, LF to be sent to it
  426. .ENDIF ;;
  427. .ENDIF ;;
  428. ;/\ ~~mda(003) -----------------------------------------------------------------------
  429. ;; ;AN000;
  430. .IF <LOWCOUNT_FOUND EQ NO> OR ;; ;AN000;
  431. .IF <HIGHCOUNT_FOUND EQ NO> ;; Missing LOWCOUNT/HIGHCOUNT parms ;AN000;
  432. .IF <COUNT_FOUND EQ NO> ;; ~~mda(001) or missing COUNT parm
  433. OR STMT_ERROR,INVALID ;; ;AN000;
  434. MOV PARSE_ERROR,YES ;; ;AN000;
  435. MOV BUILD_STATE,NO ;; ;AN000;
  436. .ENDIF
  437. .ENDIF ;; ;AN000;
  438. RET ;; ;AN000;
  439. ;; ;AN000;
  440. PARSE_GRAPHICS ENDP ;; ;AN000;
  441. ;; ;AN000;
  442. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  443. ;; ;AN000;
  444. ;; Module Name: ;AN000;
  445. ;; PARSE_COLORSELECT ;AN000;
  446. ;; ;AN000;
  447. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  448. ;; ;AN000;
  449. COLORSELECT_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
  450. DW COLORSELECT_P ;; ;AN000;
  451. DB 2 ;; # of lists ;AN000;
  452. DB 0 ;; # items in delimeter list ;AN000;
  453. DB 1 ;; # items in end-of-line list ;AN000;
  454. DB ';' ;; ';' used for comments ;AN000;
  455. ;; ;AN000;
  456. ;; ;AN000;
  457. COLORSELECT_P LABEL BYTE ;; ;AN000;
  458. CS_NUM_REQ DB 1,1 ;; Required, max parms ;AN000;
  459. COLORSELECT_PARM LABEL WORD ;; ;AN000;
  460. CS_POSITIONAL DW ? ;; Pointer to our positional ;AN000;
  461. DB 0 ;; # Switches ;AN000;
  462. DB 0 ;; # keywords ;AN000;
  463. ;; ;AN000;
  464. COLORSELECT_P0 DW 2000H ;; sTRING - display type ;AN000;
  465. DW 2 ;; Capitalize ;AN000;
  466. DW RESULT_BUFFER ;; Result buffer ;AN000;
  467. DW COLORSELECT_P0V ;; Value list ;AN000;
  468. DB 0 ;; Synomyms ;AN000;
  469. ;; ;AN000;
  470. COLORSELECT_P0V DB 0 ;; # of value lists ;AN000;
  471. ; DB 0 ;; # of range numerics ;AN000;
  472. ; DB 0 ;; # of discrete numerics ;AN000;
  473. ; DB 1 ;; # of strings ;AN000;
  474. ; DB 1 ;; tag ;AN000;
  475. ;COLORSELECT_P0V1 DW ? ;; string ;AN000;
  476. ;; ;AN000;
  477. COLORSELECT_P1 DW 8001H ;; Numeric - escape sequence byte ;AN000;
  478. DW 0 ;; No Capitalize ;AN000;
  479. DW RESULT_BUFFER ;; Result buffer ;AN000;
  480. DW COLORSELECT_P1V ;; Value list ;AN000;
  481. DB 0 ;; Synomyms ;AN000;
  482. ;; ;AN000;
  483. COLORSELECT_P1V DB 1 ;; # of value lists ;AN000;
  484. DB 1 ;; # of range numerics ;AN000;
  485. DB 1 ;; tag ;AN000;
  486. DD 1,255 ;; range 1..255 ;AN000;
  487. ;; ;AN000;
  488. ;; ;AN000;
  489. ;; ;AN000;
  490. SEQ_LENGTH_PTR DW 0 ;; Number of colorselect statements ;AN000;
  491. ;; ;AN000;
  492. ;; ;AN000;
  493. ;; ;AN000;
  494. PARSE_COLORSELECT PROC ;; ;AN000;
  495. ;; ;AN000;
  496. MOV CUR_STMT,COLS ;; ;AN000;
  497. .IF <BIT STMTS_DONE NAND PRT> ;; PRINTER statemnet must have been ;AN000;
  498. OR STMT_ERROR,MISSING ;; processed ;AN000;
  499. MOV PARSE_ERROR,YES ;; ;AN000;
  500. MOV BUILD_STATE,NO ;; ;AN000;
  501. .ENDIF ;; ;AN000;
  502. ;; ;AN000;
  503. .IF <BIT STMTS_DONE AND DISP+COLP> ;; DISDPLAYMODE and COLORPRINT stmts ;AN000;
  504. OR STMT_ERROR,SEQUENCE ;; should NOT have been processed ;AN000;
  505. MOV PARSE_ERROR,YES ;; ;AN000;
  506. MOV BUILD_STATE,NO ;; ;AN000;
  507. .ENDIF ;; ;AN000;
  508. ;; ;AN000;
  509. .IF <BIT GROUPS_DONE AND COLS> ;; Check for a previous group of ;AN000;
  510. OR STMT_ERROR,SEQUENCE ;; COLORSELECTS within this PTD ;AN000;
  511. MOV PARSE_ERROR,YES ;; ;AN000;
  512. MOV BUILD_STATE,NO ;; ;AN000;
  513. .ENDIF ;; ;AN000;
  514. ;; ;AN000;
  515. .IF <BIT STMTS_DONE NAND COLS> ;; If first COLORSELECT... ;AN000;
  516. MOV NUM_BANDS,0 ;; Init number of COLORSELECT bands ;AN000;
  517. .IF <BUILD_STATE EQ YES> ;; Update count and pointer in the ;AN000;
  518. MOV AX,BLOCK_END ;; Shared Data Area header ;AN000;
  519. MOV [BP].COLORSELECT_PTR,AX ;; Set pointer to COLORSELECT info ;AN000;
  520. MOV [BP].NUM_PRT_BANDS,0 ;; Init NUMBER OF COLORSELECTS ;AN000;
  521. .ENDIF ;; ;AN000;
  522. .ENDIF ;; ;AN000;
  523. ;; ;AN000;
  524. OR STMTS_DONE,COLS ;; Indicate found ;AN000;
  525. .IF <PREV_STMT NE COLS> THEN ;; Terminate any preceeding groups ;AN000;
  526. MOV AX,PREV_STMT ;; except for COLORSELECT ;AN000;
  527. OR GROUPS_DONE,AX ;; ;AN000;
  528. .ENDIF ;; ;AN000;
  529. ;; ;AN000;
  530. MOV AX,1 ;; Make room for sequence length field ;AN000;
  531. CALL GROW_SHARED_DATA ;; ;AN000;
  532. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  533. INC [BP].NUM_PRT_BANDS ;; Inc number of selects ;AN000;
  534. MOV DI,BLOCK_END ;; ;AN000;
  535. MOV BYTE PTR [BP+DI-1],0 ;; Init sequence length field ;AN000;
  536. LEA AX,[DI-1] ;; ;AN000;
  537. MOV SEQ_LENGTH_PTR,AX ;; Save pointer to length of sequence ;AN000;
  538. .ENDIF ;; ;AN000;
  539. ;; ;AN000;
  540. MOV DI,OFFSET COLORSELECT_PARSE_PARMS ;; parse parms ;AN000;
  541. MOV CS_NUM_REQ,1 ;; Change to 1 required parameters ;AN000;
  542. MOV AX,OFFSET COLORSELECT_P0 ;; Point to control block for the band ;AN000;
  543. MOV CS_POSITIONAL,AX ;; ID. (Dealing with only 1 positional ;AN000;
  544. ;; parameter at a time was the only way ;AN000;
  545. ;; I could get SYSPARSE to handle ;AN000;
  546. ;; the COLORSELECT syntax!) ;AN000;
  547. ;; SI => the line to parse ;AN000;
  548. XOR DX,DX ;; ;AN000;
  549. XOR CX,CX ;; ;AN000;
  550. ;; ;AN000;
  551. CALL SYSPARSE ;; PARSE the band ID ;AN000;
  552. .IF <AX NE 0> ;; ;AN000;
  553. OR STMT_ERROR,INVALID ;; ;AN000;
  554. MOV PARSE_ERROR,YES ;; ;AN000;
  555. MOV BUILD_STATE,NO ;; ;AN000;
  556. RET ;; statement. ;AN000;
  557. .ENDIF ;; ;AN000;
  558. ;; ;AN000;
  559. PUSH ES ;; We got a band id........ ;AN000;
  560. PUSH DI ;; ;AN000;
  561. ;; ;AN000;
  562. LES DI,DWORD PTR RESULT_VAL ;; Get pointer to the parsed band id ;AN000;
  563. .IF <<BYTE PTR ES:[DI+1]> NE 0> ;; Make sure the band id is only ;AN000;
  564. OR STMT_ERROR,INVALID ;; one byte long ;AN000;
  565. MOV PARSE_ERROR,YES ;; ;AN000;
  566. MOV BUILD_STATE,NO ;; ;AN000;
  567. .ENDIF ;; ;AN000;
  568. ;; ;AN000;
  569. MOV BL,NUM_BANDS ;; ;AN000;
  570. XOR BH,BH ;; ;AN000;
  571. .IF <BX EQ MAX_BANDS> THEN ;; Watch out for too many COLORSELECTs ;AN000;
  572. OR STMT_ERROR,SEQUENCE ;; ;AN000;
  573. MOV PARSE_ERROR,YES ;; ;AN000;
  574. MOV BUILD_STATE,NO ;; ;AN000;
  575. .ELSE ;; ;AN000;
  576. SHL BX,1 ;; calc index to store band in value list;AN000;
  577. MOV AL,ES:[DI] ;; get BAND ID FROM PARSEr ;AN000;
  578. MOV BAND_VAL_LIST[BX],AL ;; ;AN000;
  579. INC NUM_BANDS ;; bump number of bands ;AN000;
  580. .ENDIF ;; ;AN000;
  581. ;; ;AN000;
  582. POP DI ;; ;AN000;
  583. POP ES ;; ;AN000;
  584. ;; ;AN000;
  585. ;; ;AN000;
  586. MOV AX,OFFSET COLORSELECT_P1 ;; Switch to numeric positional parm!!! ;AN000;
  587. MOV CS_POSITIONAL,AX ;; ;AN000;
  588. MOV CS_NUM_REQ,0 ;; Change to 0 required parameters ;AN000;
  589. XOR DX,DX ;; PARSE the sequence of escape bytes ;AN000;
  590. .REPEAT ;; ;AN000;
  591. XOR CX,CX ;; ;AN000;
  592. CALL SYSPARSE ;; ;AN000;
  593. .IF <AX EQ 0> ;; If esc byte is valid ;AN000;
  594. PUSH AX ;; ;AN000;
  595. MOV AX,1 ;; Add a byte to the sequence ;AN000;
  596. CALL GROW_SHARED_DATA ;; Update block end ;AN000;
  597. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  598. PUSH DI ;; ;AN000;
  599. MOV DI,SEQ_LENGTH_PTR ;; ;AN000;
  600. INC byte ptr [BP+DI] ;; Bump number of bytes in sequence ;AN000;
  601. MOV DI,BLOCK_END ;; ;AN000;
  602. MOV AL,RESULT_VAL ;; Get esc byte from result buffer ;AN000;
  603. MOV [BP+DI-1],AL ;; Store at end of sequence ;AN000;
  604. POP DI ;; ;AN000;
  605. .ENDIF ;; ;AN000;
  606. POP AX ;; ;AN000;
  607. .ELSE ;; ;AN000;
  608. .IF <AX NE -1> ;; ;AN000;
  609. OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
  610. MOV PARSE_ERROR,YES ;; ;AN000;
  611. MOV BUILD_STATE,NO ;; ;AN000;
  612. .ENDIF ;; ;AN000;
  613. .ENDIF ;; ;AN000;
  614. .UNTIL <AX EQ -1> NEAR ;; ;AN000;
  615. ;; ;AN000;
  616. ;; ;AN000;
  617. RET ;; ;AN000;
  618. ;; ;AN000;
  619. PARSE_COLORSELECT ENDP ;; ;AN000;
  620. ;; ;AN000;
  621. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  622. ;; ;AN000;
  623. ;; Module Name: ;AN000;
  624. ;; PARSE_COLORPRINT ;AN000;
  625. ;; ;AN000;
  626. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  627. ;; ;AN000;
  628. COLORPRINT_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
  629. DW COLORPRINT_P ;; ;AN000;
  630. DB 2 ;; # of lists ;AN000;
  631. DB 0 ;; # items in delimeter list ;AN000;
  632. DB 1 ;; # items in end-of-line list ;AN000;
  633. DB ';' ;; ';' used for comments ;AN000;
  634. ;; ;AN000;
  635. ;; ;AN000;
  636. COLORPRINT_P LABEL BYTE ;; ;AN000;
  637. DB 3,4 ;; Required,MAX ;AN000;
  638. DW COLORPRINT_P0 ;; Numeric: Red value ;AN000;
  639. DW COLORPRINT_P0 ;; Green value ;AN000;
  640. DW COLORPRINT_P0 ;; Blue value ;AN000;
  641. DW COLORPRINT_P1 ;; Band ID ... REPEATING ;AN000;
  642. DB 0 ;; # Switches ;AN000;
  643. DB 0 ;; # keywords ;AN000;
  644. ;; ;AN000;
  645. COLORPRINT_P0 DW 8000H ;; Numeric - RGB value ;AN000;
  646. DW 0 ;; No Capitalize ;AN000;
  647. DW RESULT_BUFFER ;; Result buffer ;AN000;
  648. DW COLORPRINT_P0V ;; Value list ;AN000;
  649. DB 0 ;; Synomyms ;AN000;
  650. ;; ;AN000;
  651. COLORPRINT_P0V DB 1 ;; # of value lists ;AN000;
  652. DB 1 ;; # of range numerics ;AN000;
  653. DB 1 ;; tag ;AN000;
  654. DD 0,63 ;; range 0..63 ;AN000;
  655. ;; ;AN000;
  656. COLORPRINT_P1 DW 2001H ;; sTRING - Band ID ;AN000;
  657. DW 2 ;; Capitalize ;AN000;
  658. DW RESULT_BUFFER ;; Result buffer ;AN000;
  659. DW COLORPRINT_P1V ;; Value list ;AN000;
  660. DB 0 ;; Synomyms ;AN000;
  661. ;; ;AN000;
  662. COLORPRINT_P1V DB 3 ;; # of value lists ;AN000;
  663. DB 0 ;; 0 - no range numerics ;AN000;
  664. DB 0 ;; 0 - no actual numerics ;AN000;
  665. NUM_BANDS DB 0 ;; number of band values ;AN000;
  666. DB 01H ;; tag: TAGS ARE BAND MASKS ;AN000;
  667. DW BAND_PTR_1 ;; ptr ;AN000;
  668. DB 02H ;; tag ;AN000;
  669. DW BAND_PTR_2 ;; ptr ;AN000;
  670. DB 04H ;; tag ;AN000;
  671. DW BAND_PTR_3 ;; ptr ;AN000;
  672. DB 08H ;; tag ;AN000;
  673. DW BAND_PTR_4 ;; ptr ;AN000;
  674. DB 10H ;; tag ;AN000;
  675. DW BAND_PTR_5 ;; ptr ;AN000;
  676. DB 20H ;; tag ;AN000;
  677. DW BAND_PTR_6 ;; ptr ;AN000;
  678. DB 40H ;; tag ;AN000;
  679. DW BAND_PTR_7 ;; ptr ;AN000;
  680. DB 80H ;; tag ;AN000;
  681. DW BAND_PTR_8 ;; ptr ;AN000;
  682. ;; ;AN000;
  683. MAX_BANDS EQU 8 ;; ;AN000;
  684. ;; ;AN000;
  685. BAND_VAL_LIST LABEL BYTE ;; ;AN000;
  686. BAND_PTR_1 DB ?,0 ;; ;AN000;
  687. BAND_PTR_2 DB ?,0 ;; ;AN000;
  688. BAND_PTR_3 DB ?,0 ;; ;AN000;
  689. BAND_PTR_4 DB ?,0 ;; ;AN000;
  690. BAND_PTR_5 DB ?,0 ;; ;AN000;
  691. BAND_PTR_6 DB ?,0 ;; ;AN000;
  692. BAND_PTR_7 DB ?,0 ;; ;AN000;
  693. BAND_PTR_8 DB ?,0 ;; ;AN000;
  694. ;; ;AN000;
  695. ;; ;AN000;
  696. PARSE_COLORPRINT PROC ;; ;AN000;
  697. ;; ;AN000;
  698. MOV CUR_STMT,COLP ;; ;AN000;
  699. .IF <BIT STMTS_DONE NAND PRT> ;; PRINTER statemnet must have been ;AN000;
  700. OR STMT_ERROR,MISSING ;; processed ;AN000;
  701. MOV PARSE_ERROR,YES ;; ;AN000;
  702. MOV BUILD_STATE,NO ;; ;AN000;
  703. .ENDIF ;; ;AN000;
  704. ;; ;AN000;
  705. .IF <BIT STMTS_DONE AND DISP> ;; DISPLAYMODE stmts ;AN000;
  706. OR STMT_ERROR,SEQUENCE ;; should NOT have been processed ;AN000;
  707. MOV PARSE_ERROR,YES ;; ;AN000;
  708. MOV BUILD_STATE,NO ;; ;AN000;
  709. .ENDIF ;; ;AN000;
  710. ;; ;AN000;
  711. .IF <BIT GROUPS_DONE AND COLP> ;; Check for a previous group of ;AN000;
  712. OR STMT_ERROR,SEQUENCE ;; COLORPRINTS within this PTD ;AN000;
  713. MOV PARSE_ERROR,YES ;; ;AN000;
  714. MOV BUILD_STATE,NO ;; ;AN000;
  715. .ENDIF ;; ;AN000;
  716. ;; ;AN000;
  717. MOV CUR_PRINTER_TYPE,COLOR ;; ;AN000;
  718. ;; ;AN000;
  719. .IF <BIT STMTS_DONE NAND COLP> ;; If first COLORPRINT... ;AN000;
  720. .IF <BUILD_STATE EQ YES> ;; Update count and pointer in the ;AN000;
  721. MOV AX,BLOCK_END ;; Shared Data Area header ;AN000;
  722. MOV [BP].COLORPRINT_PTR,AX ;; Set pointer to COLORPRINT info ;AN000;
  723. MOV [BP].PRINTER_TYPE,COLOR ;; ;AN000;
  724. MOV [BP].NUM_PRT_COLOR,0 ;; Init NUMBER OF COLORPRINTS ;AN000;
  725. .ENDIF ;; ;AN000;
  726. .ENDIF ;; ;AN000;
  727. ;; ;AN000;
  728. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  729. INC [BP].NUM_PRT_COLOR ;; Inc number of selects ;AN000;
  730. .ENDIF ;; ;AN000;
  731. ;; ;AN000;
  732. OR STMTS_DONE,COLP ;; Indicate found ;AN000;
  733. .IF <PREV_STMT NE COLP> THEN ;; Terminate any preceeding groups ;AN000;
  734. MOV AX,PREV_STMT ;; except for COLORPRINT ;AN000;
  735. OR GROUPS_DONE,AX ;; ;AN000;
  736. .ENDIF ;; ;AN000;
  737. ;; ;AN000;
  738. MOV AX,BLOCK_END ;; Start a new block ;AN000;
  739. MOV BLOCK_START,AX ;; ;AN000;
  740. MOV AX,SIZE COLORPRINT_STR ;; Make room for COLORPRINT info ;AN000;
  741. CALL GROW_SHARED_DATA ;; ;AN000;
  742. ;; ;AN000;
  743. MOV DI,OFFSET COLORPRINT_PARSE_PARMS ;; parse parms ;AN000;
  744. ;; SI => the line to parse ;AN000;
  745. XOR DX,DX ;; ;AN000;
  746. XOR CX,CX ;; ;AN000;
  747. ;; ;AN000;
  748. CALL SYSPARSE ;; PARSE the RED value ;AN000;
  749. .IF <AX NE 0> ;; ;AN000;
  750. OR STMT_ERROR,INVALID ;; ;AN000;
  751. MOV PARSE_ERROR,YES ;; ;AN000;
  752. MOV BUILD_STATE,NO ;; ;AN000;
  753. .ELSE ;; ;AN000;
  754. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  755. PUSH DI ;; ;AN000;
  756. MOV DI,BLOCK_START ;; ;AN000;
  757. MOV AL,RESULT_VAL ;; Store RED value in COLORPRINT info ;AN000;
  758. MOV [BP+DI].RED,AL ;; ;AN000;
  759. POP DI ;; ;AN000;
  760. .ENDIF ;; ;AN000;
  761. .ENDIF ;; ;AN000;
  762. ;; ;AN000;
  763. CALL SYSPARSE ;; PARSE the GREEN value ;AN000;
  764. .IF <AX NE 0> ;; ;AN000;
  765. OR STMT_ERROR,INVALID ;; ;AN000;
  766. MOV PARSE_ERROR,YES ;; ;AN000;
  767. MOV BUILD_STATE,NO ;; ;AN000;
  768. .ELSE ;; ;AN000;
  769. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  770. PUSH DI ;; ;AN000;
  771. MOV DI,BLOCK_START ;; ;AN000;
  772. MOV AL,RESULT_VAL ;; Store GREEN value in COLORPRINT info ;AN000;
  773. MOV [BP+DI].GREEN,AL ;; ;AN000;
  774. POP DI ;; ;AN000;
  775. .ENDIF ;; ;AN000;
  776. .ENDIF ;; ;AN000;
  777. ;; ;AN000;
  778. CALL SYSPARSE ;; PARSE the BLUE value ;AN000;
  779. .IF <AX NE 0> ;; ;AN000;
  780. OR STMT_ERROR,INVALID ;; ;AN000;
  781. MOV PARSE_ERROR,YES ;; ;AN000;
  782. MOV BUILD_STATE,NO ;; ;AN000;
  783. .ELSE ;; ;AN000;
  784. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  785. PUSH DI ;; ;AN000;
  786. MOV DI,BLOCK_START ;; ;AN000;
  787. MOV AL,RESULT_VAL ;; Store BLUE value in COLORPRINT info ;AN000;
  788. MOV [BP+DI].BLUE,AL ;; ;AN000;
  789. POP DI ;; ;AN000;
  790. .ENDIF ;; ;AN000;
  791. .ENDIF ;; ;AN000;
  792. ;; ;AN000;
  793. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  794. PUSH DI ;; ;AN000;
  795. MOV DI,BLOCK_START ;; ;AN000;
  796. MOV [BP+DI].SELECT_MASK,0 ;; Initialize band select mask ;AN000;
  797. POP DI ;; ;AN000;
  798. .ENDIF ;; ;AN000;
  799. XOR DX,DX ;; For each band found "OR" the item ;AN000;
  800. .REPEAT ;; tag into the select mask ;AN000;
  801. MOV CX,3 ;; Avoid getting too many parms error ;AN000;
  802. CALL SYSPARSE ;; from parser ;AN000;
  803. .IF <AX EQ 0> ;; ;AN000;
  804. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  805. PUSH DI ;; ;AN000;
  806. MOV DI,BLOCK_START ;; ;AN000;
  807. MOV AL,RESULT_TAG ;; ;AN000;
  808. OR [BP+DI].SELECT_MASK,AL ;; OR the mask for this band into the ;AN000;
  809. ;; select mask for this color ;AN000;
  810. POP DI ;; ;AN000;
  811. .ENDIF ;; ;AN000;
  812. .ELSE ;; ;AN000;
  813. .IF <AX NE -1> ;; ;AN000;
  814. OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
  815. MOV PARSE_ERROR,YES ;; ;AN000;
  816. MOV BUILD_STATE,NO ;; ;AN000;
  817. .ENDIF ;; ;AN000;
  818. .ENDIF ;; ;AN000;
  819. .UNTIL <AX EQ -1> NEAR ;; ;AN000;
  820. ;; ;AN000;
  821. RET ;; ;AN000;
  822. ;; ;AN000;
  823. PARSE_COLORPRINT ENDP ;; ;AN000;
  824. ;; ;AN000;
  825. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  826. ;; ;AN000;
  827. ;; ;AN000;
  828. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  829. ;; ;AN000;
  830. ;; Module Name: ;AN000;
  831. ;; PARSE_DARKADJUST ;AN000;
  832. ;; ;AN000;
  833. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  834. ;AN000;
  835. DARKADJUST_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
  836. DW DARKADJUST_P ;; ;AN000;
  837. DB 2 ;; # of lists ;AN000;
  838. DB 0 ;; # items in delimeter list ;AN000;
  839. DB 1 ;; # items in end-of-line list ;AN000;
  840. DB ';' ;; ';' used for comments ;AN000;
  841. ;; ;AN000;
  842. ;; ;AN000;
  843. DARKADJUST_P LABEL BYTE ;; ;AN000;
  844. DB 1,1 ;; Required,MAX ;AN000;
  845. DW DARKADJUST_P0 ;; Numeric: adjust value ;AN000;
  846. DB 0 ;; # Switches ;AN000;
  847. DB 0 ;; # keywords ;AN000;
  848. ;; ;AN000;
  849. DARKADJUST_P0 DW 4000H ;; Signed Numeric - adjust value ;AN000;
  850. DW 0 ;; No Capitalize ;AN000;
  851. DW RESULT_BUFFER ;; Result buffer ;AN000;
  852. DW DARKADJUST_P0V ;; Value list ;AN000;
  853. DB 0 ;; Synomyms ;AN000;
  854. ;; ;AN000;
  855. DARKADJUST_P0V DB 1 ;; # of value lists ;AN000;
  856. DB 1 ;; # of range numerics ;AN000;
  857. DB 1 ;; tag ;AN000;
  858. DD -63,63 ;; range -63,63 ;AN000;
  859. ;;;;***********************************;; ;AN000;
  860. ;; ;AN000;
  861. ;AN000;
  862. PARSE_DARKADJUST PROC ;; ;AN000;
  863. ;; ;AN000;
  864. MOV CUR_STMT,DARK ;; ;AN000;
  865. .IF <BIT STMTS_DONE NAND PRT> ;; PRINTER statemnet must have been ;AN000;
  866. OR STMT_ERROR,MISSING ;; processed ;AN000;
  867. MOV PARSE_ERROR,YES ;; ;AN000;
  868. MOV BUILD_STATE,NO ;; ;AN000;
  869. .ENDIF ;; ;AN000;
  870. ;; ;AN000;
  871. ;; ;AN000;
  872. OR STMTS_DONE,DARK ;; Indicate found ;AN000;
  873. ;; Terminate any preceeding groups ;AN000;
  874. MOV AX,PREV_STMT ;; ;AN000;
  875. OR GROUPS_DONE,AX ;; ;AN000;
  876. ;; ;AN000;
  877. MOV DI,OFFSET DARKADJUST_PARSE_PARMS ;; parse parms ;AN000;
  878. ;; SI => the line to parse ;AN000;
  879. XOR DX,DX ;; ;AN000;
  880. XOR CX,CX ;; ;AN000;
  881. ;; ;AN000;
  882. CALL SYSPARSE ;; PARSE the ADJUST VALUE ;AN000;
  883. .IF <AX NE 0> ;; ;AN000;
  884. OR STMT_ERROR,INVALID ;; ;AN000;
  885. MOV PARSE_ERROR,YES ;; ;AN000;
  886. MOV BUILD_STATE,NO ;; ;AN000;
  887. .ELSE ;; ;AN000;
  888. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  889. MOV AL,RESULT_VAL ;; ;AN000;
  890. MOV [BP].DARKADJUST_VALUE,AL ;; ;AN000;
  891. .ENDIF ;; ;AN000;
  892. CALL SYSPARSE ;; CHECK FOR EXTRA PARMS ;AN000;
  893. .IF <AX NE -1> ;; ;AN000;
  894. OR STMT_ERROR,INVALID ;; ;AN000;
  895. MOV PARSE_ERROR,YES ;; ;AN000;
  896. MOV BUILD_STATE,NO ;; ;AN000;
  897. .ENDIF ;; ;AN000;
  898. .ENDIF ;; ;AN000;
  899. ;; ;AN000;
  900. RET ;; ;AN000;
  901. ;; ;AN000;
  902. PARSE_DARKADJUST ENDP ;; ;AN000;
  903. ;AN000;
  904. LIMIT LABEL NEAR ;; ;AN000;
  905. CODE ENDS ;; ;AN000;
  906. END ;AN000;
  907.