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.

1217 lines
56 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 altered the procedure PARSE_VERB and added the new
  11. ;** procedure PARSE_DEFINE and made it public in order to handle
  12. ;** the new statement DEFINE. I also made the new variable
  13. ;** DATA_TYPE have the default of DATA_COL, so the default
  14. ;** assumes IBM type printers.
  15. ;**
  16. ;** BUG NOTES: Bug mda002 was completely fixed for the pre-release
  17. ;** version Q.01.02, whereas bug mda005 was only partially
  18. ;** fixed. In other words, part of bug mda005 is in the
  19. ;** released versions D.01.01 & D.01.02.
  20. ;**
  21. ;** BUG (mda002)
  22. ;** ------------
  23. ;**
  24. ;** NAME: GRAPHICS prints garbage on PCL printers if IBM printers are
  25. ;** listed after HP printers in the GRAPHICS profile.
  26. ;**
  27. ;** FILES & PROCEDURES AFFECTED: GRLOAD2.ASM - PARSE_PRINTER
  28. ;** GRLOAD2.ASM - PARSE_DEFINE
  29. ;**
  30. ;** CAUSES: 1) In the procedure Parse_Define I was moving values in the
  31. ;** variable DATA_TYPE for every DEFINE statement, instead of
  32. ;** just for the DEFINE statement that corresponded to the
  33. ;** printer we were using.
  34. ;**
  35. ;** 2) In the procedure Parse_Printer I was resetting DATA_TYPE to
  36. ;** DATA_COL if BUILD_STATE = YES, but I was doing it in a
  37. ;** section of code where BUILD_STATE would never be YES.
  38. ;**
  39. ;** FIXES: 1) Made a couple of changes in the procedure Parse_Define so
  40. ;** that values are moved into the variable DATA_TYPE just for
  41. ;** the DEFINE statement that corresponds to the printer
  42. ;** currently being used.
  43. ;**
  44. ;** 2) I moved a section of code from the procedure Parse_Printer
  45. ;** to the end of the procedure, because this is where it is
  46. ;** possible for BUILD_STATE to equal YES.
  47. ;**
  48. ;** BUG (mda005)
  49. ;** ------------
  50. ;**
  51. ;** NAME: If a picture is printed using a 3,1 printbox, the picture has
  52. ;** blank lines throughout the picture, which has the wrong aspect
  53. ;** ratio.
  54. ;**
  55. ;** FILES & PROCEDURES AFFECTED: GRLOAD2.ASM - PARSE_PRINTBOX
  56. ;**
  57. ;** CAUSE: The print buffer was being filled as follows,
  58. ;**
  59. ;** --------------------------
  60. ;** | o o o o o o o o |
  61. ;** --------------------------
  62. ;** |_____| | |_____| |
  63. ;** | | | |
  64. ;** | | | |
  65. ;** FROM: pixel 1 | pixel 2 |
  66. ;** | |
  67. ;** |___________|
  68. ;** |
  69. ;** |
  70. ;** |
  71. ;** Always left blank
  72. ;**
  73. ;** instead of as follows,
  74. ;**
  75. ;** --------------------------
  76. ;** | o o o o o o o o |
  77. ;** --------------------------
  78. ;** |_____| |_____| |__|
  79. ;** | | |
  80. ;** | | |
  81. ;** FROM: pixel 1 pixel 2 pixel 3
  82. ;**
  83. ;** Note that this not only resulted in a strange picture, but a
  84. ;** picture with the incorrect aspect ratio. Because in essence the
  85. ;** picture was printed indirectly with a 4,1 printbox because for
  86. ;** every pixel read four bits were sent to the printer.
  87. ;**
  88. ;** FIX: Because of time constraints it was decided to print the picture
  89. ;** directly with a 4,1 printbox. So even though the picture still
  90. ;** has the wrong aspect ratio, it at least does not have funny blank
  91. ;** lines throughout the entire picture. This fix was implemented by
  92. ;** changing a 3,1 printbox to a 4,1 printbox.
  93. ;**
  94. ;** DOCUMENTATION NOTES: This version of GRLOAD2.ASM differs from the previous
  95. ;** version only in terms of documentation.
  96. ;**
  97. ;**
  98. ;************************************************************
  99. PAGE ,132 ;AN000;
  100. TITLE DOS - GRAPHICS Command - Profile Load Modules #2 ;AN000;
  101. ;AN000;
  102. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  103. ;; DOS - GRAPHICS Command
  104. ;;
  105. ;; ;AN000;
  106. ;; File Name: GRLOAD.ASM ;AN000;
  107. ;; ---------- ;AN000;
  108. ;; ;AN000;
  109. ;; Description: ;AN000;
  110. ;; ------------ ;AN000;
  111. ;; This file contains the modules used to load the ;AN000;
  112. ;; GRAPHICS profile into resident memory. ;AN000;
  113. ;; ;AN000;
  114. ;; ************* The EGA Dynamic Save Area will be built (by ;AN000;
  115. ;; ** NOTE ** CHAIN_INTERRUPTS in file GRINST.ASM) over top of these ;AN000;
  116. ;; ************* modules to avoid having to relocate this save just before ;AN000;
  117. ;; terminating. This is safe since the maximum memory used is ;AN000;
  118. ;; 288 bytes and the profile loading modules are MUCH larger than ;AN000;
  119. ;; this. So GRLOAD.ASM MUST be linked before GRINST.ASM and after ;AN000;
  120. ;; GRPRINT.ASM. ;AN000;
  121. ;; ;AN000;
  122. ;; ;AN000;
  123. ;; Documentation Reference: ;AN000;
  124. ;; ------------------------ ;AN000;
  125. ;; PLACID Functional Specifications ;AN000;
  126. ;; OASIS High Level Design ;AN000;
  127. ;; OASIS GRAPHICS I1 Overview ;AN000;
  128. ;; ;AN000;
  129. ;; Procedures Contained in This File: ;AN000;
  130. ;; ---------------------------------- ;AN000;
  131. ;; LOAD_PROFILE - Main module for profile loading ;AN000;
  132. ;; ;AN000;
  133. ;; Include Files Required: ;AN000;
  134. ;; ----------------------- ;AN000;
  135. ;; ?????????? - Externals for profile loading modules ;AN000;
  136. ;; ;AN000;
  137. ;; External Procedure References: ;AN000;
  138. ;; ------------------------------ ;AN000;
  139. ;; None ;AN000;
  140. ;; ;AN000;
  141. ;; Linkage Instructions: ;AN000;
  142. ;; --------------------- ;AN000;
  143. ;; Refer to GRAPHICS.ASM ;AN000;
  144. ;; ;AN000;
  145. ;; Change History: ;AN000;
  146. ;; --------------- ;AN000;
  147. ;; ;AN000;
  148. ;; ;AN000;
  149. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  150. ;; ;AN000;
  151. ;; ;AN000;
  152. CODE SEGMENT PUBLIC 'CODE' BYTE ;; ;AN000;
  153. ;; ;AN000;
  154. INCLUDE STRUC.INC ;; ;AN000;
  155. INCLUDE GRINST.EXT ;; Bring in external declarations ;AN000;
  156. ;; for transient command processing ;AN000;
  157. INCLUDE GRSHAR.STR ;; ;AN000;
  158. INCLUDE GRMSG.EQU ;; ;AN000;
  159. INCLUDE GRINST.EXT ;; ;AN000;
  160. INCLUDE GRLOAD.EXT ;; ;AN000;
  161. INCLUDE GRPARSE.EXT ;; ;AN000;
  162. INCLUDE GRPATTRN.STR ;; ;AN000;
  163. INCLUDE GRPATTRN.EXT ;; ;AN000;
  164. ;; ;AN000;
  165. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  166. ;; ;AN000;
  167. ;; Public Symbols ;AN000;
  168. ;; ;AN000;
  169. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  170. ;; ;AN000;
  171. PUBLIC PARSE_VERB ;; ;AN000;
  172. PUBLIC PARSE_PRINTER ;; ;AN000;
  173. ; \/ ~~mda(001) ---------------------------------
  174. ; Added procedure PARSE_DEFINE
  175. ;
  176. PUBLIC PARSE_DEFINE ;
  177. ; /\ ~~mda(001) ---------------------------------
  178. PUBLIC PARSE_DISPLAYMODE ;; ;AN000;
  179. PUBLIC PARSE_PRINTBOX ;; ;AN000;
  180. PUBLIC PARSE_SETUP ;; ;AN000;
  181. PUBLIC PARSE_RESTORE ;; ;AN000;
  182. PUBLIC TERMINATE_DISPLAYMODE ;; ;AN000;
  183. PUBLIC TERMINATE_PRINTER ;; ;AN000;
  184. PUBLIC CUR_PRINTER_TYPE ;; ;AN000;
  185. ;; ;AN000;
  186. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  187. ;; ;AN000;
  188. ASSUME CS:CODE,DS:CODE ;; ;AN000;
  189. ;; ;AN000;
  190. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  191. ;; ;AN000;
  192. ;; ;AN000;
  193. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  194. ;; ;AN000;
  195. ;; Profile Load Variables ;AN000;
  196. ;; ;AN000;
  197. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  198. ;; ;AN000;
  199. NO EQU 0 ;; ;AN000;
  200. YES EQU 1 ;; ;AN000;
  201. ;; ;AN000;
  202. RESULT_BUFFER LABEL BYTE ;; general purpose result buffer ;AN000;
  203. DB ? ;; operand type ;AN000;
  204. RESULT_TAG DB 0 ;; operand tag ;AN000;
  205. DW ? ;; pointer to synonym/keyword ;AN000;
  206. RESULT_VAL DB ?,?,?,? ;; returned numeric value ;AN000;
  207. ;; ;AN000;
  208. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  209. ;; ;AN000;
  210. ;; Module Name: ;AN000;
  211. ;; TERMINATE_DISPLAYMODE ;AN000;
  212. ;; ;AN000;
  213. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  214. ;; ;AN000;
  215. ;; ;AN000;
  216. TERMINATE_DISPLAYMODE PROC ;; ;AN000;
  217. ;; ;AN000;
  218. MOV AX,STMTS_DONE ;; ;AN000;
  219. .IF <PTD_FOUND EQ YES> AND ;; For the matched PTD ;AN000;
  220. .IF <BIT AX NAND BOX> AND ;; issue "Invalid parm value" ;AN000;
  221. .IF <PRT_BOX_ERROR EQ NO> ;; message if PRINTBOX ID not ;AN000;
  222. ;; matched in each DISPLAYMODE section ;AN000;
  223. PUSH AX ;; Save STMT_DONE flags ;AN000;
  224. MOV AX,INVALID_PB ;; ;AN000;
  225. MOV CX,0 ;; ;AN000;
  226. CALL DISP_ERROR ;; ;AN000;
  227. MOV BUILD_STATE,NO ;; ;AN000;
  228. MOV PRT_BOX_ERROR,YES ;; Issue this message only once ;AN000;
  229. POP AX ;; ;AN000;
  230. .ENDIF ;; ;AN000;
  231. AND AX,GR ;; Check for missing statements is last ;AN000;
  232. .IF <AX NE GR> ;; DISPLAYMODE section: ;AN000;
  233. OR STMT_ERROR,MISSING ;; GRAPHICS stmt is required ;AN000;
  234. MOV PARSE_ERROR,YES ;; ;AN000;
  235. MOV BUILD_STATE,NO ;; ;AN000;
  236. .ENDIF ;; ;AN000;
  237. ;; ;AN000;
  238. RET ;; ;AN000;
  239. ;; ;AN000;
  240. TERMINATE_DISPLAYMODE ENDP ;; ;AN000;
  241. ;; ;AN000;
  242. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  243. ;; ;AN000;
  244. ;; Module Name: ;AN000;
  245. ;; TERMINATE_PRINTER ;AN000;
  246. ;; ;AN000;
  247. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  248. ;; ;AN000;
  249. TERMINATE_PRINTER PROC ;; ;AN000;
  250. ;; ;AN000;
  251. MOV AX,BLOCK_END ;; ;AN000;
  252. .IF <AX A MAX_BLOCK_END> ;; Keep track of the largest PRINTER ;AN000;
  253. MOV MAX_BLOCK_END,AX ;; section so we can allow space for ;AN000;
  254. .ENDIF ;; reload with a different printer ;AN000;
  255. ;; type. ;AN000;
  256. ;; ;AN000;
  257. ;; Check for missing statements ;AN000;
  258. MOV AX,STMTS_DONE ;; ;AN000;
  259. AND AX,DISP ;; At least one DISPLAYMODE ;AN000;
  260. .IF <AX NE DISP> ;; must have been found in last ;AN000;
  261. OR STMT_ERROR,MISSING ;; PRINTER section ;AN000;
  262. MOV PARSE_ERROR,YES ;; ;AN000;
  263. MOV BUILD_STATE,NO ;; ;AN000;
  264. .ENDIF ;; ;AN000;
  265. ;; ;AN000;
  266. RET ;; ;AN000;
  267. ;; ;AN000;
  268. TERMINATE_PRINTER ENDP ;; ;AN000;
  269. ;; ;AN000;
  270. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  271. ;; ;AN000;
  272. ;; Module Name: ;AN000;
  273. ;; PARSE_PRINTER ;AN000;
  274. ;; ;AN000;
  275. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  276. ;; ;AN000;
  277. PRINTER_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
  278. DW PRINTER_P ;; ;AN000;
  279. DB 2 ;; # of lists ;AN000;
  280. DB 0 ;; # items in delimeter list ;AN000;
  281. DB 1 ;; # items in end-of-line list ;AN000;
  282. DB ';' ;; ';' used for comments ;AN000;
  283. ;; ;AN000;
  284. PRINTER_P DB 0,1 ;; Required, max parms ;AN000;
  285. DW PRINTER_P1 ;; ;AN000;
  286. DB 0 ;; # Switches ;AN000;
  287. DB 0 ;; # keywords ;AN000;
  288. ;; ;AN000;
  289. PRINTER_P1 DW 2000H ;; simple string ;AN000;
  290. DW 0002H ;; Capitalize using character table ;AN000;
  291. DW RESULT_BUFFER ;; Result buffer ;AN000;
  292. DW PRINTER_P1V ;; Value list ;AN000;
  293. DB 0 ;; Synomyms ;AN000;
  294. ;; ;AN000;
  295. PRINTER_P1V DB 3 ;; # of value lists ;AN000;
  296. DB 0 ;; # of range numerics ;AN000;
  297. DB 0 ;; # of discrete numerics ;AN000;
  298. DB 1 ;; # of strings ;AN000;
  299. DB 1 ;; tag: index into verb jump table ;AN000;
  300. PRINTER_P1V1 DW ? ;; string offset ;AN000;
  301. ;; ;AN000;
  302. ;; ;AN000;
  303. CUR_PRINTER_TYPE DB 0 ;; Type of printer currently being ;AN000;
  304. ;; parsed: 1-color 2-b&w ;AN000;
  305. ;; ;AN000;
  306. PARSE_PRINTER PROC ;; ;AN000;
  307. ;; ;AN000;
  308. MOV CUR_STMT,PRT ;; ;AN000;
  309. MOV CUR_PRINTER_TYPE,BLACK_WHITE ;; Assume black & white until we hit ;AN000;
  310. ;; a COLORPRINT ;AN000;
  311. ;; ;AN000;
  312. .IF <BIT STMTS_DONE AND PRT> ;; If not the first PRINTER section ;AN000;
  313. CALL TERMINATE_DISPLAYMODE ;; then clean up the last one and ;AN000;
  314. CALL TERMINATE_PRINTER ;; the last DISPLAYMODE section. ;AN000;
  315. .ENDIF ;; ;AN000;
  316. ;; ;AN000;
  317. MOV AX,FIRST_BLOCK ;; ;AN000;
  318. MOV BLOCK_START,AX ;; Reset block pointers to start ;AN000;
  319. MOV BLOCK_END,AX ;; of variable area ;AN000;
  320. ;; ;AN000;
  321. MOV STMTS_DONE,PRT ;; Clear all bits except for PRT ;AN000;
  322. MOV GROUPS_DONE,0 ;; Clear ;AN000;
  323. ;; ;AN000;
  324. .IF <PTD_FOUND EQ YES> ;; PRINTER statement marks the end of ;AN000;
  325. MOV PTD_FOUND,PROCESSED ;; the previous PTD ;AN000;
  326. MOV BUILD_STATE,NO ;; Stop building shared data ;AN000;
  327. .ENDIF ;; ;AN000;
  328. ;; ;AN000;
  329. MOV CL,TAB_DIR_NB_ENTRIES ;; Reset the pattern table copy ;AN000;
  330. XOR CH,CH ;; pointers. These pointers ;AN000;
  331. MOV BX,OFFSET TAB_DIRECTORY ;; are established when a pattern ;AN000;
  332. .REPEAT ;; table is copied to the shared ;AN000;
  333. MOV [BX].TAB_COPY,-1 ;; data area. Initially they ;AN000;
  334. ADD BX,SIZE TAB_ENTRY ;; are -1. ;AN000;
  335. .LOOP ;; ;AN000;
  336. ;; ;AN000;
  337. MOV AX,OFFSET PRINTER_TYPE_PARM ;; Store printer type from command ;AN000;
  338. MOV PRINTER_P1V1,AX ;; line in value list ;AN000;
  339. MOV DI,OFFSET PRINTER_PARSE_PARMS ;; parse parms ;AN000;
  340. ;; SI => the line to parse ;AN000;
  341. XOR DX,DX ;; ;AN000;
  342. ;; ;AN000;
  343. .REPEAT ;; ;AN000;
  344. XOR CX,CX ;; Don't worry about number of operands ;AN000;
  345. CALL SYSPARSE ;; ;AN000;
  346. .IF <AX EQ 9> ;; Syntax error is the only thing ;AN000;
  347. OR STMT_ERROR,INVALID ;; which can go wrong ;AN000;
  348. MOV PARSE_ERROR,YES ;; ;AN000;
  349. MOV BUILD_STATE,NO ;; ;AN000;
  350. .ENDIF ;; ;AN000;
  351. .UNTIL <AX EQ 0> OR ;; ;AN000;
  352. .UNTIL <AX EQ -1> ;; ;AN000;
  353. ;; Printer type parm matched one coded ;AN000;
  354. ;; on the PRINTER statement ;AN000;
  355. .IF <AX EQ 0> ;; ;AN000;
  356. .IF <PTD_FOUND EQ NO> ;; ;AN000;
  357. MOV PTD_FOUND,YES ;; If the printer type matches and ;AN000;
  358. .IF <PARSE_ERROR EQ NO> AND ;; no errors have been found yet ;AN000;
  359. .IF <PRT_BOX_ERROR EQ NO> AND ;; ;AN000;
  360. .IF <MEM_OVERFLOW EQ NO> ;; ;AN000;
  361. MOV BUILD_STATE,YES ;; then start building the shared ;AN000;
  362. .ENDIF ;; data ;AN000;
  363. .ENDIF ;; ;AN000;
  364. .ELSE ;; No match ;AN000;
  365. MOV BUILD_STATE,NO ;; ;AN000;
  366. .IF <AX NE -1> ;; Error during parse ;AN000;
  367. OR STMT_ERROR,INVALID ;; set error flag for caller ;AN000;
  368. MOV PARSE_ERROR,YES ;; set error flag for caller ;AN000;
  369. .ENDIF ;; ;AN000;
  370. .ENDIF ;; ;AN000;
  371. ; \/ ~~mda(002) -----------------------------------------------------------------------
  372. .IF <BUILD_STATE EQ YES> ;;
  373. MOV [BP].DATA_TYPE,DATA_COL;; Set DATA_TYPE back to default of DATA_COL
  374. .ENDIF ;; for new PTD.
  375. ; /\ ~~mda(002) -----------------------------------------------------------------------
  376. ;; ;AN000;
  377. RET ;AN000;
  378. ;; ;AN000;
  379. PARSE_PRINTER ENDP ;AN000;
  380. ;AN000;
  381. ;; ;AN000;
  382. ;; ;AN000;
  383. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  384. ;; ;AN000;
  385. ;; Module Name: ;AN000;
  386. ;; PARSE_DISPLAYMODE ;AN000;
  387. ;; ;AN000;
  388. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  389. ;; ;AN000;
  390. DISPMODE_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
  391. DW DISPMODE_P ;; ;AN000;
  392. DB 2 ;; # of lists ;AN000;
  393. DB 0 ;; # items in delimeter list ;AN000;
  394. DB 1 ;; # items in end-of-line list ;AN000;
  395. DB ';' ;; ';' used for comments ;AN000;
  396. ;; ;AN000;
  397. DISPMODE_P DB 0,1 ;; Required, max parms ;AN000;
  398. DW DISPMODE_P1 ;; ;AN000;
  399. DB 0 ;; # Switches ;AN000;
  400. DB 0 ;; # keywords ;AN000;
  401. ;; ;AN000;
  402. DISPMODE_P1 DW 8000H ;; Numeric ;AN000;
  403. DW 0 ;; No Capitalize ;AN000;
  404. DW RESULT_BUFFER ;; Result buffer ;AN000;
  405. DW DISPMODE_P1V ;; Value list ;AN000;
  406. DB 0 ;; Synomyms ;AN000;
  407. ;; ;AN000;
  408. DISPMODE_P1V DB 1 ;; # of value lists ;AN000;
  409. DB 1 ;; # of range numerics ;AN000;
  410. DB 1 ;; tag ;AN000;
  411. DD 0,19 ;; range 0..19 ;AN000;
  412. ;; ;AN000;
  413. ;; ;AN000;
  414. ;; ;AN000;
  415. PARSE_DISPLAYMODE PROC ;; ;AN000;
  416. ;; ;AN000;
  417. MOV CUR_STMT,DISP ;; ;AN000;
  418. ;; Check for a preceeding PRINTER ;AN000;
  419. .IF <BIT STMTS_DONE NAND PRT> ;; ;AN000;
  420. OR STMT_ERROR,MISSING ;; ;AN000;
  421. MOV PARSE_ERROR,YES ;; ;AN000;
  422. MOV BUILD_STATE,NO ;; ;AN000;
  423. .ENDIF ;; ;AN000;
  424. ;; ;AN000;
  425. ;; ;AN000;
  426. .IF <BIT STMTS_DONE NAND DISP> ;; If first DISPLAYMODE... ;AN000;
  427. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  428. MOV AX,BLOCK_END ;; ;AN000;
  429. MOV [BP].DISPLAYMODE_PTR,AX ;; Set pointer to first DISPLAYMODE ;AN000;
  430. MOV BLOCK_START,AX ;; New block starts after last one ;AN000;
  431. .ENDIF ;; ;AN000;
  432. .ELSE ;; ;AN000;
  433. CALL TERMINATE_DISPLAYMODE ;; If not the first DISPLAYMODE then ;AN000;
  434. ;; clean up the last one. ;AN000;
  435. MOV DI,BLOCK_START ;; DI=pointer to DISPLAYMODE block just ;AN000;
  436. MOV AX,BLOCK_END ;; built ;AN000;
  437. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  438. MOV [BP+DI].NEXT_DISP_MODE,AX ;; Add new block to DISPLAYMODE chain ;AN000;
  439. .ENDIF ;; ;AN000;
  440. MOV BLOCK_START,AX ;; New block starts after last one ;AN000;
  441. .ENDIF ;; ;AN000;
  442. ;; ;AN000;
  443. MOV AX,SIZE DISPLAYMODE_STR ;; Allocate space for new DISPLAYMODE ;AN000;
  444. CALL GROW_SHARED_DATA ;; block ;AN000;
  445. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  446. MOV DI,BLOCK_START ;; Start of new block ;AN000;
  447. MOV [BP+DI].NUM_SETUP_ESC,0 ;; SETUP, RESTORE are optional so set ;AN000;
  448. MOV [BP+DI].NUM_RESTORE_ESC,0 ;; to defaults ;AN000;
  449. MOV [BP+DI].SETUP_ESC_PTR,-1 ;; ;AN000;
  450. MOV [BP+DI].RESTORE_ESC_PTR,-1 ;; ;AN000;
  451. MOV [BP+DI].BOX_WIDTH,0 ;; ;AN000;
  452. MOV [BP+DI].BOX_HEIGHT,0 ;; ;AN000;
  453. MOV [BP+DI].PRINT_OPTIONS,0 ;; Default to NO print options ;AN000;
  454. MOV [BP+DI].NUM_DISP_MODE,0 ;; Get ready to INC this ;AN000;
  455. MOV [BP+DI].NEXT_DISP_MODE,-1 ;; This is the last DISPLAYMODE for now! ;AN000;
  456. MOV AX,BLOCK_END ;; ;AN000;
  457. MOV [BP+DI].DISP_MODE_LIST_PTR,AX;; Start mode list at end of new block ;AN000;
  458. .ENDIF ;; ;AN000;
  459. ;; ;AN000;
  460. OR STMTS_DONE,DISP ;; Indicate DISPLAYMODE found ;AN000;
  461. AND STMTS_DONE,NOT (BOX+GR+SET+REST) ;; Reset flags for PRINTBOX, GRAPHICS ;AN000;
  462. ;; stmts found ;AN000;
  463. AND GROUPS_DONE,NOT (GR+SET+REST) ;; Reset flags for GRAPHICS, SETUP, ;AN000;
  464. ;; RESTORE groups processed ;AN000;
  465. MOV DI,OFFSET DISPMODE_PARSE_PARMS ;; parse parms ;AN000;
  466. ;; SI => the line to parse ;AN000;
  467. XOR DX,DX ;; ;AN000;
  468. .REPEAT ;; ;AN000;
  469. XOR CX,CX ;; ;AN000;
  470. CALL SYSPARSE ;; ;AN000;
  471. .IF <AX EQ 0> ;; If mode is valid ;AN000;
  472. PUSH AX ;; ;AN000;
  473. MOV AX,1 ;; Add a mode to the list ;AN000;
  474. CALL GROW_SHARED_DATA ;; Update block end ;AN000;
  475. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  476. PUSH DI ;; ;AN000;
  477. MOV DI,BLOCK_START ;; ;AN000;
  478. INC [BP+DI].NUM_DISP_MODE ;; Bump number of modes in list ;AN000;
  479. MOV DI,BLOCK_END ;; ;AN000;
  480. MOV AL,RESULT_VAL ;; Get mode from result buffer ;AN000;
  481. MOV [BP+DI-1],AL ;; Store the mode at end of list ;AN000;
  482. POP DI ;; ;AN000;
  483. .ENDIF ;; ;AN000;
  484. POP AX ;; ;AN000;
  485. .ELSE ;; ;AN000;
  486. .IF <AX NE -1> ;; ;AN000;
  487. OR STMT_ERROR,INVALID ;; Mode is invalid ;AN000;
  488. MOV PARSE_ERROR,YES ;; ;AN000;
  489. MOV BUILD_STATE,NO ;; ;AN000;
  490. .ENDIF ;; ;AN000;
  491. .ENDIF ;; ;AN000;
  492. .UNTIL <AX EQ -1> ;; ;AN000;
  493. ;; ;AN000;
  494. RET ;AN000;
  495. ;; ;AN000;
  496. PARSE_DISPLAYMODE ENDP ;AN000;
  497. ;AN000;
  498. ;; ;AN000;
  499. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  500. ;; ;AN000;
  501. ;; Module Name: ;AN000;
  502. ;; PARSE_SETUP ;AN000;
  503. ;; ;AN000;
  504. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  505. ;; ;AN000;
  506. SETUP_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
  507. DW SETUP_P ;; ;AN000;
  508. DB 2 ;; # of lists ;AN000;
  509. DB 0 ;; # items in delimeter list ;AN000;
  510. DB 1 ;; # items in end-of-line list ;AN000;
  511. DB ';' ;; ';' used for comments ;AN000;
  512. ;; ;AN000;
  513. SETUP_P DB 0,1 ;; Required, max parms ;AN000;
  514. DW SETUP_P1 ;; ;AN000;
  515. DB 0 ;; # Switches ;AN000;
  516. DB 0 ;; # keywords ;AN000;
  517. ;; ;AN000;
  518. SETUP_P1 DW 08000H ;; Numeric ;AN000;
  519. DW 0 ;; nO Capitalize ;AN000;
  520. DW RESULT_BUFFER ;; Result buffer ;AN000;
  521. DW SETUP_P1V ;; Value list ;AN000;
  522. DB 0 ;; Synomyms ;AN000;
  523. ;; ;AN000;
  524. ;; ;AN000;
  525. SETUP_P1V DB 1 ;; # of value lists ;AN000;
  526. DB 1 ;; # of range numerics ;AN000;
  527. DB 1 ;; tag ;AN000;
  528. DD 0,255 ;; range 0..255 ;AN000;
  529. ;; ;AN000;
  530. ;; ;AN000;
  531. PARSE_SETUP PROC ;; ;AN000;
  532. ;; ;AN000;
  533. MOV CUR_STMT,SET ;; ;AN000;
  534. .IF <BIT STMTS_DONE NAND DISP> ;; DISPLAYMODE must preceed this ;AN000;
  535. OR STMT_ERROR,MISSING ;; ;AN000;
  536. MOV PARSE_ERROR,YES ;; ;AN000;
  537. MOV BUILD_STATE,NO ;; ;AN000;
  538. .ENDIF ;; ;AN000;
  539. ;; ;AN000;
  540. .IF <BIT GROUPS_DONE AND SET> ;; Check for previous group of SETUP ;AN000;
  541. OR STMT_ERROR,SEQUENCE ;; stmts ;AN000;
  542. MOV PARSE_ERROR,YES ;; ;AN000;
  543. MOV BUILD_STATE,NO ;; ;AN000;
  544. .ENDIF ;; ;AN000;
  545. ;; ;AN000;
  546. .IF <BIT STMTS_DONE NAND SET> ;; If first SETUP... ;AN000;
  547. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  548. MOV DI,BLOCK_START ;; ;AN000;
  549. MOV AX,BLOCK_END ;; ;AN000;
  550. MOV [BP+DI].SETUP_ESC_PTR,AX ;; Set pointer to SETUP seq ;AN000;
  551. MOV [BP+DI].NUM_SETUP_ESC,0 ;; Init sequence size ;AN000;
  552. .ENDIF ;; ;AN000;
  553. .ENDIF ;; ;AN000;
  554. ;; ;AN000;
  555. OR STMTS_DONE,SET ;; Indicate SETUP found ;AN000;
  556. .IF <PREV_STMT NE SET> THEN ;; Terminate any preceeding groups ;AN000;
  557. MOV AX,PREV_STMT ;; except for SETUP group ;AN000;
  558. OR GROUPS_DONE,AX ;; ;AN000;
  559. .ENDIF ;; ;AN000;
  560. ;; ;AN000;
  561. MOV DI,OFFSET SETUP_PARSE_PARMS ;; parse parms ;AN000;
  562. ;; SI => the line to parse ;AN000;
  563. XOR DX,DX ;; ;AN000;
  564. .REPEAT ;; ;AN000;
  565. XOR CX,CX ;; ;AN000;
  566. CALL SYSPARSE ;; ;AN000;
  567. .IF <AX EQ 0> ;; If esc byte is valid ;AN000;
  568. PUSH AX ;; ;AN000;
  569. MOV AX,1 ;; Add a byte to the sequence ;AN000;
  570. CALL GROW_SHARED_DATA ;; Update block end ;AN000;
  571. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  572. PUSH DI ;; ;AN000;
  573. MOV DI,BLOCK_START ;; ;AN000;
  574. INC [BP+DI].NUM_SETUP_ESC ;; Bump number of bytes in sequence ;AN000;
  575. MOV DI,BLOCK_END ;; ;AN000;
  576. MOV AL,RESULT_VAL ;; Get esc byte from result buffer ;AN000;
  577. MOV [BP+DI-1],AL ;; Store at end of sequence ;AN000;
  578. POP DI ;; ;AN000;
  579. .ENDIF ;; ;AN000;
  580. POP AX ;; ;AN000;
  581. .ELSE ;; ;AN000;
  582. .IF <AX NE -1> ;; ;AN000;
  583. OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
  584. MOV PARSE_ERROR,YES ;; ;AN000;
  585. MOV BUILD_STATE,NO ;; ;AN000;
  586. .ENDIF ;; ;AN000;
  587. .ENDIF ;; ;AN000;
  588. .UNTIL <AX EQ -1> NEAR ;; ;AN000;
  589. RET ;; ;AN000;
  590. ;; ;AN000;
  591. PARSE_SETUP ENDP ;; ;AN000;
  592. ;AN000;
  593. ;; ;AN000;
  594. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  595. ;; ;AN000;
  596. ;; Module Name: ;AN000;
  597. ;; PARSE_RESTORE ;AN000;
  598. ;; ;AN000;
  599. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  600. ;; ;AN000;
  601. RESTORE_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
  602. DW RESTORE_P ;; ;AN000;
  603. DB 2 ;; # of lists ;AN000;
  604. DB 0 ;; # items in delimeter list ;AN000;
  605. DB 1 ;; # items in end-of-line list ;AN000;
  606. DB ';' ;; ';' used for comments ;AN000;
  607. ;; ;AN000;
  608. RESTORE_P DB 0,1 ;; Required, max parms ;AN000;
  609. DW RESTORE_P1 ;; ;AN000;
  610. DB 0 ;; # Switches ;AN000;
  611. DB 0 ;; # keywords ;AN000;
  612. ;; ;AN000;
  613. RESTORE_P1 DW 08000H ;; Numeric ;AN000;
  614. DW 0 ;; nO Capitalize ;AN000;
  615. DW RESULT_BUFFER ;; Result buffer ;AN000;
  616. DW RESTORE_P1V ;; Value list ;AN000;
  617. DB 0 ;; Synomyms ;AN000;
  618. ;; ;AN000;
  619. ;; ;AN000;
  620. RESTORE_P1V DB 1 ;; # of value lists ;AN000;
  621. DB 1 ;; # of range numerics ;AN000;
  622. DB 1 ;; tag ;AN000;
  623. DD 0,255 ;; range 0..255 ;AN000;
  624. ;; ;AN000;
  625. ;; ;AN000;
  626. PARSE_RESTORE PROC ;; ;AN000;
  627. ;; ;AN000;
  628. MOV CUR_STMT,SET ;; ;AN000;
  629. .IF <BIT STMTS_DONE NAND DISP> ;; DISPLAYMODE must preceed this ;AN000;
  630. OR STMT_ERROR,MISSING ;; ;AN000;
  631. MOV PARSE_ERROR,YES ;; ;AN000;
  632. MOV BUILD_STATE,NO ;; ;AN000;
  633. .ENDIF ;; ;AN000;
  634. ;; ;AN000;
  635. .IF <BIT GROUPS_DONE AND REST> ;; Check for previous group of RESTORE ;AN000;
  636. OR STMT_ERROR,SEQUENCE ;; stmts ;AN000;
  637. MOV PARSE_ERROR,YES ;; ;AN000;
  638. MOV BUILD_STATE,NO ;; ;AN000;
  639. .ENDIF ;; ;AN000;
  640. ;; ;AN000;
  641. .IF <BIT STMTS_DONE NAND REST> ;; If first RESTORE... ;AN000;
  642. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  643. MOV DI,BLOCK_START ;; ;AN000;
  644. MOV AX,BLOCK_END ;; ;AN000;
  645. MOV [BP+DI].RESTORE_ESC_PTR,AX ;; Set pointer to RESTORE seq ;AN000;
  646. MOV [BP+DI].NUM_RESTORE_ESC,0 ;; Init sequence size ;AN000;
  647. .ENDIF ;; ;AN000;
  648. .ENDIF ;; ;AN000;
  649. ;; ;AN000;
  650. OR STMTS_DONE,REST ;; Indicate RESTORE found ;AN000;
  651. .IF <PREV_STMT NE REST> THEN ;; Terminate any preceeding groups ;AN000;
  652. MOV AX,PREV_STMT ;; except for RESTORE group ;AN000;
  653. OR GROUPS_DONE,AX ;; ;AN000;
  654. .ENDIF ;; ;AN000;
  655. ;; ;AN000;
  656. MOV DI,OFFSET RESTORE_PARSE_PARMS ;; parse parms ;AN000;
  657. ;; SI => the line to parse ;AN000;
  658. XOR DX,DX ;; ;AN000;
  659. .REPEAT ;; ;AN000;
  660. XOR CX,CX ;; ;AN000;
  661. CALL SYSPARSE ;; ;AN000;
  662. .IF <AX EQ 0> ;; If esc byte is valid ;AN000;
  663. PUSH AX ;; ;AN000;
  664. MOV AX,1 ;; Add a byte to the sequence ;AN000;
  665. CALL GROW_SHARED_DATA ;; Update block end ;AN000;
  666. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  667. PUSH DI ;; ;AN000;
  668. MOV DI,BLOCK_START ;; ;AN000;
  669. INC [BP+DI].NUM_RESTORE_ESC ;; Bump number of bytes in sequence ;AN000;
  670. MOV DI,BLOCK_END ;; ;AN000;
  671. MOV AL,RESULT_VAL ;; Get esc byte from result buffer ;AN000;
  672. MOV [BP+DI-1],AL ;; Store at end of sequence ;AN000;
  673. POP DI ;; ;AN000;
  674. .ENDIF ;; ;AN000;
  675. POP AX ;; ;AN000;
  676. .ELSE ;; ;AN000;
  677. .IF <AX NE -1> ;; ;AN000;
  678. OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
  679. MOV PARSE_ERROR,YES ;; ;AN000;
  680. MOV BUILD_STATE,NO ;; ;AN000;
  681. .ENDIF ;; ;AN000;
  682. .ENDIF ;; ;AN000;
  683. .UNTIL <AX EQ -1> NEAR ;; ;AN000;
  684. RET ;; ;AN000;
  685. ;; ;AN000;
  686. PARSE_RESTORE ENDP ;; ;AN000;
  687. ;AN000;
  688. ;; ;AN000;
  689. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  690. ;; ;AN000;
  691. ;; Module Name: ;AN000;
  692. ;; PARSE_PRINTBOX ;AN000;
  693. ;; ;AN000;
  694. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  695. ;; ;AN000;
  696. PRINTBOX_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
  697. DW PRINTBOX_P ;; ;AN000;
  698. DB 2 ;; # of lists ;AN000;
  699. DB 0 ;; # items in delimeter list ;AN000;
  700. DB 1 ;; # items in end-of-line list ;AN000;
  701. DB ';' ;; ';' used for comments ;AN000;
  702. ;; ;AN000;
  703. PRINTBOX_P DB 1,4 ;; Required, max parms ;AN000;
  704. DW PRINTBOX_P0 ;; LCD/STD ;AN000;
  705. DW PRINTBOX_P1 ;; width ;AN000;
  706. DW PRINTBOX_P1 ;; height ;AN000;
  707. DW PRINTBOX_P2 ;; rotate ;AN000;
  708. DB 0 ;; # Switches ;AN000;
  709. DB 0 ;; # keywords ;AN000;
  710. ;; ;AN000;
  711. PRINTBOX_P0 DW 2000H ;; sTRING - display type ;AN000;
  712. DW 2 ;; Capitalize ;AN000;
  713. DW RESULT_BUFFER ;; Result buffer ;AN000;
  714. DW PRINTBOX_P0V ;; Value list ;AN000;
  715. DB 0 ;; Synomyms ;AN000;
  716. ;; ;AN000;
  717. PRINTBOX_P0V DB 3 ;; # of value lists ;AN000;
  718. DB 0 ;; # of range numerics ;AN000;
  719. DB 0 ;; # of discrete numerics ;AN000;
  720. DB 1 ;; # of strings ;AN000;
  721. DB 1 ;; tag ;AN000;
  722. PRINTBOX_P0V1 DW ? ;; string ;AN000;
  723. ;; ;AN000;
  724. PRINTBOX_P1 DW 8001H ;; Numeric - BOX DIMENSIONS ;AN000;
  725. DW 0 ;; No Capitalize ;AN000;
  726. DW RESULT_BUFFER ;; Result buffer ;AN000;
  727. DW PRINTBOX_P1V ;; Value list ;AN000;
  728. DB 0 ;; Synomyms ;AN000;
  729. ;; ;AN000;
  730. PRINTBOX_P1V DB 1 ;; # of value lists ;AN000;
  731. DB 1 ;; # of range numerics ;AN000;
  732. DB 1 ;; tag ;AN000;
  733. DD 1,9 ;; range 1..9 ;AN000;
  734. ;; ;AN000;
  735. ;; ;AN000;
  736. PRINTBOX_P2 DW 2001H ;; sTRING - ROTATE PARM ;AN000;
  737. DW 2 ;; Capitalize ;AN000;
  738. DW RESULT_BUFFER ;; Result buffer ;AN000;
  739. DW PRINTBOX_P2V ;; Value list ;AN000;
  740. DB 0 ;; Synomyms ;AN000;
  741. ;; ;AN000;
  742. PRINTBOX_P2V DB 3 ;; # of value lists ;AN000;
  743. DB 0 ;; # of range numerics ;AN000;
  744. DB 0 ;; # of discrete numerics ;AN000;
  745. DB 1 ;; # of strings ;AN000;
  746. DB 1 ;; tag ;AN000;
  747. DW ROTATE_STR ;; string ;AN000;
  748. ROTATE_STR DB 'ROTATE',0 ;; ;AN000;
  749. ;; ;AN000;
  750. ;; ;AN000;
  751. PROF_BOX_W DB 0 ;; Box width and height extracted from ;AN000;
  752. PROF_BOX_H DB 0 ;; the profile ;AN000;
  753. PRINTBOX_MATCH DB 0 ;; ;AN000;
  754. ;; ;AN000;
  755. ;; ;AN000;
  756. PARSE_PRINTBOX PROC ;; ;AN000;
  757. ;; ;AN000;
  758. MOV PRINTBOX_MATCH,NO ;; Start out assuming the PRINTBOX ID ;AN000;
  759. MOV PROF_BOX_W,0 ;; does not match the one requested ;AN000;
  760. MOV PROF_BOX_H,0 ;; ;AN000;
  761. MOV CUR_STMT,BOX ;; ;AN000;
  762. .IF <BIT STMTS_DONE NAND DISP> ;; DISPLAYMODE must preceed PRINTBOX ;AN000;
  763. OR STMT_ERROR,MISSING ;; ;AN000;
  764. MOV PARSE_ERROR,YES ;; ;AN000;
  765. MOV BUILD_STATE,NO ;; ;AN000;
  766. .ENDIF ;; ;AN000;
  767. ;; Multiple PRINTBOX stmts may be coded ;AN000;
  768. ;; We must decide if this one ;AN000;
  769. ;; matches the requested display type ;AN000;
  770. ;; If not, ignore the statement ;AN000;
  771. MOV DI,OFFSET PRINTBOX_PARSE_PARMS ;; parse parms ;AN000;
  772. ;; SI => the line to parse ;AN000;
  773. XOR DX,DX ;; ;AN000;
  774. XOR CX,CX ;; ;AN000;
  775. ;; ;AN000;
  776. MOV AX,PRINTBOX_ID_PTR ;; Insert requested display type in ;AN000;
  777. MOV PRINTBOX_P0V1,AX ;; parser value list ;AN000;
  778. CALL SYSPARSE ;; PARSE display type ;AN000;
  779. .IF <AX EQ 0> ;; If ID matches then set this flag. ;AN000;
  780. MOV PRINTBOX_MATCH,YES ;; ;AN000;
  781. OR STMTS_DONE,BOX ;; Indicate PRINTBOX found ;AN000;
  782. MOV AX,PREV_STMT ;; Terminate any preceeding groups ;AN000;
  783. OR GROUPS_DONE,AX ;; ;AN000;
  784. .ENDIF ;; ;AN000;
  785. ;; ;AN000;
  786. ;; ;AN000;
  787. ;; ;AN000;
  788. CALL SYSPARSE ;; PARSE horizontal dimension ;AN000;
  789. .IF <AX EQ 0> ;; ;AN000;
  790. MOV BL,RESULT_VAL ;; ;AN000;
  791. ; \/ ~~mda(005) -----------------------------------------------------------------------
  792. ; Presently a 3,1 printbox is not supported for HP PCL printers, but
  793. ; a 4,1 printbox is supported. The reason for this is that one byte
  794. ; is printed at a time and only two 3,1 print boxes are placed in
  795. ; the one byte print buffer, leaving two blank bits. This causes
  796. ; the picture to have blank lines running through it and results in
  797. ; a 4,1 printbox. Instead of placing only two 3,1 print boxes in
  798. ; the print buffer, two 3,1 print boxes plus a partial 3,1 printbox
  799. ; should be placed in the print buffer. Another solution is to
  800. ; make the print buffer be three bytes long, and place eight 3,1
  801. ; print boxes in the three byte long print buffer. Since the present
  802. ; implementation results in a faulty 4,1 printbox, we change the 3,1
  803. ; printbox to a 4,1 printbox up front. So even though we still
  804. ; have a 4,1 printbox, at least we will have an accurate picture.
  805. .IF <[BP].DATA_TYPE EQ DATA_ROW> AND
  806. .IF <BL EQ 3>
  807. MOV BL,4
  808. .ENDIF
  809. ; /\ ~~mda(005) -----------------------------------------------------------------------
  810. MOV PROF_BOX_W,BL ;; Save in local var ;AN000;
  811. .ELSE ;; ;AN000;
  812. .IF <AX EQ -1> ;; ;AN000;
  813. JMP PRINTBOX_DONE ;; ;AN000;
  814. .ELSE ;; ;AN000;
  815. OR STMT_ERROR,INVALID ;; ;AN000;
  816. MOV PARSE_ERROR,YES ;; ;AN000;
  817. MOV BUILD_STATE,NO ;; ;AN000;
  818. .ENDIF ;; ;AN000;
  819. .ENDIF ;; ;AN000;
  820. ;; ;AN000;
  821. CALL SYSPARSE ;; PARSE vertical dimension ;AN000;
  822. .IF <AX EQ 0> ;; ;AN000;
  823. MOV BL,RESULT_VAL ;; ;AN000;
  824. MOV PROF_BOX_H,BL ;; Save in local var ;AN000;
  825. .ELSE ;; ;AN000;
  826. .IF <AX EQ -1> ;; ;AN000;
  827. JMP SHORT PRINTBOX_DONE ;; ;AN000;
  828. .ELSE ;; ;AN000;
  829. OR STMT_ERROR,INVALID ;; ;AN000;
  830. MOV PARSE_ERROR,YES ;; ;AN000;
  831. MOV BUILD_STATE,NO ;; ;AN000;
  832. .ENDIF ;; ;AN000;
  833. .ENDIF ;; ;AN000;
  834. ;; ;AN000;
  835. CALL SYSPARSE ;; Parse ROTATE parm ;AN000;
  836. .IF <AX EQ 0> ;; ;AN000;
  837. .IF <BUILD_STATE EQ YES> AND ;; ;AN000;
  838. .IF <PRINTBOX_MATCH EQ YES> ;; ;AN000;
  839. PUSH DI ;; ;AN000;
  840. MOV DI,BLOCK_START ;; ;AN000;
  841. OR [BP+DI].PRINT_OPTIONS,ROTATE ;; ;AN000;
  842. POP DI ;; ;AN000;
  843. .ENDIF ;; ;AN000;
  844. .ELSE ;; ;AN000;
  845. .IF <AX EQ -1> ;; ;AN000;
  846. JMP SHORT PRINTBOX_DONE ;; ;AN000;
  847. .ELSE ;; ;AN000;
  848. OR STMT_ERROR,INVALID ;; ;AN000;
  849. MOV PARSE_ERROR,YES ;; ;AN000;
  850. MOV BUILD_STATE,NO ;; ;AN000;
  851. .ENDIF ;; ;AN000;
  852. .ENDIF ;; ;AN000;
  853. ;; ;AN000;
  854. CALL SYSPARSE ;; CHECK FOR EXTRA PARMS ;AN000;
  855. .IF <AX NE -1> ;; ;AN000;
  856. OR STMT_ERROR,INVALID ;; ;AN000;
  857. MOV PARSE_ERROR,YES ;; ;AN000;
  858. MOV BUILD_STATE,NO ;; ;AN000;
  859. .ENDIF ;; ;AN000;
  860. ;; ;AN000;
  861. ;; ;AN000;
  862. PRINTBOX_DONE: ;; ;AN000;
  863. ;; ;AN000;
  864. .IF <BUILD_STATE EQ YES> AND ;; Store the PRINTBOX dimensions ;AN000;
  865. .IF <PRINTBOX_MATCH EQ YES> ;; ;AN000;
  866. PUSH DI ;; in the DISPLAYMODE block ;AN000;
  867. MOV DI,BLOCK_START ;; ;AN000;
  868. MOV AL,PROF_BOX_W ;; ;AN000;
  869. MOV [BP+DI].BOX_WIDTH,AL ;; ;AN000;
  870. MOV AL,PROF_BOX_H ;; ;AN000;
  871. MOV [BP+DI].BOX_HEIGHT,AL ;; ;AN000;
  872. POP DI ;; ;AN000;
  873. .ENDIF ;; ;AN000;
  874. ;; If we have a B&W printer then ;AN000;
  875. ;; load the grey patterns for the ;AN000;
  876. ;; requested print box size. ;AN000;
  877. .IF <CUR_PRINTER_TYPE EQ BLACK_WHITE> NEAR ;AN000;
  878. ;; ;AN000;
  879. .IF <PROF_BOX_W NE 0> AND NEAR ;; Dimensions could also be 0 if the ;AN000;
  880. .IF <PROF_BOX_H NE 0> NEAR ;; printbox ID does not apply to this;AN000;
  881. ;; displaymode, so don't try for ;AN000;
  882. ;; a pattern! ;AN000;
  883. MOV BX,OFFSET TAB_DIRECTORY ;; ;AN000;
  884. MOV CL,TAB_DIR_NB_ENTRIES ;; ;AN000;
  885. XOR CH,CH ;; ;AN000;
  886. MOV DI,BLOCK_START ;; ;AN000;
  887. MOV AL,PROF_BOX_W ;; Requested box width ;AN000;
  888. MOV AH,PROF_BOX_H ;; Requested box height ;AN000;
  889. .REPEAT ;; ;AN000;
  890. .IF <[BX].BOX_W_PAT EQ AL> AND ;; ;AN000;
  891. .IF <[BX].BOX_H_PAT EQ AH> ;; ;AN000;
  892. .LEAVE ;; ;AN000;
  893. .ELSE ;; ;AN000;
  894. ADD BX,SIZE TAB_ENTRY ;; ;AN000;
  895. .ENDIF ;; ;AN000;
  896. .LOOP ;; ;AN000;
  897. .IF <ZERO CX> ;; ;AN000;
  898. OR STMT_ERROR,INVALID ;; Unsupported box size ;AN000;
  899. MOV PARSE_ERROR,YES ;; ;AN000;
  900. MOV BUILD_STATE,NO ;; ;AN000;
  901. .ELSE NEAR ;; Box size OK - pattern tab found ;AN000;
  902. .IF <[BX].TAB_COPY NE -1> ;; Pointer is NOT null if the table ;AN000;
  903. MOV AX,[BX].TAB_COPY ;; has already been copied to ;AN000;
  904. ;; the shared data area. ;AN000;
  905. .IF <BUILD_STATE EQ YES> AND ;; Point to the copy. ;AN000;
  906. .IF <PRINTBOX_MATCH EQ YES> ;; Establish pointer to table ONLY ;AN000;
  907. MOV [BP+DI].PATTERN_TAB_PTR,AX ;; if the PB ID matched. ;AN000;
  908. MOV AL,[BX].NB_INT ;; Number of table entries (intensitie;AN000;
  909. MOV [BP+DI].NUM_PATTERNS,AL ;; ;AN000;
  910. .ENDIF ;; ;AN000;
  911. .ELSE ;; Otherwise we have to copy it. ;AN000;
  912. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  913. ;; Copy the table even if the printbox ID didn't match! ;AN000;
  914. ;; This is a simple way to reserve enough space to allow reloading ;AN000;
  915. ;; with a different PRINTBOX ID specified on the command line. ;AN000;
  916. ;; This scheme avoids storing ;AN000;
  917. ;; duplicate tables but may reserve slightly more space ;AN000;
  918. ;; (probably only a hundred bytes or so) than ;AN000;
  919. ;; could ever be required. The optimal solution (too ;AN000;
  920. ;; complicated!) would involve keeping running totals for each ;AN000;
  921. ;; PRINTBOX ID coded. ;AN000;
  922. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  923. ;; ;AN000;
  924. MOV DI,BLOCK_END ;; Copy it onto the end of the ;AN000;
  925. ;; current block ;AN000;
  926. MOV DX,DI ;; Save start addr of the copy ;AN000;
  927. MOV [BX].TAB_COPY,DX ;; Store ptr to copy in the directory ;AN000;
  928. MOV AX,[BX].TAB_SIZE ;; ;AN000;
  929. CALL GROW_SHARED_DATA ;; Allocate room for the table ;AN000;
  930. .IF <BUILD_STATE EQ YES> ;; ;AN000;
  931. MOV CX,AX ;; Number of bytes to copy ;AN000;
  932. PUSH SI ;; Save parse pointer ;AN000;
  933. MOV SI,[BX].TAB_OFFSET ;; Source pointer ;AN000;
  934. ADD DI,BP ;; make DI an absolute pointer (dest) ;AN000;
  935. REP MOVSB ;; Move it! ;AN000;
  936. POP SI ;; ;AN000;
  937. .IF <PRINTBOX_MATCH EQ YES> ;; Establish pointer to table ONLY ;AN000;
  938. MOV DI,BLOCK_START ;; Establish pointer in DISPLAYMODE;AN000;
  939. MOV [BP+DI].PATTERN_TAB_PTR,DX ;; info ;AN000;
  940. MOV AL,[BX].NB_INT ;; Number of table entries (intens);AN000;
  941. MOV [BP+DI].NUM_PATTERNS,AL ;; ;AN000;
  942. .ENDIF ;; ;AN000;
  943. .ENDIF ;; ;AN000;
  944. .ENDIF ;; ;AN000;
  945. .ENDIF ;; ;AN000;
  946. .ENDIF ;; ;AN000;
  947. .ENDIF ;; ;AN000;
  948. RET ;; ;AN000;
  949. ;; ;AN000;
  950. ;; ;AN000;
  951. PARSE_PRINTBOX ENDP ;AN000;
  952. ;AN000;
  953. ;; ;AN000;
  954. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  955. ;; ;AN000;
  956. ;; Module Name: ;AN000;
  957. ;; PARSE_VERB ;AN000;
  958. ;; ;AN000;
  959. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  960. ;; ;AN000;
  961. VERB_PARSE_PARMS LABEL WORD ;; Parser control blocks to parse verb ;AN000;
  962. DW VERB_P ;; Parser control blocks to parse verb ;AN000;
  963. DB 2 ;; # of lists ;AN000;
  964. DB 0 ;; # items in delimeter list ;AN000;
  965. DB 1 ;; # items in end-of-line list ;AN000;
  966. DB ';' ;; ';' used for comments ;AN000;
  967. ;; ;AN000;
  968. VERB_P DB 0,1 ;; Required, max parms ;AN000;
  969. DW VERB_P1 ;; ;AN000;
  970. DB 0 ;; # Switches ;AN000;
  971. DB 0 ;; # keywords ;AN000;
  972. ;; ;AN000;
  973. VERB_P1 DW 2000H ;; simple string ;AN000;
  974. DW 0002H ;; Capitalize using character table ;AN000;
  975. DW RESULT_BUFFER ;; Result buffer ;AN000;
  976. DW VERB_P1V ;; Value list ;AN000;
  977. DB 0 ;; Synomyms ;AN000;
  978. ;; ;AN000;
  979. VERB_P1V DB 3 ;; # of value lists ;AN000;
  980. DB 0 ;; # of range numerics ;AN000;
  981. DB 0 ;; # of discrete numerics ;AN000;
  982. ;\/ ~~mda(001) ----------------------------------------------------------
  983. ; Changed the number of strings from 9 to 10 because of the
  984. ; new DEFINE statement.
  985. DB 10 ;; # of strings ;AN000;
  986. ;/\ ~~mda(001) ----------------------------------------------------------
  987. DB 0 ;; tag: index into verb jump table ;AN000;
  988. DW PRINTER_STRING ;; string offset ;AN000;
  989. DB 2 ;; tag ;AN000;
  990. DW DISPLAYMODE_STRING ;; string offset ;AN000;
  991. DB 4 ;; tag ;AN000;
  992. DW PRINTBOX_STRING ;; string offset ;AN000;
  993. DB 6 ;; tag ;AN000;
  994. DW SETUP_STRING ;; string offset ;AN000;
  995. DB 8 ;; tag ;AN000;
  996. DW RESTORE_STRING ;; string offset ;AN000;
  997. DB 10 ;; tag ;AN000;
  998. DW GRAPHICS_STRING ;; string offset ;AN000;
  999. DB 12 ;; tag ;AN000;
  1000. DW COLORPRINT_STRING ;; string offset ;AN000;
  1001. DB 14 ;; tag ;AN000;
  1002. DW COLORSELECT_STRING ;; string offset ;AN000;
  1003. DB 16 ;; tag ;AN000;
  1004. DW DARKADJUST_STRING ;; string offset ;AN000;
  1005. ;\/ ~~mda(001) ----------------------------------------------------------
  1006. ; Added DEFINE_STRING to the value list.
  1007. ;
  1008. DB 18 ;; tag
  1009. DW DEFINE_STRING ;; string offset
  1010. ;/\ ~~mda(001) ----------------------------------------------------------
  1011. PRINTER_STRING DB 'PRINTER',0 ;; ;AN000;
  1012. DISPLAYMODE_STRING DB 'DISPLAYMODE',0 ;; ;AN000;
  1013. PRINTBOX_STRING DB 'PRINTBOX',0 ;; ;AN000;
  1014. SETUP_STRING DB 'SETUP',0 ;; ;AN000;
  1015. RESTORE_STRING DB 'RESTORE',0 ;; ;AN000;
  1016. GRAPHICS_STRING DB 'GRAPHICS',0 ;; ;AN000;
  1017. COLORPRINT_STRING DB 'COLORPRINT',0 ;; ;AN000;
  1018. COLORSELECT_STRING DB 'COLORSELECT',0 ;; ;AN000;
  1019. DARKADJUST_STRING DB 'DARKADJUST',0 ;; ;AN000;
  1020. ;\/ ~~mda(001) ----------------------------------------------------------
  1021. ; Added the DEFINE_STRING.
  1022. ;
  1023. DEFINE_STRING DB 'DEFINE',0 ;;
  1024. ;/\ ~~mda(001) ----------------------------------------------------------
  1025. ;; ;AN000;
  1026. ;; ;AN000;
  1027. PARSE_VERB PROC ;; ;AN000;
  1028. ;; ;AN000;
  1029. MOV DI,OFFSET VERB_PARSE_PARMS ;; parse parms ;AN000;
  1030. MOV SI,OFFSET STMT_BUFFER ;; the line to parse ;AN000;
  1031. XOR DX,DX ;; ;AN000;
  1032. XOR CX,CX ;; ;AN000;
  1033. CALL SYSPARSE ;; ;AN000;
  1034. .IF <AX EQ 0> ;; ;AN000;
  1035. MOV BL,RESULT_TAG ;; ;AN000;
  1036. XOR BH,BH ;; return tag in BX ;AN000;
  1037. .ELSE ;; ;AN000;
  1038. .IF <AX NE -1> ;; syntax error ;AN000;
  1039. OR STMT_ERROR,INVALID ;; set error flag for caller ;AN000;
  1040. .ENDIF ;; ;AN000;
  1041. .ENDIF ;; ;AN000;
  1042. RET ;AN000;
  1043. PARSE_VERB ENDP ;AN000;
  1044. ;; ;AN000;
  1045. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  1046. ;\/ ~~mda(001) -----------------------------------------------------------------------
  1047. ; This procedure parses the new statement DEFINE in the
  1048. ; graphics profile. The reason for this new statement
  1049. ; is to be able to define the new keyword, DATA, as DATA_ROW
  1050. ; or DATA_COL. This is necessary in order to support HP PCL
  1051. ; printers since they print in row format and IBM printers
  1052. ; print in column format.
  1053. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1054. ;;
  1055. ;; Module Name:
  1056. ;; PARSE_DEFINE
  1057. ;;
  1058. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1059. ;;
  1060. DEFINE_PARSE_PARMS LABEL WORD ;; Parser control blocks
  1061. DW DEFINE_P ;;
  1062. DB 2 ;; # of lists
  1063. DB 0 ;; # items in delimeter list
  1064. DB 1 ;; # items in end-of-line list
  1065. DB ';' ;; ';' used for comments
  1066. ;;
  1067. DEFINE_P DB 0,1 ;; Required, max parms. If have DEFINE
  1068. ;; then must have DEFINE DATA,ROW or
  1069. ;; DEFINE DATA,COLUMN
  1070. DW DEFINE_P1 ;;
  1071. DB 0 ;; # Switches
  1072. DB 0 ;; # keywords
  1073. ;;
  1074. DEFINE_P1 DW 2000H ;; simple string
  1075. DW 2 ;; Capitalize
  1076. DW RESULT_BUFFER ;; Result buffer
  1077. DW DEFINE_P1V ;; Value list
  1078. DB 0 ;; Synomyms
  1079. ;;
  1080. ;;
  1081. DEFINE_P1V DB 3 ;; # of value lists
  1082. DB 0 ;; # of range numerics
  1083. DB 0 ;; # of discrete numerics
  1084. DB 3 ;; 3 STRING VALUES
  1085. DB 1 ;; tag
  1086. DW DATA_STR ;; ptr
  1087. DB 2 ;; tag
  1088. DW ROW_STR ;; ptr
  1089. DB 3 ;; tag
  1090. DW COL_STR ;; ptr
  1091. ;;
  1092. DATA_STR DB 'DATA',0 ;;
  1093. ROW_STR DB 'ROW',0 ;;
  1094. COL_STR DB 'COLUMN',0 ;;
  1095. ;;
  1096. ;;
  1097. ROW_FOUND DB NO ;;
  1098. COL_FOUND DB NO ;; Assume column until told otherwise
  1099. DATA_FOUND DB NO ;;
  1100. ;;
  1101. ;;
  1102. PARSE_DEFINE PROC ;;
  1103. ;;
  1104. MOV CUR_STMT,DEF ;;
  1105. .IF <BIT STMTS_DONE NAND PRT> ;; If no preceeding PRT stmt
  1106. OR STMT_ERROR,MISSING ;; then issue error
  1107. MOV PARSE_ERROR,YES ;;
  1108. MOV BUILD_STATE,NO ;;
  1109. .ENDIF ;;
  1110. ;;
  1111. .IF <BIT STMTS_DONE AND DISP> ;; DISPLAYMODE stmts
  1112. OR STMT_ERROR,SEQUENCE ;; should NOT have been processed
  1113. MOV PARSE_ERROR,YES ;;
  1114. MOV BUILD_STATE,NO ;;
  1115. .ENDIF ;;
  1116. ;;
  1117. .IF <BIT STMTS_DONE AND DEF> ;; If another DEF stmt within in this
  1118. OR STMT_ERROR,INVALID ;; PTD then issue error
  1119. MOV PARSE_ERROR,YES ;;
  1120. MOV BUILD_STATE,NO ;;
  1121. .ENDIF ;;
  1122. ;;
  1123. ;;
  1124. MOV ROW_FOUND,NO ;; Flags to indicate whether the ROW,
  1125. MOV COL_FOUND,NO ;; COLUMN, or DATA parms were found.
  1126. MOV DATA_FOUND,NO ;;
  1127. ;;
  1128. OR STMTS_DONE,DEF ;; Indicate DEFINE found
  1129. ;;
  1130. MOV DI,OFFSET DEFINE_PARSE_PARMS ;; parse parms
  1131. ;; SI => the line to parse
  1132. XOR DX,DX ;;
  1133. .REPEAT ;;
  1134. XOR CX,CX ;;
  1135. CALL SYSPARSE ;;
  1136. ;;
  1137. .IF <AX EQ 0> NEAR ;; If PARM is valid
  1138. MOV BL,RESULT_TAG ;;
  1139. .SELECT ;;
  1140. .WHEN <BL EQ 1> ;; DATA string
  1141. CMP DATA_FOUND,NO ;; .IF <DATA_FOUND EQ NO> ... .ELSE ...
  1142. JNE DATA_ERROR ;; Not using .IF macro because jump is
  1143. MOV DATA_FOUND,YES ;; out of range.
  1144. JMP CONT_PARSE ;;
  1145. DATA_ERROR: ;;
  1146. OR STMT_ERROR,INVALID ;; Duplicate DATA parms
  1147. MOV PARSE_ERROR,YES ;;
  1148. MOV BUILD_STATE,NO ;;
  1149. ;;
  1150. .WHEN <BL EQ 2> ;; ROW
  1151. .IF <ROW_FOUND EQ NO> AND ;;
  1152. .IF <COL_FOUND EQ NO> ;;
  1153. MOV ROW_FOUND,YES ;;
  1154. .IF <BUILD_STATE EQ YES> ;; ~~mda(002) If this is the DEFINE stmt we're using
  1155. MOV [BP].DATA_TYPE,DATA_ROW ;; Set DATA_TYPE to DATA_ROW.
  1156. .ENDIF
  1157. .ELSE ;;
  1158. OR STMT_ERROR,INVALID ;; Duplicate ROW parms or combo of
  1159. ;; parms ROW and COLUMN
  1160. MOV PARSE_ERROR,YES ;;
  1161. MOV BUILD_STATE,NO ;;
  1162. .ENDIF ;;
  1163. ;;
  1164. .WHEN <BL EQ 3> ;; COLUMN
  1165. .IF <COL_FOUND EQ NO> AND ;;
  1166. .IF <ROW_FOUND EQ NO> ;;
  1167. MOV COL_FOUND,YES ;;
  1168. .IF <BUILD_STATE EQ YES> ;; ~~mda(002) If this is the DEFINE stmt we're using
  1169. MOV [BP].DATA_TYPE,DATA_COL ;; Set DATA_TYPE to DATA_COL.
  1170. .ENDIF ;;
  1171. .ELSE ;;
  1172. OR STMT_ERROR,INVALID ;; Duplicate COLUMN parms or combo of
  1173. ;; parms COLUMN and ROW
  1174. MOV PARSE_ERROR,YES ;;
  1175. MOV BUILD_STATE,NO ;;
  1176. .ENDIF ;;
  1177. .ENDSELECT ;;
  1178. .ELSE NEAR ;;
  1179. .IF <AX NE -1> ;;
  1180. OR STMT_ERROR,INVALID ;; parm is invalid
  1181. MOV PARSE_ERROR,YES ;;
  1182. MOV BUILD_STATE,NO ;;
  1183. .ENDIF ;;
  1184. .ENDIF ;;
  1185. CONT_PARSE: ;;
  1186. .UNTIL <AX EQ -1> NEAR ;;
  1187. ;;
  1188. .IF <DATA_FOUND EQ NO> ;; Missing DATA parm
  1189. OR STMT_ERROR,INVALID ;;
  1190. MOV PARSE_ERROR,YES ;;
  1191. MOV BUILD_STATE,NO ;;
  1192. .ENDIF ;;
  1193. ;;
  1194. ;;
  1195. .IF <ROW_FOUND EQ NO> AND ;; Missing ROW or COLUMN parm
  1196. .IF <COL_FOUND EQ NO> ;;
  1197. OR STMT_ERROR,INVALID ;;
  1198. MOV PARSE_ERROR,YES ;;
  1199. MOV BUILD_STATE,NO ;;
  1200. .ENDIF ;;
  1201. ;;
  1202. RET ;;
  1203. ;;
  1204. PARSE_DEFINE ENDP ;;
  1205. ;;
  1206. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1207. ;/\ ~~mda(001) -----------------------------------------------------------------------
  1208. ;AN000;
  1209. LIMIT LABEL NEAR ;; ;AN000;
  1210. CODE ENDS ;; ;AN000;
  1211. END ;AN000;
  1212. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
  1213.