Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-1


					PAGE	,132			;
				
					TITLE	CODE TO BE MADE RESIDENT BY MODE
				
				.LIST
				;.SALL
				
				;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  P R O L O G  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»	
							   ;AN000;
				;Ί											  Ί	
							   ;AN000;
																
							   ;AN000;
				;  AC000 - P2852: Infinite retry check at beginning of INT 14 handler was using
				;		  wrong bit pattern.
				
				;  AC001 - P5148: retry_flag was addressing the wrong segment
				
				;Ί											  Ί	
							   ;AN000;
				;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  P R O L O G  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ	
							   ;AN000;
																
							   ;AN000;
				
				;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  M A C R O S  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
				;Ί											  Ί
				
				DISPLAY MACRO	MSG
					MOV	DX,OFFSET MSG
					CALL	PRINTF
					ENDM
				
				GET_INT_VECT MACRO INT_NO		;Input: "INT_NO" - the interrupt to be gotten
					PUSH	AX
					MOV	AL,INT_NO		;
					MOV	AH,35H			;FUNCTION CALL "GET VECTOR"
					INT	21H			;Output: ES:BX = the address in the vector
					POP	AX
					ENDM
				
				SET	MACRO	REG,VALUE		;SET REG TO VALUE. DON'T SPECIFY AX FOR REG
				
					PUSH	AX
					MOV	AX,VALUE
					MOV	REG,AX
					POP	AX
				
				ENDM
				
				SET_INT_VECT MACRO INT_NO		;Input: "INT_NO" - the interrupt to be set
					PUSH	AX			;	DS:DX = CS:IP value to set the interrupt to
					MOV	AL,INT_NO		;Output: the vector "INT_NO" contains DS:DX
					MOV	AH,25H			;function call "SET VECTOR"
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-2


					INT	21H
					POP	AX
					ENDM
				
				store_vector MACRO dword_holder 	;Input: "dword_holder" - where to store it
									;	ES:BX - the address (vector) to be stored
				   MOV	WORD PTR dword_holder,BX	;Output: "dword_holder"=the value passed in ES:BX
				   MOV	WORD PTR dword_holder[2],ES
				
				ENDM
				
				;Ί											  Ί
				;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  M A C R O S  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
				
				
				;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  E Q U A T E S  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
				;Ί											    Ί
				
 = 00A0				ADJUSTMENT EQU	(entpt - move_destination)	;# of bytes the resident code is moved
 = 000A				adjustment_in_paragraphs  EQU  (adjustment / 10H)	;# paragraphs the code moved
 = 0003				COM_status	EQU	03		  ;BIOS input for com status request	;AN001;
 = 0001				E		EQU	1		  ;value of "res_com_retry_type" for E retry requested	 ;AN
				001;
 = 0000				false		EQU	0
 = 0800				framing_error	EQU	0000100000000000B ;bit returned in AX from com status			 ;AN
				001;
 = 2000				holding_empty	EQU	0010000000000000B ;bit returned in AX from com status			 ;AN
				001;
 = 0014				INT14		EQU	014H
 = 0017				INT17		EQU	017H
 = 0002				LPT_status	EQU	02		  ;value of AH for printer status checks		
							   ;AN000;
 = 0080				not_busy	EQU	80H		  ;just the not busy bit on
 = 0200				overrun_error	EQU	0000001000000000B ;bit returned in AX from com status			 ;AN
				001;
 = 0400				parity_error	EQU	0000010000000000B ;bit returned in AX from com status			 ;AN
				001;
 = 00F9				P14_model_byte	EQU	0F9H		  ;P14's have a F9 at F000:FFFE
 = 0003				R		EQU	3		  ;value of "res_com_retry_type" for R retry requested	 ;AN
				001;
 = 4000				shift_empty	EQU	0100000000000000B ;bit returned in AX from com status			 ;AN
				001;
 = 8000				time_out	EQU	1000000000000000B ;time out bit returned in AX from com status		 ;AN
				001;
 = 0009				TO_SCREEN	EQU	9		  ;REQUEST OUTPUT TO SCREEN
 = 00FF				TRUE		EQU	0FFH
 = 0000				USER_ABORT	EQU	00H
				
				;Ί											    Ί
				;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  E Q U A T E S  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
				
				
				;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  S T R U C T U R E S  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
				;Ί											  Ί
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-3


				
				
				;Ί											  Ί
				;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  S T R U C T U R E S  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
				
				
 0000				ROM	SEGMENT AT 0F000H
 E739					ORG	0E739H
 E739				RS232	LABEL	FAR
 EFD2					ORG	0EFD2H
 EFD2				PRINTER_IO LABEL FAR
				;NOTE: THE VALUES REPRESENTED BY THIS SEGMENT ARE NOT NECESSARILY
				; THE ONES USED BY THE SUBSEQUENT PROCEDURES.  THESE HERE MERELY
				; SERVE AS SAMPLES.  THE ACTUAL VALUES IN THE INSTRUCTIONS:
				;	JMP	RS232
				;	JMP	PRINTER_IO
				; WILL BE MOVED INTO THESE INSTRUCTIONS FROM THE VECTOR TABLE USING
				; THE THEN CURRENT VALUES OF INT 14H FOR RS232 AND OF INT 17H FOR
				; THE PRINTER_IO JUMP TARGETS.	THIS IS TO ALLOW FOR SOME USER
				; TO HAVE INTERCEPTED THESE VECTORS AND DIRECTED THEIR REQUESTS TO
				; HIMSELF INSTEAD OF TO THE ROM.
				
 FFFE					ORG	0FFFEH
				;model_byte	 LABEL	 BYTE
 FFFE				ROM	ENDS
				
 0000				VECT	SEGMENT AT 0
 0050					ORG	50H
 0050				VECT14H LABEL	DWORD			;RS232 CALL
 005C					ORG	5CH
 005C				VECT17H LABEL	DWORD			;PRINTER I/O CALL
 0471					ORG	471H
 0471				BREAK_FLAG LABEL BYTE			;BREAK FLAG
 = 0080				BREAK_BIT EQU	80H			;ON=BREAK
 0530					ORG	530H
 0530				RESSEG	LABEL	DWORD			;VECTOR OF MODETO, INIT TO ZERO
 0530				VECT	ENDS
				
				
				;****************************************************************
 0000				PRINTF_CODE SEGMENT PUBLIC
					ASSUME	CS:PRINTF_CODE,DS:PRINTF_CODE
				
				
				;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  E X T R N S	ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
				;Ί											  Ί
				
				EXTRN	 device_type:BYTE	 ;see parse.asm
				EXTRN	 COMX:ABS		 ;see parse.asm
				EXTRN	 LPTX:ABS		 ;see parse.asm
				EXTRN	MAIN:NEAR
				EXTRN	MOVED_MSG:WORD	    ;CR,LF,"Resident portion of MODE loaded",CR,LF,"$"
				EXTRN	busy_status:ABS      ;value of lpt1_retry_type[BX] when user wants actual status, see modepr
				in
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-4


				EXTRN	PRINTF:NEAR		;interface to message retriever, see display.asm
				EXTRN	 reroute_requested:BYTE    ;see parse.asm
				EXTRN	 retry_requested:BYTE	 ;see parse.asm
				
				;Ί											  Ί
				;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  E X T R N S	ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
				
				
				
				;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  P U B L I C S  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
				;Ί											  Ί
				
				PUBLIC	 first_char_in_command_line	     ;location of the command line parameters
				PUBLIC	FIXUP
				PUBLIC	 lpt1_retry_type	 ;filled in and used to get at other two lpt retry masks in modeprin
				PUBLIC	rescode_length		;REFERENCED IN MAIN PROCEDURE
				PUBLIC	MODETO
				PUBLIC	move_destination	;location of the resident code after it has been moved
				PUBLIC	NEW_PTSFLAG		;RESIDENT THE FLAG WILL BE ACCESSABLE TO
				PUBLIC	NEW_SCRNTABL		;MODESCRN NEEDS TO KNOW WHERE IT WENT
				PUBLIC	OFFPTS			;USED IN MODEECHO TO ADDRESS MODEPTS
				PUBLIC	OFFRETRY
				PUBLIC	 ptsflag1		 ;make available to display_printer_reroute_status
				PUBLIC	P14_model_byte
				PUBLIC	res_com_retry_type
				;PUBLIC  res_lpt_retry_type
				PUBLIC	 resflag2		 ;make available to display_printer_reroute_status
				PUBLIC	RES_MODEFLAG		; RESIDENT THE FLAG WILL BE ACCESSABLE
				PUBLIC	RESSEG			;SCRNTABL NEEDS TO FOLLOW THIS VECTOR TO ADDRESS VIDEO PARMS
				PUBLIC	SCRNTABL
				PUBLIC	submodel_byte		 ;holder for machine's secondary model byte
				PUBLIC	VECTOR14
				PUBLIC	VECTOR17
				
				;Ί											  Ί
				;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  P U B L I C S  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
				
 002C					ORG	2CH
 002C  0000			environ_seg    DW    ?			  ;segment address of the environment, used as the block of 
				memory to free so	   ;AN000;
									  ;environment is not part of resident code.
				
 0060					ORG	60H			  ;first usable byte of PSP. If you change this check the
									  ;calculation of paragraphs in 'main'
				
 0060				move_destination   LABEL   WORD    ;where the resident will be moved to
				
				;    THIS STRUCTURE DEFINES THE PROGRAM SEGMENT PREFIX AREA
				;     POINTED TO BY THE ES REGISTER.  THIS MUST BE DEFINED HERE, IT REPLACES THE
				;     'ORG 100'
				
 0080					ORG	80H
 0080  00			command_line_length  DB    ?			;not used, just place holder to allign next field
 0081				first_char_in_command_line  LABEL   BYTE		;location of the command line parameters
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-5


				;command_line		     DB      7FH DUP(?) 	 ;PARM AREA
				
 0100					ORG	100H
 0100  E9 0000 E		ENTPT:	JMP	MAIN			;ENTRY POINT, START AT THE MAIN PROCEDURE
					SUBTTL	SERIAL RETRY
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-6
SERIAL RETRY                                                

					PAGE
				;THIS PROC WILL BE POINTED TO BY INT VECTOR 14H
				
				
 0103				MODETO	PROC	NEAR
				
				
				
				
 0103  51			PUSH  CX
 0104  8A CA			MOV   CL,DL		   ;CL=DL=0,1,2 or 3
 0106  D0 E1			SHL   CL,1		   ;CL= 0, 2, 4 or 6 for COM 1,2,3 or 4 respectively			
							   ;AC000;
 0108  32 ED			XOR   CH,CH		   ;CH=0 ready for ANDing in the mask					
							   ;AC000;
 010A  80 CD 03			OR    CH,00000011B	   ;CH=00000011, mask for any type of retry, to be shifted into proper posit
				ion 		   ;AC000;
 010D  D2 E5			SHL   CH,CL		   ;CH=00000011, 00001100, 00110000 or 11000000 for COM 1,2,3 or 4 respectiv
				ely
 010F  2E: 22 2E 017D R		AND   CH,BYTE PTR CS:res_modeflag	  ;see if any bit is on for this COM port ;AC001;
 0114  2E: 89 0E 0270 R		MOV   CS:retry_type,CX	   ;AC001; save for check after call to old INT 14		 ;AN001;
 0119  59			POP   CX
 011A  75 05			JNZ   pushax
				
				
				
				
				
 011C				VECTOR14 LABEL	WORD			;THE NEXT JMP INSTRUCTION HAS 5 BYTES,
				;		    THE LAST 4 ARE THE CONTENTS OF INT 14H,
				;		    WHICH NORMALLY POINTS TO THE ROM RS232
				;		    HANDLER.  THE CODE GENERATED HERE BY THE
				;		    ASSEMBLER IS REPLACED BY THE ACTUAL
				;		    CONTENTS OF INT 14H.
				
 011C				TOROM:
 011C  EA E739 ---- R			JMP	RS232			;NO RETRY, GO DIRECTLY TO ROM ENTRY IRET from there
 0121				PUSHAX:
 0121  2E: 88 26 026F R			MOV	CS:request,AH		;save request type
 0126  50				PUSH	AX			;SAVE ENTRY PARAMETERS FOR LATER RETRY
 0127  1E				PUSH	DS			;SAVE REGS
 0128  50				PUSH	AX			;SAVE REGS
 0129  2B C0				SUB	AX,AX			;POINT TO
 012B  8E D8				MOV	DS,AX			; PAGE ZERO
 012D  80 26 0471 R 7F			AND	DS:BREAK_FLAG,0FFH-BREAK_BIT ;RESET BREAK FLAG
 0132  58				POP	AX			;RESTORE
 0133  1F				POP	DS			; REGS
 0134  9C				PUSHF				;SAVE FLAGS TO SIMULATE INT INSTRUCTION
				
 = 011D				VEC	EQU	(VECTOR14 +1)  ;OFFSET TO IMMEDIATE FIELD OF PREVIOUSLY SET
				;				FAR JMP INSTRUCTION, FILLED WITH THE
				;				ORIGINAL CONTENTS OF THE INTERRUPT VECTOR
 0135  2E: FF 1E 011D R			CALL	DWORD PTR CS:VEC       ;CALL PREVIOUS RS232 HANDLER
					.IF <CS:request EQ COM_status> THEN		;IF a status request THEN		
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-7
SERIAL RETRY                                                

					      ;AN001;
 013A  2E: 80 3E 026F R 03   3						cmp CS:request,COM_status 
 0140  75 1E                 6						jne $l2 
 0142  51				   PUSH    CX			  ;need CX for shift count in CL			
					      ;AN001;
 0143  2E: 8B 0E 0270 R			   MOV	   CX,CS:retry_type	  ;AC001; get back retry type for this port		
						     ;AN001;
 0148  D2 ED				   SHR	   CH,CL		  ;put back in first two bits for retry type check below
					      ;AN001;
					   .IF <CH EQ E> THEN									
					      ;AN001;
 014A  80 FD 01              3						cmp CH,E 
 014D  75 06                 6						jne $l5 
 014F  B8 8E00				      MOV  AX,time_out+framing_error+parity_error+overrun_error     ;indicate the port is on
				 fire     ;AN001;
					   .ELSEIF <CH EQ R> THEN								
					      ;AN001;
 0152  EB 09                 3						jmp short $l4 
 0154  90                    3						nop 
 0155                        2	$l5: 
 0155  80 FD 03              3						cmp CH,R 
 0158  75 03                 6						jne $l4 
 015A  B8 6030				      MOV  AX,shift_empty+holding_empty+clear_to_send+data_set_ready  ;indicate the port is 
				ready     ;AN001;
					   .ENDIF					;otherwise assume B retry and pass actual st
				atus      ;AN001;
 015D                        2	$l4: 
 015D  59				   POP	   CX			  ;restore reg						
					      ;AN001;
					.ELSE				  ;continue as if a send request			
					      ;AN001;
 015E  EB 12                 3						jmp short $l1 
 0160                        2	$l2: 
 0160  50				   PUSH    AX			   ;SAVE REGS
 0161  1E				   PUSH    DS			   ; REGS
 0162  2B C0				   SUB	   AX,AX		   ;POINT TO
 0164  8E D8				   MOV	   DS,AX		   ; PAGE ZERO
 0166  F6 06 0471 R 80			   TEST    DS:BREAK_FLAG,BREAK_BIT ;TEST BREAK FLAG
 016B  1F				   POP	   DS			   ;RESTORE
 016C  58				   POP	   AX			   ; REGS
 016D  74 06				   JZ	   TESTER		   ;BRANCH IF NO BREAK
 016F  80 CC 80				   OR	   AH,80H		   ;SIMULATE TIMEOUT ERROR ON BREAK
					.ENDIF				   ;ENDIF status request				
					      ;AN001;
 0172                        2	$l1: 
 0172				FLUSH:
 0172  44				INC	SP			;FLUSH THE
 0173  44				INC	SP			; STACK
 0174  CF				IRET				;RETURN
				;
 0175				TESTER:
 0175  F6 C4 80				TEST	AH,80H			;TEST IF A REAL TIMEOUT
 0178  74 F8				JZ	FLUSH			;IF NOT, RETURN
 017A  58				POP	AX			;RETRIEVE ORIGINAL ENTRY PARAMETERS
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-8
SERIAL RETRY                                                

 017B  EB A4				JMP	PUSHAX			;DO RETRY
				;**********************************************************************
 = 017D				RES_MODEFLAG EQU $			;WHEN THIS CODE IS RESIDENT THE FLAG WILL BE
									; ACCESSABLE BY MODECOM AS AN OFFSET FROM ADDRESS
									; POINTED TO BY VECT14H AND RESSEG
 = 017D				res_com_retry_type equ $
				
 017D  00				    DB	  0			;AN665;no retry of any type active for any port
				;
				;	    bits comx		00=>no retry for any port
				;	    ---- ----		01=>E for COM1, no retry for 2, 3 and 4
				;	    0-1  com1		02=>B for COM1, no retry for 2, 3 and 4
				;	    2-3  com2		03=>R for COM1, no retry for 2, 3 and 4
				;	    4-5  com3		04=>E for COM2, no retry for 1, 3 and 4
				;	    6-7  com4		05=>E for COM2, E for COM1, none for 3 and 4
				;				06=>E for COM2, B for COM1, none for 3 and 4
				;	    bit 		07=>E for COM2, R for COM1, none for 3 and 4
				;	   pair 		08=>B for COM2, none for 1, 3 and 4
				;	  value  active 	09=>B for COM2, E for COM1, none for 3 and 4
				;	  -----  ------ 	0A=>B for COM2, B for COM1, none for 3 and 4
				;	      0  unknown	0B=>B for COM2, R for COM1, none for 3 and 4
				;	      1  E		0C=>R for COM2, no retry for 1, 3 and 4
				;	      2  B		0D=>R for COM2, E for COM1, none for 3 and 4
				;	      3  R		0E=>R for COM2, B for COM1, none for 3 and 4
				;				0F=>R for COM2, R for COM1, none for 3 and 4
				;				10=>E for COM3, none for 1, 2 and 4
				;					  etc.
 017E				MODETO	ENDP
				;**************************************************************
					SUBTTL	DETERMINE PARALLEL TO SERIAL, OR PARALLEL TIMEOUT
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-9
DETERMINE PARALLEL TO SERIAL, OR PARALLEL TIMEOUT           

					PAGE
				;THIS PROC MAY BE POINTED TO BY INT VECTOR 17H
 017E				MODEPTS PROC	NEAR
 = 007B				OFFPTS	EQU	MODEPTS - MODETO
 017E  F6 C2 01				TEST	DL,1			;DETERMINE IF REDIRECTION APPLIES
				;		NOTE: THIS IMMEDIATE FIELD IS Revised BY MODE
				;
				;THIS NEXT JUMP INSTRUCTION IS Revised BY MODEECHO TO REFLECT WHICH
				;LPTN IS TO BE REDIRECTED TO WHICH COMM.
 0181  75 61				JNZ	CK			;THIS JNZ IS Revised BY MODE
				;
 0181					ORG	$-2
 0181  74 61				JZ	CK			;IT MAY BE CHANGED TO THIS
				;
 0181					ORG	$-2
 0181  EB 00				JMP	SHORT NOREDIRECT	;  OR THIS...
				;
 0183				NOREDIRECT:
 = 0183				OFFRETRY EQU	$		;disp into resident code of retry flgs
				;THIS NEXT SECTION WILL TEST FOR THE OPTIONAL RETRY ON PARALLEL TIMEOUT.
 0183  F6 C2 01				TEST	DL,1			;TEST TO SEE IF PARALLEL RETRY IS ACTIVE
				;THIS NEXT JUMP INSTRUCTION IS Revised BY MODEPRIN TO REFLECT WHICH
				;LPT1n DEFICE IS TO BE RETRIED.  IT WILL APPEAR IN SEVERAL FORMS:
 0186  75 05				JNZ	PAR_RETRY		;THIS INSTRUCTION MAY BE Revised
				;
 0186					ORG	$-2
 0186  74 05				JZ	PAR_RETRY
				;
 0186					ORG	$-2
 0186  EB 00				JMP	SHORT ASIS
				;
 0188				VECTOR17 LABEL	WORD
 0188  EA EFD2 ---- R		ASIS:	JMP	PRINTER_IO		;NO REDIRECTION, GO DIRECTLY TO PREVIOUS INT 17H
				;**************************************************************
					SUBTTL	RETRY PARALLEL ON TIMEOUT.
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-10
RETRY PARALLEL ON TIMEOUT.                                  

					PAGE
 018D				PAR_RETRY:
 018D				RT:
 018D  2E: 88 26 026F R		      MOV   CS:request,AH	       ;save the function requested for check after return from call
				 to INT 17		  ;AN000;
 0192  50			      PUSH  AX			    ;SAVE ENTRY PARAMETERS FOR LATER USE
 0193  1E			      PUSH  DS			    ;SAVE CALLER'S REGS
 0194  50			      PUSH  AX			    ;SAVE REGS
				;
 0195  2B C0			      SUB   AX,AX		    ;POINT TO PAGE ZERO
 0197  8E D8			      MOV   DS,AX		    ; USING THE DATA SEG REG
				;
 0199  80 26 0471 R 7F		      AND   DS:BREAK_FLAG,0FFH-BREAK_BIT ;RESET BREAK FLAG
				;
 019E  58			      POP   AX			    ;RESTORE CALLER'S REGS
 019F  1F			      POP   DS			    ;RESTORE REGS
 01A0  9C			      PUSHF			    ;SAVE FLAGS TO SIMULATE INT INSTRUCTION
 = 0189				PVEC  EQU   VECTOR17+1		    ;OFFSET TO IMMEDIATE FIELD OF PREVIOUSLY SET
				;		    FAR JUMP INSTRUCTION, FILLED WITH THE
				;		    ORIGINAL CONTENTS OF THE INT 17H VECTOR.
 01A1  2E: FF 1E 0189 R		      CALL  DWORD PTR CS:PVEC	    ;CALL PREVIOUS PARALLEL PORT HANDLER
 01A6  2E: 80 3E 026F R 02	      CMP   CS:request,LPT_status								
							   ;AN000;
 01AC  75 19			      JNE   init_or_write									
							   ;AN000;
 01AE  F6 C4 80				 TEST  AH,not_busy	    ;see if the printer was busy (not busy bit off)		
							   ;AN000;
 01B1  75 26				 JNZ   pflush		    ;IF busy dork the status byte				
							   ;AN000;
 01B3  53				    PUSH  BX										
							   ;AN000;
 01B4  8B DA				    MOV   BX,DX 	       ;BX=zero based printer number				
							   ;AN000;
 01B6  2E: 80 BF 022C R 00 E		    CMP   BYTE PTR CS:lpt1_retry_type[BX],busy_status  ;IF status should be changed THEN
						     ;AN000;
 01BC  74 05				    JZ	  dont_modify					     ;busy setting means user wants 
				actual status	   ;AN000;
 01BE  2E: 8A A7 022C R			       MOV   AH,BYTE PTR CS:lpt1_retry_type[BX]  ;change to status set by prior retry settin
				g request for this LPT ;AN000;
 01C3					    dont_modify:									
							   ;AN000;
 01C3  5B				    POP   BX										
							   ;AN000;
 01C4  EB 13 90			      JMP   pflush		    ;return to caller						
							   ;AN000;
 01C7				init_or_write:											
							   ;AN000;
 01C7  50			      PUSH  AX			    ;SAVE RETURN CODE IN AH
 01C8  1E			      PUSH  DS			    ;SAVE DATA SEGMENT REG
				;
 01C9  2B C0			      SUB   AX,AX		    ;POINT TO
 01CB  8E D8			      MOV   DS,AX		    ;  SEGMENT AT ZERO
				;
 01CD  F6 06 0471 R 80		      TEST  DS:BREAK_FLAG,BREAK_BIT ;TEST BREAK FLAG BIT
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-11
RETRY PARALLEL ON TIMEOUT.                                  

 01D2  1F			      POP   DS			    ;RESTORE SEG REG
 01D3  58			      POP   AX			    ;RESTORE RETURN CODE TO AH
 01D4  74 06			      JZ    PTEST		    ;BRANCH IF NO BREAK REQUESTED
				;
 01D6  80 CC 00			      OR    AH,USER_ABORT	    ;SIMULATE TIMEOUT
 01D9				PFLUSH:
 01D9  44			      INC   SP			    ;FLUSH THE
 01DA  44			      INC   SP			    ;  STACK
 01DB  CF			      IRET			    ;RETURN TO CALLER
				;
 01DC				PTEST:
 01DC  F6 C4 01			      TEST  AH,01H		    ;TEST IF A REAL PARALLEL TIMEOUT
 01DF  74 F8			      JZ    PFLUSH		    ;IF NOT, RETURN
 01E1  58			      POP   AX			    ;RETRIEVE ORIGINAL ENTRY PARAMETERS
 01E2  EB A9			      JMP   RT			    ;DO RETRY
				;**************************************************************
					SUBTTL	REDIRECT PARALLEL I/O TO SERIAL
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-12
REDIRECT PARALLEL I/O TO SERIAL                             

					PAGE
 01E4				CK:
 = 0061				FIXUP	EQU	CK - NOREDIRECT
 01E4  80 FC 01				CMP	AH,1			;CHECK FOR 'INITIALIZE' CODE
				;			AH=0, PRINT THE CHAR IN AL
				;			AH=1, INITIALIZE
				;			AH=2, READ STATUS
 01E7  75 03				JNZ	PTCHR			;IT IS PRINT CHARACTER OR READ STATUS
				;			SINCE IT IS 'INITIALIZE'
 01E9  B4 80				MOV	AH,80H			;PASS BACK 'NOT BUSY' RETURN CODE FROM
				;			AH=1, (INITIALIZE)
 01EB  CF				IRET
				;
 01EC				PTCHR:
				;			IT IS PRINT CHARACTER OR READ STATUS
 01EC  53				PUSH	BX			;SAVE THE
 01ED  50				PUSH	AX			; REGS
 01EE  52				PUSH	DX			;SAVE MORE REGS
 01EF  BB 0229 R			MOV	BX,OFFSET RESFLAG2	       ;POINT AT PARALLEL TO SERIAL
				;				     CORRESPONDENCE TABLE IN RESIDENT CODE
 01F2  03 DA				ADD	BX,DX			;INDEX USING PRINTER SELECTION (0,1,OR 2)
 01F4  2E: 8A 17			MOV	DL,CS:[BX]		;GET CORRESPONDING SERIAL PORT SELECT
 01F7  80 FC 00				CMP	AH,0			;CHECK FOR 'PRINT CHAR' CODE
 01FA  74 19				JZ	SENDCHAR		; YES, PRINT CHAR
				;				  NO, MUST BE READ STATUS
 01FC  B4 03				MOV	AH,3			;SET TO INT 14 'READ STAT' ENTRY PT
 01FE  CD 14				INT	14H			;GO RS232 AND READ STATUS INTO AX
				;
				;			AH HAS LINE STATUS:
				;			IF TRANSFER HOLDING REG EMPTY, AND
				;			IF TRANSMIT SHIFT REGISTER READY, THEN SERIAL PORT
				;			NOT BUSY
 = 0010				CLEAR_TO_SEND	EQU	10H
 = 0020				DATA_SET_READY	EQU	20H		;DATA SET READY LINE HIGH
 0200  24 30				AND	AL,CLEAR_TO_SEND+DATA_SET_READY 	;SEE IF PRINTER HAS A CHANCE
				;	$IF	Z			;DSR and CTS low, so probably off or out of paper
 0202  75 04				JNZ $$IF1
 0204  B4 29				   MOV	   AH,29H		;PAR 'BUSY' 'OUT OF PAPER' 'I/O ERROR' 'TIME OUT'
				;	$ELSE
 0206  EB 0A				JMP SHORT $$EN1
 0208				$$IF1:
 0208  3C 30				   CMP	   AL,CLEAR_TO_SEND+DATA_SET_READY
				;	   $IF	   E			;IF clear to send and dsta set ready THEN
 020A  75 04				   JNE $$IF3
 020C  B4 90				      MOV     AH,90H		;'NOT BUSY' 'SELECTED'
				;	   $ELSE			;ELSE clear to send high OR data set ready high
 020E  EB 02				   JMP SHORT $$EN3
 0210				$$IF3:
 0210  B4 10				      MOV     AH,10H		   ;SET TO PARALLEL 'BUSY' 'SELECTED'
				;	   $ENDIF
 0212				$$EN3:
				;	$ENDIF
 0212				$$EN1:
 0212  5A				POP	DX			;RESTORE REG
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-13
REDIRECT PARALLEL I/O TO SERIAL                             

 0213  EB 0E				JMP	SHORT POPPER		;RESTORE REGS AND EXIT
				;
 0215				SENDCHAR:
 0215  B4 01				MOV	AH,1			;SET TO INT 14 'SEND CHAR' ENTRY PT
 0217  CD 14				INT	14H			;GO RS232 SEND CHAR
				;
 0219  5A				POP	DX			;RESTORE REG
 021A  F6 C4 80				TEST	AH,80H			;TEST IF TIMEOUT RS232 ERROR
 021D  B4 90				MOV	AH,90H			;SET UP NORMAL RETURN AS IF FROM PRINTER
				;			THAT IS: PARALLEL 'NOT BUSY' 'SELECTED'
 021F  74 02				JZ	POPPER			;IF NO ERROR
 0221  B4 09				MOV	AH,09H			;RESET AH TO PARALLEL TIMEOUT ERROR CODE
				;		    RET CODE='BUSY', 'I/O ERROR', 'TIMEOUT'
				;		    THE USUAL RETURN FROM A WRITE DATA
				;		    TO A PARALLEL PRINTER THAT IS OFFLINE
 0223				POPPER:
 0223  5B				POP	BX			;RETRIEVE ORIGINAL AX
 0224  8A C3				MOV	AL,BL			;RESTORE ORIGINAL AL VALUE LEAVING NEW AH
 0226  5B				POP	BX			;RESTORE BX
 0227  CF				IRET				;RETURN
				
				;**********************************************************************
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-14
REDIRECT PARALLEL I/O TO SERIAL                             

				PAGE
				
 0228  00			PTSFLAG1 DB	0			;FLAG FOR MODE COMMAND:
				
 = 0125				NEW_PTSFLAG EQU PTSFLAG1 - MODETO	;WHEN THIS CODE IS
									; RESIDENT THE FLAG WILL BE ACCESSABLE TO
									; MODEECHO AS AN OFFSET FROM ADDRESS
									; POINTED TO BY VECT14H AND RESSEG
				;		0=NO INTERCEPT
				;		1=INTERCEPT LPT1
				;		2=INTERCEPT LPT2
				;		3=INTERCEPT LPT1 AND LPT2
				;		4=INTERCEPT LPT3
				;		5=INTERCEPT LPT1 AND LPT3
				;		6=INTERCEPT LPT2 AND LPT3
				;		7=INTERCEPT LPT1, LPT2, AND LPT3
 = 0229				RESFLAG2 EQU	$			;WHERE PTSFLAG2 IS IN THE RESIDENT CODE
 0229  00			PTSFLAG2 DB	0			;FLAG FOR MODE COMMAND:
				;		    LPT1 CORRESPONDENCE VALUE:
				;		0=COM1
				;		1=COM2
				;		2=COM3
				;		3=COM4
				;RESFLAG2 EQU	 (PTSFLAG2 - MODETO)+BASE ;WHERE PTSFLAG2
									; IS IN THE RESIDENT CODE
 022A  00			PTSFLAG3 DB	0			;FLAG FOR MODE COMMAND:
				;		    LPT2 CORRESPONDENCE VALUE:
				;		0=COM1
				;		1=COM2
				;		2=COM3
				;		3=COM4
 022B  00			PTSFLAG4 DB	0			;FLAG FORMODE COMMAND:
				;		    LPT3 CORRESPONDENCE VALUE:
				;		0=COM1
				;		1=COM2
				;		2=COM3
				;		3=COM4
				
				
 022C  00			lpt1_retry_type   DB	0	 ;holder of mask for status return byte 			
						;AN000;
 022D  00			lpt2_retry_type   DB	0	 ;can be one of no_retry_flag, error_status,			
						;AN000;
 022E  00			lpt3_retry_type   DB	0	 ;busy_status or ready_status, see MODEPRIN			
					       ;AN000;
				
				PUBLIC lpt1_retry_type
				
				
				;THE FOLLOWING AREA IS USED BY MODESCRN TO STORE THE VIDEO PARMS THAT
				;ALLOW FOR THE SHIFTING RIGHT OR LEFT OF THE SCREEN IMAGE.
 022F  0010[			SCRNTABL DB	16 DUP("PARM")		;64 BYTES OF SPACE
	   50 41 52 4D		
			 ]	
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-15
REDIRECT PARALLEL I/O TO SERIAL                             

				
 = 012C				NEW_SCRNTABL EQU SCRNTABL - MODETO	;OFFSET INTO RESIDENT
				;			CODE OF THE 64 BYTE SCREEN TABLE
				
 026F  00			request     DB	  0	      ;holder for INT 14 or INT 17 request passed in AH
 0270  0000			retry_type  DW	  0	      ;holder for INT 14 retry type and shift count
				
 0272				MODEPTS ENDP
				
 = 0018				rescode_length	  equ	(($ - entpt) / 16) + 1	  ;length of resident code in paragraphs
				
 = 0172				MOVELEN EQU	$ - entpt   ;length of resident code in bytes
				
				
				;*******************************************************************************
				
					SUBTTL	LOAD THE RESIDENT PORTION OF MODE
				
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-16
LOAD THE RESIDENT PORTION OF MODE                           

					PAGE
				
				
 0272				MODELOAD PROC	NEAR
					PUBLIC	MODELOAD
				;		    GET THE CONTENTS OF INT VECTOR 14H
				;		    TO SEE IF THE RESIDENT CODE IS
				;		    ALREADY LOADED
				;		    SET UP REGS TO MOVE IT INTO PLACE
 0272  1E			   PUSH    DS			   ;SAVE SEG REG
 0273  06			   PUSH    ES			   ;SAVE SEG REG
 0274  57			   PUSH    DI
 0275  56			   PUSH    SI			   ;SAVE FOR CALLING PROCEDURE
 0276  52			   PUSH    DX			   ;SAVE FOR CALLING PROCEDURE
 0277  50			   PUSH    AX			   ;SAVE FOR CALLING PROCEDURE
 0278  53			   PUSH    BX
 0279  B8 0000			   MOV	   AX,0 		   ;GET THE PARAGRAPH NUMBER OF DESTINATION
 027C  8E C0			   MOV	   ES,AX		   ; TO THE EXTRA SEGMENT BASE
 027E  26: C4 3E 0530 R		   LES	   DI,ES:RESSEG 	   ;GET POINTER TO RETRY CODE
				;  IF THE CODE IS NOT ALREADY MOVED,
				   .IF <DI EQ 0> THEN NEAR	   ;AC000;IF nothing at 50:30 THEN code is not loaded
 0283  83 FF 00              3						cmp DI,0 
 0286  74 03                 6						je $+5 
 0288  EB 7F 90              5						jmp $l10 
				;
				;		    SINCE CODE HAS NOT YET BEEN MOVED,
				;		    PATCH PROPER ADDRESSES INTO IT
				
				;     .IF <retry_requested EQ true> AND      ;AN000;
				;     .IF <device_type EQ COMX> THEN	     ;AN000;
				;
				;	 XOR	 AX,AX
				;	 MOV	 ES,AX		     ;BACK TO THE VECTOR AT ZERO
				;	 MOV	 AX,WORD PTR ES:VECT14H ;GET THE VECTOR OF INT 14H
				;	 MOV	 VECTOR14+1,AX	     ; INTO CODE TO BE MOVED
				;
				;	 MOV	 AX,WORD PTR ES:VECT14H[2] ;MOVE REST OF VECTOR
				;	 MOV	 VECTOR14+3,AX
				;
				;     .ENDIF				     ;AN000;
				;
				;     .IF <device_type EQ LPTX> AND	     ;AN000;
				;     .IF <retry_requested EQ true> OR	     ;AN000;
				;     .IF <reroute_requested EQ true> THEN   ;AN000;
				;
				;	 MOV	 AX,WORD PTR ES:VECT17H ;GET VECTOR OF INT 17H
				;	 MOV	 VECTOR17+1,AX	     ; INTO CODE TO BE MOVED
				;
				;	 MOV	 AX,WORD PTR ES:VECT17H[2] ;MOVE REST OF VECTOR
				;	 MOV	 VECTOR17+3,AX
				;
				;     .ENDIF				     ;AN000;
				
				
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-17
LOAD THE RESIDENT PORTION OF MODE                           

 028B  06			      PUSH    ES		  ;SAVE POINTER TO VECTOR ZERO
				
				;Get and save previous interrupt handlers
				
				      get_int_vect 14H		    ;get vector of INT 17H, ES:BX=vector
 028C  50                    1		PUSH	AX 
 028D  B0 14                 1		MOV	AL,14H		; 
 028F  B4 35                 1		MOV	AH,35H			;FUNCTION CALL "GET VECTOR" 
 0291  CD 21                 1		INT	21H			;Output: ES:BX = the address in the vector 
 0293  58                    1		POP	AX 
 0294  89 1E 011D R		      MOV     VECTOR14+1,BX	  ;put offset INTO CODE TO BE MOVED
 0298  8C 06 011F R		      MOV     VECTOR14+3,ES	  ;save segment
				
				      get_int_vect 17H		    ;get vector of INT 17H, ES:BX=vector
 029C  50                    1		PUSH	AX 
 029D  B0 17                 1		MOV	AL,17H		; 
 029F  B4 35                 1		MOV	AH,35H			;FUNCTION CALL "GET VECTOR" 
 02A1  CD 21                 1		INT	21H			;Output: ES:BX = the address in the vector 
 02A3  58                    1		POP	AX 
 02A4  89 1E 0189 R		      MOV     VECTOR17+1,BX	  ;put offset INTO CODE TO BE MOVED
 02A8  8C 06 018B R		      MOV     VECTOR17+3,ES	  ;save segment
				
				
 02AC  BE 0100 R		      MOV     SI,OFFSET entpt	  ;WILL BE MOVED FROM HERE
 02AF  BF 0060 R		      MOV     DI,OFFSET move_destination	;WILL BE MOVED TO HERE
 02B2  B9 0172			      MOV     CX,MOVELEN	  ;NUMBER OF BYTES TO BE MOVED
 02B5  0E			      PUSH    CS		  ;GET SEGMENT OF PROGRAM HEADER
 02B6  07			      POP     ES		  ; INTO ES, THE DESTINATION SEGMENT
 02B7  FC			      CLD			  ;INCREMENT SI AND DI AFTER EACH BYTE IS MOVED
 02B8  F3/ A4			      REP     MOVSB		  ;MOVE CX BYTES FROM DS:SI TO ES:DI
 02BA  07			      POP     ES
				
				
				;Put a pointer to the resident code 50:30 (0:530)
				
 02BB  FA			      CLI			  ;DISABLE UNTIL VECTOR SET
				
 02BC  26: C7 06 0530 R 0103	      MOV   ES:WORD PTR resseg,OFFSET modeto	   ;offset of "modeto" in res code pointer
	R			
 02C3  8C C8			      MOV   AX,CS
 02C5  2D 000A 90		      SUB   AX,adjustment_in_paragraphs 	   ;adjust res CS by amount the code moved
 02C9  26: A3 0532 R		      MOV   ES:WORD PTR resseg[2],AX		   ;store segment of res code in pointer
				
 02CD  FB			      STI			   ;allow some interrupts
				
				;Set interrupts 14 and 17 to point to their respective handlers.  AX has correct segment.
				
 02CE  8E D8			      MOV   DS,AX				   ;DS=resident code segment
 02D0  BA 0103 R		      MOV   DX,OFFSET modeto			   ;DS:DX=> INT14 handler "modeto"
				      set_int_vect  INT14
 02D3  50                    1		PUSH	AX			;	DS:DX = CS:IP value to set the interrupt to 
 02D4  B0 14                 1		MOV	AL,INT14		;Output: the vector "INT_NO" contains DS:DX 
 02D6  B4 25                 1		MOV	AH,25H			;function call "SET VECTOR" 
 02D8  CD 21                 1		INT	21H 
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-18
LOAD THE RESIDENT PORTION OF MODE                           

 02DA  58                    1		POP	AX 
				
 02DB  BA 017E R		      MOV   DX,OFFSET modepts			   ;DS:DX=> INT17 handler "modepts"
				      set_int_vect  INT17
 02DE  50                    1		PUSH	AX			;	DS:DX = CS:IP value to set the interrupt to 
 02DF  B0 17                 1		MOV	AL,INT17		;Output: the vector "INT_NO" contains DS:DX 
 02E1  B4 25                 1		MOV	AH,25H			;function call "SET VECTOR" 
 02E3  CD 21                 1		INT	21H 
 02E5  58                    1		POP	AX 
				
 02E6  2E: 8E 06 002C R		      MOV   ES,CS:environ_seg	 ;ES=segment of the block to be returned
 02EB  B4 49			      MOV   AH,49H		 ;49 is the Free Allocated Memory function call
 02ED  CD 21			      INT   21H 		 ;free the environment
				
 02EF  2E: C6 06 0001 27	      MOV     BYTE PTR CS:1,27H   ;SET EXIT TO REMAIN RESIDENT by dorking opcode in the PSP
				;
 02F5  0E			      PUSH  CS
 02F6  1F			      POP   DS		;"PRINTF" requires that DS be the segment containing the messages
				
				      DISPLAY MOVED_MSG 	  ;"Resident portion of MODE loaded"
 02F7  BA 0000 E             1		MOV	DX,OFFSET MOVED_MSG 
 02FA  E8 0000 E             1		CALL	PRINTF 
 02FD  2E: C6 06 0327 R 01	      MOV     BYTE PTR CS:LOADED_YET,1 ;SET FLAG TO INDICATE ABOVE MSG
				;				   HAS BEEN DISPLAYED
				;				   MODESCRN MAY NEED TO REPEAT MESSAGE
 0303  C6 06 0370 R FF 90	      MOV     stay_resident,true
				   .ENDIF			   ;AC000;END IS CODE ALREADY LOADED? TEST
 0309                        2	$l10: 
				
 0309  5B				POP	BX
 030A  58				POP	AX			;RESTORE FOR CALLING PROCEDURE
 030B  5A				POP	DX			;RESTORE FOR CALLING PROCEDURE
 030C  5E				POP	SI			;RESTORE FOR CALLING PROCEDURE
 030D  5F				POP	DI
 030E  07				POP	ES			;RESTORE SEG REG
 030F  1F				POP	DS			;RESTORE SEG REG
 0310  C3				RET
 0311				MODELOAD ENDP
				
				;************************************************************
					SUBTTL	COMMON PARMAMETER LIST AND WORKAREA
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-19
COMMON PARMAMETER LIST AND WORKAREA                         

					PAGE
				; THE FOLLOWING AREA IS USED TO STORE PARSED PARAMETER LIST, AND WORK STORAGE
				; USED BY OTHER MODULES
				
				;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  N O N	 R E S I D E N T   D A T A  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
				;Ί											  Ί
				
 0311  0005[			CTRL_ST DB	5 DUP(24)		;PRINTER CONFIGURATION CONTROL STRING
	   18			
			 ]	
				
 0316  000A[			PARM1	DB	10 DUP(0)
	   00			
			 ]	
				
 0320  FF			PARM2	DB	-1			;-1 INDICATES TO SERVER THAT THIS PARM IS UNCHANGED
 0321  00			PARM3	DB	0
 0322  00			MODE	DB	0
 0323  00			FLAG	DB	0
 0324  0000			INDEX	DW	00			;REDIRECTED PRINTER NETWORK REDIRECTION LIST INDEX
 0326  FF			IS_LOCAL DB	TRUE			;INITIALIZE for MODEPRIN
 0327  00			LOADED_YET DB	false
 0328  0010[			LOCAL_NAME DB	16 DUP(0)		;HOLDING AREA FOR GET ASSIGN LIST ENTRY CALL USE
	   00			
			 ]	
				
 0338  FF			machine_type  DB 0FFH			;holder for the machine type
 0339  FF			NOERROR DB	TRUE			;INDICATE NO ERROR MESSAGES HAVE BEEN ISSUED YET
 033A  0090			NEW_VIDEO_PARMS_OFFSET DW 090H		;OFFSET OF INIT TABLE FOR SCREEN SHIFTING
 033C  0040			NEW_VIDEO_PARMS_SEGMENT DW 040H 	;SEGMENT OF INIT TABLE FOR SCREEN SHIFTING
 033E  0032[			REMOTE_DEV DB	50 DUP(0)		;HOLDING AREA FOR GET ASSIGN LIST ENTRY CALL USE
	   00			
			 ]	
				
 0370  00			stay_resident	  DB	false		;boolean indicating should stay resident when terminate
 0371  FF			submodel_byte	  DB	0FFH		;secondary model byte
				
				
				;Ί											  Ί
				;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  N O N	 R E S I D E N T   D A T A  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
				
				
				;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  P U B L I C S  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
				;Ί											  Ί
				
				PUBLIC	PARM1,PARM2,PARM3,MODE,FLAG,CTRL_ST,INDEX,LOCAL_NAME,REMOTE_DEV       ;AC000;
				PUBLIC	IS_LOCAL
				PUBLIC	LOADED_YET
				PUBLIC	machine_type		;holder for machine type, found in "main"
				PUBLIC	NOERROR
				PUBLIC	NEW_VIDEO_PARMS_OFFSET
				PUBLIC	NEW_VIDEO_PARMS_SEGMENT
				PUBLIC	stay_resident
				
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Page     1-20
COMMON PARMAMETER LIST AND WORKAREA                         

				;Ί											  Ί
				;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  P U B L I C S  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
				
 0372				PRINTF_CODE ENDS
					END	ENTPT

Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Symbols-1


