2 TITLE PARSE
CODE AND CONTROL BLOCKS FOR
DISPLAY.SYS
4 ;****************** START OF SPECIFICATIONS **************************
6 ; MODULE NAME: PARSER.ASM
8 ; DESCRIPTIVE NAME: PARSES THE DEVICE= STATEMENT IN CONFIG.SYS FOR
11 ; FUNCTION: THE COMMAND LINE PASSED TO DISPLAY.SYS IN THE CONFIG.SYS
12 ; STATEMENT IS PARSED TO CHECK FOR CORRECT SYNTAX. A TABLE
13 ; IS SETUP CONTAINING THE VALUES FOUND.
17 ; INPUT: ES:DI POINTS TO REQUEST HEADER
20 ; NORMAL: TABLE SET UP WITH VALUES FOUND.
22 ; ERROR: 0 RETURNED IN FIRST WORD OF TABLE.
24 ; INTERNAL REFERENCES:
26 ; ROUTINES: SYSPARSE - PARSING CODE
28 ; DATA AREAS: PARMSx - PARSE CONTROL BLOCK FOR SYSPARSE
29 ; TABLE - TO CONTAIN VALUES FOUND IN DEVICE= LINE
31 ; EXTERNAL REFERENCES:
40 ; AN000; - DOS Version 4.00
41 ; AN001 - GHG P897 - Changes to the parser forced the inclusion
42 ; of the '=' in the device ID.
44 ; Label: "The DOS DISPLAY.SYS Device Driver"
45 ; "Version 4.00 (C) Copyright 1988 Microsoft
46 ; "Licensed Material - Program Property of Microsoft"
48 ;****************** END OF SPECIFICATIONS ****************************
49 ;Modification history *********************************************************
50 ;AN002; P1895 DISPLAY.SYS rejects command CON=(cga,(437),(0,0)) 10/22/87 J.K.
51 ;******************************************************************************
52 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54 ; The following is the table structure of the parser. All fields are
55 ; two bytes field (accept for the device and id name)
59 ; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
60 ; ³ N = Number of devices. ³
61 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
62 ; ³ Device # 1 offset ÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ>ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
63 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ³
64 ; ³ Device # 2 offset ³ ³ Table_1 (a) ³
65 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ³
66 ; ³ Device # 3 offset ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
67 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
68 ; ³ Device # 4 offset ³
69 ; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
72 ; N = 1,2,3 or 4. A two bytes number indicating the number of device specified.
73 ; DEVICE # N OFFSET : a two bytes offset address to table_1. (ie. Device #1 offset
74 ; is a pointer to table_1 (a). Device #2 offset is a pointer to table_1
75 ; (b)...etc.). If an error was detected in the command N is set to zero.
82 ; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
83 ; ³ N = Number of Offsets. ³ ³ ³
84 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ÚÄÄÄÄÄij Table_2 (a) ³
85 ; ³ Device Name offset ÄÅÄÄÄÄÙ ³ ³
86 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
87 ; ³ Device Id offset ÄÅÄÄÄÄÄÄ¿
88 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
89 ; ³ Device HWCP offset ÄÅÄÄÄÄ¿ ³ ³ ³
90 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ÀÄÄÄij Table_3 (a) ³
91 ; ³ Device Desg offset ÄÅÄÄ¿ ³ ³ ³
92 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
94 ; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
96 ; ³ ÀÄÄÄÄÄij Table_4 (a) ³
98 ; ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
99 ; ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
101 ; ÀÄÄÄÄÄÄÄij Table_5 (a) ³
103 ; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
106 ; N=Length of table_1, or the number of offsets contained in table_1.
107 ; The offsets are pointers (two bytes) to the parameters value of the device.
108 ; "Reserved" : a two byte memory reserved for future use of the "PARMS" option.
114 ; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
115 ; ³ N = Length of devices name ³
116 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
118 ; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
120 ; N = Length of device name. Device length is always 8 byte long.
121 ; Device Name : the name of the device (eg. LPT1, CON, PRN). The name
122 ; is paded with spaces to make up the rest of the 8 characters.
129 ; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
130 ; ³ N = Length of Id name. ³
131 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
133 ; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
135 ; N = Length of id name. Id name length is always 8 byte long.
136 ; Id Name : the name of the id (eg. EGA, VGA). The name
137 ; is paded with spaces to make up the rest of the 8 character.
144 ; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
145 ; ³ N = Length of table. ³
146 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
148 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
150 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
154 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
156 ; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
159 ; N = Length of table in words. Or the number of HWCP's.
160 ; HWCP # N : a hardware code page number converted to binary. The maximum
161 ; number of pages allowed is 10.
168 ; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
169 ; ³ N = Length of table. ³
170 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
172 ; ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
174 ; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
176 ; N = Lenght of table. 0 - nothing was specified
177 ; 1 - Only a designate was specified.
178 ; 2 - Designate and font were given. If the Desg field
179 ; was left empty in the DEVICE command then the
180 ; Designate field is filled with 0FFFFH.
181 ; Designate, Font : Are the Desg. and Font binary numbers.
183 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
185 INCLUDE DEF
-EQU
.INC ; structures and equates ;AN000;
188 INCLUDE STRUC.INC ; Structured macros ;AN000;
191 PUBLIC PARSER
; near procedure for parsing DEVICE= statement ;AN000;
192 PUBLIC TABLE
; table for variable storage used by INIT module. ;AN000;
193 PUBLIC GET_DEVICE_ID
; procedure to determine device adapter ;AN000;
195 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
197 ; Set assemble switches for parse code
199 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
209 CODE SEGMENT PUBLIC BYTE 'CODE'
214 INCLUDE PARSE
.ASM
; Parsing code ;AN000;
218 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
220 ; PARM control block for DISPLAY.SYS - DEVICE= command statement.
221 ; Command line looks like:
223 ; DEVICE=[d:][path]DISPLAY.SYS CON[:]=(type[,[hwcp][,n]])
225 ; DEVICE=[d:][path]DISPLAY.SYS CON[:]=(type[,[hwcp][,(n,m)]])
226 ; or, for compatibility with DOS 3.3; PTM P1895
227 ; DEVICE=[d:][path]DISPLAY.SYS CON[:]=(type[,[(hwcp)][,n|(n,m)]])
229 ; The command line will be parsed from left to right, taking care of the
230 ; nesting of complex lists as they occur.
232 ; The first level of control blocks is shown below.
233 ; Complex list control blocks follow.
234 ; Null VALUE LIST and RESULT BUFFER are placed after all other PARSE control
237 ; d:\path\DISPLAY.SYS CON=(complex list)
239 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
241 PARMS1
LABEL WORD ;AN000;
243 DB 0 ; no extra delimeters or EOLs. ;AN000;
245 PARMSX1
LABEL BYTE ;AN000;
246 DB 1,1 ; min,max positional operands ;AN000;
247 DW D_NAME
; pointer to control block ;AN000;
248 DB 0 ; no switches ;AN000;
249 DB 1 ; 1 keywords ;AN000;
250 DW DSP_LIST
; pointer to control block ;AN000;
252 D_NAME
LABEL WORD ;AN000;
253 DW 0200H ; file spec ;AN000;
254 DW 0001H ; cap result by file table ;AN000;
255 DW RESULT_BUF
; result ;AN000;
256 DW NOVALS
; no value checking done ;AN000;
257 DB 0 ; no keyword/switch synonyms ;AN000;
259 DSP_LIST
LABEL WORD ;AN000;
260 DW 0400H ; complex list, ignore colon ;AN000;
261 DW 0012H ; cap result by char table ;AN000;
262 DW RESULT_BUF
; result ;AN000;
263 DW NOVALS
; no value checking done ;AN000;
264 DB 2 ; 1 keyword ;AN000;
265 DB "CON=",0 ;GHG CON[:]= keyword ;AN001;
266 DB "CON:=",0 ;GHG ;AN001;
268 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
270 ; PARM control block for second level of nesting.
271 ; ie. complex list from first level of nesting
273 ; (type, hwcp, n or complex list)
275 ; (type, (hwcp), n or complex list)
276 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
278 PARMS2
LABEL WORD ;AN000;
280 DB 0 ; no extra delimeters or EOLs. ;AN000;
282 PARMSX2
LABEL BYTE ;AN000;
283 DB 0,3 ; min,max positional operands ;AN000;
284 DW DSP_TYPE
; pointer to control block ;AN000;
285 DW HWCP
; pointer to control block ;AN000;
286 DW CP_PREPS
; pointer to control block ;AN000;
287 DB 0 ; no switches ;AN000;
288 DB 0 ; no keywords ;AN000;
290 DSP_TYPE
LABEL BYTE ;AN000;
291 DW 2001H
; sstring (optional) ;AN000;
292 DW 0002H ; cap by char table ;AN000;
293 DW RESULT_BUF
; result ;AN000;
294 DW NOVALS
; value list ;AN000;
295 DB 0 ; no keyword/switch synonyms ;AN000;
298 HWCP
LABEL BYTE ;AN000;
299 DW 8401H
;AN002; numeric or complex list (optional)
300 DW 0 ; no functions ;AN000;
301 DW RESULT_BUF
; result ;AN000;
302 DW NOVALS
; no value checking done ;AN000;
303 DB 0 ; no keyword/switch synonyms ;AN000;
305 CP_PREPS
LABEL BYTE ;AN000;
306 DW 8401H
; numeric or complex list (optional) ;AN000;
307 DW 0 ; no functions ;AN000;
308 DW RESULT_BUF
; result ;AN000;
309 DW NOVALS
; value list ;AN000;
310 DB 0 ; no keyword/switch synonyms ;AN000;
313 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
315 ; PARM control block for third level of nesting.
316 ; ie. complex list from second nesting level
320 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
322 PARMS3_X
LABEL WORD ;AN002;
324 DB 0 ;AN002; no extra delimeters or EOLs.
326 PARMSX3_X
LABEL BYTE ;AN002;
327 DB 1,1 ;AN002; min,max positional operands
328 DW PREPS
;AN002; pointer to control block
329 DB 0 ;AN002; no switches
330 DB 0 ;AN002; no keywords
332 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
334 ; PARM control block for third level of nesting.
335 ; ie. complex list from second nesting level
339 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
341 PARMS3
LABEL WORD ;AN000;
343 DB 0 ; no extra delimeters or EOLs. ;AN000;
345 PARMSX3
LABEL BYTE ;AN000;
346 DB 1,2 ; min,max positional operands ;AN000;
347 DW PREPS
; pointer to control block ;AN000;
348 DW SUBFONTS
; pointer to control block ;AN000;
349 DB 0 ; no switches ;AN000;
350 DB 0 ; no keywords ;AN000;
352 PREPS
LABEL BYTE ;AN000;
353 DW 8000H
; numeric ;AN000;
354 DW 0 ; no functions ;AN000;
355 DW RESULT_BUF
; result ;AN000;
356 DW NOVALS
; value list ;AN000;
357 DB 0 ; no keyword/switch synonyms ;AN000;
359 SUBFONTS
LABEL BYTE ;AN000;
360 DW 8001H
; numeric (optional) ;AN000;
361 DW 0 ; no functions ;AN000;
362 DW RESULT_BUF
; result ;AN000;
363 DW NOVALS
; no value checking done ;AN000;
364 DB 0 ; no keyword/switch synonyms ;AN000;
366 ; Null VALUE LIST and RESULT BUFFER for all PARSE control blocks ;AN000;
368 NOVALS
LABEL BYTE ;AN000;
369 DB 0 ; no value checking done ;AN000;
371 RESULT_BUF
LABEL BYTE ;AN000;
372 RESULT_TYPE
DB ?
; type returned (number, string, etc.) ;AN000;
373 DB ?
; matched item tag (if applicable) ;AN000;
374 DW ?
; synonym ptr (if applicable) ;AN000;
375 RESULT_VAL
DD ?
; value ;AN000;
377 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
379 ; TABLE STRUCTURE FOR RETURNING VALUES TO THE INIT MODULE
380 ; (ADAPTED FROM VERSION 1.0 DISPLAY.SYS)
382 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
384 TABLE
LABEL BYTE ; table header ;AN000;
385 DEVICE_NUM
DW ONE
; should only be one device ;AN000;
386 TABLE2_PTR
DW TABLE2
; pointer to table 2 ;AN000;
388 TABLE2
LABEL WORD ;AN000;
389 OFFSET_NUM
DW FOUR
; 4 pointer follow ;AN000;
390 TABLE3_PTR
DW TABLE3
; pointer to table 3 (device name) ;AN000;
391 TABLE4_PTR
DW TABLE4
; pointer to table 4 (device id) ;AN000;
392 TABLE5_PTR
DW TABLE5
; pointer to table 5 (hwcp's) ;AN000;
393 TABLE6_PTR
DW TABLE6
; pointer to table 6 (num desg's and fonts) ;AN000;
395 TABLE3
LABEL WORD ; device name (ie. CON) ;AN000;
396 T3_LENGTH
DW EIGHT
; length ;AN000;
397 T3_NAME
DB "CON " ; value ;AN000;
399 TABLE4
LABEL WORD ; device id. (eg. EGA,MONO...) ;AN000;
400 T4_LENGTH
DW ZERO
; length ;AN000;
401 T4_NAME
DB " " ; value ;AN000;
403 TABLE5
LABEL WORD ; hardware code pages ;AN000;
404 T5_NUM
DW ZERO
; only 1 for CON ;AN000;
405 T5_VALUE
DW ?
; value ;AN000;
407 TABLE6
LABEL WORD ; Designates and fonts ;AN000;
408 T6_NUM
DW ZERO
; values given (0 - 2 valid) ;AN000;
409 T6_DESG
DW ?
; n value ;AN000;
410 T6_FONT
DW ?
; m value ;AN000;
413 OK_FLAG
DB ON ; FLAG INDICATING PARSE STATUS ;AN000;
414 LOOP1
DB ZERO
;AN000;
415 LOOP2
DB ZERO
;AN000;
417 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
419 ; PROCEDURE_NAME: PARSER
422 ; THIS PROCEDURE PARSES THE DEVICE= PARAMETERS FROM THE INIT REQUEST
425 ; AT ENTRY: ES:DI POINTS TO REQUEST HEADER
428 ; NORMAL: TABLE SET UP WITH VALUES FOUND
430 ; ERROR: 0 LOADED IN FIRST WORD OF TABLE
434 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
436 PARSER PROC
NEAR ;AN000;
441 LDS SI,RH
.RH0_BPBA
; ;AN000;
442 PUSH CS ; establish ES .. ;AN000;
443 POP ES ; addressability to data ;AN000;
444 LEA DI,PARMS1
; point to PARMS control block ;AN000;
445 XOR CX,CX ; clear both CX and DX for ;AN000;
446 XOR DX,DX ; SYSPARSE ;AN000;
447 CALL SYSPARSE
; move pointer past file spec ;AN000;
448 CALL SYSPARSE
; do first parse ;AN000;
449 .WHILE <AX NE RC_EOL
> AND ; EOL?...then end parse...and.. ;AN000;
450 .WHILE <OK_FLAG
EQ ON> ; make sure that flag still ok.. ;AN000;
451 .IF <AX NE RC_NO_ERROR
> ; parse error? ;AN000;
452 MOV OK_FLAG
,OFF
; yes...reset flag ;AN000;
453 .ELSE ; no...process.. ;AN000;
455 .WHEN
<RESULT_TYPE
EQ COMPLEX
> ; complex string found? ;AN000;
456 INC LOOP1
; increment count ;AN000;
457 .IF <LOOP1 GT ONE
> ; more than one? ;AN000;
458 MOV OK_FLAG
,OFF
; yes....we have an error ;AN000;
459 .ELSE ; no .. ;AN000;
460 CALL PARSE_MAIN
; process complex string.. ;AN000;
462 .OTHERWISE
; not a complex string so.. ;AN000;
463 MOV OK_FLAG
,OFF
; we have a problem...reset flag ;AN000;
465 CALL SYSPARSE
; continue parsing.. ;AN000;
468 .IF <OK_FLAG
EQ OFF
> OR ; flag indicating error? ;AN000;
469 .IF <LOOP1
EQ ZERO
> ; or no parameters specified? ;AN000;
470 MOV DEVICE_NUM
,ZERO
; yes...set device number to 0 ;AN000;
483 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
485 ; PROCEDURE_NAME: PARSE_MAIN
488 ; THIS PROCEDURE PARSES THE CON=( ) COMPLEX LIST DEVICE= LINE FOUND
491 ; AT ENTRY: RESULT BUFFER CONTAINS POINTER TO COMPLEX STRING
494 ; NORMAL: TABLE SET UP WITH VALUES FOUND
498 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
500 PARSE_MAIN PROC
NEAR ;AN000;
501 PUSH DI ; setup to parse the nested.. ;AN000;
502 PUSH DS ; complex string...but save.. ;AN000;
503 PUSH SI ; current parsing status. ;AN000;
506 LEA DI,PARMS2
; next control block.. ;AN000;
507 LDS SI,RESULT_VAL
; point to stored string ;AN000;
508 CALL SYSPARSE
; ;AN000;
509 .WHILE <AX NE RC_EOL
> AND ; not EOL? and.. ;AN000;
510 .WHILE <OK_FLAG
EQ ON> ; error flag still ok? ;AN000;
511 .IF <AX NE RC_NO_ERROR
> ; check for parse errors ;AN000;
512 MOV OK_FLAG
,OFF
; yes....reset error flag ;AN000;
513 .ELSE ; no...process ;AN000;
516 .WHEN
<RESULT_TYPE
EQ STRING
> ; simple string ;AN000;
517 CALL PARSE_STR
; yes...process ;AN000;
518 .WHEN
<RESULT_TYPE
EQ NUMBER
> ; number?.. ;AN000;
519 CALL PARSE_NUM
; yes...process ;AN000;
520 .WHEN
<RESULT_TYPE
EQ COMPLEX
> ; complex string? ;AN000;
521 CALL PARSE_COMPLEX
;AN002;
522 .OTHERWISE
; anything else is.. ;AN000;
523 MOV OK_FLAG
,OFF
; an error...reset flag. ;AN000;
525 CALL SYSPARSE
; continue parsing ;AN000;
528 POP CX ; restore original parse.. ;AN000;
529 POP SI ; registers. ;AN000;
536 PARSE_COMPLEX PROC
;AN002;
537 .IF <LOOP2
EQ TWO
> ;AN002; Should be for HWCP
538 CALL PARSE_COMP_X
;AN002; for (hwcp)
540 CALL PARSE_COMP
; yes...process for (n,m) ;AN000;
545 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
547 ; PROCEDURE_NAME: PARSE_COMP_X
550 ; THIS PROCEDURE PARSES A COMPLEX LIST FOUND WITHIN THE CON=( )
551 ; COMPLEX LIST for (hwcp).
553 ; AT ENTRY: RESULT BUFFER CONTAINS POINTER TO COMPLEX STRING
556 ; NORMAL: TABLE SET UP WITH VALUES FOUND
560 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
562 PARSE_COMP_X PROC
NEAR ;AN002;
563 PUSH DI ;AN002; setup ro parse the nested..
564 PUSH DS ;AN002; complex string..saving the..
565 PUSH SI ;AN002; current parse status.
568 LEA DI,PARMS3_X
;AN002; next control block
569 LDS SI,RESULT_VAL
;AN002; point to stored string.
570 CALL SYSPARSE
;AN002;
571 .WHILE <AX NE RC_EOL
> AND ;AN002; not EOL?...and..
572 .WHILE <OK_FLAG
EQ ON> ;AN002; error flag still okay?
573 .IF <AX NE RC_NO_ERROR
> OR ;AN002; parse error?...or..
574 .IF <RESULT_TYPE NE NUMBER
> ;AN002; something other than a number..
575 MOV OK_FLAG
,OFF
;AN002; found?....yes..reset flag.
576 .ELSE ;AN002; no...process..
577 INC T5_NUM
;AN002; increment counter
578 MOV AX,WORD PTR RESULT_VAL
;AN002; get numeric value into word
579 MOV T5_VALUE
,AX ;AN002; yes...number of designates.
580 CALL SYSPARSE
;AN002; continue parsing
583 POP CX ;AN002; restore previous parse..
584 POP SI ;AN002; registers.
588 PARSE_COMP_X ENDP
;AN002;
591 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
593 ; PROCEDURE_NAME: PARSE_COMP
596 ; THIS PROCEDURE PARSES A COMPLEX LIST FOUND WITHIN THE CON=( )
597 ; COMPLEX LIST for (n,m).
599 ; AT ENTRY: RESULT BUFFER CONTAINS POINTER TO COMPLEX STRING
602 ; NORMAL: TABLE SET UP WITH VALUES FOUND
606 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
608 PARSE_COMP PROC
NEAR ;AN000;
609 PUSH DI ; setup ro parse the nested.. ;AN000;
610 PUSH DS ; complex string..saving the.. ;AN000;
611 PUSH SI ; current parse status. ;AN000;
614 LEA DI,PARMS3
; next control block ;AN000;
615 LDS SI,RESULT_VAL
; point to stored string. ;AN000;
616 CALL SYSPARSE
; ;AN000;
617 .WHILE <AX NE RC_EOL
> AND ; not EOL?...and.. ;AN000;
618 .WHILE <OK_FLAG
EQ ON> ; error flag still okay? ;AN000;
619 .IF <AX NE RC_NO_ERROR
> OR ; parse error?...or.. ;AN000;
620 .IF <RESULT_TYPE NE NUMBER
> ; something other than a number.. ;AN000;
621 MOV OK_FLAG
,OFF
; found?....yes..reset flag. ;AN000;
622 .ELSE ; no...process.. ;AN000;
623 INC T6_NUM
; increment counter ;AN000;
624 MOV AX,WORD PTR RESULT_VAL
; get numeric value into word ;AN000;
625 .IF <T6_NUM
EQ ONE
> ; first value found? ;AN000;
626 MOV T6_DESG
,AX ; yes...number of designates. ;AN000;
627 .ELSE ; else.. ;AN000;
628 MOV T6_FONT
,AX ; second number...number of fonts. ;AN000;
630 CALL SYSPARSE
; continue parsing ;AN000;
633 POP CX ; restore previous parse.. ;AN000;
634 POP SI ; registers. ;AN000;
641 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
643 ; PROCEDURE_NAME: PARSE_STR
646 ; THIS PROCEDURE PARSES A STRING FOUND WITHIN THE CON=( ) STATEMENT
648 ; AT ENTRY: RESULT BUFFER POINTS TO ASCIIZ STRING
651 ; NORMAL: TABLE SET UP WITH VALUES FOUND
655 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
657 PARSE_STR PROC
NEAR ;AN000;
658 PUSH DI ; get source and.. ;AN000;
659 PUSH DS ; destination registers.. ;AN000;
660 PUSH SI ; setup. ;AN000;
661 LDS SI,RESULT_VAL
; ;AN000;
662 .IF <<BYTE PTR DS:[SI]> NE ZERO
> ; check for null string ;AN000;
663 LEA DI,T4_NAME
; ;AN000;
664 LODSB ; load first character. ;AN000;
665 .WHILE <AL NE ZERO
> ; while not at end of ASCIIZ do.. ;AN000;
666 STOSB ; store.. ;AN000;
667 LODSB ; load next character.. ;AN000;
669 MOV T4_LENGTH
,EIGHT
; value found. ;AN000;
671 POP SI ; restore registers. ;AN000;
678 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
680 ; PROCEDURE_NAME: PARSE_NUM
683 ; THIS PROCEDURE PARSES NUMBERS FOUND IN THE CON=( ) STATEMENT
686 ; AT ENTRY: RESULT BUFFER CONTAINS A DWORD NUMBER VALUE
689 ; NORMAL: TABLE SET UP WITH VALUES FOUND
693 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
695 PARSE_NUM PROC
NEAR ;AN000;
696 MOV AX,WORD PTR RESULT_VAL
; get value into word form ;AN000;
697 .IF <LOOP2
EQ TWO
> ; if this is the code page then.. ;AN000;
698 MOV T5_VALUE
,AX ; load that value. ;AN000;
700 .ELSEIF
<LOOP2
EQ THREE
> ; ;AN000;
701 MOV T6_DESG
,AX ; must be number of designates.. ;AN000;
702 INC T6_NUM
; load and increment count ;AN000;
705 PARSE_NUM ENDP
;AN000;
708 ASSUME
CS:CODE,DS:CODE
710 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
712 ; PROCEDURE_NAME: GET_DEVICE_ID
715 ; THIS PROCEDURE RETURNS THE DISPLAY DEVICE TO THE INIT ROUTINE WHEN
716 ; A DEVICE ID IS NOT SUPPLIED.
721 ; NORMAL: DEVICE ID PLACED WITHIN THE TABLE. (EGA OR LCD)
724 ; ERROR: DEVICE ID IS MONO OR CGA
727 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
729 FUNC_INFO INFO_BLOCK
<> ;AN000;
731 DEVICE_N_LENGTH EQU EIGHT
;AN000;
733 DEVICE_TYPES
DB "EGA " ;AN000;
736 NUM_DEVICE_TYPES EQU
($-DEVICE_TYPES
)/DEVICE_N_LENGTH
;AN000;
738 DEVICE_FLAG
DB 00000000B ;AN000;
741 GET_DEVICE_ID PROC
NEAR ;AN000;
745 PUSH DX ; a r ;AN000;
746 PUSH DI ; v e ;AN000;
747 PUSH SI ; e g ;AN000;
755 MOV AH,FUNC_CALL
; ;AN000;
756 LEA DI,FUNC_INFO
; ;AN000;
758 INT 10H
; try VGA functionality call ;AN000;
759 .IF <AL EQ FUNC_CALL
> ; worked?....then ;AN000;
760 OR DEVICE_FLAG
,VGA_FOUND
; VGA found. ;AN000;
761 .ELSE ; no VGA...try EGA ;AN000;
762 MOV AH,ALT_SELECT
; ;AN000;
763 MOV BL,EGA_INFO_CALL
; ;AN000;
765 .IF <BL NE EGA_INFO_CALL
> ; if changed then EGA present.. ;AN000;
766 OR DEVICE_FLAG
,EGA_FOUND
; mark as found. ;AN000;
767 .ELSE ; no EGA...try LCD. ;AN000;
768 MOV AH,GET_SYS_ID
; get system id.. ;AN000;
769 INT 15H
; yup....its a convertible..so ;AN000;
770 .IF <ES:[BX].MODEL_BYTE
EQ LCD_MODEL
> AND ;AN000;
771 MOV AH,GET_STATUS
; check for LCD.. ;AN000;
773 .IF <BIT
AL NAND
ON> ; yes....bit says LCD..so.. ;AN000;
774 OR DEVICE_FLAG
,LCD_FOUND
; mark as LCD. ;AN000;
778 .IF <DEVICE_FLAG NE ZERO
> ; nothing found?..then exit (eg. MONO) ;AN000;
779 LEA SI,DEVICE_TYPES
; start of new id's ;AN000;
780 SAR DEVICE_FLAG
,ONE
; shift flag into carry bit ;AN000;
781 .WHILE NC
; carry not set yet.. ;AN000;
782 ADD SI,DEVICE_N_LENGTH
; next id ;AN000;
783 SAR DEVICE_FLAG
,ONE
; next flag... ;AN000;
785 PUSH CS ; found....transfer id.. ;AN000;
786 POP ES ; into the table.. ;AN000;
787 LEA DI,T4_NAME
; ;AN000;
788 MOV CX,DEVICE_N_LENGTH
; ;AN000;
790 MOV T4_LENGTH
,EIGHT
; ;AN000;
791 CLC ; clear error flag ;AN000;
793 STC ; set error (ie. MONO or CGA found) ;AN000;
804 GET_DEVICE_ID ENDP
; s