]>
wirehaze git hosting - MS-DOS.git/blob - v4.0/src/DEV/PRINTER/CPSFONT3.ASM
4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6 ;; FILENAME: CPS Device Driver -- Font Parser
7 ;; MODULE NAME: CPSFONT
8 ;; TYPE: Font Parser Module
9 ;; LINK PROCEDURE: Link CPS+CPSSUB+CPSINT9+...+CPSINIT into .EXE format
10 ;; CPS must be first. CPSINIT must be last. Everything
11 ;; before CPSINIT will be resident.
16 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
18 INCLUDE CPSPEQU
.INC ;;
20 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22 CSEG
SEGMENT PUBLIC 'CODE' ;;
26 PUBLIC FTABLE
,FONT_PARSER
;;
28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
30 ;; ************************************
32 ;; ** Resident Code **
34 ;; ************************************
36 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
38 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
42 ;; -- Interface table : FTABLE
44 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
45 FTABLE: FBUFS
<0FFFFH,,,> ;; for temporary testing
46 FTB1 FTBLK
<,,,,,,,,,,,,> ;; -- at most 12 entries
47 FTB2 FTBLK
<,,,,,,,,,,,,> ;;
48 FTB3 FTBLK
<,,,,,,,,,,,,> ;;
49 FTB4 FTBLK
<,,,,,,,,,,,,> ;;
50 FTB5 FTBLK
<,,,,,,,,,,,,> ;;
51 FTB6 FTBLK
<,,,,,,,,,,,,> ;;
52 FTB7 FTBLK
<,,,,,,,,,,,,> ;;
53 FTB8 FTBLK
<,,,,,,,,,,,,> ;;
54 FTB9 FTBLK
<,,,,,,,,,,,,> ;;
55 FTBa FTBLK
<,,,,,,,,,,,,> ;;
56 FTBb FTBLK
<,,,,,,,,,,,,> ;;
57 FTBc FTBLK
<,,,,,,,,,,,,> ;;
59 FP_ERROR
DW 0000H ;; internal error register
61 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
62 ;; the followings are bytes accumulated
63 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
64 FTAG_LEN EQU
8 ;; FILE TAGE in the font file header
65 FTAG_COUNT
DW 0000H ;;
67 FTAG_PATTERN
LABEL BYTE ;;
72 ;; POINTER in the font file header
73 fptr_LOW
LABEL WORD ;;
74 fptr_LOL
DB 00H ;; NEXT
76 fptr_HIGH
LABEL WORD ;;
82 ENTRY_WORD
LABEL WORD ;;
83 ENTRY_LOB
DB 00H ;; ENTRY COUNT
85 NEXT_LOW
LABEL WORD ;;
86 NEXT_LOL
DB 00H ;; NEXT
88 NEXT_HIGH
LABEL WORD ;;
91 TYPE_WORD
LABEL WORD ;;
92 TYPE_LOB
DB 00H ;; TYPE
94 TID_CNT
DW 00000H ;; TYPEID COUNT(0 to 8)
95 TYPE_ID
: DB ' ' ;; TYPEID
96 CPG_WORD
LABEL WORD ;;
97 CPG_LOB
DB 00H ;; CODE PAGE
99 FONT_LOW
LABEL WORD ;;
100 FONT_LOL
DB 00H ;; FONT ADDRESS
102 FONT_HIGH
LABEL WORD ;;
105 ;; the followings are contained in the font-block in the exact order & length
106 MOD_WORD
LABEL WORD ;;
107 MOD_LOB
DB 00H ;; MODIFIER
109 FONTS_WORD
LABEL WORD ;;
110 FONTS_LOB
DB 00H ;; FONTS
112 FDLEN_WORD
LABEL WORD ;;
113 FDLEN_LOB
DB 00H ;; FONT DATA LENGTH
115 PRE_FONT_ND EQU
($-MOD_WORD
) ;; used to update target for font data
116 ;; to follow. -- for NON-DISPLAY
117 DISP_ROWS
DB 00H ;; DISPLAY's parameters :
118 DISP_COLS
DB 00H ;; BOX SIZE
119 DISP_X
DB 00H ;; ASPECT RATIO
121 COUNT_WORD
LABEL WORD ;; NO. OF DISPLAY CHARACTERS
124 PRE_FONT_D EQU
($-MOD_WORD
) ;; used to update target for font data
125 ;; to follow. -- for DISPLAY
127 PTR_SEL_WORD
LABEL WORD ;;
130 PRE_FONT_P0 EQU
($-PTR_SELOB
+PRE_FONT_ND
) ;; to update target for font data
131 ;; to follow -- for PRINTER with
132 ;; selection type = 0.
134 PTR_LEN_WORD
LABEL WORD ;;
137 PRE_FONT_P EQU
($-PTR_SELOB
+PRE_FONT_ND
) ;; to update target for font data
138 ;; to follow -- for PRINTER with
139 ;; selection type <> 0.
142 ;; also update STAGE_CASES and indexing constants
143 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
144 ;; the stage the parsing is in : ;;;;;
145 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
147 STAGE_CASES
LABEL WORD ;; the stage the parsing is in :
149 ;; *** INDEXED BY STAGE-INDEX
151 DW OFFSET ENTRYLO
;; 0
152 DW OFFSET ENTRYHI
;; 1
153 DW OFFSET NEXTLOL
;; 2
154 DW OFFSET NEXTLOH
;; 3
155 DW OFFSET NEXTHIL
;; 4
156 DW OFFSET NEXTHIH
;; 5
157 DW OFFSET TYPELO
;; 6
158 DW OFFSET TYPEHI
;; 7
159 DW OFFSET TYPEIDS
;; 8
162 DW OFFSET FONTLOL
;; B
163 DW OFFSET FONTLOH
;; C
164 DW OFFSET FONTHIL
;; D
165 DW OFFSET FONTHIH
;; E
166 DW 00H ;; MATCH case -- end of SEARCH stages
167 DW 00H ;; SCAN case -- before PRE-FOUND stage
168 DW OFFSET MODLO
;; 11
169 DW OFFSET MODHI
;; 12
170 DW OFFSET FONTSLO
;; 13
171 DW OFFSET FONTSHI
;; 14
172 DW OFFSET FDLENLO
;; 15
173 DW OFFSET FDLENHI
;; 16 -- lead to FONT case,NON- DISPLAY
174 DW OFFSET DSPROWS
;; 17 -- DISPLAY only
175 DW OFFSET DSPCOLS
;; 18
178 DW OFFSET DSPCOUNTLO
;; 1B
179 DW OFFSET DSPCOUNTHI
;; 1C -- lead to FONT case, DISPLAY
180 DW OFFSET PTRSELLO
;; 1D -- PRINTER only
181 DW OFFSET PTRSELHI
;; 1E
182 DW OFFSET PTRLENLO
;; 1F
183 DW OFFSET PTRLENHI
;; 20 -- lead to FONT case, PRINTER
185 DW 00H ;; GET_FONT case
186 DW 00H ;; PASS special stage
187 DW OFFSET FILETAG
;; 24
188 DW OFFSET fptrLOL
;; 25
189 DW OFFSET fptrLOH
;; 26
190 DW OFFSET fptrHIL
;; 27
191 DW OFFSET fptrHIH
;; 28
192 DW 00H ;; FPTR_SKIP_CASE
194 ;; The followings are individual stage
195 STAGE_MAX EQU
($-STAGE_CASES
)/2 ;; number of stages
199 ;; **** INDEX TO STAGE_CASES ****
202 NEXT_LOLX EQU
02H ;; NEXT
206 TYPE_LOBX EQU
06H ;; TYPE
208 TYPE_IDX EQU
08H ;; TYPEID
209 CPG_LOBX EQU
09H ;; CODE PAGE
211 FONT_LOLX EQU
0BH ;; FONT ADDRESS
215 ;; ------------------------------
216 MATCHX EQU
0FH ;; MATCH is the end of SEARCH's stages
217 SCANX EQU 10H
;; SCANX is before the PRE-FOUND stages
218 ;; ------------------------------
219 MOD_LOBX EQU 11H
;; MODIFIER
221 FONTS_LOBX EQU 13H
;; FONTS
222 FONTS_HIBX EQU 14H
;;
223 FDLEN_LOBX EQU 15H
;; FONT DATA LENGTH
224 FDLEN_HIBX EQU 16H
;;
225 DISP_ROWSX EQU 17H
;; DISPLAY -- CHAR. SIZE
226 DISP_COLSX EQU 18H
;;
227 DISP_XX EQU 19H
;; DISPLAY -- ASPECT RATIO
229 COUNT_LOBX EQU 1
BH ;; DISPLAY -- COUNT
230 COUNT_HIBX EQU 1
CH ;;
236 ;; ------------------------------
237 FOUNDX EQU 21H
;; GET_FX is the end of PRE-FOUND stage
239 ;; ------------------------------
240 PASSX EQU 23H
;; see pass_brk table
241 ;; ------------------------------
242 FTAGX EQU 24H
;; RESTART ==> FILE TAG
244 fptr_LOLX EQU 25H
;; POINTER in font file header
247 fptr_HIHX EQU 28H
;; ---------------------------------
249 fptr_SKIPX EQU 29H
;; ==> ENTRY_LOX
250 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
251 ;; PASS -- to skip some bytes ;;;;;;
252 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
253 ;; the PASS mechanism is used to skip
254 ;; a number of bytes between two fields
255 ;; The numbers are tabulated in
256 ;; PASS_BRK table in the accumulative
257 ;; sum. The PASS_POSTX(and PASS_POSTXX)
258 ;; are used to tell what is the stage
259 ;; after all the bytes have skipped.
261 PASS_POSTX
DW STAGE_MAX
;; the stage after pass-stage
263 FILE_OFFSET EQU
0BH ;; spaces to be skipped in font file :
264 ;; ( after TAG, before POINTER)
267 PASS_BRK
LABEL WORD ;;
268 DW FILE_OFFSET
;; skip in the font file header
269 DW FILE_OFFSET
+2 ;; pass header-length, needs to reset
270 ;; PASS_CNT for each of the font_header
271 DW FILE_OFFSET
+8 ;; pass header-reserved bytes
272 PASS_INDX EQU
($-PASS_BRK
)/2 ;;
273 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
274 ;; the control variables : ;;;;;;;;
275 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
276 STAGE
DW STAGE_MAX
;; of the STAGE-INDEX
278 Pre_font_len
DW 00000H ;; no. of bytes before the FONT DATA
281 COUNT_LO
DW 00000H ;; no. of bytes parsed so far
282 COUNT_hI
DW 00000H ;;
284 HIT_LO
DW 00000H ;; the next byte that is addressed by :
285 HIT_HI
DW 00000H ;; either NEXT or TARGET in FTBLK.
287 HIT_FLAG
DW 00000H ;; IF ZERO, the NEXT is approaching
288 HIT_BX
DW 00000H ;; where FTB is found for nearest hit
290 NUM_FTB
DW 00000H ;; as defined in the FP_BUFFER
292 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
294 ;; FONT_PARSER routine
296 ;; -- to be called at every packet received to extract informations
297 ;; from Font File on byte basis.
299 ;; -- Interface though FTABLE
301 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
304 PUSH DS ;; save all registers Revised
312 ;; BP isn't used, so it isn't saved
316 LDS SI,FTP
.BUFFER_ADDR
;; DS:[SI]
317 MOV CX,FTP
.BUFFER_LEN
;; CX = length of packet
318 MOV DX,FTP
.NUM_FTBLK
;; DX = number of FTB
322 MOV cs:fp_error
,0020H ;; ERROR 0020H
326 AND AX,FLAG_RESTART
;;
330 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
332 PUSH BX ;; reset all the output fields
333 ADD BX,TYPE FBUFS
;; FTP = FONT BLOCK
336 MOV cs:ftag_count
,AX ;;
337 MOV cs:fptr_low
,AX ;;
338 MOV cs:fptr_high
,AX ;;
339 MOV cs:pre_font_len
,AX ;;
340 MOV cs:count_lo
,AX ;;
341 MOV cs:count_hi
,AX ;;
342 MOV cs:next_low
,AX ;;
343 MOV cs:next_high
,AX ;;
346 MOV cs:hit_flag
,AX ;;
347 MOV cs:pass_cnt
,AX ;;
348 MOV cs:pass_postx
,STAGE_MAX
;;
350 MOV cs:stage
,STAGE_MAX
;;
353 MOV FTP
.FTB_STATUS
,FSTAT_SEARCH
354 MOV FTP
.FTB_TYPE
,AX ;;
355 MOV FTP
.FTB_MOD
,AX ;;
356 MOV FTP
.FTB_FONTS
,AX ;;
357 MOV FTP
.FTB_ROWS
,AL ;;
358 MOV FTP
.FTB_COLS
,AL ;;
361 MOV FTP
.FTB_COUNT
,AX ;;
362 MOV FTP
.FTB_DLEFT
,AX ;;
363 MOV FTP
.FTB_DLEN
,AX ;;
364 MOV FTP
.FTB_DALO
,AX ;;
365 MOV FTP
.FTB_DAHI
,AX ;;
366 MOV FTP
.TARGET_LO
,AX ;;
367 MOV FTP
.TARGET_HI
,AX ;;
369 ADD BX, TYPE FTBLK
;;
376 NO_RESTART
: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
377 ;; any FTBLKs have their data all
378 ;; returned ? if so set their status
379 ;; from FOUND to COMPLETE
381 ADD BX,TYPE FBUFS
;; FTP = FONT BLOCK
386 MOV AX,FTP
.FTB_STATUS
;;
390 MOV AX,FTP
.FTB_DLEFT
;;
394 MOV FTP
.FTB_STATUS
,FSTAT_COMPLETE
405 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
406 ADD BX,TYPE FBUFS
;; FTP = FONT BLOCK
408 PUSH CX ;; STACK 1 = CX
409 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
411 ;; DO WHILE CX is not zero :
413 ;; -- on each loop, the CX, COUNTs are updated
415 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
421 ADD cs:count_lo
,AX ;;
423 ADD cs:count_hi
,1000H
;;
425 PUSH CX ;; STACK 1 = CX
430 FTB_CONT
: ;; ==========
436 JMP START_CASE
;; ** RESTART **
441 JMP SEARCH_CASE
;; ** SEARCH **
446 JMP MATCH_CASE
;; ** MATCH **
451 JMP SCAN_CASE
;; ** SCAN **
456 JMP PRE_FOUND_CASE
;; ** PRE-FOUND **
461 JMP FOUND_CASE
;; ** FOUND **
466 JMP GETFONT_CASE
;; ** GET_FONT **
471 JMP PASS
;; ** PASS **
476 JMP SEARCH_CASE
;; ** SEARCH **
481 JMP FPTR_SKIP_CASE
;; ** SEARCH **
484 MOV FTP
.FTB_STATUS
,STAT_DEVERR
485 JMP FTB_LPEND
;; ** DEVICE ERROR **
487 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
489 ;; at the entry of each STAGES /CASES
491 ;; -- DS:[SI] (FPKT) points to PACKET, of DOS's buffer
492 ;; -- CX remaining packet length
493 ;; -- ES:[BX] points to the first FTBLK
494 ;; -- COUNT_LO, COUNT_HI, upto but and including the address pointed by FPKT
497 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
499 ;============================================================================
500 START_CASE
: ;; pass the FILE leading bytes
502 MOV cs:ftag_count
,0 ;;
503 MOV cs:stage
,ftagx
;;
506 ;=============================================================================
507 FPTR_SKIP_CASE
: ;; skip until the ENTRY pointed by
508 ;; POINTER (in FPTR) is reached.
511 MOV AX,cs:fptr_low
;; * HIT = FPTR *
512 MOV cs:hit_lo
,AX ;; **************
513 MOV DX,cs:fptr_high
;;
517 JNE FPTR_SKIP_VALID
;;
519 JNE FPTR_SKIP_VALID
;;
521 MOV FTP
.FTB_STATUS
,STAT_BADATA
;; returned at the first FTBLK
522 JMP FPTR_SKIP_MORE
;;
525 ;; normalised HIT_HI, HIT_LO
539 ;; **************************
540 ;; * compare FPTR and COUNT *
541 ;; **************************
542 ;; DX:AX = HIT_HI:HIT_LO (normalised)
544 SUB AX,cs:count_lo
;;
550 SUB DX,cs:count_hi
;;
553 INC AX ;; COUNT can be at the HIT, then AX=0
554 JNC NO_CARRY11
;; INC AX to make AX comparable to CX
555 ADD DX,01000H ;; i.e. AX = offset + 1
559 JA fptr_skip_more
;; AX > CX, whole CX to be skipped
561 PUSH DX ;; normalise dx:ax
575 PUSH DX ;; STACK +1 : normalosed DX:AX
579 JC fptr_MORE_CXp
;; dx:ax < cx
583 JNE fptr_skip_MOREP
;;
585 JNE fptr_skip_MOREP
;;
589 ;; ************************************
590 ;; * POINTER is within the current CX *
591 ;; ************************************
596 fptr_MORE_CX
: ;; DX = 0,to have more CX than offset+1
597 DEC AX ;; = offset : 0 and above
599 ADD SI,AX ;; where the first byte is
601 MOV cs:stage
,entry_lox
;; ENTRIES in the font file
603 JMP FTB_LOOP
;; ****** RETURN *******
605 ;; ***********************************
606 ;; * more to skip ==> FPTR_SKIP_CASE *
607 ;; ***********************************
615 JMP FTB_LOOP
;; ****** RETURN *****
617 ;; ***********************************
618 ;; * bad POINTER in font file header *
619 ;; ***********************************
622 MOV cs:fptr_low
,0FFFFH ;;
623 MOV cs:fptr_high
,0FFFFH ;;
625 MOV FTP
.FTB_STATUS
,STAT_BADATA
;; returned at the first FTBLK
627 JMP FPTR_SKIP_MORE
;;
629 ;=============================================================================
631 ;; still looking for header to match
632 ;; the input : codepage and typeid
636 ADD DI,DI ;; double to index to WORD-offset
638 JMP CS:STAGE_CASES
[DI] ;; call routine to process the stage
641 ;===========================================================================
649 MOV AX,FTP
.FTB_STATUS
;;
650 CMP AX,FSTAT_SEARCH
;;
655 MOV AX,FTP
.FTB_CP
;; check the FTB with SEARCH status
656 CMP AX,cs:cpg_word
;;
658 PUSH DS ;; code page matched
664 MOV SI,OFFSET TYPE_ID
;;
665 LEA DI,[BX].FTB_TID
;;
674 ;; MATCH !!!!! (type_id matched)
675 MOV FTP
.FTB_STATUS
,FSTAT_MATCH
676 MOV AX,cs:type_word
;;
677 MOV FTP
.FTB_TYPE
,AX ;;
678 MOV AX,cs:font_low
;;
679 MOV FTP
.TARGET_LO
,AX ;;
680 MOV AX,cs:font_high
;;
681 MOV FTP
.TARGET_HI
,AX ;;
685 MATCH_MORE
: ;; if this is the last rounf ?
687 MOV AX,cs:next_low
;; NEXT = FFFF:FFFF means no more
688 CMP AX,-1 ;; header to come.
691 MOV AX,cs:next_high
;;
695 MOV FTP
.FTB_STATUS
,STAT_NOFIND
;; ERROR : no match
698 ADD BX,FTP
.FTB_LENGTH
;;
705 MOV cs:stage
,SCANX
;;
711 ;===========================================================================
713 ;; **********************************
714 ;; * determine whether it the font *
715 ;; * data(TARGET),or the next font *
716 ;; * header(NEXT) that is approaching
717 ;; **********************************
719 MOV AX,cs:next_low
;;
721 MOV AX,cs:next_high
;;
724 MOV cs:hit_flag
,AX ;;
726 MOV DI,cs:hit_hi
;; normalised HIT_HI, HIT_LO
745 MOV AX,FTP
.FTB_STATUS
;;
746 CMP AX,FSTAT_MATCH
;;
750 MOV DI,FTP
.TARGET_HI
;; NORMALISED TARGET
758 ADD AX,FTP
.TARGET_LO
;;
761 NO_CARRY1
: ;; DI:AX = NORMALISED TARGET
763 ;; ** compare the TARGET and the NEXT
775 ;; **********************************
776 ;; * the font data is approaching *
777 ;; **********************************
779 MOV cs:hit_flag
,-1 ;;
782 MOV cs:hit_bx
,BX ;; used for BAD_BX and in FOUND_CASE
785 ;; **********************************
786 ;; * the NEXT header is approaching *
787 ;; **********************************
789 MOV AX,cs:hit_flag
;;
792 MOV FTP
.FTB_STATUS
,STAT_BADATA
;; next header and font cannot be the
800 ADD BX,FTP
.FTB_LENGTH
;;
801 JMP SCAN_LOOP
;; ** is there any closer font data ?
803 ;; ************************************
804 ;; * the HIT is either font data(TARGET
805 ;; * or the font block (NEXT). *
806 ;; ************************************
809 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
810 MOV DX,cs:hit_hi
;; HIT_FLAG, HIT_LO, HIT_HI defined
817 JMP SCAN_MORE
;; stage remained as SCAN, discard data
820 ;; DX:AX = HIT_HI:HIT_LO (normalised)
821 SUB AX,cs:count_lo
;;
826 SUB DX,cs:count_hi
;;
829 INC AX ;; COUNT can be at the HIT, then AX=0
830 JNC NO_CARRYX
;; INC AX to make AX comparable to CX
831 ADD DX,01000H ;; i.e. AX = offset + 1
870 MORE_CX
: ;; DX = 0,to have more CX than offset+1
871 DEC AX ;; = offset : 0 and above
873 ADD SI,AX ;; where the first byte is
874 MOV AX,cs:hit_flag
;;
878 MOV cs:stage
,MOD_LOBX
;; font-data reached,
880 JMP FTB_LOOP
;; ****** RETURN *******
883 MOV cs:stage
,PASSX
;;
884 MOV cs:pass_postx
,next_lolX
;;
885 MOV cs:pass_cnt
,FILE_OFFSET
;;
888 JMP FTB_LOOP
;; ****** RETURN *******
890 ;; ***********************************
891 SCAN_MOREP
: ;; * scan more FTBLK for the nearest *
893 ;; ***********************************
900 JMP FTB_LOOP
;; more SCAN stage
902 SCAN_BAD: ;; *************************
903 MOV AX,cs:hit_flag
;; * scan is bad *
904 AND AX,AX ;; *************************
906 MOV AX,-1 ;; NEXT is pointing backwards
907 MOV cs:next_low
,AX ;;
908 MOV cs:next_high
,AX ;; no more NEXT
909 MOV FTP
.FTB_STATUS
,STAT_BADATA
;; returned at the first FTBLK
913 PUSH BX ;; FONT is pointing backwards
915 MOV FTP
.FTB_STATUS
,STAT_BADATA
919 ;===========================================================================
921 ;; extract informations from the font
922 ;; block until font_length is defined
926 ADD DI,DI ;; double to index to WORD-offset
928 JMP CS:STAGE_CASES
[DI] ;; call routine to process the stage
930 ;===========================================================================
932 MOV DI,OFFSET FTB_LOOP
;; as FOUND has two places to return to
934 ;===========================================================================
936 ;; define informations into FTBLK of
937 ;; HIT_BX defined in the SCAN case
941 MOV AX,cs:mod_word
;;
942 MOV FTP
.FTB_MOD
,AX ;;
943 MOV AX,cs:fonts_word
;;
944 MOV FTP
.FTB_FONTS
,AX ;;
946 MOV AX,cs:fdlen_word
;;
947 MOV FTP
.FTB_DLEFT
,AX ;;
948 MOV FTP
.FTB_DLEN
,0 ;;
949 MOV FTP
.FTB_DALO
,0 ;;
950 MOV FTP
.FTB_DAHI
,0 ;;
952 MOV FTP
.FTB_STATUS
,FSTAT_FOUND
954 CMP FTP
.FTB_TYPE
,TYPE_DISPLAY
;
955 JNE CHECK_PTR_TYPE
;;
956 CMP cs:pre_font_len
,PRE_FONT_D
;;
961 CMP FTP
.FTB_TYPE
,TYPE_PRINTER
;
963 CMP cs:ptr_sel_word
,0 ;;
964 JNE PRINTER_HAS_SEL
;;
965 CMP cs:pre_font_len
,PRE_FONT_P0
;;
970 CMP cs:pre_font_len
,PRE_FONT_P
;;
976 MOV FTP
.FTB_STATUS
,STAT_BADATA
;the FDLEN_WORD should be 0.
979 MOV AL,cs:disp_rows
;;
980 MOV FTP
.FTB_ROWS
,AL ;;
981 MOV AL,cs:disp_cols
;;
982 MOV FTP
.FTB_COLS
,AL ;;
987 MOV AX,cs:count_word
;;
988 MOV FTP
.FTB_COUNT
,AX ;;
993 MOV FTP
.FTB_STATUS
,STAT_BADATA
;the FDLEN_WORD should be 0.
996 MOV AX,cs:ptr_sel_word
;;
997 MOV FTP
.FTB_SELECT
,AX ;;
998 MOV AX,cs:ptr_len_word
;;
999 MOV FTP
.FTB_SELLEN
,AX ;;
1001 SET_STAGE
: ;; STAGE :
1002 MOV AX,cs:fdlen_word
;; if no font data to follow
1005 MOV cs:stage
,SCANX
;; then scan for next header or font
1008 GET_FDATA
: ;; update the moving target
1009 MOV cs:stage
,GET_FX
;;
1010 MOV AX,cs:pre_font_len
;;
1011 ADD FTP
.TARGET_LO
,AX ;;
1013 ADD FTP
.TARGET_HI
,01000H ;;
1019 ;===========================================================================
1020 GETFONT_CASE
: ;; as ES:[SI], at COUNT, there is font
1022 MOV DX,cs:num_ftb
;;
1025 MOV cs:hit_hi
,0 ;; temp. register
1026 MOV cs:hit_flag
,0 ;; assumed can be changed to SCAN stage
1028 MOV DI,cs:count_hi
;; normalised COUNT_HI,COUNT_LO
1036 ADD AX,cs:count_lo
;;
1040 MOV cs:count_lo
,AX ;;
1041 MOV cs:count_hi
,DI ;;
1045 MOV AX,FTP
.FTB_STATUS
;;
1046 CMP AX,FSTAT_FONT
;;
1049 CMP AX,FSTAT_FOUND
;;
1055 MOV AX,FTP
.FTB_DLEFT
;;
1058 MOV FTP
.FTB_STATUS
,FSTAT_FONT
;
1059 JMP GETFONT_CONT1
;;
1063 MOV AX,FTP
.FTB_DLEFT
;;
1065 JNZ GETFONT_CONT1
;;
1068 ;; only on FOUND and DLEFT <> 0
1070 MOV DI,FTP
.TARGET_HI
;; normalised TARGET
1078 ADD AX,FTP
.TARGET_LO
;;
1081 NO_CARRY5
: ;; DI:AX = TARGET (normalised)
1083 CMP DI,cs:count_hi
;;
1086 CMP AX,cs:count_lo
;;
1090 MOV FTP
.FTB_DALO
,SI ;; where the font data is in the packet
1091 MOV FTP
.FTB_DAHI
,DS ;;
1093 MOV AX,FTP
.FTB_DLEFT
;;
1097 MOV FTP
.FTB_DLEFT
,0 ;;
1098 MOV FTP
.FTB_DLEN
,AX ;;
1103 ADD FTP
.TARGET_LO
,AX ;;
1105 ADD FTP
.TARGET_HI
,01000H ;;
1109 MOV FTP
.FTB_STATUS
,STAT_BADATA
;; pointing backwards
1114 MOV FTP
.FTB_DLEFT
,AX ;;
1115 MOV FTP
.FTB_DLEN
,CX ;;
1117 ADD FTP
.TARGET_LO
,CX ;;
1119 ADD FTP
.TARGET_HI
,01000H ;;
1121 AND AX,AX ;; all data have been returned ?
1124 MOV cs:hit_flag
,-1 ;; no ! stay in the GET_FONT stage
1127 ADD BX,FTP
.FTB_LENGTH
;;
1138 CMP cs:hit_flag
,0 ;;
1140 MOV cs:stage
,SCANX
;; no more in the GET_FONT stage
1147 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1149 ;; STAGES -- "called by" SERACH_CASE
1151 ;; -- DS:[SI] (FPKT) points to PACKET, of DOS's buffer
1152 ;; -- CX remaining packet length
1153 ;; -- ES:[BX] points to the first FTBLK
1154 ;; -- COUNT_LO, COUNT_HI, upto but not including the address pointed by FPKT
1157 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1158 ;;+++++++++++++++++++++++++++++++++
1161 ; mov ax,ftag_len ;;
1162 cmp cs:ftag_count
,ftag_len
;;
1166 mov ftp
.ftb_status
,stat_deverr
1167 mov cs:fp_error
,00022H ;; ERROR 0022H
1169 FTAG_FAILED
: ;; discard all the bytes, while
1170 ADD SI,CX ;; stage stays as FTAGX
1172 JMP FTB_LOOP
;; **** RETURN (bytes discarded) ****
1179 MOV DI,cs:ftag_count
;;
1180 CMP AL,cs:ftag_pattern
[DI] ;;
1183 mov ftp
.ftb_status
,stat_badata
1184 MOV ax,ftag_len
;; stays in FTAGX to consume all bytes
1185 MOV cs:ftag_count
,ax ;; stays in FTAGX to consume all bytes
1186 JMP FTB_LOOP
;; **** RETURN (FAILED !) ****
1190 MOV cs:ftag_count
,DI ;;
1195 JMP FTB_LOOP
;; **** RETURN ( MORE TO COME) ****
1198 MOV cs:pass_cnt
,0 ;;
1199 MOV cs:stage
,PASSX
;;
1200 MOV cs:pass_postx
,fptr_lolx
;;
1202 JMP FTB_LOOP
;; **** NEXT STAGE ****
1204 ;;+++++++++++++++++++++++++++++++++
1205 fptrLOL
: ;; STAGE the low byte of the low fptr
1207 INC SI ;; byte by byte
1211 MOV cs:fptr_lol
,AL ;;
1212 MOV cs:stage
,fptr_lohX
;;
1217 MOV cs:fptr_low
,AX ;;
1218 MOV cs:stage
,fptr_HILX
;;
1220 ;;+++++++++++++++++++++++++++++++++
1221 fptrLOH
: ;; STAGE the high byte of the low fptr
1223 INC SI ;; byte by byte
1225 MOV cs:fptr_loh
,AL ;;
1226 MOV cs:stage
,fptr_HILX
;;
1228 ;;+++++++++++++++++++++++++++++++++
1229 fptrHIL
: ;; STAGE the low byte of the high fptr
1231 INC SI ;; byte by byte
1235 MOV cs:fptr_hil
,AL ;;
1236 MOV cs:stage
,fptr_hihX
;;
1241 MOV cs:fptr_high
,AX ;;
1242 MOV cs:stage
,FPTR_SKIPX
;;
1244 ;;+++++++++++++++++++++++++++++++++
1245 fptrHIH
: ;; STAGE the high byte of the high fptr
1247 INC SI ;; byte by byte
1249 MOV cs:fptr_hih
,AL ;;
1250 MOV cs:stage
,FPTR_SKIPX
;;
1252 ;;+++++++++++++++++++++++++++++++++
1253 ENTRYLO
: ;; STAGE - ENTRY LOW BYTE
1255 INC SI ;; byte by byte
1259 MOV cs:entry_lob
,AL ;;
1260 MOV cs:stage
,ENTRY_HIX
;;
1265 MOV cs:entry_word
,AX ;;
1266 MOV cs:stage
,PASSX
;; 2 bytes to be passed
1267 MOV cs:pass_postx
,NEXT_LOLX
;;
1269 ;;+++++++++++++++++++++++++++++++++
1270 ENTRYHI
: ;; stage - ENTRY HIGN BYTE
1272 INC SI ;; byte by byte
1274 MOV cs:entry_hib
,AL ;;
1275 MOV cs:stage
,PASSX
;; 2 bytes to be passed
1276 MOV cs:pass_postx
,NEXT_LOLX
;;
1291 MOV cs:stage
,NEXT_LOLX
;;
1293 ;;+++++++++++++++++++++++++++++++++
1294 NEXTLOL
: ;; STAGE the low byte of the low NEXT
1296 INC SI ;; byte by byte
1300 MOV cs:next_lol
,AL ;;
1301 MOV cs:stage
,NEXT_LOHX
;;
1306 MOV cs:next_low
,AX ;;
1307 MOV cs:stage
,next_hilX
;;
1309 ;;+++++++++++++++++++++++++++++++++
1310 NEXTLOH
: ;; STAGE the high byte of the low NEXT
1312 INC SI ;; byte by byte
1314 MOV cs:next_loh
,AL ;;
1315 MOV cs:stage
,next_hilX
;;
1317 ;;+++++++++++++++++++++++++++++++++
1318 NEXTHIL
: ;; STAGE the low byte of the high NEXT
1320 INC SI ;; byte by byte
1324 MOV cs:next_hil
,AL ;;
1325 MOV cs:stage
,NEXT_HIHX
;;
1330 MOV cs:next_high
,AX ;;
1331 MOV cs:stage
,type_lobX
;;
1333 ;;+++++++++++++++++++++++++++++++++
1334 NEXTHIH
: ;; STAGE the high byte of the high NEXT
1336 INC SI ;; byte by byte
1338 MOV cs:next_hih
,AL ;;
1339 MOV cs:stage
,type_lobX
;;
1341 ;;+++++++++++++++++++++++++++++++++
1342 TYPELO
: ;; STAGE the low byte of the TYPE
1344 INC SI ;; byte by byte
1348 MOV cs:type_lob
,AL ;;
1349 MOV cs:stage
,type_hibX
;;
1354 MOV cs:type_word
,AX ;;
1355 MOV cs:stage
,type_idX
;;
1358 ;;+++++++++++++++++++++++++++++++++
1359 TYPEHI
: ;; STAGE the high byte of the TYPE
1361 INC SI ;; byte by byte
1363 MOV cs:type_hib
,AL ;;
1364 MOV cs:stage
,TYPE_IDX
;;
1367 ;;+++++++++++++++++++++++++++++++++
1368 TYPEIDS
: ;; STAGE the type id
1371 MOV FTP
.FTB_STATUS
,STAT_DEVERR
1372 MOV cs:fp_error
,00021H ;; ERROR 0021H
1379 SUB AX,cs:tid_cnt
;;
1382 ;; all data in FPKT are stored
1387 MOV DI,OFFSET TYPE_ID
;;
1388 ADD DI,cs:tid_cnt
;;
1389 ADD cs:tid_cnt
,CX ;;
1390 REP MOVSB ;; SI is incremented accordingly
1393 MOV CX,0 ;; STAGE remained
1402 MOV DI,OFFSET TYPE_ID
;;
1403 ADD DI,cs:tid_cnt
;;
1405 REP MOVSB ;; SI is incremented accordingly
1408 ADD cs:tid_cnt
,AX ;;
1412 MOV cs:stage
,CPG_LOBX
;;
1414 ;;+++++++++++++++++++++++++++++++++
1415 CPGLO
: ;; STAGE the low byte of the CODE PAGE
1417 INC SI ;; byte by byte
1421 MOV cs:cpg_lob
,AL ;;
1422 MOV cs:stage
,CPG_HIBX
;;
1427 MOV cs:cpg_word
,AX ;;
1428 MOV cs:stage
,PASSX
;;
1429 MOV cs:pass_postx
,font_lolX
;;
1431 ;;+++++++++++++++++++++++++++++++++
1432 CPGHI
: ;; STAGE the high byte of the CODE PAGE
1434 INC SI ;; byte by byte
1436 MOV cs:cpg_hib
,AL ;;
1437 MOV cs:stage
,PASSX
;;
1438 MOV cs:pass_postx
,font_lolX
;;
1440 ;;+++++++++++++++++++++++++++++++++
1441 FONTLOL
: ;; STAGE the low byte of the low FONT
1443 INC SI ;; byte by byte
1447 MOV cs:font_lol
,AL ;;
1448 MOV cs:stage
,FONT_LOHX
;;
1453 MOV cs:font_low
,AX ;;
1454 MOV cs:stage
,FONT_HILX
;;
1456 ;;+++++++++++++++++++++++++++++++++
1457 FONTLOH
: ;; STAGE the high byte of the low FONT
1459 INC SI ;; byte by byte
1461 MOV cs:font_loh
,AL ;;
1462 MOV cs:stage
,FONT_HILX
;;
1464 ;;+++++++++++++++++++++++++++++++++
1465 FONTHIL
: ;; STAGE the low byte of the high FONT
1467 INC SI ;; byte by byte
1471 MOV cs:font_hil
,AL ;;
1472 MOV cs:stage
,FONT_HIHX
;;
1477 MOV cs:font_high
,AX ;;
1478 ;;;;;; MOV cs:stage,MOD_LOBX ;; end of SCAN
1479 ;; anymore headers to be processed ?
1480 MOV cs:stage
,MATCHX
;;
1481 MOV AX,cs:entry_word
;;
1483 MOV cs:entry_word
,AX ;;
1486 ;; no more header to be processed !
1488 MOV cs:next_low
,AX ;;
1489 MOV cs:next_high
,AX ;; as ENTRY has been consumed
1493 MOV AX,cs:next_low
;;
1496 MOV AX,cs:next_high
;;
1499 ;; no more header to be processed !
1501 MOV cs:next_low
,AX ;; as NEXT is nil
1502 MOV cs:next_high
,AX ;;
1506 ;;+++++++++++++++++++++++++++++++++
1507 FONTHIH
: ;; STAGE the high byte of the high FONT
1509 INC SI ;; byte by byte
1511 MOV cs:font_hih
,AL ;;
1512 ;;;;; MOV cs:stage,MOD_LOBX ;; end of SCAN
1514 MOV cs:stage
,MATCHX
;;
1515 ;; anymore headers to be processed ?
1516 MOV AX,cs:entry_word
;;
1518 MOV cs:entry_word
,AX ;;
1521 ;; no more header to be processed !
1523 MOV cs:next_low
,AX ;;
1524 MOV cs:next_high
,AX ;; as ENTRY has been consumed
1528 MOV AX,cs:next_low
;;
1531 MOV AX,cs:next_high
;;
1534 ;; no more header to be processed !
1536 MOV cs:next_low
,AX ;; as NEXT is nil
1537 MOV cs:next_high
,AX ;;
1542 ;;+++++++++++++++++++++++++++++++++
1543 MODLO
: ;; STAGE the low byte of the MODIFIER
1545 INC SI ;; byte by byte
1550 MOV cs:stage
,MOD_HIBX
;;
1555 MOV cs:mod_word
,AX ;;
1556 MOV cs:stage
,fonts_lobX
;;
1558 ;;+++++++++++++++++++++++++++++++++
1559 MODHI
: ;; STAGE the high byte of the MODIFIER
1561 INC SI ;; byte by byte
1563 MOV cs:mod_hib
,AL ;;
1564 MOV cs:stage
,FONTS_LOBX
;;
1566 ;;+++++++++++++++++++++++++++++++++
1567 FONTSLO
: ;; STAGE the low byte of the FONTS
1569 INC SI ;; byte by byte
1573 MOV cs:fonts_lob
,AL ;;
1574 MOV cs:stage
,FONTS_HIBX
;;
1579 MOV cs:fonts_word
,AX ;;
1580 MOV cs:stage
,FDLEN_LOBX
;;
1582 ;;+++++++++++++++++++++++++++++++++
1583 FONTSHI
: ;; STAGE the high byte of the FONTS
1585 INC SI ;; byte by byte
1587 MOV cs:fonts_hib
,AL ;;
1588 MOV cs:stage
,FDLEN_LOBX
;;
1590 ;;+++++++++++++++++++++++++++++++++
1591 FDLENLO
: ;; the low byte of the FONT-LENGTH
1593 INC SI ;; byte by byte
1597 MOV cs:fdlen_lob
,AL ;;
1598 MOV cs:stage
,FDLEN_HIBX
;;
1603 MOV cs:pre_font_len
,PRE_FONT_ND
;;
1604 MOV cs:fdlen_word
,AX ;;
1607 CMP cs:type_word
,TYPE_DISPLAY
;;
1609 CMP cs:type_word
,TYPE_PRINTER
;;
1613 MOV cs:stage
,FOUNDX
;; FSTAT is to be changed
1616 MOV cs:stage
,DISP_ROWSX
;;
1619 MOV cs:stage
,PTRSELLOX
;;
1622 ;;+++++++++++++++++++++++++++++++++
1623 FDLENHI
: ;; STAGE the high byte of the F-LENGTH
1624 MOV cs:pre_font_len
,PRE_FONT_ND
1626 INC SI ;; byte by byte
1628 MOV cs:fdlen_hib
,AL ;;
1629 MOV AX,cs:fdlen_word
;;
1632 CMP cs:type_word
,TYPE_DISPLAY
;;
1634 CMP cs:type_word
,TYPE_PRINTER
;;
1637 MOV cs:stage
,FOUNDX
;; FSTAT is to be changed
1640 MOV cs:stage
,DISP_ROWSX
;;
1643 MOV cs:stage
,PTRSELLOX
;;
1646 ;;+++++++++++++++++++++++++++++++++
1647 DSPROWS
: ;; STAGE : get the rows
1649 MOV cs:disp_rows
,AL ;;
1650 MOV cs:disp_cols
,AL ;;
1653 MOV cs:count_word
,AX ;;
1655 INC cs:pre_font_len
;;
1659 MOV cs:disp_rows
,AL ;;
1660 MOV AX,cs:fdlen_word
;;
1662 MOV cs:fdlen_word
,AX ;;
1664 MOV cs:stage
,disp_colsX
;;
1667 MOV cs:stage
,FOUNDX
;; FSTAT is to be changed
1669 ;;+++++++++++++++++++++++++++++++++
1670 DSPCOLS
: ;; STAGE : get the COLS
1671 INC cs:pre_font_len
;;
1675 MOV cs:disp_cols
,AL ;;
1676 MOV AX,cs:fdlen_word
;;
1678 MOV cs:fdlen_word
,AX ;;
1680 MOV cs:stage
,DISP_XX
;;
1682 ;;+++++++++++++++++++++++++++++++++
1683 DSPX
: ;; STAGE : get the aspect X
1684 INC cs:pre_font_len
;;
1689 MOV AX,cs:fdlen_word
;;
1691 MOV cs:fdlen_word
,AX ;;
1693 MOV cs:stage
,DISP_YX
;;
1695 ;;+++++++++++++++++++++++++++++++++
1696 DSPY
: ;; STAGE : get the aspect Y
1697 INC cs:pre_font_len
;;
1702 MOV AX,cs:fdlen_word
;;
1704 MOV cs:fdlen_word
,AX ;;
1706 MOV cs:stage
,COUNT_LOBX
;;
1709 ;;+++++++++++++++++++++++++++++++++
1710 DSPCOUNTLO
: ;; the low byte of the FONT-LENGTH
1711 INC cs:pre_font_len
;;
1713 INC SI ;; byte by byte
1715 PUSH AX ;; check if length is enough
1716 MOV AX,cs:fdlen_word
;;
1718 MOV cs:fdlen_word
,AX ;;
1721 JMP NO_DISP_FONT3
;;
1725 MOV cs:count_lob
,AL ;;
1726 MOV cs:stage
,COUNT_HIBX
;;
1729 INC cs:pre_font_len
;;
1732 MOV cs:count_word
,AX ;;
1733 ; MOV cs:pre_font_len,PRE_FONT_D;
1735 MOV AX,cs:fdlen_word
;;
1737 MOV cs:fdlen_word
,AX ;;
1738 MOV cs:stage
,FOUNDX
;; FSTAT is to be changed
1741 ;;+++++++++++++++++++++++++++++++++
1742 DSPCOUNTHI
: ;; STAGE the high byte of the F-LENGTH
1743 INC cs:pre_font_len
;;
1745 INC SI ;; byte by byte
1747 MOV cs:count_hib
,AL ;;
1748 ; MOV cs:pre_font_len,PRE_FONT_D;
1750 MOV AX,cs:fdlen_word
;;
1752 MOV cs:fdlen_word
,AX ;;
1753 MOV cs:stage
,FOUNDX
;; FSTAT is to be changed
1757 ;;+++++++++++++++++++++++++++++++++
1758 PTRSELLO
: ;; the low byte of the SELECTION_TYPE
1759 INC cs:pre_font_len
;;
1761 INC SI ;; byte by byte
1763 PUSH AX ;; check if length is enough
1764 MOV AX,cs:fdlen_word
;;
1766 MOV cs:fdlen_word
,AX ;;
1773 MOV cs:ptr_selob
,AL ;;
1774 MOV cs:stage
,PTRSELHIX
;;
1777 INC cs:pre_font_len
;;
1780 MOV cs:ptr_sel_word
,AX ;;
1782 MOV AX,cs:fdlen_word
;;
1784 MOV cs:fdlen_word
,AX ;;
1786 CMP cs:ptr_sel_word
,0 ;;
1790 MOV cs:stage
,FOUNDX
;; FSTAT is to be changed
1794 MOV cs:stage
,PTRLENLOX
;;
1797 ;;+++++++++++++++++++++++++++++++++
1798 PTRSELHI: ;; STAGE the high byte of SELECT_TYPE
1799 INC cs:pre_font_len
;;
1801 INC SI ;; byte by byte
1803 MOV cs:ptr_sehib
,AL ;;
1805 MOV AX,cs:fdlen_word
;;
1807 MOV cs:fdlen_word
,AX ;;
1809 CMP cs:ptr_sel_word
,0 ;;
1813 MOV cs:stage
,FOUNDX
;; FSTAT is to be changed
1817 ;;+++++++++++++++++++++++++++++++++
1818 PTRLENLO
: ;; the low byte of SELECTION_LENGTH
1819 INC cs:pre_font_len
;;
1821 INC SI ;; byte by byte
1823 PUSH AX ;; check if length is enough
1824 MOV AX,cs:fdlen_word
;;
1826 MOV cs:fdlen_word
,AX ;;
1833 MOV cs:ptr_lnlob
,AL ;;
1834 MOV cs:stage
,PTRLENHIX
;;
1837 INC cs:pre_font_len
;;
1840 MOV cs:ptr_len_word
,AX ;;
1842 MOV AX,cs:fdlen_word
;;
1844 MOV cs:fdlen_word
,AX ;;
1845 MOV cs:stage
,FOUNDX
;; FSTAT is to be changed
1848 ;;+++++++++++++++++++++++++++++++++
1849 PTRLENHI
: ;; STAGE the high byte of SELECT_LENGTH
1850 INC cs:pre_font_len
;;
1852 INC SI ;; byte by byte
1854 MOV cs:ptr_lnhib
,AL ;;
1856 MOV AX,cs:fdlen_word
;;
1858 MOV cs:fdlen_word
,AX ;;
1859 MOV cs:stage
,FOUNDX
;; FSTAT is to be changed
1863 MOV cs:stage
,FOUNDX
;; FSTAT is to be changed
1865 ;;+++++++++++++++++++++++++++++++++
1866 PASS
: ;; STAGE - PASS DUMMY BYTES
1874 MOV DI,OFFSET PASS_BRK
;;
1876 MOV AX,cs:pass_cnt
;;
1878 NEXT_BRK: ;; find the next pass-break
1889 UPTO_BRK
: ;; next break point found
1891 SUB DX,AX ;; bytes to be skipped
1892 CMP CX,DX ;; all to be skipped ?
1895 ADD cs:pass_cnt
,CX ;;
1901 ADD cs:pass_cnt
,DX ;;
1905 MOV AX,cs:pass_postx
;;
1908 ; cmp ax,passx ;; is the next stage a pass-stage ?
1910 ; mov ax,pass_postxx ;;
1911 ; mov pass_postx,ax ;;
1912 ; mov pass_postxx,stage_max ;; can support only 2 consecutive pass
1918 PASS_ERR
: ;; DEVICE ERROR, wrong stage
1922 MOV FTP
.FTB_STATUS
,STAT_DEVERR
1923 SUB CX,CX ;; ignore all the input string
1933 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1937 CMP cs:stage
,FOUNDX
;;
1947 POP SI ;; restore registers
1959 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;