Macros:

		N a m e			Lines

.ELSE  . . . . . . . . . . . . .  	  21
.ELSEIF  . . . . . . . . . . . .  	  16
.ENDIF . . . . . . . . . . . . .  	  11
.ENDSELECT . . . . . . . . . . .  	  15
.ENDWHILE  . . . . . . . . . . .  	  10
.FOR . . . . . . . . . . . . . .  	  23
.IF  . . . . . . . . . . . . . .  	  13
.LEAVE . . . . . . . . . . . . .  	   1
.LOOP  . . . . . . . . . . . . .  	  12
.NEXT  . . . . . . . . . . . . .  	  20
.OTHERWISE . . . . . . . . . . .  	  21
.REPEAT  . . . . . . . . . . . .  	   9
.SELECT  . . . . . . . . . . . .  	   4
.THEN  . . . . . . . . . . . . .  	   6
.UNTIL . . . . . . . . . . . . .  	   1
.WHEN  . . . . . . . . . . . . .  	  24
.WHILE . . . . . . . . . . . . .  	  14
DISPLAY  . . . . . . . . . . . .  	   2
GET_INT_VECT . . . . . . . . . .  	   5
SET  . . . . . . . . . . . . . .  	   4
SET_INT_VECT . . . . . . . . . .  	   5
STORE_VECTOR . . . . . . . . . .  	   3

Segments and Groups:

                N a m e         	Length	 Align	Combine Class

PRINTF_CODE  . . . . . . . . . .  	0372	PARA	PUBLIC	
ROM  . . . . . . . . . . . . . .  	FFFE	AT	F000	
VECT . . . . . . . . . . . . . .  	0530	AT	0000	

Symbols:            

                N a m e         	Type	 Value	 Attr

ADJUSTMENT . . . . . . . . . . .  	NUMBER	00A0	
ADJUSTMENT_IN_PARAGRAPHS . . . .  	NUMBER	000A	
ASIS . . . . . . . . . . . . . .  	L NEAR	0188	PRINTF_CODE

BREAK_BIT  . . . . . . . . . . .  	NUMBER	0080	
BREAK_FLAG . . . . . . . . . . .  	L BYTE	0471	VECT
busy_status  . . . . . . . . . .  	NUMBER	0000		Communal

CK . . . . . . . . . . . . . . .  	L NEAR	01E4	PRINTF_CODE
CLEAR_TO_SEND  . . . . . . . . .  	NUMBER	0010	
COMMAND_LINE_LENGTH  . . . . . .  	L BYTE	0080	PRINTF_CODE
COMX . . . . . . . . . . . . . .  	NUMBER	0000		Communal
COM_STATUS . . . . . . . . . . .  	NUMBER	0003	
CTRL_ST  . . . . . . . . . . . .  	L BYTE	0311	PRINTF_CODE	Global	Length = 0005

Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Symbols-2


DATA_SET_READY . . . . . . . . .  	NUMBER	0020	
device_type  . . . . . . . . . .  	V BYTE	0000	PRINTF_CODE	External
DONT_MODIFY  . . . . . . . . . .  	L NEAR	01C3	PRINTF_CODE

E  . . . . . . . . . . . . . . .  	NUMBER	0001	
ENTPT  . . . . . . . . . . . . .  	L NEAR	0100	PRINTF_CODE
ENVIRON_SEG  . . . . . . . . . .  	L WORD	002C	PRINTF_CODE

FALSE  . . . . . . . . . . . . .  	NUMBER	0000	
first_char_in_command_line . . .  	L BYTE	0081	PRINTF_CODE	Global
FIXUP  . . . . . . . . . . . . .  	NUMBER	0061		Global
FLAG . . . . . . . . . . . . . .  	L BYTE	0323	PRINTF_CODE	Global
FLUSH  . . . . . . . . . . . . .  	L NEAR	0172	PRINTF_CODE
FRAMING_ERROR  . . . . . . . . .  	NUMBER	0800	

HOLDING_EMPTY  . . . . . . . . .  	NUMBER	2000	

INDEX  . . . . . . . . . . . . .  	L WORD	0324	PRINTF_CODE	Global
INIT_OR_WRITE  . . . . . . . . .  	L NEAR	01C7	PRINTF_CODE
INT14  . . . . . . . . . . . . .  	NUMBER	0014	
INT17  . . . . . . . . . . . . .  	NUMBER	0017	
IS_LOCAL . . . . . . . . . . . .  	L BYTE	0326	PRINTF_CODE	Global

LOADED_YET . . . . . . . . . . .  	L BYTE	0327	PRINTF_CODE	Global
LOCAL_NAME . . . . . . . . . . .  	L BYTE	0328	PRINTF_CODE	Global	Length = 0010
lpt1_retry_type  . . . . . . . .  	L BYTE	022C	PRINTF_CODE	Global
LPT2_RETRY_TYPE  . . . . . . . .  	L BYTE	022D	PRINTF_CODE
LPT3_RETRY_TYPE  . . . . . . . .  	L BYTE	022E	PRINTF_CODE
LPTX . . . . . . . . . . . . . .  	NUMBER	0000		Communal
LPT_STATUS . . . . . . . . . . .  	NUMBER	0002	

machine_type . . . . . . . . . .  	L BYTE	0338	PRINTF_CODE	Global
MAIN . . . . . . . . . . . . . .  	L NEAR	0000	PRINTF_CODE	External
MODE . . . . . . . . . . . . . .  	L BYTE	0322	PRINTF_CODE	Global
MODELOAD . . . . . . . . . . . .  	N PROC	0272	PRINTF_CODE	Global	Length = 009F
MODEPTS  . . . . . . . . . . . .  	N PROC	017E	PRINTF_CODE	Length = 00F4
MODETO . . . . . . . . . . . . .  	N PROC	0103	PRINTF_CODE	Global	Length = 007B
MOVED_MSG  . . . . . . . . . . .  	V WORD	0000	PRINTF_CODE	External
MOVELEN  . . . . . . . . . . . .  	NUMBER	0172	
move_destination . . . . . . . .  	L WORD	0060	PRINTF_CODE	Global

NEW_PTSFLAG  . . . . . . . . . .  	NUMBER	0125		Global
NEW_SCRNTABL . . . . . . . . . .  	NUMBER	012C		Global
NEW_VIDEO_PARMS_OFFSET . . . . .  	L WORD	033A	PRINTF_CODE	Global
NEW_VIDEO_PARMS_SEGMENT  . . . .  	L WORD	033C	PRINTF_CODE	Global
NOERROR  . . . . . . . . . . . .  	L BYTE	0339	PRINTF_CODE	Global
NOREDIRECT . . . . . . . . . . .  	L NEAR	0183	PRINTF_CODE
NOT_BUSY . . . . . . . . . . . .  	NUMBER	0080	

OFFPTS . . . . . . . . . . . . .  	NUMBER	007B		Global
OFFRETRY . . . . . . . . . . . .  	NEAR	0183	PRINTF_CODE	Global
OVERRUN_ERROR  . . . . . . . . .  	NUMBER	0200	

P14_model_byte . . . . . . . . .  	NUMBER	00F9		Global
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Symbols-3


PARITY_ERROR . . . . . . . . . .  	NUMBER	0400	
PARM1  . . . . . . . . . . . . .  	L BYTE	0316	PRINTF_CODE	Global	Length = 000A
PARM2  . . . . . . . . . . . . .  	L BYTE	0320	PRINTF_CODE	Global
PARM3  . . . . . . . . . . . . .  	L BYTE	0321	PRINTF_CODE	Global
PAR_RETRY  . . . . . . . . . . .  	L NEAR	018D	PRINTF_CODE
PFLUSH . . . . . . . . . . . . .  	L NEAR	01D9	PRINTF_CODE
POPPER . . . . . . . . . . . . .  	L NEAR	0223	PRINTF_CODE
PRINTER_IO . . . . . . . . . . .  	L FAR 	EFD2	ROM
PRINTF . . . . . . . . . . . . .  	L NEAR	0000	PRINTF_CODE	External
PTCHR  . . . . . . . . . . . . .  	L NEAR	01EC	PRINTF_CODE
PTEST  . . . . . . . . . . . . .  	L NEAR	01DC	PRINTF_CODE
ptsflag1 . . . . . . . . . . . .  	L BYTE	0228	PRINTF_CODE	Global
PTSFLAG2 . . . . . . . . . . . .  	L BYTE	0229	PRINTF_CODE
PTSFLAG3 . . . . . . . . . . . .  	L BYTE	022A	PRINTF_CODE
PTSFLAG4 . . . . . . . . . . . .  	L BYTE	022B	PRINTF_CODE
PUSHAX . . . . . . . . . . . . .  	L NEAR	0121	PRINTF_CODE
PVEC . . . . . . . . . . . . . .  	WORD	0189	PRINTF_CODE

R  . . . . . . . . . . . . . . .  	NUMBER	0003	
REMOTE_DEV . . . . . . . . . . .  	L BYTE	033E	PRINTF_CODE	Global	Length = 0032
REQUEST  . . . . . . . . . . . .  	L BYTE	026F	PRINTF_CODE
reroute_requested  . . . . . . .  	V BYTE	0000	PRINTF_CODE	External
rescode_length . . . . . . . . .  	NUMBER	0018		Global
resflag2 . . . . . . . . . . . .  	NEAR	0229	PRINTF_CODE	Global
RESSEG . . . . . . . . . . . . .  	L DWORD	0530	VECT	Global
res_com_retry_type . . . . . . .  	NEAR	017D	PRINTF_CODE	Global
RES_MODEFLAG . . . . . . . . . .  	NEAR	017D	PRINTF_CODE	Global
retry_requested  . . . . . . . .  	V BYTE	0000	PRINTF_CODE	External
RETRY_TYPE . . . . . . . . . . .  	L WORD	0270	PRINTF_CODE
RS232  . . . . . . . . . . . . .  	L FAR 	E739	ROM
RT . . . . . . . . . . . . . . .  	L NEAR	018D	PRINTF_CODE

SCRNTABL . . . . . . . . . . . .  	L BYTE	022F	PRINTF_CODE	Global	Length = 0010
SENDCHAR . . . . . . . . . . . .  	L NEAR	0215	PRINTF_CODE
SHIFT_EMPTY  . . . . . . . . . .  	NUMBER	4000	
stay_resident  . . . . . . . . .  	L BYTE	0370	PRINTF_CODE	Global
submodel_byte  . . . . . . . . .  	L BYTE	0371	PRINTF_CODE	Global

TESTER . . . . . . . . . . . . .  	L NEAR	0175	PRINTF_CODE
TIME_OUT . . . . . . . . . . . .  	NUMBER	8000	
TOROM  . . . . . . . . . . . . .  	L NEAR	011C	PRINTF_CODE
TO_SCREEN  . . . . . . . . . . .  	NUMBER	0009	
TRUE . . . . . . . . . . . . . .  	NUMBER	00FF	

USER_ABORT . . . . . . . . . . .  	NUMBER	0000	

VEC  . . . . . . . . . . . . . .  	WORD	011D	PRINTF_CODE
VECT14H  . . . . . . . . . . . .  	L DWORD	0050	VECT
VECT17H  . . . . . . . . . . . .  	L DWORD	005C	VECT
VECTOR14 . . . . . . . . . . . .  	L WORD	011C	PRINTF_CODE	Global
VECTOR17 . . . . . . . . . . . .  	L WORD	0188	PRINTF_CODE	Global

$$EN1  . . . . . . . . . . . . .  	L NEAR	0212	PRINTF_CODE
$$EN3  . . . . . . . . . . . . .  	L NEAR	0212	PRINTF_CODE
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:09
CODE TO BE MADE RESIDENT BY MODE                            Symbols-4


$$IF1  . . . . . . . . . . . . .  	L NEAR	0208	PRINTF_CODE
$$IF3  . . . . . . . . . . . . .  	L NEAR	0210	PRINTF_CODE
$L1  . . . . . . . . . . . . . .  	L NEAR	0172	PRINTF_CODE
$L10 . . . . . . . . . . . . . .  	L NEAR	0309	PRINTF_CODE
$L2  . . . . . . . . . . . . . .  	L NEAR	0160	PRINTF_CODE
$L4  . . . . . . . . . . . . . .  	L NEAR	015D	PRINTF_CODE
$L5  . . . . . . . . . . . . . .  	L NEAR	0155	PRINTF_CODE
$LL1 . . . . . . . . . . . . . .  	NUMBER	0001	
$LL10  . . . . . . . . . . . . .  	NUMBER	000A	
@CPU . . . . . . . . . . . . . .  	TEXT  0101h		
@FILENAME  . . . . . . . . . . .  	TEXT  rescode		
@VERSION . . . . . . . . . . . .  	TEXT  510		


   1420 Source  Lines
   3084 Total   Lines
    244 Symbols

  46386 + 189599 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
