Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-1


					PAGE	,132								;AN000;
					TITLE	DOS GRAPHICS Command  -	Color printing modules
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;					;AN000;
				;; DOS - GRAPHICS Command
				;; (c) Copyright 1988 Microsoft
				;;										;AN000;
				;; File Name:  GRCOLPRT.ASM							;AN000;
				;; ----------									;AN000;
				;;										;AN000;
				;; Description: 								;AN000;
				;; ------------ 								;AN000;
				;;	 This file contains the code for printing a screen (text and graphics)	;AN000;
				;;	 on a COLOR printer.							;AN000;
				;;										;AN000;
				;; Documentation Reference:							;AN000;
				;; ------------------------							;AN000;
				;;	 OASIS High Level Design						;AN000;
				;;	 OASIS GRAPHICS I1 Overview						;AN000;
				;;										;AN000;
				;; Procedures Contained in This File:						;AN000;
				;; ----------------------------------						;AN000;
				;;										;AN000;
				;;	PRINT_COLOR								;AN000;
				;;	  SCAN_FOR_BANDS_APA							;AN000;
				;;	  SCAN_FOR_BANDS_TXT							;AN000;
				;;	  PRINT_BAND_APA							;AN000;
				;;	  PRINT_BAND_TXT							;AN000;
				;;	  SET_CURSOR								;AN000;
				;;	  SET_COLOR_BAND							;AN000;
				;;	  INIT_BLACK_BOX							;AN000;
				;;										;AN000;
				;;										;AN000;
				;; Include Files Required:							;AN000;
				;; -----------------------							;AN000;
				;;										;AN000;
				;;	 GRCTRL.EXT   - Externals for print screen control			;AN000;
				;;	 GRCTRL.STR   - Structures and equates for print screen control 	;AN000;
				;;	 GRPATTRN.STR - Structures for the printer patterns.			;AN000;
				;;										;AN000;
				;;	 GRSHAR.STR   - Shared Data Area Structure				;AN000;
				;;										;AN000;
				;;	 STRUC.INC    - Macros for using structured assembly language		;AN000;
				;;										;AN000;
				;; External Procedure References:						;AN000;
				;; ------------------------------						;AN000;
				;;	 FROM FILE  GRCTRL.ASM: 						;AN000;
				;;	      PRT_SCR - Main module for printing the screen.			;AN000;
				;;	 TO FILE GRCOMMON.ASM							;AN000;
				;;	      Common modules - tools for printing a screen.			;AN000;
				;;										;AN000;
				;; Linkage Instructions:							;AN000;
				;; -------------------- 							;AN000;
				;;	 Refer to GRAPHICS.ASM							;AN000;
				;;										;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-2


				;; Change History:								;AN000;
				;; ---------------								;AN000;
				;;	 Date last updated 5/26/87.						;AN000;
				;;										;AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;					;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-3


				PAGE										;AN000;
 0000				CODE	SEGMENT PUBLIC 'CODE'                                                   ;AN000;
					ASSUME		CS:CODE,DS:CODE 					;AN000;
														;AN000;
					PUBLIC	PRINT_MODULE_START     ;; Color modules public			;AN000;
					PUBLIC	PRINT_COLOR	       ;;  procedures				;AN000;
					PUBLIC	LEN_OF_COLOR_MODULES   ;;					;AN000;
								       ;;					;AN000;
			     C	.LIST										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; PRINT SCREEN INTERNAL ERROR CODES						;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 = 0000                      C	NO_ERROR	EQU	0							;AN000;
 = 0001                      C	UNABLE_TO_PRINT EQU	1	; The procedure was unable to print the 	;AN000;
			     C					; screen					;AN000;
 = 0002                      C	DISPLAYMODE_INFO_NOT_FOUND EQU 2 ; There was no DISPLAYMODE info record 	;AN000;
			     C					;  in the Shared Area for the current mode	;AN000;
 = 0004                      C	MODE_NOT_SUPPORTED EQU	4	; This mode is not supported by this version	;AN000;
			     C					; of GRAHICS.					;AN000;
 = 0008                      C	PRINTER_ERROR	 EQU	8	; An error occurred while printing a byte	;AN000;
			     C					;  (i.e., Out of paper, etc)			;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; PIXEL INTERNAL REPRESENTATION 						;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	PIXEL_STR	STRUC								;AN000;
 0000  00                    C	 R	DB	?		; RED component (0 to MAX_INT)			;AN000;
 0001  00                    C	 G	DB	?		; GREEN component (0 to MAX_INT)		;AN000;
 0002  00                    C	 B	DB	?		; BLUE component (0 to MAX_INT) 		;AN000;
 0003                        C	PIXEL_STR	ENDS								;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; VIDEO MODE TYPES								;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 = 0000                      C	TXT		EQU	0	; Text						;AN000;
 = 0001                      C	APA		EQU	1	; All Points Addressable			;AN000;
			     C											;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; BIOS INTERRUPT 10H CALL EQUATES						;AN000;
			     C	; Note: Either AX or AH must be initialized, depending if the call is		;AN000;
			     C	;	a sub-call or not.							;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 = 000D                      C	READ_DOT_CALL	EQU	0DH	; Read dot					;AN000;
 = 0002                      C	SET_CURSOR_CALL EQU	02H	; Set cursor on the screen			;AN000;
 = 0003                      C	READ_CURSOR_CALL EQU	03H	; Read position of the cursor on the screen	;AN000;
 = 0008                      C	READ_CHAR_CALL	EQU	08H	; Read attribute/character			;AN000;
 = 000F                      C	GET_STATE_CALL	EQU	0FH	; Return current video state			;AN000;
 = 1007                      C	GET_P_REG_CALL	EQU	1007H	; Read a palette register (EGA, VGA)		;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-4


 = 1015                      C	GET_C_REG_CALL	EQU	1015H	; Read a color register (VGA)			;AN000;
 = 1A00                      C	READ_CONFIG_CALL EQU	1A00H	; Read display adapter configuration (PS/2)	;AN000;
 = 101A                      C	PAGE_STATE_CALL  EQU	101AH	; Read color page state call (PS/2)		;AN000;
 = 0012                      C	ALT_SELECT_CALL EQU	12H	; Alternate select call (AH = 12h)		;AN000;
 = 0010                      C	EGA_INFO_CALL	EQU	10H	; Return EGA information (AH=12H,BH = 10H)	;AN000;
 = 0015                      C	DISP_DESC_CALL	EQU	15H	; PC CONVERTIBLE display description call	;AN000;
			     C											;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; BIOS DATA AREA EQUATES							;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 = 0040                      C	BIOS_SEG	EQU	40H	; BIOS segment					;AN000;
 = 0084                      C	NB_ROWS_OFFSET	EQU	84H	; Number of rows displayed when in a text mode	;AN000;
			     C											;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; CONSTANT DEFINITIONS								;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 = 0000                      C	NO		EQU	0							;AN000;
 = 0001                      C	YES		EQU	1							;AN000;
 = 0000                      C	OFF		EQU	0							;AN000;
 = 0001                      C	ON		EQU	1							;AN000;
			     C											;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; TRANSLATION TABLE DEFINITIONS 						;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 = 003F                      C	WHITE_INT	EQU	63	; Intensity for WHITE on the printer		;AN000;
 = 0000                      C	BLACK_INT	EQU	0	; Intensity for BLACK on the printer		;AN000;
 =                           C	MAX_INT 	EQU   WHITE_INT ; Maximum intensity for a RGB value,		;AN000;
			     C					;  (Red, Green, or Blue).			;AN000;
 = 0015                      C	ONE_THIRD	EQU MAX_INT*1/3 ; Used to calculate Red, Green, Blue intensity	;AN000;
 = 002A                      C	TWO_THIRD	EQU MAX_INT*2/3 ;  values.					;AN000;
			     C											;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; PRINTER CONTROL ASCII CODES							;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 = 000D                      C	CR		EQU	0DH	; Carriage return				;AN000;
 = 000A                      C	LF		EQU	0AH	; Line feed					;AN000;
				INCLUDE GRSHAR.STR			;  for both set of print modules	;AN000;
			     C	.LIST										;AN000;
			     C						;					;AN000;
			     C	SHARED_DATA_AREA_STR STRUC		;					;AN000;
 0000  0000                  C	  SD_TOTAL_SIZE       DW    ?		; Total # bytes ALLOCATED to the	;AN000;
			     C						;  the Shared Data Area.		;AN000;
			     C	  ;;;;;;;;;;;; Environment ;;;;;;;;;;;;;;					;AN000;
 0002  00                    C	  SWITCHES	      DB    0		; Command line switches 		;AN000;
 0003  00                    C	  HARDWARE_CONFIG     DB    ?		; Type of video hardware		;AN000;
 0004  00                    C	  PRINTER_TYPE	      DB    ?		; Type of printer attached		;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-5


			     C						;					;AN000;
			     C	  ;;;;;;;;;;;; Profile Data ;;;;;;;;;;;;;					;AN000;
 0005  00                    C	  DARKADJUST_VALUE    DB    0		; Darkness adjustment value		;AN000;
			     C						;					;AN000;
 0006  00                    C	  NUM_PRT_COLOR       DB    ?		; Number of print colors		;AN000;
 0007  0000                  C	  COLORPRINT_PTR      DW    ?		; Pointer to COLORPRINT info		;AN000;
			     C						;					;AN000;
 0009  00                    C	  NUM_PRT_BANDS       DB    ?		; Number of selectable print bands	;AN000;
 000A  0000                  C	  COLORSELECT_PTR     DW    ?		; Pointer to COLORSELECT info		;AN000;
			     C						;  bands				;AN000;
 000C  0000                  C	  DISPLAYMODE_PTR     DW  ?		; Pointer to start of DISPLAYMODE	;AN000;
			     C						;  info 				;AN000;
 000E                        C	SHARED_DATA_AREA_STR ENDS	       ;;					;AN000;
			     C											;AN000;
			     C											;AN000;
			     C	;;;;;;;;; COLORSELECT info structure ;;;;					;AN000;
			     C						;					;AN000;
			     C	COLORSELECT_STR  STRUC			;					;AN000;
 0000  00                    C	  NUM_SELECT_ESC    DB	?		; number of escape bytes to		;AN000;
			     C						;  select this band			;AN000;
 0001  00                    C	  SELECT_ESC	    DB	?		; Escape bytes to select band		;AN000;
 0002                        C	COLORSELECT_STR  ENDS		       ;;					;AN000;
			     C											;AN000;
			     C											;AN000;
			     C											;AN000;
			     C	;;;;;;;;; COLORPRINT info structure ;;;;;					;AN000;
			     C						;					;AN000;
			     C	COLORPRINT_STR	STRUC			;					;AN000;
 0000  00                    C	  RED		    DB	?		; RGB value				;AN000;
 0001  00                    C	  GREEN 	    DB	?		;					;AN000;
 0002  00                    C	  BLUE		    DB	?		;					;AN000;
			     C						; Bit mask indicating color		;AN000;
 0003  00                    C	  SELECT_MASK	    DB	?		;  bands required:			;AN000;
			     C						;  Bit 0: first band in table		;AN000;
 0004                        C	COLORPRINT_STR	ENDS		       ;;  Bit 1: second band...		;AN000;
			     C											;AN000;
			     C											;AN000;
			     C	;;;;;;;;; DISPLAYMODE info structure ;;;;					;AN000;
			     C						; A new block is built when a		;AN000;
			     C	DISPLAYMODE_STR STRUC			;  DISPLAYMODE statement is		;AN000;
			     C						;   found				;AN000;
 0000  0000                  C	  NEXT_DISP_MODE    DW	?		; Pointer to info for next		;AN000;
			     C						;  display mode; -1 if last		;AN000;
 0002  00                    C	  NUM_DISP_MODE     DB	?		; Number of display modes for		;AN000;
 0003  0000                  C	  DISP_MODE_LIST_PTR DW ?		;  this record - list of them		;AN000;
			     C						;					;AN000;
 0005  00                    C	  BOX_WIDTH	    DB	?		; Print box size - horizontal		;AN000;
 0006  00                    C	  BOX_HEIGHT	    DB	?		; Print box size - vertical		;AN000;
			     C						;					;AN000;
 0007  00                    C	  NUM_PATTERNS	    DB	?		; Number of grey patterns for		;AN000;
			     C						;  this box size			;AN000;
 0008  0000                  C	  PATTERN_TAB_PTR   DW	?		; pointer to grey pattern table 	;AN000;
			     C						;  for this display mode		;AN000;
 000A  00                    C	  NUM_GRAPHICS_ESC  DB	?		; # of escape byte for GRAPHICS 	;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-6


 000B  0000                  C	  GRAPHICS_ESC_PTR  DW	?		; pointer to GRAPHICS escape		;AN000;
 000D  0000                  C	  LOW_BYT_COUNT_PTR DW	?		; pointers to number of bytes sent	;AN000;
 000F  0000                  C	  HGH_BYT_COUNT_PTR DW	?		;  to the printer (1 word holds this	;AN000;
			     C						;    number but, must be send 1 byte	;AN000;
			     C						;     at a time).			;AN000;
 0011  00                    C	  NUM_SETUP_ESC     DB	?		; # of escape byte for SETUP		;AN000;
 0012  0000                  C	  SETUP_ESC_PTR     DW	?		; pointer to SETUP escape seq		;AN000;
			     C						;  for this display mode		;AN000;
 0014  00                    C	  NUM_RESTORE_ESC   DB	?		; # of escape byte for RESTORE		;AN000;
 0015  0000                  C	  RESTORE_ESC_PTR   DW	?		; pointer to RESTORE escape		;AN000;
			     C						;  seq for this display mode		;AN000;
 0017  00                    C	  PRINT_OPTIONS     DB	?		;					;AN000;
			     C						;					;AN000;
 0018                        C	DISPLAYMODE_STR ENDS		       ;;					;AN000;
			     C											;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;					;AN000;
			     C	;;										;AN000;
			     C	;; SHARED DATA AREA  -	EQUATES 						;AN000;
			     C	;;										;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;					;AN000;
			     C											;AN000;
			     C	; SWITCHES	      DB    <bit mask>	; Command line switches:		;AN000;
 = 0001                      C	    REVERSE_SW		EQU 1		;   /R					;AN000;
 = 0002                      C	    BACKGROUND_SW	EQU 2		;   /B					;AN000;
			     C						;					;AN000;
			     C	; HARDWARE_CONFIG     DB    <bit mask>	; Type of video hardware		;AN000;
 = 0001                      C	    PALACE		EQU 1		;  attached				;AN000;
 = 0002                      C	    ROUNDUP		EQU 2		; PS 2 MODEL 50 60 AND 80		;AN000;
 = 0004                      C	    EGA 		EQU 4		; Enhance Graphics Adapter		;AN000;
 = 0008                      C	    PC_CONVERTIBLE	EQU 8		; PC Convertible LCD			;AN000;
 = 0010                      C	    OLD_ADAPTER 	EQU 16		; Color Graph. Adater or MONO		;AN000;
			     C						;					;AN000;
			     C	; PRINTER_TYPE	      DB    <bit mask>	; Type of printer attached		;AN000;
 = 0001                      C	    COLOR		EQU 1		;					;AN000;
 = 0002                      C	    BLACK_WHITE 	EQU 2		;					;AN000;
			     C						;					;AN000;
			     C	; PRINT_OPTIONS       DB  <bit mask>	;					;AN000;
 = 0001                      C	    ROTATE		EQU 1		;					;AN000;
				INCLUDE GRPATTRN.STR			;					;AN000;
			     C	.LIST										;AN000;
			     C											;AN000;
			     C	TAB_ENTRY STRUC 	   ; TABLE DIRECTORY ENTRY USED TO LOCATED		;AN000;
			     C				   ;   WHAT TABLE OF PATTERNS TO USE			;AN000;
 0000  0000                  C	  TAB_OFFSET DW  ?	   ; ADDRESS OF THE PATTERN TABLE			;AN000;
 0002  0000                  C	  TAB_COPY   DW  ?	   ; ADDRESS OF PATTERN TABLE COPY IN SHARED DATA	;AN000;
 0004  0000                  C	  TAB_SIZE   DW  ?	   ; SIZE OF THE PATTERN TABLE				;AN000;
 0006  00                    C	  BOX_W_PAT  DB  ?	   ; BOX WIDTH	FOR PATTERNS IN THIS TABLE		;AN000;
 0007  00                    C	  BOX_H_PAT  DB  ?	   ; BOX HEIGHT FOR PATTERNS IN THIS TABLE		;AN000;
 0008  00                    C	  NB_INT     DB  ?	   ; NUMBER OF INTENSITIES IN THIS TABLE		;AN000;
 0009                        C	TAB_ENTRY ENDS									;AN000;
			     C											;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	; PATTERN TYPES:								;AN000;
			     C	;										;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-7


			     C	;      The maximum intensity field represents the upper bound for using 	;AN000;
			     C	; a pattern (e.g.,  the acual intensity of a specific pattern may be		;AN000;
			     C	; 25 but, it will be used for printing intensities of up to 32).		;AN000;
			     C	; Intensities range from 0 = Black to 63 = White.				;AN000;
			     C	;										;AN000;
			     C	;      For example, a 4x2 structure represents the following pattern:		;AN000;
			     C	;		      ---							;AN000;
			     C	;										;AN000;
			     C	;		      BYTES:	C1_4X2	C2_4X2	C3_4X2	C4_4X2			;AN000;
			     C	;										;AN000;
			     C	;	Top dot to print ------>   0	   0	   0	   0			;AN000;
			     C	;										;AN000;
			     C	; Least significatnt bit ------>   0	   0	   0	   0			;AN000;
			     C	; of the byte is the dot							;AN000;
			     C	; printed below.								;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C											;AN000;
			     C	PAT_4X2_STR STRUC			; PATTERN MADE OF 2X1 BOXES		;AN000;
 0000  00                    C	  MAX_4X2 DB	?			  ; Maximum intensity			;AN000;
 0001  00                    C	  C1_4X2  DB	00B			  ; Column 1 (Leftmost column)		;AN000;
 0002  00                    C	  C2_4X2  DB	00B			  ; Column 2				;AN000;
 0003  00                    C	  C3_4X2  DB	00B			  ; Column 3				;AN000;
 0004  00                    C	  C4_4X2  DB	00B			  ; Column 4 (Rightmost column) 	;AN000;
 0005                        C	PAT_4X2_STR ENDS								;AN000;
			     C											;AN000;
			     C	PAT_4X4_STR STRUC			; PATTERN MADE OF 2X2 BOXES		;AN000;
 0000  00                    C	  MAX_4X4 DB	?			  ; Maximum intensity			;AN000;
 0001  00                    C	  C1_4X4  DB	0000B			  ; Column 1 (Leftmost column)		;AN000;
 0002  00                    C	  C2_4X4  DB	0000B			  ; Column 2				;AN000;
 0003  00                    C	  C3_4X4  DB	0000B			  ; Column 3				;AN000;
 0004  00                    C	  C4_4X4  DB	0000B			  ; Column 4 (Rightmost column) 	;AN000;
 0005                        C	PAT_4X4_STR ENDS								;AN000;
			     C											;AN000;
			     C	PAT_6X2_STR STRUC			; PATTERN MADE OF 3X1 BOXES		;AN000;
 0000  00                    C	  MAX_6X2 DB	?			  ; Maximum intensity			;AN000;
 0001  00                    C	  C1_6X2  DB	00B			  ; Column 1 (Leftmost column)		;AN000;
 0002  00                    C	  C2_6X2  DB	00B			  ; Column 2				;AN000;
 0003  00                    C	  C3_6X2  DB	00B			  ; Column 3				;AN000;
 0004  00                    C	  C4_6X2  DB	00B			  ; Column 4				;AN000;
 0005  00                    C	  C5_6X2  DB	00B			  ; Column 5				;AN000;
 0006  00                    C	  C6_6X2  DB	00B			  ; Column 6 (Rightmost column) 	;AN000;
 0007                        C	PAT_6X2_STR ENDS								;AN000;
			     C											;AN000;
			     C	PAT_8X2_STR STRUC			; PATTERN MADE OF 4X1 BOXES		;AN000;
 0000  00                    C	  MAX_8X2 DB	?			  ; Maximum intensity			;AN000;
 0001  00                    C	  C1_8X2  DB	00B			  ; Column 1 (Leftmost column)		;AN000;
 0002  00                    C	  C2_8X2  DB	00B			  ; Column 2				;AN000;
 0003  00                    C	  C3_8X2  DB	00B			  ; Column 3				;AN000;
 0004  00                    C	  C4_8X2  DB	00B			  ; Column 4				;AN000;
 0005  00                    C	  C5_8X2  DB	00B			  ; Column 5				;AN000;
 0006  00                    C	  C6_8X2  DB	00B			  ; Column 6				;AN000;
 0007  00                    C	  C7_8X2  DB	00B			  ; Column 7				;AN000;
 0008  00                    C	  C8_8X2  DB	00B			  ; Column 8 (Rightmost column) 	;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-8


 0009                        C	PAT_8X2_STR ENDS								;AN000;
			     C											;AN000;
			     C	PAT_8X4_STR STRUC			; PATTERN MADE OF 4X2 BOXES		;AN000;
 0000  00                    C	  MAX_8X4 DB	?			  ; Maximum intensity			;AN000;
 0001  00                    C	  C1_8X4  DB	0000B			  ; Column 1 (Leftmost column)		;AN000;
 0002  00                    C	  C2_8X4  DB	0000B			  ; Column 2				;AN000;
 0003  00                    C	  C3_8X4  DB	0000B			  ; Column 3				;AN000;
 0004  00                    C	  C4_8X4  DB	0000B			  ; Column 4				;AN000;
 0005  00                    C	  C5_8X4  DB	0000B			  ; Column 5				;AN000;
 0006  00                    C	  C6_8X4  DB	0000B			  ; Column 6				;AN000;
 0007  00                    C	  C7_8X4  DB	0000B			  ; Column 7				;AN000;
 0008  00                    C	  C8_8X4  DB	0000B			  ; Column 8 (Rightmost column) 	;AN000;
 0009                        C	PAT_8X4_STR ENDS								;AN000;
			     C											;AN000;
			     C	PAT_6X4_STR STRUC			; PATTERN MADE OF 3X2 BOXES		;AN000;
 0000  00                    C	  MAX_6X4 DB	?			  ; Maximum intensity			;AN000;
 0001  00                    C	  C1_6X4  DB	0000B			  ; Column 1 (Leftmost column)		;AN000;
 0002  00                    C	  C2_6X4  DB	0000B			  ; Column 2				;AN000;
 0003  00                    C	  C3_6X4  DB	0000B			  ; Column 3				;AN000;
 0004  00                    C	  C4_6X4  DB	0000B			  ; Column 4				;AN000;
 0005  00                    C	  C5_6X4  DB	0000B			  ; Column 5				;AN000;
 0006  00                    C	  C6_6X4  DB	0000B			  ; Column 6 (Rightmost column) 	;AN000;
 0007                        C	PAT_6X4_STR ENDS								;AN000;
			     C											;AN000;
			     C	PAT_8X6_STR STRUC			; PATTERN MADE OF 4X3 BOXES		;AN000;
 0000  00                    C	  MAX_8X6 DB	?			  ; Maximum intensity			;AN000;
 0001  00                    C	  C1_8X6  DB	000000B 		  ; Column 1 (Leftmost column)		;AN000;
 0002  00                    C	  C2_8X6  DB	000000B 		  ; Column 2				;AN000;
 0003  00                    C	  C3_8X6  DB	000000B 		  ; Column 3				;AN000;
 0004  00                    C	  C4_8X6  DB	000000B 		  ; Column 4				;AN000;
 0005  00                    C	  C5_8X6  DB	000000B 		  ; Column 5				;AN000;
 0006  00                    C	  C6_8X6  DB	000000B 		  ; Column 6				;AN000;
 0007  00                    C	  C7_8X6  DB	000000B 		  ; Column 7				;AN000;
 0008  00                    C	  C8_8X6  DB	000000B 		  ; Column 8 (Rightmost column) 	;AN000;
 0009                        C	PAT_8X6_STR ENDS								;AN000;
									;					;AN000;
				INCLUDE GRCTRL.EXT			; Externals from PRT_SCR control module ;AN000;
			     C	PAGE	,132
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;					;AN000;
			     C	;; DOS - GRAPHICS Command
			     C	;; (C) Copyright 1988 Microsoft
			     C	;;										;AN000;
			     C	;; File Name:  GRCTRL.EXT							;AN000;
			     C	;; ----------									;AN000;
			     C	;;										;AN000;
			     C	;; Description: 								;AN000;
			     C	;; ------------ 								;AN000;
			     C	;;	 Include file containing external declarations for			;AN000;
			     C	;;	 the code and data defined in GRCTRL.ASM				;AN000;
			     C	;;										;AN000;
			     C	;; Change History:								;AN000;
			     C	;; ---------------								;AN000;
			     C	;;										;AN000;
			     C	;;										;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-9


			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;					;AN000;
			     C					       ;;					;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;					;AN000;
			     C	EXTRN  DET_HW_CONFIG:NEAR							;AN000;
			     C	EXTRN  RGB:BYTE 								;AN000;
			     C	EXTRN  BIOS_INT_5H:WORD 							;AN000;
			     C	EXTRN  PRT_SCR:NEAR								;AN000;
			     C	EXTRN  PRINT_SCREEN_ALLOWED:BYTE						;AN000;
			     C	EXTRN  XLT_TAB:BYTE								;AN000;
			     C	EXTRN  MODE_TYPE:BYTE								;AN000;
			     C	EXTRN  CUR_MODE_PTR:WORD							;AN000;
			     C	EXTRN  CUR_MODE:BYTE								;AN000;
			     C	EXTRN  MODE_TYPE:BYTE								;AN000;
			     C	EXTRN  NB_COLORS:WORD								;AN000;
			     C	EXTRN  SCREEN_HEIGHT:WORD							;AN000;
			     C	EXTRN  SCREEN_WIDTH:WORD							;AN000;
			     C	EXTRN  NB_CHAR_COLUMNS:BYTE							;AN000;
			     C	EXTRN  CUR_PAGE:BYTE								;AN000;
			     C	EXTRN  CUR_COLUMN:WORD								;AN000;
			     C	EXTRN  CUR_ROW:WORD								;AN000;
			     C	EXTRN  NB_SCAN_LINES:WORD							;AN000;
			     C	EXTRN  SCAN_LINE_MAX_LENGTH:WORD						;AN000;
			     C	EXTRN  CUR_SCAN_LNE_LENGTH:WORD 						;AN000;
			     C	EXTRN  PRT_BUF:BYTE								;AN000;
			     C	EXTRN  NB_BOXES_PER_PRT_BUF:BYTE						;AN000;
			     C	EXTRN  CUR_BOX:BYTE								;AN000;
			     C	EXTRN  BOX_H:BYTE								;AN000;
			     C	EXTRN  BOX_W:BYTE								;AN000;
			     C	EXTRN  ERROR_CODE:BYTE								;AN000;
			     C	EXTRN  ROTATE_SW:BYTE								;AN000;
				INCLUDE STRUC.INC			;					;AN000;
			     C	;;STRUC--Stucture Macro Library
			     C	;;Optimizing Version 2.30  03/31/87
			     C	
			     C	else	       ;else for if1
			     C	$Pop	$Temp
			     C	;;if	   $Temp ne $NoType
			     C	.xcref $NoConj,$And,$Or,$Short,$Near,$NearToShort,$AndOr,$Temp,$Temp2,$Dist
			     C	.xcref $NoType,$ConjIfType,$IfType,$ElseType,$WhileType,$ConjWhileType
			     C	.xcref $RepeatType,$ConjUntilType,$ForType,$ConjLeaveType,jncxz
			     C	.xcref $SelectType,$WhenType,$OtherwiseType,$ConjWhenType
			     C	.xcref jeq,jgt,jlt,jneq,jngt,jnlt,jnna,jnnae,jnnb,jnnbe,jnnc,jnncxz
			     C	.xcref jnne,jnng,jnnge,jnnl,jnnle,jnno,jnnp,jnns,jnnz,jnpe,jnpo,$BuildJump
			     C	.xcref $GetConj,$GetDist,$Poke,$Peek,$Push,$Pop,$Label,$CondJump,$CondLoop,$Test
			     C	.xcref $TopTest,$leave2,$until2,$StrucError,j,jn,jand,jnand,jnnand
			     C	.xcref jnnonzero,jnonzero,jnzero,jzero
			     C	.xcref $st,$sn,$OrFound,$LoopEnd,$LeaveFound,$DefDist
			     C	.xcref $LastLabel,$LastLabelOrg,$EquateLabel,$TraceLabel,$CondJump2,$ncxz
			     C	endif
			     C	
			     C	
 = 0000                      C	$st	= 0
 = 0000                      C	$sn	= 0
 = 0000                      C	$OrFound = 0
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-10


 = 0000                      C	$LoopEnd = 0
 = 0000                      C	$LeaveFound = 0
 =-0001                      C	$LastLabel = -1
 = 0000                      C	$LastLabelOrg = $
 = 0003                      C	$DefDist= $Short
			     C	$Push	%$NoType
				.LIST					;					;AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AN000;
				;;										;AN000;
				;;										;AN000;
				;; PRINT_COLOR : PRINT TEXT AND APA MODE SCREEN ON A COLOR PRINTER		;AN000;
				;;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT:	BP	 = Offset of the shared data area			;AN000;
				;		XLT_TAB  = Color translation table				;AN000;
				;										;AN000;
				;	OUTPUT: PRINTER 							;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;;										;AN000;
				;; Description: 								;AN000;
				;;   Main control module for printing of text and graphics			;AN000;
				;;   on color printers. 							;AN000;
				;;										;AN000;
				;;   Calls either the text or graphics mode routine.				;AN000;
				;;										;AN000;
				;; Called By:									;AN000;
				;;   PRINT_SCREEN								;AN000;
				;;										;AN000;
				;; External Calls:								;AN000;
				;;   LOC_MODE_PRT_INFO, PRINT_COLOR_APA, PRINT_COLOR_TXT			;AN000;
				;;										;AN000;
				;; Logic:									;AN000;
				;;   IF MODE_TYPE = TXT 							;AN000;
				;;     THEN CALL PRINT_COLOR_TXT						;AN000;
				;;   ELSE (MODE_TYPE = APA)							;AN000;
				;;     CALL LOC_MODE_PRT_INFO	 ; Get DISPLAYMODE record from the SHARED AREA	;AN000;
				;;     CALL PRINT_COLOR_APA							;AN000;
				;;   RETURN									;AN000;
				;;										;AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	;AN000;
 0000				PRINT_MODULE_START  LABEL BYTE							;AN000;
 0000				PRINT_COLOR	PROC NEAR							;AN000;
 0000  EB 09				JMP	SHORT PRINT_COLOR_BEGIN 					;AN000;
 0002  00 00 00 00		WHITE_BOX	DB	0,0,0,0 ; Print boxes for APA mode			;AN000;
 0006  00 00 00 00		BLACK_BOX	DB	?,?,?,? ;  NOTE: 1 print box = 1 screen pixel		;AN000;
								;   only BOX_W bytes are used out of these 2	;AN000;
								;    boxes.					;AN000;
														;AN000;
 000A  00			REQ_BAND_MASK	DB	?	; Mask = "All color bands needed for the current;AN000;
								;	   print line".                         ;AN000;
														;AN000;
 000B				PRINT_COLOR_BEGIN:								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-11


				.IF <MODE_TYPE EQ TXT>								;AN000;
 000B  80 3E 0000 E 00       3						cmp MODE_TYPE,TXT 
 0010  75 05                 6						jne $l2 
				.THEN										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; The screen is in a text mode: 						;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0012  E8 0057 R		  CALL PRINT_COLOR_TXT			; Print a text screen on a color printer;AN000;
				.ELSE										;AN000;
 0015  EB 3F                 3						jmp short $l1 
 0017                        2	$l2: 
				;-------------------------------------------------------------------------------;AN000;
				; The screen is in All Points Addressable mode: 				;AN000;
				; Locate and extract printer DISPLAYMODE information from			;AN000;
				; the shared data area. 							;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0017  E8 035B R			CALL	LOC_MODE_PRT_INFO	; Get printer info related to curr. mode;AN000;
				;										;AN000;
				;-------Test if DISPLAYMODE info record was found:				;AN000;
				       .IF <ERROR_CODE EQ DISPLAYMODE_INFO_NOT_FOUND>				;AN000;
 001A  80 3E 0000 E 02       3						cmp ERROR_CODE,DISPLAYMODE_INFO_NOT_FOUND 
 001F  75 07                 6						jne $l5 
				       .THEN									;AN000;
 0021  C6 06 0000 E 01			  MOV	  ERROR_CODE,UNABLE_TO_PRINT ; IF no record found,		;AN000;
 0026  EB 2E				  JMP	  SHORT PRINT_COLOR_END      ; then, return error code		;AN000;
				       .ENDIF				     ;	      and quit procedure	;AN000;
 0028                        2	$l5: 
				;										;AN000;
				;-------Get the box size from the DISPLAYMODE info record:			;AN000;
 0028  8B 1E 0000 E			MOV	BX,CUR_MODE_PTR 	; BX := Offset current DISPLAYMODE info.;AN000;
 002C  8A 67 05				MOV	AH,[BX].BOX_WIDTH	; Take local copy of the box size.	;AN000;
 002F  88 26 0000 E			MOV	BOX_W,AH		;  in BOX_W and BOX_H			;AN000;
 0033  8A 47 06				MOV	AL,[BX].BOX_HEIGHT						;AN000;
 0036  A2 0000 E			MOV	BOX_H,AL							;AN000;
				;										;AN000;
				;-------Verify if the box size obtained from DISPLAYMODE info. is valid 	;AN000;
				       .IF <ZERO AL> OR 		; IF height of the box is 0		;AN000;
 0039  0A C0                 3						or AL,AL 
 003B  74 04                 6						jz $l10 
				       .IF <ZERO AH>			;  OR width of the box is 0		;AN000;
 003D  0A E4                 3						or AH,AH 
 003F  75 07                 6						jnz $l8 
 0041                        3	$l10: 
				       .THEN				; THEN we can't print:                  ;AN000;
 0041  C6 06 0000 E 01			  MOV	  ERROR_CODE,UNABLE_TO_PRINT ; return error code		;AN000;
 0046  EB 0E				  JMP	  SHORT PRINT_COLOR_END      ;	     and quit			;AN000;
				       .ENDIF									;AN000;
 0048                        2	$l8: 
				;										;AN000;
				;-------Get the Print Orientation from the DISPLAYMODE info record		;AN000;
				       .IF <[BX].PRINT_OPTIONS EQ ROTATE>; If printing sideways 		;AN000;
 0048  80 7F 17 01           3						cmp [BX].PRINT_OPTIONS,ROTATE 
 004C  75 05                 6						jne $l11 
				       .THEN				;  then:				;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-12


 004E  C6 06 0000 E 01			  MOV	  ROTATE_SW,ON		;    Rotate switch := "ON"              ;AN000;
				       .ENDIF									;AN000;
 0053                        2	$l11: 
 0053  E8 0171 R		  CALL PRINT_COLOR_APA			; Print APA screen on a color printer	;AN000;
				.ENDIF										;AN000;
 0056                        2	$l1: 
 0056				PRINT_COLOR_END:								;AN000;
 0056  C3				RET									;AN000;
 0057				PRINT_COLOR ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-13


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; PRINT_COLOR_TXT: PRINT A TEXT MODE SCREEN ON A COLOR PRINTER			;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT:	BP		     = Offset of the shared data area		;AN000;
				;		XLT_TAB 	     = Color translation table			;AN000;
				;		SCREEN_WIDTH	     = Maximum length of Screen scan line.	;AN000;
				;		SCREEN_HEIGHT	     = Number of SCAN LINES on the screen	;AN000;
				;										;AN000;
				;	OUTPUT: PRINTER 							;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; DESCRIPTION: The screen is read and printed line by line; character by	;AN000;
				; character.									;AN000;
				; Each line is first scanned in order to determine what colors are present on	;AN000;
				; it and what printer bands will be needed to approximate these colors. 	;AN000;
				;										;AN000;
				; For each printer color band needed for the current line, this screen line	;AN000;
				; is READ AGAIN character by character; If the color of the			;AN000;
				; current character must use the current color band to be			;AN000;
				; approximated; then, the character is printed. 				;AN000;
				;										;AN000;
				;										;AN000;
				; LOGIC :									;AN000;
				;										;AN000;
				; Save current coordinates of the cursor.					;AN000;
				; Initialize the cursor to the first character to be read  (Top-left of screen) ;AN000;
				; FOR each row on the screen (SCREEN_HEIGHT)					;AN000;
				;   BEGIN									;AN000;
				;   CALL SCAN_FOR_BANDS_TXT(CUR_ROW,CUR_COLUMN,REQ_BAND_MASK)			;AN000;
				;   CUR_BAND_MASK := 01H							;AN000;
				;   IF REQ_BAND_MASK <> 0 THEN							;AN000;
				;	DO 8 TIMES								;AN000;
				;	 IF (REQ_BAND_MASK AND CUR_BAND_MASK)=1 THEN				;AN000;
				;	    CALL PRINT_BAND_TXT(CUR_ROW,CUR_COLUMN,CUR_BAND_MASK)		;AN000;
				;	    CALL PRINT_BYTE(CARRIAGE_RETURN)					;AN000;
				;	  ENDIF 								;AN000;
				;	  Shift CUR_BAND_MASK one bit left					;AN000;
				;	ENDDO									;AN000;
				;	CALL PRINT_BYTE(LINE_FEED)						;AN000;
				;   ENDIF									;AN000;
				;   CUR_COLUMN := 0		    ; Get next row coordinates			;AN000;
				;   CUR_ROW    := CUR_ROW + 1							;AN000;
				;   END ; FOR each row on the screen						;AN000;
				; Restore initial coordinates of the cursor					;AN000;
				;										;AN000;
 0057				PRINT_COLOR_TXT PROC								;AN000;
 0057  53				PUSH	BX								;AN000;
 0058  51				PUSH	CX								;AN000;
 0059  52				PUSH	DX								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-14


				;										;AN000;
				;-------Save coordinates of the cursor on the stack:				;AN000;
 005A  B4 03				MOV	AH,READ_CURSOR_CALL  ; Read position of the cursor on the screen;AN000;
 005C  8A 3E 0000 E			MOV	BH,CUR_PAGE	     ;	for the current page			;AN000;
 0060  CD 10				INT	10H		     ; Call BIOS				;AN000;
 0062  52				PUSH	DX		     ; DH := Row number, DL := Column number	;AN000;
								     ; CX := Top line and bottom line for cursor;AN000;
								     ;	      (not needed)			;AN000;
				;										;AN000;
				;-------Initialize the cursor to the first character to be read 		;AN000;
 0063  C7 06 0000 E 0000		MOV	CUR_ROW,0	     ; cursor = position (0,0) on the screen	;AN000;
 0069  C7 06 0000 E 0000		MOV	CUR_COLUMN,0	     ;	(top-left corner)			;AN000;
 006F  E8 0309 R			CALL	SET_CURSOR							;AN000;
														;AN000;
 0072  8B 0E 0000 E			MOV	CX,SCREEN_HEIGHT     ; CX := Number of rows on the screen	;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; FOR EACH ROW ON THE SCREEN:							;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0076				PRINT_1_TEXT_LINE:								;AN000;
 0076  E8 00DD R			CALL	SCAN_FOR_BANDS_TXT	; REQ_BAND_MASK := Print bands needed	;AN000;
									;  for this line			;AN000;
 0079  B2 01				MOV	DL,01H			; DL :="Current Band printed" mask      ;AN000;
														;AN000;
					; NOTE: The COLORSELECT records are stored sequentially in the		;AN000;
					; Shared Data area. The band mask 00000001 corresponds to the first	;AN000;
					; record, 00000010 to the second, etc.					;AN000;
					; The COLORSELECT record indicates: "How to select the color band"      ;AN000;
					; on the printer (It contains the bytes that must be sent to the printer;AN000;
														;AN000;
 007B  3E: 8B 5E 0A			MOV	BX,DS:[BP].COLORSELECT_PTR; BX := relative offset of COLORSELECT;AN000;
 007F  03 DD				ADD	BX,BP			; BX := absolute offset of COLORSELECT	;AN000;
 0081  51				PUSH	CX			; Save row counter			;AN000;
 0082  B9 0008				MOV	CX,8			; For up to the maximum number of print ;AN000;
									;  bands with this printer		;AN000;
					;-----------------------------------------------------------------------;AN000;
					;									;AN000;
					; FOR each Color Band available with the ribbon installed on the printer;AN000;
					;									;AN000;
					;-----------------------------------------------------------------------;AN000;
 0085					PRINT_1_COLOR_BAND_TXT: 	  ; Do one pass of the printer head:	;AN000;
					 .IF <BIT REQ_BAND_MASK AND DL>   ; IF this color band is needed	;AN000;
 0085  84 16 000A R          3						test REQ_BAND_MASK,DL 
 0089  74 1C                 6						jz $l14 
					 .THEN				  ;  by any character on the line	;AN000;
 008B  E8 0320 R			    CALL SET_COLOR_BAND 	  ; then, select the color band 	;AN000;
 008E  E8 011B R			    CALL PRINT_BAND_TXT 	  ;    and do one Print Pass for it.	;AN000;
					   .IF	<BIT ERROR_CODE NZ PRINTER_ERROR>				;AN000;
 0091  F6 06 0000 E 08       3						test ERROR_CODE,PRINTER_ERROR 
 0096  74 04                 6						jz $l17 
					   .THEN			  ; A printer error occurred:		;AN000;
 0098  59				      POP     CX		  ;   Restore the line counter		;AN000;
 0099  EB 2E 90				      JMP     PRINT_COLOR_TXT_END ;    and quit.			;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-15


					   .ENDIF								;AN000;
 009C                        2	$l17: 
 009C  B0 0D				    MOV     AL,CR		  ;    Print a carriage return		;AN000;
 009E  E8 053A R			    CALL    PRINT_BYTE							;AN000;
					   .IF	C								;AN000;
 00A1  73 04                 5						jnC $l14 
					   .THEN			  ; A printer error occurred:		;AN000;
 00A3  59				      POP     CX		  ;   Restore the line counter		;AN000;
 00A4  EB 23 90				      JMP     PRINT_COLOR_TXT_END ;    and quit.			;AN000;
					   .ENDIF			  ; ENDIF printer error 		;AN000;
					 .ENDIF 			  ; ENDIF this color band is needed	;AN000;
 00A7                        2	$l14: 
 00A7  D0 E2				  SHL	  DL,1			  ; Get next Color Band mask		;AN000;
									  ; [BX] := Next COLORSELECT record:	;AN000;
 00A9  8A 07				  MOV	  AL,[BX].NUM_SELECT_ESC  ;	skip the escape bytes		;AN000;
 00AB  32 E4				  XOR	  AH,AH 		  ;					;AN000;
 00AD  03 D8				  ADD	  BX,AX 		  ;					;AN000;
 00AF  43				  INC	  BX			  ;	skip the NUM_SELECT_ESC field	;AN000;
 00B0  E2 D3				LOOP	PRINT_1_COLOR_BAND_TXT						;AN000;
 00B2  59				POP	CX			  ; Restore row counter 		;AN000;
				;										;AN000;
				;-----Print a line feed:							;AN000;
 00B3  B0 0A				MOV	AL,LF								;AN000;
 00B5  E8 053A R			CALL	PRINT_BYTE		; Send the LF				;AN000;
 00B8  72 0F				JC	PRINT_COLOR_TXT_END	; If printer error, quit		;AN000;
				;										;AN000;
				;-------Get coordinates of the first character in the next scan line:		;AN000;
 00BA  FF 06 0000 E			INC	CUR_ROW 		;   CUR_ROW + 1 			;AN000;
 00BE  C7 06 0000 E 0000		MOV	CUR_COLUMN,0		;   CUR_COLUMN := 0			;AN000;
				;										;AN000;
				;-------Point CURSOR to first character in the next scan line:			;AN000;
 00C4  E8 0309 R			CALL	SET_CURSOR							;AN000;
														;AN000;
 00C7  E2 AD				LOOP	PRINT_1_TEXT_LINE	; Print next scan line			;AN000;
														;AN000;
				;										;AN000;
				;-------Restore CURSOR to its original location (saved on the stack)		;AN000;
 00C9				PRINT_COLOR_TXT_END:								;AN000;
 00C9  5A				POP	DX			; DH := Row number, DL := Column number ;AN000;
 00CA  8A CE				MOV	CL,DH								;AN000;
 00CC  89 0E 0000 E			MOV	CUR_ROW,CX		; CUR_ROW := Original row number	;AN000;
 00D0  8A CA				MOV	CL,DL								;AN000;
 00D2  89 0E 0000 E			MOV	CUR_COLUMN,CX		; CUR_COLUMN := Original column number	;AN000;
 00D6  E8 0309 R			CALL	SET_CURSOR		; Set the cursor back there		;AN000;
														;AN000;
 00D9  5A				POP	DX								;AN000;
 00DA  59				POP	CX								;AN000;
 00DB  5B				POP	BX								;AN000;
 00DC  C3				RET									;AN000;
 00DD				PRINT_COLOR_TXT ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-16


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; SCAN_FOR_BANDS_TEXT: DETERMINE WHAT PRINTER COLOR BANDS ARE NEEDED FOR	;AN000;
				;			PRINTING THE COLORS ON THE CURRENT SCREEN LINE. 	;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; INPUT:  CUR_ROW	      = row to start scanning				;AN000;
				;	  CUR_COLUMN	      = column to start scanning			;AN000;
				;	  ROTATE_SW	      = ON if printing is sideways			;AN000;
				;										;AN000;
				; OUTPUT: REQ_BAND_MASK 							;AN000;
				;										;AN000;
				;										;AN000;
				; DATA STRUCTURE REFERENCED:							;AN000;
				;	  XLT_TAB	     = Color translation table				;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; DESCRIPTION: Read all characters on the current line from left to right.	;AN000;
				; For each character, extract its band mask from the color translation table.	;AN000;
				; Add the band mask required for this character to the "Required Bands" mask.   ;AN000;
				;										;AN000;
				; LOGIC :									;AN000;
				; Save current coordinates							;AN000;
				; DO (SCREEN_WIDTH) TIMES							;AN000;
				;   Read a character								;AN000;
				;   Get its Band Mask from the color translation table in AL			;AN000;
				;   OR REQ_BAND_MASK,AL 	; Add its band mask to the "Required bands" mask;AN000;
				;   ; Get coordinates of the next character:					;AN000;
				;   INC CUR_COLUMN								;AN000;
				; Restore initial coordinates							;AN000;
				;										;AN000;
 00DD				SCAN_FOR_BANDS_TXT PROC NEAR							;AN000;
 00DD  FF 36 0000 E			PUSH	CUR_ROW 		; Save coordinates			;AN000;
 00E1  FF 36 0000 E			PUSH	CUR_COLUMN							;AN000;
 00E5  50				PUSH	AX								;AN000;
 00E6  53				PUSH	BX								;AN000;
 00E7  51				PUSH	CX								;AN000;
														;AN000;
 00E8  C6 06 000A R 00			MOV	REQ_BAND_MASK,0 	; No Color bands needed so far...	;AN000;
 00ED  8B 0E 0000 E			MOV	CX,SCREEN_WIDTH 	; For each character on the screen row	;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; FOR each character on the current scan line:					;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 00F1				SCAN_1_CHAR:									;AN000;
				;										;AN000;
				;-------Read the character at the current cursor position			;AN000;
 00F1  E8 0309 R			CALL	SET_CURSOR		; Set cursor at character to be read	;AN000;
 00F4  B4 08				MOV	AH,READ_CHAR_CALL	; Read one character			;AN000;
 00F6  8A 3E 0000 E			MOV	BH,CUR_PAGE		;  at CUR_PAGE, CUR_COLUMN and CUR_ROW	;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-17


 00FA  CD 10				INT	10H			; Call BIOS				;AN000;
									; AL:=Character read, AH:=Byte attribute;AN000;
 00FC  80 E4 0F				AND	AH,00001111B		; AH := Foreground color attribute	;AN000;
 00FF  86 C4				XCHG	AL,AH			; AL := AH, used as index in the XLT_TAB;AN000;
 0101  BB 0000 E			MOV	BX,OFFSET XLT_TAB	; BX := Offset of translation table	;AN000;
 0104  D7				XLAT	XLT_TAB 		; AL  = Band mask			;AN000;
				;										;AN000;
				;-------Obtain what Print bands are required to print the color of this char:	;AN000;
 0105  08 06 000A R			OR	REQ_BAND_MASK,AL						;AN000;
														;AN000;
 0109  FF 06 0000 E			INC	CUR_COLUMN		; Get coordinates of next character	;AN000;
 010D  E2 E2				LOOP	SCAN_1_CHAR		; Scan next character			;AN000;
														;AN000;
 010F  59				POP	CX								;AN000;
 0110  5B				POP	BX								;AN000;
 0111  58				POP	AX								;AN000;
 0112  8F 06 0000 E			POP	CUR_COLUMN		; Restore initial coordinates		;AN000;
 0116  8F 06 0000 E			POP	CUR_ROW 							;AN000;
 011A  C3				RET									;AN000;
 011B				SCAN_FOR_BANDS_TXT ENDP 							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-18


				PAGE										;AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AN000;
				;;										;AN000;
				;;   PRINT_BAND_TXT: PRINT ALL CHARACTERS ON THE CURRENT LINE THAT ARE THE SAME ;AN000;
				;;		     COLOR AS THE CURRENT PRINT BAND.				;AN000;
				;;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;  INPUT:  CUR_ROW,								;AN000;
				;	   CUR_COLUMN	  : Coordinates of the first character to be read in	;AN000;
				;			    the current scan line.				;AN000;
				;	   DL		  : Band mask indicating what print band to use 	;AN000;
				;			    for this print pass.				;AN000;
				;	   SCAN_LINE_LENGTH: Length of the current scan line.			;AN000;
				;										;AN000;
				;  OUTPUT: PRINTER								;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; LOGIC:									;AN000;
				;    DO (SCAN_LINE_LENGTH) TIMES						;AN000;
				;      CALL BIOS INT 10H Read Character - returns CHAR, COLOR_NUM		;AN000;
				;      IF (CUR_BAND_MASK AND XLAT_TAB[COLOR_NUM])=1				;AN000;
				;      THEN IF Background color is same as Foreground color			;AN000;
				;	    THEN								;AN000;
				;	      CALL PRINT_BYTE(SOLID_BOX)					;AN000;
				;	    ELSE								;AN000;
				;	      CALL PRINT_BYTE(CHAR)						;AN000;
				;      ELSE									;AN000;
				;	 CALL PRINT_BYTE(blank) 						;AN000;
				;      Get coordinates of the next character					;AN000;
				;										;AN000;
 011B				PRINT_BAND_TXT PROC								;AN000;
 = 00DB				SOLID_BOX	EQU	219	; ASCII Code for printing a solid box		;AN000;
 = 0020				BLANK		EQU	32	; ASCII code for printing a space		;AN000;
 011B  FF 36 0000 E			PUSH	CUR_COLUMN	; Save column number				;AN000;
 011F  50				PUSH	AX								;AN000;
 0120  53				PUSH	BX								;AN000;
 0121  51				PUSH	CX								;AN000;
 0122  8B 0E 0000 E			MOV	CX,SCREEN_WIDTH ; CX := Number of character on one screen row	;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; FOR each character on the current row:					;AN000;
				;										;AN000;
				;===============================================================================;AN000;
 0126				PRINT_1_CHAR:									;AN000;
				;										;AN000;
				;-------Read the character at the current cursor position			;AN000;
 0126  E8 0309 R			CALL	SET_CURSOR		; Set cursor at character to be read	;AN000;
 0129  B4 08				MOV	AH,READ_CHAR_CALL	; Read one character			;AN000;
 012B  8A 3E 0000 E			MOV	BH,CUR_PAGE		;  at CUR_PAGE, CUR_COLUMN and CUR_ROW	;AN000;
 012F  CD 10				INT	10H			; Call BIOS				;AN000;
									; AL:=Character read, AH:=Byte attribute;AN000;
 0131  A2 0170 R			MOV	CUR_CHAR,AL							;AN000;
 0134  8A F4				MOV	DH,AH			; DH := Byte attribute			;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-19


 0136  80 E6 F0				AND	DH,11110000B		; DH := Background color		;AN000;
 0139  D0 EE				SHR	DH,1			; DH := Background color right justified;AN000;
 013B  D0 EE				SHR	DH,1								;AN000;
 013D  D0 EE				SHR	DH,1								;AN000;
 013F  D0 EE				SHR	DH,1								;AN000;
 0141  80 E4 0F				AND	AH,00001111B		; AH := Foreground color right justified;AN000;
				;										;AN000;
				;-------Test if this character should be printed (need color of the current band;AN000;
 0144  8A C4				MOV	AL,AH			; AL:=color used as index in the XLT_TAB;AN000;
 0146  BB 0000 E			MOV	BX,OFFSET XLT_TAB	; BX := Offset of translation table	;AN000;
 0149  D7				XLAT	XLT_TAB 		; AL := Band mask (DL=current band mask);AN000;
				       .IF     <BIT AL AND DL>		;If needs this band to print the color	;AN000;
 014A  84 C2                 3						test AL,DL 
 014C  74 0D                 6						jz $l24 
				       .THEN				; of this character			;AN000;
					 .IF	 <AH EQ DH>		; then: when foreground = background	;AN000;
 014E  3A E6                 3						cmp AH,DH 
 0150  75 04                 6						jne $l27 
					 .THEN				;	send a solid box		;AN000;
 0152  B0 DB				    MOV     AL,SOLID_BOX	;					;AN000;
					 .ELSE				;	when foreground <> background	;AN000;
 0154  EB 07                 3						jmp short $l23 
 0156                        2	$l27: 
 0156  A0 0170 R			    MOV     AL,CUR_CHAR 	;	send the character		;AN000;
					 .ENDIF 			; Endif foreground = background 	;AN000;
				       .ELSE				; else: send a blank			;AN000;
 0159  EB 02                 3						jmp short $l23 
 015B                        2	$l24: 
 015B  B0 20				  MOV	  AL,BLANK		;					;AN000;
				       .ENDIF				; Endif color band needed		;AN000;
 015D                        2	$l23: 
 015D  E8 053A R			CALL	PRINT_BYTE		; Print the byte			;AN000;
 0160  72 06				JC	PRINT_BAND_TXT_END	; If printer error occurred: QUIT	;AN000;
 0162  FF 06 0000 E			INC CUR_COLUMN			; Else, Get next column; keep going	;AN000;
 0166  E2 BE				LOOP	PRINT_1_CHAR							;AN000;
														;AN000;
 0168				PRINT_BAND_TXT_END:								;AN000;
 0168  59				POP	CX								;AN000;
 0169  5B				POP	BX								;AN000;
 016A  58				POP	AX								;AN000;
 016B  8F 06 0000 E			POP	CUR_COLUMN		; Restore column number 		;AN000;
 016F  C3				RET									;AN000;
 0170  00			CUR_CHAR	DB ?								;AN000;
 0171				PRINT_BAND_TXT ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-20


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; PRINT_COLOR_APA: PRINT AN APA MODE SCREEN ON A COLOR PRINTER			;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT:	BP	 = Offset of the shared data area			;AN000;
				;		XLT_TAB  = Color translation table				;AN000;
				;		CUR_MODE_PTR = Coordinates of current DISPLAYMODE info. 	;AN000;
				;										;AN000;
				;	OUTPUT: PRINTER 							;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; DESCRIPTION: Each pixel on the screen is printed as a "box" of dots on the    ;AN000;
				; printer. For a screen pixel of a given color, the best color approximation	;AN000;
				; is chosen among the color available on the printer.				;AN000;
				;										;AN000;
				; The printer colors are obtained by selecting a print band. A few more printer ;AN000;
				; color are obtained by printing twice (or more times) with different color	;AN000;
				; bands.									;AN000;
				;										;AN000;
				; For example, let's say we have a ribbon on the printer with a YELLOW CYAN     ;AN000;
				; MAGENTA ribbon and we read a GREEN pixel on the screen.			;AN000;
				;										;AN000;
				;   We first determine what "box" size will be used to represent this pixel.    ;AN000;
				;   Let's say it's a 3x2 box (this is obtained from the DISPLAYMODE record)     ;AN000;
				;   In all cases, we will print this pixel as a 3x2 box of printer dots.	;AN000;
				;   That is, we will print 6 dots on the printer for one on the screen. 	;AN000;
				;   We do not use any kind of patterns (e,g,. printing only 2 dots out of 6)	;AN000;
				;   for printing on the color printer. A screen pixel is either printed 	;AN000;
				;   as a "full" box of printer dots or not printed at all (e,g,. if it's white).;AN000;
				;										;AN000;
				;   Now, from the COLORPRINT records, we know all the colors availables on the	;AN000;
				;   printer, and what print bands must be used (or overlaid) in order to	;AN000;
				;   obtain them.								;AN000;
				;										;AN000;
				;   So, we consult these COLORPRINT records one by one comparing how close	;AN000;
				;   the color of each of them is to our GREEN pixel. (the colors for our pixel	;AN000;
				;   AND for the printer color are both indicated in terms of RGB values)	;AN000;
				;   WE PICK THE CLOSEST PRINTER COLOR.						;AN000;
				;										;AN000;
				;   To conclude, our GREEN pixel will be printed by first selecting the YELLOW	;AN000;
				;   band, then sending to the printer a "box".  Then, the BLUE band is selected ;AN000;
				;   and the "box" is sent again.                                                ;AN000;
				;										;AN000;
				; This process is carried line by line. 					;AN000;
				;										;AN000;
				; For each line, we first read each pixel to see what color bands are going	;AN000;
				; to be needed for this line.							;AN000;
				;										;AN000;
				; Then, we loop for each band available on the printer. 			;AN000;
				;										;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-21


				; IF the current line needs the current printer band (i.e.,if any pixel on	;AN000;
				;  the line needs this color band in order to achieve its color.		;AN000;
				; THEN, we select this color band (we know how to do it from the COLORSELECT	;AN000;
				;	record in the Shared Data area) 					;AN000;
				;	AND we must read the line again; for each pixel that needs the current	;AN000;
				;	band  a "box" is sent to the printer.                                   ;AN000;
				;										;AN000;
				; LOGIC :									;AN000;
				;     CALL INIT_BLACK_BOX		; Initialize a print box		;AN000;
				;     CALL GET_SCREEN_INFO							;AN000;
				;     CALL SETUP_PRT								;AN000;
				;     DO (NB_SCAN_LINES) TIMES							;AN000;
				;	  CALL DET_CUR_SCAN_LNE_LENGTH						;AN000;
				;	  IF CUR_SCAN_LNE_LENGTH NE 0 THEN					;AN000;
				;	    CALL SCAN_FOR_BANDS_APA(CUR_ROW,CUR_COLUMN,REQ_BAND_MASK)		;AN000;
				;	    CUR_BAND_MASK := 01H						;AN000;
				;	    IF REQ_BAND_MASK <> 0 THEN						;AN000;
				;	       DO 8 TIMES							;AN000;
				;		  IF (REQ_BAND_MASK AND CUR_BAND_MASK)=1 THEN			;AN000;
				;		     CALL NEW_PRT_LINE						;AN000;
				;		     CALL PRINT_BAND_APA(CUR_ROW,CUR_COLUMN,CUR_BAND_MASK)	;AN000;
				;		     CALL PRINT_BYTE(CARRIAGE_RETURN)				;AN000;
				;		  ENDIF 							;AN000;
				;		  Shift CUR_BAND_MASK one bit left				;AN000;
				;	       ENDDO								;AN000;
				;	    ENDIF ; Should make a print pass for this color band		;AN000;
				;	    CALL PRINT_BYTE(LINE_FEED)						;AN000;
				;	  ENDIF ; Current scan line is not empty				;AN000;
				;	  IF rotated print THEN 						;AN000;
				;	     CUR_COLUMN := CUR_COLUMN - BOXES_PER_PRT_BUF			;AN000;
				;	     CUR_ROW := SAVE_START_ROW						;AN000;
				;	  ELSE									;AN000;
				;	     CUR_ROW := CUR_ROW + BOXES_PER_PRT_BUF				;AN000;
				;	     CUR_COLUMN := SAVE_START_COLUMN					;AN000;
				;	  ENDIF 								;AN000;
				;     ENDDO ; Number of Scan lines						;AN000;
				;     CALL RESTORE_PRT								;AN000;
				;										;AN000;
 0171				PRINT_COLOR_APA PROC								;AN000;
 0171  50				PUSH	AX								;AN000;
 0172  53				PUSH	BX								;AN000;
 0173  51				PUSH	CX								;AN000;
 0174  52				PUSH	DX								;AN000;
														;AN000;
														;AN000;
				;-------Initialize print box (A "box" represents one screen pel on the printer) ;AN000;
 0175  E8 0339 R			CALL INIT_BLACK_BOX							;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;  Determine where to start reading the screen: 				;AN000;
				;    If printing sideways, start in LOW LEFT corner.				;AN000;
				;    If normal printing, start in TOP LEFT corner.				;AN000;
				;  Determine the maximum length for a scan line:				;AN000;
				;    If printing sideways, it is the height of the screen.			;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-22


				;    For normal printing, it is the width of the screen.			;AN000;
				;  Determine the number of scan lines on the screen.				;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0178  E8 03CE R			CALL	GET_SCREEN_INFO 	; Get info. about how to read the screen;AN000;
 017B  E8 04B9 R			CALL	SETUP_PRT		; Set up the printer (Line spacing, etc);AN000;
				       .IF  <BIT ERROR_CODE NZ PRINTER_ERROR>					;AN000;
 017E  F6 06 0000 E 08       3						test ERROR_CODE,PRINTER_ERROR 
 0183  74 03                 6						jz $l31 
				       .THEN				; A printer error occurred: quit	;AN000;
 0185  E9 0208 R			  JMP	  PRINT_COLOR_APA_END	;					;AN000;
				       .ENDIF									;AN000;
 0188                        2	$l31: 
														;AN000;
 0188  8B 0E 0000 E			MOV	CX,NB_SCAN_LINES						;AN000;
				;----------------------------------------------------------------------------	;AN000;
				;										;AN000;
				; FOR EACH SCAN LINE ON THE SCREEN (and each print line):			;AN000;
				;										;AN000;
				;----------------------------------------------------------------------------	;AN000;
 018C				PRINT_SCAN_LINE:								;AN000;
 018C  E8 0426 R			CALL	DET_CUR_SCAN_LNE_LENGTH ; Determine length of the scan line	;AN000;
				       .IF <CUR_SCAN_LNE_LENGTH NE 0>	; If line is not empty			;AN000;
 018F  83 3E 0000 E 00       3						cmp CUR_SCAN_LNE_LENGTH,0 
 0194  74 40                 6						je $l34 
				       .THEN									;AN000;
 0196  E8 020D R			  CALL	  SCAN_FOR_BANDS_APA	  ; REQ_BAND_MASK := Mask for what print;AN000;
									  ;  bands are needed.			;AN000;
 0199  B2 01				  MOV	  DL,01H		  ; DL := "Current Band to be printed"  ;AN000;
 019B  3E: 8B 5E 0A			  MOV	  BX,DS:[BP].COLORSELECT_PTR; BX := Offset of COLORSELECT record;AN000;
 019F  03 DD				  ADD	  BX,BP 		  ;	("How to select the color band");AN000;
 01A1  51				  PUSH	  CX			  ; Save scan line counter		;AN000;
 01A2  B9 0008				  MOV	  CX,8			  ; For up to the maximum number of prin;AN000;
									  ;  bands with this printer		;AN000;
					  ;---------------------------------------------------------------------;AN000;
					  ;									;AN000;
					  ; FOR each Color Band needed: 					;AN000;
					  ;									;AN000;
					  ;---------------------------------------------------------------------;AN000;
 01A5				       PRINT_1_COLOR_BAND_APA:		  ; Only if this color band is needed:	;AN000;
					   .IF <BIT REQ_BAND_MASK AND DL> ;   Do one pass of the printer head	;AN000;
 01A5  84 16 000A R          3						test REQ_BAND_MASK,DL 
 01A9  74 1F                 6						jz $l37 
					   .THEN			  ;					;AN000;
 01AB  E8 0320 R			      CALL    SET_COLOR_BAND	  ; Select the color band on the printer;AN000;
 01AE  E8 0501 R			      CALL    NEW_PRT_LINE	  ; Send escape sequence to the printer ;AN000;
									  ;  for starting a new graphics line	;AN000;
					     .IF  <BIT ERROR_CODE NZ PRINTER_ERROR>				;AN000;
 01B1  F6 06 0000 E 08       3						test ERROR_CODE,PRINTER_ERROR 
 01B6  74 04                 6						jz $l40 
					     .THEN			  ; A printer error occurred:		;AN000;
 01B8  59					POP   CX		  ; Restore the line counter and	;AN000;
 01B9  EB 4D 90					JMP   PRINT_COLOR_APA_END ;  return				;AN000;
					     .ENDIF			  ; Endif printer error occurred	;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-23


 01BC                        2	$l40: 
														;AN000;
 01BC  E8 0276 R			      CALL PRINT_BAND_APA	  ; Do one Print Pass for current band	;AN000;
 01BF  B0 0D				      MOV     AL,CR		  ;   Print a carriage return		;AN000;
 01C1  E8 053A R			      CALL    PRINT_BYTE						;AN000;
					     .IF      C 		  ; If a printer error occurred 	;AN000;
 01C4  73 04                 5						jnC $l37 
					     .THEN								;AN000;
 01C6  59					POP   CX		  ; Restore the line counter and	;AN000;
 01C7  EB 3F 90					JMP   PRINT_COLOR_APA_END ;  return				;AN000;
					     .ENDIF			  ; End if printer error occurred	;AN000;
					   .ENDIF			  ; End if this color band is needed	;AN000;
 01CA                        2	$l37: 
 01CA  D0 E2				    SHL     DL,1		  ; Get next Color Band mask		;AN000;
									  ; Locate next COLORSELECT record:	;AN000;
 01CC  8A 07				    MOV     AL,[BX].NUM_SELECT_ESC;  skip the escape bytes		;AN000;
 01CE  32 E4				    XOR     AH,AH							;AN000;
 01D0  03 D8				    ADD     BX,AX							;AN000;
 01D2  43				    INC     BX			  ;  skip the NUM_SELECT_ESC field	;AN000;
 01D3  E2 D0				  LOOP	  PRINT_1_COLOR_BAND_APA					;AN000;
 01D5  59				  POP	  CX			  ; Restore scan line counter		;AN000;
				       .ENDIF ; Scan line length <> 0						;AN000;
 01D6                        2	$l34: 
				;										;AN000;
				;-----Print a line feed:							;AN000;
 01D6  B0 0A				MOV	AL,LF								;AN000;
 01D8  E8 053A R			CALL	PRINT_BYTE							;AN000;
 01DB  72 2B				JC	PRINT_COLOR_APA_END	  ; If a printer error occurred: quit	;AN000;
				;										;AN000;
				;-------Get coordinates of next scan line:					;AN000;
				       .IF <ROTATE_SW EQ ON>		; If printing sideways			;AN000;
 01DD  80 3E 0000 E 01       3						cmp ROTATE_SW,ON 
 01E2  75 11                 6						jne $l47 
				       .THEN				; then: 				;AN000;
 01E4  A0 0000 E			  MOV	  AL,NB_BOXES_PER_PRT_BUF;  AX := Numbers of pels read on row	;AN000;
 01E7  98				  CBW				;					;AN000;
 01E8  01 06 0000 E			  ADD	  CUR_COLUMN,AX 	;   CUR_COLUMN + Number of pels read	;AN000;
 01EC  A1 0000 E			  MOV	  AX,SCREEN_HEIGHT	;   CUR_ROW := SCREEN_HEIGHT - 1	;AN000;
 01EF  48				  DEC	  AX			;					;AN000;
 01F0  A3 0000 E			  MOV	  CUR_ROW,AX		;					;AN000;
				       .ELSE				; else, printing NOT rotated:		;AN000;
 01F3  EB 0E                 3						jmp short $l46 
 01F5                        2	$l47: 
 01F5  A0 0000 E			  MOV	  AL,NB_BOXES_PER_PRT_BUF ; AX := Number of pels read on column ;AN000;
 01F8  98				  CBW				;					;AN000;
 01F9  01 06 0000 E			  ADD	  CUR_ROW,AX		;   CUR_ROW + Number of pels read	;AN000;
 01FD  C7 06 0000 E 0000		  MOV	  CUR_COLUMN,0		;   CUR_COLUMN := 0			;AN000;
				       .ENDIF				; End if printing sideways		;AN000;
 0203                        2	$l46: 
 0203  E2 87				LOOP	PRINT_SCAN_LINE 	;					;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Restore the printer (send a Page Eject, etc.) 				;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-24


				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0205  E8 04DD R			CALL	RESTORE_PRT							;AN000;
 0208				PRINT_COLOR_APA_END:								;AN000;
 0208  5A				POP	DX								;AN000;
 0209  59				POP	CX								;AN000;
 020A  5B				POP	BX								;AN000;
 020B  58				POP	AX								;AN000;
 020C  C3				RET									;AN000;
 020D				PRINT_COLOR_APA ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-25


				PAGE										;AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AN000;
				;;										;AN000;
				;;										;AN000;
				;;   SCAN_FOR_BANDS_APA : DETERMINE WHAT PRINT BANDS ARE NEEDED FOR THE CURRENT ;AN000;
				;;			  PRINT PASS.						;AN000;
				;;										;AN000;
				;;------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; INPUT:  CUR_ROW	      : row to start scanning	(word)			;AN000;
				;	  CUR_COLUMN	      : column to start scanning (word) 		;AN000;
				;	  CUR_SCAN_LNE_LENGTH : length of the current scan line (word)		;AN000;
				;	  ROTATE_SW	      = ON if printing is sideways			;AN000;
				;										;AN000;
				; OUTPUT: REQ_BAND_MASK       : band mask for required bands (byte)		;AN000;
				;										;AN000;
				;;------------------------------------------------------------------------------;AN000;
				;;										;AN000;
				;; Data Structures Referenced:							;AN000;
				;;   Shared Data Area								;AN000;
				;;   Print Info 								;AN000;
				;;   Color Translate Table							;AN000;
				;;										;AN000;
				;;										;AN000;
				;; Description: 								;AN000;
				;;   Read all the dots required for one print line to determine 		;AN000;
				;;   the print bands required.	The print line corresponds to several		;AN000;
				;;   screen rows (or columns if rotated printing).  The number of		;AN000;
				;;   rows / columns per print line is stored in NB_BOXES_PER_PRT_BUF.		;AN000;
				;;   The band information is obtained from the Color Translate Table.		;AN000;
				;;										;AN000;
				;; Called By:									;AN000;
				;;   PRINT_COLOR_APA								;AN000;
				;;										;AN000;
				;; External Calls:								;AN000;
				;;   READ_DOT, BIOS INT 10H							;AN000;
				;;										;AN000;
				;; Logic:									;AN000;
				;;   Save initial coordinates							;AN000;
				;;   SAVE_START_COLUMN := CUR_COLUMN						;AN000;
				;;   REQ_BAND_MASK := 00H							;AN000;
				;;   DO (SCAN_LINE_LENGTH) TIMES						;AN000;
				;;	Save coordinates of the "column"                                        ;AN000;
				;;	DO (BOXES_PER_PRT_BUF) TIMES						;AN000;
				;;	  CALL READ_DOT(IN CUR_ROW,CUR_COLUMN; OUT COLOR_NUM)			;AN000;
				;;	   REQ_BAND_MASK := REQ_BAND_MASK OR COLOR_XLAT_TAB[BX] 		;AN000;
				;;	   IF rotated print THEN						;AN000;
				;;	      Increment CUR_COLUMN						;AN000;
				;;	   ELSE 								;AN000;
				;;	      Increment CUR_ROW 						;AN000;
				;;	   ENDIF								;AN000;
				;;	Restore coordinates of the "column"                                     ;AN000;
				;;	ENDDO									;AN000;
				;;	IF rotated print THEN							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-26


				;;	   Decrement CUR_ROW							;AN000;
				;;	ELSE									;AN000;
				;;	   Increment CUR_COLUMN 						;AN000;
				;;	ENDIF									;AN000;
				;;   ENDDO									;AN000;
				;;   Restore initial coordinates						;AN000;
				;;   RETURN									;AN000;
				;;										;AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	;AN000;
 020D				SCAN_FOR_BANDS_APA PROC NEAR							;AN000;
 020D  FF 36 0000 E			PUSH	CUR_ROW 							;AN000;
 0211  FF 36 0000 E			PUSH	CUR_COLUMN							;AN000;
 0215  50				PUSH	AX								;AN000;
 0216  53				PUSH	BX								;AN000;
 0217  51				PUSH	CX								;AN000;
														;AN000;
 0218  C6 06 000A R 00			MOV	REQ_BAND_MASK,0 	; No Color bands needed so far...	;AN000;
 021D  BB 0000 E			MOV	BX,OFFSET XLT_TAB	; BX := Offset of translation table	;AN000;
 0220  8B 0E 0000 E			MOV	CX,CUR_SCAN_LNE_LENGTH						;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; FOR each column on the current scan line (up to the last non=blank):		;AN000;
				;										;AN000;
				;===============================================================================;AN000;
 0224				SCAN_1_COLUMN:									;AN000;
 0224  51				PUSH	CX			; Save column counter			;AN000;
 0225  FF 36 0000 E			PUSH	CUR_ROW 		; Save coordinates of the "column"      ;AN000;
 0229  FF 36 0000 E			PUSH	CUR_COLUMN							;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; For each pixel within the current column of the scan line:			;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 022D  33 C9				XOR	CX,CX			; CX := Number of pixels to read	;AN000;
 022F  8A 0E 0000 E			MOV	CL,NB_BOXES_PER_PRT_BUF ;   within the current "column"         ;AN000;
 0233				SCAN_1_PIXEL:									;AN000;
 0233  E8 0553 R			CALL	READ_DOT		; AL := Index into translation table	;AN000;
 0236  D7				XLAT	XLT_TAB 		; AL := Band mask			;AN000;
 0237  08 06 000A R			OR	REQ_BAND_MASK,AL	; Add bands required for this pixel	;AN000;
														;AN000;
				;-------Get coordinates of next pixel:						;AN000;
				       .IF <ROTATE_SW EQ ON>		; If printing sideways			;AN000;
 023B  80 3E 0000 E 01       3						cmp ROTATE_SW,ON 
 0240  75 06                 6						jne $l51 
				       .THEN				;					;AN000;
 0242  FF 06 0000 E			  INC CUR_COLUMN		; then, increment column number 	;AN000;
				       .ELSE				;					;AN000;
 0246  EB 04                 3						jmp short $l50 
 0248                        2	$l51: 
 0248  FF 06 0000 E			  INC CUR_ROW			; else, increment row number		;AN000;
				       .ENDIF				;					;AN000;
 024C                        2	$l50: 
 024C  E2 E5				LOOP SCAN_1_PIXEL							;AN000;
 024E  8F 06 0000 E			POP	CUR_COLUMN		; Restore coordinates of the "column"   ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-27


 0252  8F 06 0000 E			POP	CUR_ROW 		;					;AN000;
 0256  59				POP	CX			; Restore column counter		;AN000;
														;AN000;
														;AN000;
				;-------Get coordinates of next "column":                                       ;AN000;
				       .IF <ROTATE_SW EQ ON>		; If printing sideways			;AN000;
 0257  80 3E 0000 E 01       3						cmp ROTATE_SW,ON 
 025C  75 06                 6						jne $l55 
				       .THEN				;					;AN000;
 025E  FF 0E 0000 E			  DEC CUR_ROW			; then, get row above on screen 	;AN000;
				       .ELSE				;					;AN000;
 0262  EB 04                 3						jmp short $l54 
 0264                        2	$l55: 
 0264  FF 06 0000 E			  INC CUR_COLUMN		; else, get column next right		;AN000;
				       .ENDIF				;					;AN000;
 0268                        2	$l54: 
 0268  E2 BA				LOOP	SCAN_1_COLUMN							;AN000;
														;AN000;
 026A  59				POP	CX								;AN000;
 026B  5B				POP	BX								;AN000;
 026C  58				POP	AX								;AN000;
 026D  8F 06 0000 E			POP	CUR_COLUMN							;AN000;
 0271  8F 06 0000 E			POP	CUR_ROW 							;AN000;
 0275  C3				RET									;AN000;
 0276				SCAN_FOR_BANDS_APA ENDP 							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-28


				PAGE										;AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AN000;
				;;										;AN000;
				;;   PRINT_BAND_APA : PRINT ALL DOTS ON CURRENT LINE THAT NEED THE CURRENT BAND ;AN000;
				;;		      TO APPROXIMATE THEIR COLOR.				;AN000;
				;;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;  INPUT:  CUR_ROW,								;AN000;
				;	   CUR_COLUMN	  : Coordinates of the first pixel to be read in the	;AN000;
				;			    current scan line.					;AN000;
				;	   DL		  : Band mask indicating what print band to use 	;AN000;
				;			    for this print pass.				;AN000;
				;	   CUR_SCAN_LNE_LENGTH: Length of the current scan line.		;AN000;
				;	   ROTATE_SW	   = ON if printing is sideways 			;AN000;
				;										;AN000;
				;  OUTPUT: PRINTER								;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;;										;AN000;
				;; Data Structures Referenced:							;AN000;
				;;   Shared Data Area								;AN000;
				;;   Print Info 								;AN000;
				;;   Color Translate Table							;AN000;
				;;										;AN000;
				;; Description: 								;AN000;
				;;   Print all dots on this print line which need the current			;AN000;
				;;   band. The print line corresponds to several				;AN000;
				;;   screen rows (or columns if rotated printing).  The number of		;AN000;
				;;   rows / columns per print line is stored in NB_BOXES_PER_PRT_BUF.		;AN000;
				;;   The band information is obtained from the Color Translate Table.		;AN000;
				;;										;AN000;
				;; Called By:									;AN000;
				;;   PRINT_COLOR_APA								;AN000;
				;;										;AN000;
				;; External Calls:								;AN000;
				;;   READ_DOT, BIOS INT 10H, STORE_BOX, PRT_BUFFER, PRINT_BYTE			;AN000;
				;;										;AN000;
				;; Logic:									;AN000;
				;;   SAVE_START_ROW := CUR_ROW							;AN000;
				;;   SAVE_START_COLUMN := CUR_COLUMN						;AN000;
				;;										;AN000;
				;;   CALL SET_COLOR_BAND	; Select the color for this print pass		;AN000;
				;;   DO (SCAN_LINE_LENGTH) TIMES						;AN000;
				;;	Save coordinates of the "column"                                        ;AN000;
				;;	Clear the print buffer							;AN000;
				;;	DO (BOXES_PER_PRT_BUF) TIMES						;AN000;
				;;	   CALL READ_DOT(CUR_ROW,CUR_COLUMN,COLOR_NUM)				;AN000;
				;;	   IF (CUR_BAND_MASK AND XLAT_TAB[COLOR_NUM])=1 THEN			;AN000;
				;;	      CALL STORE_BOX(black box) 					;AN000;
				;;	   ELSE 								;AN000;
				;;	      CALL STORE_BOX(white box) 					;AN000;
				;;	   ENDIF								;AN000;
				;;	   IF rotated print THEN						;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-29


				;;	      Decrement CUR_COLUMN						;AN000;
				;;	   ELSE 								;AN000;
				;;	      Increment CUR_ROW 						;AN000;
				;;	   ENDIF								;AN000;
				;;	ENDDO									;AN000;
				;;	CALL PRINT_BUFFER							;AN000;
				;;	Restore coordinates of the "column"                                     ;AN000;
				;;	; Get coordinates of the next "column";                                 ;AN000;
				;;	IF rotated print THEN							;AN000;
				;;	   Decrement CUR_ROW							;AN000;
				;;	   CUR_COLUMN := SAVE_START_COLUMN					;AN000;
				;;	ELSE									;AN000;
				;;	   Increment CUR_COLUMN 						;AN000;
				;;	   CUR_ROW := SAVE_START_ROW						;AN000;
				;;	ENDIF									;AN000;
				;;   ENDDO									;AN000;
				;;   RETURN									;AN000;
				;;										;AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AN000;
 0276				PRINT_BAND_APA	    PROC NEAR							;AN000;
 0276  FF 36 0000 E			PUSH	CUR_ROW 		; Save coordinates			;AN000;
 027A  FF 36 0000 E			PUSH	CUR_COLUMN							;AN000;
 027E  50				PUSH	AX								;AN000;
 027F  53				PUSH	BX								;AN000;
 0280  51				PUSH	CX								;AN000;
 0281  56				PUSH	SI								;AN000;
 0282  57				PUSH	DI								;AN000;
														;AN000;
 0283  BB 0000 E			MOV	BX,OFFSET XLT_TAB	; BX := Offset of translation table	;AN000;
 0286  8B 0E 0000 E			MOV	CX,CUR_SCAN_LNE_LENGTH						;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; FOR each column on the current scan line (up to the last non=blank):		;AN000;
				; (One "column" contains the number of pixels required to fill the Print buffer);AN000;
				;										;AN000;
				;===============================================================================;AN000;
 028A				PRINT_1_COLUMN: 								;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Clear the print buffer "PRT_BUF"                                              ;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 028A  33 FF				XOR	DI,DI		; DI := Number of bytes cleared in the buffer	;AN000;
 028C  33 C0				XOR	AX,AX								;AN000;
 028E  A0 0000 E			MOV	AL,BOX_W	; AX := Number of bytes in the print buffer	;AN000;
 0291				CLEAR_BUF:			; For each byte in the PRT_BUF: 		;AN000;
 0291  C6 85 0000 E 00			MOV	PRT_BUF[DI],0	;    Initialize byte to blanks			;AN000;
 0296  47				INC	DI		;    One more has been cleared			;AN000;
 0297  3B F8				CMP	DI,AX		;    All bytes cleared ?			;AN000;
 0299  7C F6				JL	CLEAR_BUF	;	 No, clear next one.			;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Fill up the print buffer "PRT_BUF"                                            ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-30


				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 029B  51				PUSH	CX			; Save column counter			;AN000;
 029C  33 C9				XOR	CX,CX			; CX := Number of pixels to read	;AN000;
 029E  8A 0E 0000 E			MOV	CL,NB_BOXES_PER_PRT_BUF ;   within the current "column"         ;AN000;
									;    of the scan line			;AN000;
 02A2  FF 36 0000 E			PUSH	CUR_ROW 		; Save coordinates of the "column"      ;AN000;
 02A6  FF 36 0000 E			PUSH	CUR_COLUMN							;AN000;
				;										;AN000;
				; For each pixel within the current column of the scan line:			;AN000;
 02AA				STORE_1_PIXEL:									;AN000;
 02AA  E8 0553 R			CALL	READ_DOT		; AL := Index into translation table	;AN000;
 02AD  D7				XLAT	XLT_TAB 		; AL := Band mask			;AN000;
				       .IF <BIT AL AND DL>		; If color of the current pixel needs	;AN000;
 02AE  84 C2                 3						test AL,DL 
 02B0  74 08                 6						jz $l59 
				       .THEN				;  the current printer band		;AN000;
 02B2  BE 0006 R			  MOV	SI,OFFSET BLACK_BOX	; then, store a box in the		;AN000;
 02B5  E8 0396 R			  CALL STORE_BOX		;	 PRT_BUF			;AN000;
				       .ELSE				;					;AN000;
 02B8  EB 06                 3						jmp short $l58 
 02BA                        2	$l59: 
 02BA  BE 0002 R			  MOV	SI,OFFSET WHITE_BOX	;  else, store an empty box		;AN000;
 02BD  E8 0396 R			  CALL STORE_BOX		;	  in the PRT_BUF		;AN000;
				       .ENDIF									;AN000;
 02C0                        2	$l58: 
				;										;AN000;
				;-------Get coordinates of next pixel:						;AN000;
				       .IF <ROTATE_SW EQ ON>		; If printing sideways			;AN000;
 02C0  80 3E 0000 E 01       3						cmp ROTATE_SW,ON 
 02C5  75 06                 6						jne $l63 
				       .THEN				;					;AN000;
 02C7  FF 06 0000 E			  INC CUR_COLUMN		; then, increment column number 	;AN000;
				       .ELSE				;					;AN000;
 02CB  EB 04                 3						jmp short $l62 
 02CD                        2	$l63: 
 02CD  FF 06 0000 E			  INC CUR_ROW			; else, increment row number		;AN000;
				       .ENDIF				;					;AN000;
 02D1                        2	$l62: 
 02D1  E2 D7				LOOP STORE_1_PIXEL							;AN000;
														;AN000;
 02D3  8F 06 0000 E			POP	CUR_COLUMN		; Restore coordinates of the "column"   ;AN000;
 02D7  8F 06 0000 E			POP	CUR_ROW 		;					;AN000;
 02DB  59				POP	CX			; Restore column counter		;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Print the PRT_BUF:								;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 02DC  E8 03B4 R			CALL	PRINT_BUFFER							;AN000;
				       .IF  <BIT ERROR_CODE NZ PRINTER_ERROR>					;AN000;
 02DF  F6 06 0000 E 08       3						test ERROR_CODE,PRINTER_ERROR 
 02E4  74 02                 6						jz $l66 
				       .THEN				; A printer error occurred: QUIT	;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-31


 02E6  EB 13				  JMP SHORT PRINT_BAND_APA_END	;					;AN000;
				       .ENDIF									;AN000;
 02E8                        2	$l66: 
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Get coordinates of next "column":                                             ;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				       .IF <ROTATE_SW EQ ON>		; If printing sideways			;AN000;
 02E8  80 3E 0000 E 01       3						cmp ROTATE_SW,ON 
 02ED  75 06                 6						jne $l70 
				       .THEN				;					;AN000;
 02EF  FF 0E 0000 E			  DEC CUR_ROW			; then, get row above on screen 	;AN000;
				       .ELSE				;					;AN000;
 02F3  EB 04                 3						jmp short $l69 
 02F5                        2	$l70: 
 02F5  FF 06 0000 E			  INC CUR_COLUMN		; else, get column next right		;AN000;
				       .ENDIF				;					;AN000;
 02F9                        2	$l69: 
 02F9  E2 8F				LOOP	PRINT_1_COLUMN							;AN000;
														;AN000;
 02FB				PRINT_BAND_APA_END:								;AN000;
 02FB  5F				POP	DI								;AN000;
 02FC  5E				POP	SI								;AN000;
 02FD  59				POP	CX								;AN000;
 02FE  5B				POP	BX								;AN000;
 02FF  58				POP	AX								;AN000;
 0300  8F 06 0000 E			POP	CUR_COLUMN		; Restore initial coordinates		;AN000;
 0304  8F 06 0000 E			POP	CUR_ROW 							;AN000;
 0308  C3				RET									;AN000;
 0309				PRINT_BAND_APA	ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-32


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; SET_CURSOR : SET THE CURSOR TO CUR_ROW, CUR_COLUMN AND CUR_PAGE		;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT:	CUR_ROW,							;AN000;
				;		CUR_COLUMN  = Coordinates for the cursor (word) 		;AN000;
				;		CUR_PAGE    = Page for which to set the cursor (byte)		;AN000;
				;										;AN000;
				;	OUTPUT: SCREEN								;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0309				SET_CURSOR PROC NEAR								;AN000;
 0309  50				PUSH	AX								;AN000;
 030A  53				PUSH	BX								;AN000;
 030B  52				PUSH	DX								;AN000;
 030C  8A 36 0000 E			MOV	DH,BYTE PTR CUR_ROW						;AN000;
 0310  8A 16 0000 E			MOV	DL,BYTE PTR CUR_COLUMN						;AN000;
 0314  8A 3E 0000 E			MOV	BH,CUR_PAGE							;AN000;
 0318  B4 02				MOV	AH,SET_CURSOR_CALL	; Set cursor request			;AN000;
 031A  CD 10				INT	10H			; Call BIOS				;AN000;
 031C  5A				POP	DX								;AN000;
 031D  5B				POP	BX								;AN000;
 031E  58				POP	AX								;AN000;
 031F  C3				RET									;AN000;
 0320				SET_CURSOR ENDP 								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-33


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; SET_COLOR_BAND : SET THE PRINTER TO THE CURRENT COLOR BAND			;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT: BX	= Offset of current COLORSELECT record in the		;AN000;
				;			  Shared data area.					;AN000;
				;	       DS:[BP]	= Offset of shared data area				;AN000;
				;										;AN000;
				;	OUTPUT: PRINTER 							;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0320				SET_COLOR_BAND PROC NEAR							;AN000;
 0320  50				PUSH	AX								;AN000;
 0321  53				PUSH	BX								;AN000;
 0322  51				PUSH	CX								;AN000;
														;AN000;
				;-------Send the escape sequence for selecting this color band to the printer:	;AN000;
 0323  33 C9				XOR	CX,CX								;AN000;
 0325  8A 0F				MOV	CL,[BX].NUM_SELECT_ESC	; CX := Number of bytes to send 	;AN000;
 0327  81 C3 0001			ADD	BX,OFFSET SELECT_ESC	; BX := Offset of bytes to send 	;AN000;
 032B				SEND_1_COLORSELECT_BYTE:							;AN000;
 032B  8A 07				MOV	AL,[BX] 		; AL := Byte to send to printer 	;AN000;
 032D  E8 053A R			CALL	PRINT_BYTE		; Send it				;AN000;
 0330  72 03				JC	SET_COLOR_BAND_END	; If printer error: return		;AN000;
 0332  43				INC	BX			; Get next byte 			;AN000;
 0333  E2 F6				LOOP	SEND_1_COLORSELECT_BYTE 					;AN000;
														;AN000;
 0335				SET_COLOR_BAND_END:								;AN000;
 0335  59				POP	CX								;AN000;
 0336  5B				POP	BX								;AN000;
 0337  58				POP	AX								;AN000;
 0338  C3				RET									;AN000;
 0339				SET_COLOR_BAND ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-34


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; INIT_BLACK_BOX: INIT. THE BOX FOR PRINTING APA MODE DOTS ON A COLOR PRINTER.	;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT:	BOX_W,								;AN000;
				;		BOX_H		= Size of the print box for one pixel.		;AN000;
				;										;AN000;
				;	OUTPUT: BLACK_BOX	= A box for which all dots are on.		;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; DESCRIPTION: Initialize the print box used to print a screen pixel.		;AN000;
				;										;AN000;
				; For example,									;AN000;
				; with a size of 3x2 the BLACK_BOX will use 3 bytes:				;AN000;
				;										;AN000;
				;										;AN000;
				;	  byte1     byte2     byte3						;AN000;
				;	(column1) (column2) (column3)						;AN000;
				;  bit 7 -->0	       0	 0						;AN000;
				;	    0	       0	 0						;AN000;
				;	    0	       0	 0						;AN000;
				;	    0	       0	 0						;AN000;
				;	    0	       0	 0						;AN000;
				;	    0	       0	 0						;AN000;
				;	    1	       1	 1						;AN000;
				;  bit 0 -->1	       1	 1						;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0339				INIT_BLACK_BOX PROC NEAR							;AN000;
 0339  50				PUSH	AX								;AN000;
 033A  53				PUSH	BX								;AN000;
 033B  51				PUSH	CX								;AN000;
														;AN000;
				;-------Build one box column:							;AN000;
 033C  33 C9				XOR	CX,CX								;AN000;
 033E  8A 0E 0000 E			MOV	CL,BOX_H	; CX := Height in bits of the print box 	;AN000;
 0342  32 C0				XOR	AL,AL		; AX := Bit mask for creating box column	;AN000;
				       .REPEAT			; For height of the box:			;AN000;
 0344                        2	$l73: 
 0344  D0 E0				  SHL	  AL,1		;						;AN000;
 0346  0C 01				  OR	  AL,1		;   Insert one bit in the box column		;AN000;
				       .LOOP									;AN000;
 0348  E2 FA                 2						loop $l73 
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	AL now contains one box column. 					;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
														;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-35


				;-------Replicate this column over all columns of the box.			;AN000;
 034A  33 DB				XOR	BX,BX		; BX := Index into the BOX			;AN000;
 034C				INIT_1_BLACK_COLUMN:								;AN000;
 034C  88 87 0006 R			MOV	BLACK_BOX[BX],AL; Init current column to black box column	;AN000;
 0350  43				INC	BX		; Get next column				;AN000;
 0351  3A 1E 0000 E			CMP	BL,BOX_W							;AN000;
 0355  7C F5				JL	INIT_1_BLACK_COLUMN						;AN000;
														;AN000;
 0357  59				POP	CX								;AN000;
 0358  5B				POP	BX								;AN000;
 0359  58				POP	AX								;AN000;
 035A  C3				RET									;AN000;
 035B				INIT_BLACK_BOX ENDP								;AN000;
				INCLUDE GRCOMMON.ASM								;AN000;
			     C		PAGE	,132								;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;					;AN000;
			     C	;; DOS - GRAPHICS Command
			     C	;; (c) Copyright 1988 Microsoft
			     C	;;										;AN000;
			     C	;; File Name:  GRCOMMON.ASM							;AN000;
			     C	;; ----------									;AN000;
			     C	;;										;AN000;
			     C	;; Description: 								;AN000;
			     C	;; ------------ 								;AN000;
			     C	;;										;AN000;
			     C	;;	 This file contains the modules common to the Print Screen		;AN000;
			     C	;;	 process of GRAPHICS.COM.						;AN000;
			     C	;;	 This file is included by both set of Print modules.			;AN000;
			     C	;;										;AN000;
			     C	;;	 This file MUST BE COMPILED WITH EACH SET OF MODULES since,		;AN000;
			     C	;;	 one set is relocated in memory at installation time; all		;AN000;
			     C	;;	 references to the common procedures must be resolved from		;AN000;
			     C	;;	 within each set of print modules.					;AN000;
			     C	;;										;AN000;
			     C	;;	 The set of common modules is relocated in memory along with		;AN000;
			     C	;;	 the selected set of print modules.					;AN000;
			     C	;;										;AN000;
			     C	;; Documentation Reference:							;AN000;
			     C	;; ------------------------							;AN000;
			     C	;;	 OASIS High Level Design						;AN000;
			     C	;;	 OASIS GRAPHICS I1 Overview						;AN000;
			     C	;;										;AN000;
			     C	;; Procedures Contained in This File:						;AN000;
			     C	;; ----------------------------------						;AN000;
			     C	;;	READ_DOT								;AN000;
			     C	;;	LOC_MODE_PRT_INFO							;AN000;
			     C	;;	STORE_BOX								;AN000;
			     C	;;	PRINT_BUFFER								;AN000;
			     C	;;	GET_SCREEN_INFO 							;AN000;
			     C	;;	SETUP_PRT								;AN000;
			     C	;;	RESTORE_PRT								;AN000;
			     C	;;	NEW_PRT_LINE								;AN000;
			     C	;;	PRINT_BYTE								;AN000;
			     C	;;	DET_CUR_SCAN_LNE_LENGTH 						;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-36


			     C	;;										;AN000;
			     C	;; Include Files Required:							;AN000;
			     C	;; -----------------------							;AN000;
			     C	;;	none									;AN000;
			     C	;;										;AN000;
			     C	;; External Procedure References:						;AN000;
			     C	;; ------------------------------						;AN000;
			     C	;;	 FROM FILE  GRCTRL.ASM: 						;AN000;
			     C	;;	      PRT_SCR	       - Main module for printing the screen.		;AN000;
			     C	;;	 FROM FILE  GRBWPRT.ASM:						;AN000;
			     C	;;	      PRT_BW_APA       - Main module for printing on BW printer.	;AN000;
			     C	;;	 FROM FILE  GRCOLPRT.ASM:						;AN000;
			     C	;;	      PRINT_COLOR      - Main module for printing on COLOR printer.	;AN000;
			     C	;;										;AN000;
			     C	;; Linkage Instructions:							;AN000;
			     C	;; -------------------- 							;AN000;
			     C	;;										;AN000;
			     C	;;	 This file is included by both GRBWPRT.ASM and GRCOLPRT.ASM and is	;AN000;
			     C	;;	 compiled with each of them. However, only one copy is made resident.	;AN000;
			     C	;;										;AN000;
			     C	;; Change History:								;AN000;
			     C	;; ---------------								;AN000;
			     C	;;										;AN000;
			     C	;;										;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;					;AN000;
			     C											;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-37


			     C	PAGE										;AN000;
			     C	;===============================================================================;AN000;
			     C	;										;AN000;
			     C	; LOC_MODE_PRT_INFO: LOCATE DISPLAYMODE PRINTER INFO. FOR THE CURRENT		;AN000;
			     C	;		     MODE							;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	;	INPUT:	BP		= Offset of the shared data area		;AN000;
			     C	;		CUR_MODE	= Current video mode				;AN000;
			     C	;										;AN000;
			     C	;	OUTPUT: CUR_MODE_PTR	= Absolute Offset of the			;AN000;
			     C	;				  current DISPLAYMODE INFO record.		;AN000;
			     C	;										;AN000;
			     C	;		ERROR_CODE	= DISPLAYMODE_INFO_NOT_FOUND if not found.	;AN000;
			     C	;										;AN000;
			     C	;	CALLED BY: PRINT_COLOR							;AN000;
			     C	;		   PRINT_BW_APA 						;AN000;
			     C	;										;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; DESCRIPTION:	DISPLAYMODE_PTR is pointing to the first DISPLAYMODE		;AN000;
			     C	; INFO record within the Shared Data Area.					;AN000;
			     C	;										;AN000;
			     C	; This (chained) list of DISPLAYMODE records is scanned until the record	;AN000;
			     C	; for the current mode is found.						;AN000;
			     C	;										;AN000;
			     C	; Note: All pointers in the DISPLAYMODE records are relative to the beginning	;AN000;
			     C	;	of the shared data area. Therefore, we must add the offset of the	;AN000;
			     C	;	shared data area (in BP) in order to access the data these pointers	;AN000;
			     C	;	are referencing.							;AN000;
			     C	;										;AN000;
			     C	;	The CUR_MODE_PTR is relative to the segment and references the		;AN000;
			     C	;	DISPLAYMODE record for the video mode currently set at print screen	;AN000;
			     C	;	time.									;AN000;
			     C	;										;AN000;
			     C	; LOGIC:									;AN000;
			     C	;										;AN000;
			     C	; FOUND := FALSE								;AN000;
			     C	; DO UNTIL FOUND OR END_OF_LIST 						;AN000;
			     C	;   Get a display mode information record					;AN000;
			     C	;   IF record.DISP_MODE = CUR_MODE						;AN000;
			     C	;     THEN FOUND := TRUE							;AN000;
			     C	;   ELSE									;AN000;
			     C	;     CUR_MODE_PTR := record.NEXT_DISP_MODE					;AN000;
			     C	;										;AN000;
			     C	;										;AN000;
			     C											;AN000;
 035B                        C	LOC_MODE_PRT_INFO PROC NEAR							;AN000;
 035B  53                    C		PUSH	BX								;AN000;
 035C  51                    C		PUSH	CX								;AN000;
 035D  52                    C		PUSH	DX								;AN000;
 035E  56                    C		PUSH	SI								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-38


			     C											;AN000;
 035F  3E: 8B 5E 0C          C		MOV	BX,DS:[BP].DISPLAYMODE_PTR	; [BX] := Current DISPLAYMODE	;AN000;
 0363  03 DD                 C		ADD	BX,BP				;	   record		;AN000;
 0365  8A 16 0000 E          C		MOV	DL,CUR_MODE			; DL := Current mode		;AN000;
			     C											;AN000;
 0369                        C	SCAN_1_DISPLAYMODE_RECORD:							;AN000;
 0369  8B 77 03              C		MOV	SI,[BX].DISP_MODE_LIST_PTR	; [SI] : First mode covered	;AN000;
 036C  03 F5                 C		ADD	SI,BP				;    by this DISPLAYMODE record ;AN000;
 036E  8A 4F 02              C		MOV	CL,[BX].NUM_DISP_MODE		; Scan each mode in the list	;AN000;
 0371  32 ED                 C		XOR	CH,CH								;AN000;
 0373                        C	SCAN_LIST_OF_MODES:								;AN000;
 0373  2E: 38 14             C		CMP	CS:[SI],DL			; FOUND ?			;AN000;
 0376  74 0E                 C		JE	FOUND								;AN000;
 0378  46                    C		INC	SI				; NO, get next mode in		;AN000;
 0379  E2 F8                 C		LOOP	SCAN_LIST_OF_MODES		;      DISPLAYMODE record	;AN000;
			     C											;AN000;
 037B  83 3F FF              C		CMP	[BX].NEXT_DISP_MODE,-1		; END OF DISPLAYMODE LIST ?	;AN000;
 037E  74 0C                 C		JE	NOT_FOUND			; Yes, this mode not supported	;AN000;
 0380                        C	NEXT_RECORD:					; No,				;AN000;
 0380  8B 1F                 C		MOV	BX,[BX].NEXT_DISP_MODE		;     [BX] := Next record	;AN000;
 0382  03 DD                 C		ADD	BX,BP				;				;AN000;
 0384  EB E3                 C		JMP	SHORT SCAN_1_DISPLAYMODE_RECORD 				;AN000;
			     C											;AN000;
 0386                        C	FOUND:						; Found:			;AN000;
 0386  89 1E 0000 E          C		MOV	CUR_MODE_PTR,BX 		; Update pointer to current	;AN000;
 038A  EB 05                 C		JMP	SHORT LOC_MODE_PRT_INFO_END	; DISPLAYMODE record.		;AN000;
			     C											;AN000;
 038C                        C	NOT_FOUND:					; Not found:			;AN000;
 038C  C6 06 0000 E 02       C		MOV	ERROR_CODE,DISPLAYMODE_INFO_NOT_FOUND ; Return error condition	;AN000;
			     C											;AN000;
 0391                        C	LOC_MODE_PRT_INFO_END:								;AN000;
 0391  5E                    C		POP	SI								;AN000;
 0392  5A                    C		POP	DX								;AN000;
 0393  59                    C		POP	CX								;AN000;
 0394  5B                    C		POP	BX								;AN000;
 0395  C3                    C		RET									;AN000;
 0396                        C	LOC_MODE_PRT_INFO ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-39


			     C	PAGE										;AN000;
			     C	;===============================================================================;AN000;
			     C	;										;AN000;
			     C	; STORE_BOX : STORE ONE BOX IN THE PRINT BUFFER.				;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	;	INPUT:	SI	   = OFFSET OF THE BOX TO BE PRINTED			;AN000;
			     C	;		BOX_W	   = BOX WIDTH IN BITS					;AN000;
			     C	;		BOX_H	   = BOX HEIGHT IN BITS 				;AN000;
			     C	;										;AN000;
			     C	;	OUTPUT: PRT_BUF  = THE PRINT BUFFER					;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; DESCRIPTION: The print buffer is first shifted left in order to make		;AN000;
			     C	; room for the new box (Note: the MSB's are lost; they are assumed to           ;AN000;
			     C	; have been printed), then the box is inserted in the low-order bits of 	;AN000;
			     C	; the printer buffer.								;AN000;
			     C	;										;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-40


			     C	PAGE										;AN000;
			     C	;			      EXAMPLE						;AN000;
			     C	;			      -------						;AN000;
			     C	; BEFORE:				     AFTER:				;AN000;
			     C	;										;AN000;
			     C	; BOX: 0    0	0								;AN000;
			     C	;      0    0	0								;AN000;
			     C	;      0    0	0								;AN000;
			     C	;      0    0	0								;AN000;
			     C	;      0    0	0								;AN000;
			     C	;      0    0	0								;AN000;
			     C	;      b1  b2  b3								;AN000;
			     C	;      b4  b5  b6								;AN000;
			     C	;										;AN000;
			     C	; PRT_BUF: byte1 byte2 byte3		     PRT_BUF:  byte1 byte2 byte3	;AN000;
			     C	;	     0	   1	 0				 1     1     1		;AN000;
			     C	;	     1	   0	 1				 1     1     1		;AN000;
			     C	;	     1	   1	 1				 1     1     1		;AN000;
			     C	;	     1	   1	 1				 1     1     1		;AN000;
			     C	;	     1	   1	 1				 1     1     1		;AN000;
			     C	;	     1	   1	 1				 1     1     1		;AN000;
			     C	;	     1	   1	 1				 b1    b2    b3 	;AN000;
			     C	;    LSB --> 1	   1	 1				 b4    b5    b6 	;AN000;
			     C	;										;AN000;
			     C	;										;AN000;
			     C	; LOGIC:									;AN000;
			     C	;										;AN000;
			     C	; FOR each byte of the buffer (BOX_W)						;AN000;
			     C	;   BEGIN									;AN000;
			     C	;   Make room for the box to be inserted					;AN000;
			     C	;   Insert the box								;AN000;
			     C	;   END 									;AN000;
			     C	;										;AN000;
 0396                        C	STORE_BOX PROC NEAR								;AN000;
 0396  53                    C		PUSH	BX								;AN000;
 0397  51                    C		PUSH	CX								;AN000;
 0398  57                    C		PUSH	DI								;AN000;
			     C											;AN000;
 0399  BF 0000 E             C		MOV	DI,OFFSET PRT_BUF ; DI := Offset of the Print buffer		;AN000;
 039C  33 DB                 C		XOR	BX,BX		  ; BX := Byte index number			;AN000;
			     C											;AN000;
 039E  8A 0E 0000 E          C		MOV	CL,BOX_H	  ; CL := Number of BITS to be shifted		;AN000;
			     C	; FOR each column (byte) of the box to be stored in the buffer: 		;AN000;
 03A2                        C	STORE_1_BYTE:									;AN000;
 03A2  D2 21                 C		SHL	BYTE PTR [BX][DI],CL	; Make room for the bits to be inserted ;AN000;
 03A4  8A 28                 C		MOV	CH,[BX][SI]		; CH := column of the box to be inserted;AN000;
 03A6  08 29                 C		OR	[BX][DI],CH		; Insert the box column in the buffer	;AN000;
 03A8  FE C3                 C		INC	BL			; Get next column (byte) of the box	;AN000;
 03AA  3A 1E 0000 E          C		CMP	BL,BOX_W		; All columns (bytes) of box stored ?	;AN000;
 03AE  7C F2                 C		JL	STORE_1_BYTE		; No, store next one.			;AN000;
			     C											;AN000;
 03B0                        C	STORE_BOX_END:									;AN000;
 03B0  5F                    C		POP	DI								;AN000;
 03B1  59                    C		POP	CX								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-41


 03B2  5B                    C		POP	BX								;AN000;
 03B3  C3                    C		RET									;AN000;
 03B4                        C	STORE_BOX ENDP									;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-42


			     C	PAGE										;AN000;
			     C	;===============================================================================;AN000;
			     C	;										;AN000;
			     C	; PRINT_BUFFER : PRINT THE BUFFER						;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	;	INPUT:	PRT_BUF  = BYTES TO BE PRINTED					;AN000;
			     C	;		BOW_W	 = BOX WIDTH						;AN000;
			     C	;										;AN000;
			     C	;	OUTPUT: PRINTER 							;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; DESCRIPTION: Prints BOX_W bytes.						;AN000;
			     C	;										;AN000;
			     C	; LOGIC:									;AN000;
			     C	;										;AN000;
			     C	; DO for each column in one pattern						;AN000;
			     C	;   BEGIN									;AN000;
			     C	;   Print one byte from the buffer						;AN000;
			     C	;   END 									;AN000;
			     C	;										;AN000;
 03B4                        C	PRINT_BUFFER PROC NEAR								;AN000;
 03B4  50                    C		PUSH	AX								;AN000;
 03B5  53                    C		PUSH	BX								;AN000;
 03B6  51                    C		PUSH	CX								;AN000;
			     C											;AN000;
 03B7  BB 0000 E             C		MOV	BX,OFFSET PRT_BUF						;AN000;
 03BA  33 C9                 C		XOR	CX,CX								;AN000;
 03BC  8A 0E 0000 E          C		MOV	CL,BOX_W							;AN000;
 03C0                        C	PRINT_1_BUF_COLUMN:								;AN000;
 03C0  8A 07                 C		MOV	AL,[BX] 	; Print one byte				;AN000;
 03C2  E8 053A R             C		CALL	PRINT_BYTE							;AN000;
 03C5  72 03                 C		JC	PRINT_BUFFER_END; If printer error, quit the loop		;AN000;
 03C7  43                    C		INC	BX		; Get next byte 				;AN000;
 03C8  E2 F6                 C		LOOP	PRINT_1_BUF_COLUMN						;AN000;
 03CA                        C	PRINT_BUFFER_END:								;AN000;
 03CA  59                    C		POP	CX								;AN000;
 03CB  5B                    C		POP	BX								;AN000;
 03CC  58                    C		POP	AX								;AN000;
 03CD  C3                    C		RET									;AN000;
 03CE                        C	PRINT_BUFFER ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-43


			     C	PAGE										;AN000;
			     C	;===============================================================================;AN000;
			     C	;										;AN000;
			     C	; GET_SCREEN_INFO : GET INFORMATION ABOUT HOW TO READ THE SCREEN.		;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	;	INPUT:	SCREEN_HEIGHT	  = Number of pixel rows on the screen		;AN000;
			     C	;		SCREEN_WIDTH	  = Number of pixel columns on screen		;AN000;
			     C	;		CUR_MODE_PTR	  = Offset of the current DISPLAYMODE info rec. ;AN000;
			     C	;										;AN000;
			     C	;	OUTPUT: PRINTER 							;AN000;
			     C	;		SCAN_LINE_MAX_LENGTH = Maximum length of Screen scan line.	;AN000;
			     C	;		NB_SCAN_LINES	  = Number of SCAN LINES on the screen		;AN000;
			     C	;		CUR_ROW,CUR_COLUMN = Coordinates of the first pixel to be	;AN000;
			     C	;					 read on the screen			;AN000;
			     C	;		NB_BOXES_PER_PRT_BUF = Number of boxes fitting in the Print	;AN000;
			     C	;				       buffer					;AN000;
			     C	;										;AN000;
			     C	;	CALLED BY: PRINT_COLOR							;AN000;
			     C	;		   PRT_BW_APA							;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; DESCRIPTION:									;AN000;
			     C	;										;AN000;
			     C	;    1) Determine where to start reading the screen.				;AN000;
			     C	;	For non-rotated printing, it should start with the top-left		;AN000;
			     C	;	corner pixel.								;AN000;
			     C	;	For rotated printing, it should start with the low-left corner		;AN000;
			     C	;	pixel.									;AN000;
			     C	;										;AN000;
			     C	;    2) Determine the length of a scan line.					;AN000;
			     C	;	For non-rotated printing, it is the WIDTH of the screen.		;AN000;
			     C	;	For rotated printing, it is the HEIGHT of the screen.			;AN000;
			     C	;										;AN000;
			     C	;    3) Determine the number of scan lines on the screen.			;AN000;
			     C	;	For non-rotated printing, it is the HEIGHT of the screen divided	;AN000;
			     C	;	by the number of boxes fitting in the print buffer.			;AN000;
			     C	;	For rotated printing, it is the WIDTH of the screen divided by		;AN000;
			     C	;	the number of boxes fitting in the print buffer.			;AN000;
			     C	;										;AN000;
			     C	; LOGIC:									;AN000;
			     C	;										;AN000;
			     C	; CUR_COLUMN   := 0								;AN000;
			     C	; IF printing is sideways							;AN000;
			     C	;   THEN									;AN000;
			     C	;     CUR_ROW := SCREEN_HEIGHT - 1	  ; Low-left pixel			;AN000;
			     C	;     SCAN_LINE_MAX_LENGTH := SCREEN_HEIGHT					;AN000;
			     C	;     NB_SCAN_LINES :=	SCREEN_WIDTH / NB_BOXES_PER_PRT_BUF			;AN000;
			     C	;   ELSE									;AN000;
			     C	;     CUR_ROW := 0			  ; Top-left pixel			;AN000;
			     C	;     SCAN_LINE_MAX_LENGTH := SCREEN_WIDTH					;AN000;
			     C	;     NB_SCAN_LINES :=	SCREEN_HEIGHT / NB_BOXES_PER_PRT_BUF			;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-44


			     C	;										;AN000;
			     C	;										;AN000;
 03CE                        C	GET_SCREEN_INFO PROC NEAR							;AN000;
 03CE  50                    C		PUSH	AX								;AN000;
 03CF  53                    C		PUSH	BX			; Used for DIV				;AN000;
 03D0  52                    C		PUSH	DX			; Used for DIV				;AN000;
			     C											;AN000;
 03D1  8B 1E 0000 E          C		MOV	BX,CUR_MODE_PTR 	; BX := Offset DISPLAYMODE info record	;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; Calculate how many printer boxes fit in the print buffer:			;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 03D5  B8 0008               C		MOV	AX,8			; Num := 8 bits / Box heigth		;AN000;
 03D8  8A 57 06              C		MOV	DL,[BX].BOX_HEIGHT						;AN000;
 03DB  F6 F2                 C		DIV	DL								;AN000;
 03DD  A2 0000 E             C		MOV	NB_BOXES_PER_PRT_BUF,AL 					;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; Determine where to start reading the screen:					;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 03E0  C7 06 0000 E 0000     C		MOV	CUR_COLUMN,0		; Reading always start from left of scr ;AN000;
			     C	.IF <[BX].PRINT_OPTIONS EQ ROTATE>						;AN000;
 03E6  80 7F 17 01           C3						cmp [BX].PRINT_OPTIONS,ROTATE 
 03EA  75 1B                 C6						jne $l76 
			     C	.THEN										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; Printing is sideways; screen must be read starting in low-left corner.	;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 03EC  A1 0000 E             C		MOV	AX,SCREEN_HEIGHT						;AN000;
 03EF  A3 0000 E             C		MOV	SCAN_LINE_MAX_LENGTH,AX ; Scan line length := screen height	;AN000;
 03F2  48                    C		DEC	AX								;AN000;
 03F3  A3 0000 E             C		MOV	CUR_ROW,AX		; First row := screen height - 1	;AN000;
			     C											;AN000;
			     C	;-------Calculate the number of scan lines:					;AN000;
 03F6  A1 0000 E             C		MOV	AX,SCREEN_WIDTH 	; DX AX = Screen width			;AN000;
 03F9  99                    C		CWD				;					;AN000;
 03FA  33 DB                 C		XOR	BX,BX			; BX	= Number of boxes per print buf ;AN000;
 03FC  8A 1E 0000 E          C		MOV	BL,NB_BOXES_PER_PRT_BUF ;					;AN000;
 0400  F7 F3                 C		DIV	BX			; Screen width / number boxes per buff	;AN000;
 0402  A3 0000 E             C		MOV	NB_SCAN_LINES,AX	; Number of scan lines := result	;AN000;
			     C	.ELSE										;AN000;
 0405  EB 1B                 C3						jmp short $l75 
 0407                        C2	$l76: 
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; Printing is not sideways; screen must be read starting in top-left corner	;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 0407  A1 0000 E             C		MOV	AX,SCREEN_WIDTH 						;AN000;
 040A  A3 0000 E             C		MOV	SCAN_LINE_MAX_LENGTH,AX ; Scan line length := screen width	;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-45


 040D  C7 06 0000 E 0000     C		MOV	CUR_ROW,0		; First row := 0			;AN000;
			     C											;AN000;
			     C	;-------Calculate the number of scan lines:					;AN000;
 0413  A1 0000 E             C		MOV	AX,SCREEN_HEIGHT	; DX AX = Screen height 		;AN000;
 0416  99                    C		CWD				;					;AN000;
 0417  33 DB                 C		XOR	BX,BX			; BX  = Number of boxes per print buff	;AN000;
 0419  8A 1E 0000 E          C		MOV	BL,NB_BOXES_PER_PRT_BUF ;					;AN000;
 041D  F7 F3                 C		DIV	BX			; Screen height/number boxes per buff.	;AN000;
 041F  A3 0000 E             C		MOV	NB_SCAN_LINES,AX	; Number of scan lines := result	;AN000;
			     C	.ENDIF										;AN000;
 0422                        C2	$l75: 
 0422  5A                    C		POP	DX								;AN000;
 0423  5B                    C		POP	BX								;AN000;
 0424  58                    C		POP	AX								;AN000;
 0425  C3                    C		RET									;AN000;
 0426                        C	GET_SCREEN_INFO ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-46


			     C	PAGE										;AN000;
			     C	;===============================================================================;AN000;
			     C	;										;AN000;
			     C	; DET_CUR_SCAN_LNE_LENGTH : Determine where is the last non-blank "scan line    ;AN000;
			     C	;				column" on the current scan line.               ;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	;     INPUT:  CUR_ROW,								;AN000;
			     C	;	      CUR_COLUMN	  = Coordinates of the top pixel of the current ;AN000;
			     C	;				    scan line.					;AN000;
			     C	;	      XLT_TAB		  = Color translation table			;AN000;
			     C	;										;AN000;
			     C	;     OUTPUT: CUR_SCAN_LNE_LENGTH = Number of "columns" of pixels from the      ;AN000;
			     C	;				    beginning of the scan line up to		;AN000;
			     C	;				    the last non-blank pixel.			;AN000;
			     C	;										;AN000;
			     C	; DATA	      SCREEN_WIDTH,							;AN000;
			     C	; REFERENCED: SCREEN_HEIGHT	  = Dimensions of the screen in pels		;AN000;
			     C	;	      SCAN_LINE_MAX_LENGTH= Maximum length of the scan line		;AN000;
			     C	;	      ROTATE_SW 	  = ON if printing is sideways			;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; DESCRIPTION: Determine where is the last non-blank "column" by reading        ;AN000;
			     C	; the scan line backwards, one column at a time.				;AN000;
			     C	;										;AN000;
			     C	;										;AN000;
			     C	; LOGIC:									;AN000;
			     C	;										;AN000;
			     C	; ; Obtain coordinates for the top pixel of the last column on the current	;AN000;
			     C	; ; scan line:									;AN000;
			     C	; IF printing is sideways							;AN000;
			     C	;   THEN									;AN000;
			     C	;   CUR_ROW := 0								;AN000;
			     C	; ELSE										;AN000;
			     C	;   CUR_COLUMN := SCREEN_WIDTH - 1						;AN000;
			     C	;										;AN000;
			     C	; CUR_SCAN_LNE_LENGTH := SCAN_LINE_MAX_LENGTH					;AN000;
			     C	; ; Read a column of pixels on the scan line until a non-blank is found:	;AN000;
			     C	; For each column on the screen 						;AN000;
			     C	;   CALL FILL_BUFF								;AN000;
			     C	; ; Check if PRT_BUF is empty							;AN000;
			     C	;   IF buffer is empty								;AN000;
			     C	;     THEN DEC	CUR_SCAN_LNE_LENGTH						;AN000;
			     C	;	   ; Get next column							;AN000;
			     C	;	   IF printing sideways THEN DEC CUR_ROW				;AN000;
			     C	;				ELSE DEC CUR_COLUMN				;AN000;
			     C	;   ELSE quit the loop								;AN000;
			     C	;										;AN000;
 0426                        C	DET_CUR_SCAN_LNE_LENGTH PROC NEAR						;AN000;
 0426  50                    C		PUSH	AX								;AN000;
 0427  53                    C		PUSH	BX								;AN000;
 0428  51                    C		PUSH	CX								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-47


 0429  52                    C		PUSH	DX								;AN000;
 042A  56                    C		PUSH	SI								;AN000;
 042B  57                    C		PUSH	DI								;AN000;
 042C  FF 36 0000 E          C		PUSH	CUR_COLUMN							;AN000;
 0430  FF 36 0000 E          C		PUSH	CUR_ROW 							;AN000;
			     C											;AN000;
 0434  BB 0000 E             C		MOV	BX,OFFSET XLT_TAB	; BX := Offset of XLT_TAB		;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; Obtain coordinates of the top pixel for the last column of the current	;AN000;
			     C	; scan line:									;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	       .IF <ROTATE_SW EQ ON>		; If printing sideways			;AN000;
 0437  80 3E 0000 E 01       C3						cmp ROTATE_SW,ON 
 043C  75 08                 C6						jne $l80 
			     C	       .THEN				; then, 				;AN000;
 043E  C7 06 0000 E 0000     C		  MOV	  CUR_ROW,0		;   CUR_ROW := 0			;AN000;
			     C	       .ELSE				; else, 				;AN000;
 0444  EB 09                 C3						jmp short $l79 
 0446                        C2	$l80: 
 0446  8B 0E 0000 E          C		  MOV	  CX,SCREEN_WIDTH	;   CUR_COLUMN := SCREEN_WIDTH - 1	;AN000;
 044A  49                    C		  DEC	  CX			;					;AN000;
 044B  89 0E 0000 E          C		  MOV	  CUR_COLUMN,CX 	;					;AN000;
			     C	       .ENDIF									;AN000;
 044F                        C2	$l79: 
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; Read the scan line backwards "column" by "column" until a non-blank is found: ;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 044F  8B 0E 0000 E          C		MOV	CX,SCAN_LINE_MAX_LENGTH ; CX := current length			;AN000;
			     C	;										;AN000;
			     C	;-------For each "column"                                                       ;AN000;
 0453                        C	CHECK_1_COLUMN: 								;AN000;
 0453  8B 36 0000 E          C		MOV	SI,CUR_ROW		; Save coordinates of the column	;AN000;
 0457  8B 3E 0000 E          C		MOV	DI,CUR_COLUMN		; in SI, DI				;AN000;
 045B  32 D2                 C		XOR	DL,DL			; DL := Number of pixels verified in	;AN000;
			     C						;	  one "column"                  ;AN000;
			     C	;										;AN000;
			     C	;-------For each pixel within that "column"                                     ;AN000;
 045D                        C	CHECK_1_PIXEL:									;AN000;
 045D  E8 0553 R             C		CALL	READ_DOT		; AL := Index into translation table	;AN000;
 0460  D7                    C		XLAT	XLT_TAB 		; AL := Band mask or Intensity		;AN000;
			     C											;AN000;
			     C	;-------Check if pixel will map to an empty box:				;AN000;
			     C	       .IF <DS:[BP].PRINTER_TYPE EQ BLACK_WHITE> ; If BLACK AND WHITE printer	;AN000;
 0461  3E: 80 7E 04 02       C3						cmp DS:[BP].PRINTER_TYPE,BLACK_WHITE 
 0466  75 06                 C6						jne $l84 
			     C	       .THEN				; then, check for intensity of white	;AN000;
 0468  3C 3F                 C		  CMP	  AL,WHITE_INT		;      If curent pixel not blank	;AN000;
 046A  75 3A                 C		  JNE	  DET_LENGTH_END	;      THEN, LEAVE THE LOOP		;AN000;
			     C	       .ELSE				; else, COLOR printer			;AN000;
 046C  EB 04                 C3						jmp short $l83 
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-48


 046E                        C2	$l84: 
 046E  0A C0                 C		  OR	  AL,AL 		;      IF Band mask not blank		;AN000;
 0470  75 34                 C		  JNZ	  DET_LENGTH_END	;      THEN, LEAVE THE LOOP		;AN000;
			     C	       .ENDIF									;AN000;
 0472                        C2	$l83: 
			     C											;AN000;
			     C	;-------All pixels so far on this "column" are blank, get next pixel:           ;AN000;
			     C	       .IF <ROTATE_SW EQ ON>		; If printing sideways			;AN000;
 0472  80 3E 0000 E 01       C3						cmp ROTATE_SW,ON 
 0477  75 06                 C6						jne $l88 
			     C	       .THEN				;					;AN000;
 0479  FF 06 0000 E          C		  INC CUR_COLUMN		; then, increment column number 	;AN000;
			     C	       .ELSE				;					;AN000;
 047D  EB 04                 C3						jmp short $l87 
 047F                        C2	$l88: 
 047F  FF 06 0000 E          C		  INC CUR_ROW			; else, increment row number		;AN000;
			     C	       .ENDIF				;					;AN000;
 0483                        C2	$l87: 
 0483  FE C2                 C		INC	DL			; One more pixel checked		;AN000;
 0485  3A 16 0000 E          C		CMP	DL,NB_BOXES_PER_PRT_BUF ; All pixels for that column done ?	;AN000;
 0489  7C D2                 C		JL	CHECK_1_PIXEL		;   No, check next one. 		;AN000;
			     C											;AN000;
			     C	;-------Nothing to print for this column, get next column			;AN000;
			     C	       .IF <ROTATE_SW EQ ON>		; If printing sideways			;AN000;
 048B  80 3E 0000 E 01       C3						cmp ROTATE_SW,ON 
 0490  75 0A                 C6						jne $l92 
			     C	       .THEN				; then, 				;AN000;
 0492  89 3E 0000 E          C		  MOV CUR_COLUMN,DI		;   Restore column number		;AN000;
 0496  FF 06 0000 E          C		  INC CUR_ROW			;   Get next row			;AN000;
			     C	       .ELSE				; else, 				;AN000;
 049A  EB 08                 C3						jmp short $l91 
 049C                        C2	$l92: 
 049C  89 36 0000 E          C		  MOV CUR_ROW,SI		;   Restore row number			;AN000;
 04A0  FF 0E 0000 E          C		  DEC CUR_COLUMN		;   Get next column			;AN000;
			     C	       .ENDIF				;					;AN000;
 04A4                        C2	$l91: 
 04A4  E2 AD                 C		LOOP CHECK_1_COLUMN		; CX (length) := CX - 1 		;AN000;
			     C											;AN000;
 04A6                        C	DET_LENGTH_END: 								;AN000;
 04A6  89 0E 0000 E          C		MOV	CUR_SCAN_LNE_LENGTH,CX	; Get current length			;AN000;
			     C											;AN000;
 04AA  8F 06 0000 E          C		POP	CUR_ROW 							;AN000;
 04AE  8F 06 0000 E          C		POP	CUR_COLUMN							;AN000;
 04B2  5F                    C		POP	DI								;AN000;
 04B3  5E                    C		POP	SI								;AN000;
 04B4  5A                    C		POP	DX								;AN000;
 04B5  59                    C		POP	CX								;AN000;
 04B6  5B                    C		POP	BX								;AN000;
 04B7  58                    C		POP	AX								;AN000;
 04B8  C3                    C		RET									;AN000;
 04B9                        C	DET_CUR_SCAN_LNE_LENGTH ENDP							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-49


			     C	PAGE										;AN000;
			     C	;===============================================================================;AN000;
			     C	;										;AN000;
			     C	; SETUP_PRT : SET UP THE PRINTER FOR PRINTING IN GRAPHIC MODE			;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	;	INPUT: CUR_MODE_PTR = Offset of the DISPLAYMODE information		;AN000;
			     C	;			      record for the current mode			;AN000;
			     C	;										;AN000;
			     C	;	OUTPUT: PRINTER 							;AN000;
			     C	;										;AN000;
			     C	;	CALLED BY: PRINT_COLOR							;AN000;
			     C	;		   PRT_BW_APA							;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; DESCRIPTION: Extract the SETUP escape sequence from the DISPLAYMODE		;AN000;
			     C	; information record; Send this escape sequence to the printer. 		;AN000;
			     C	;										;AN000;
			     C	; LOGIC:									;AN000;
			     C	;										;AN000;
			     C	; Number of bytes to print := CUR_MODE_PTR.NUM_SETUP_ESC			;AN000;
			     C	;										;AN000;
			     C	; Get the escape sequence:							;AN000;
			     C	; SI := CUR_MODE_PTR.SETUP_ESC_PTR						;AN000;
			     C	;										;AN000;
			     C	; FOR each byte to be printed							;AN000;
			     C	;   PRINT_BYTE [SI]			; Send the byte to the printer		;AN000;
			     C	;   INC SI				; Get the next byte			;AN000;
			     C	;										;AN000;
 04B9                        C	SETUP_PRT PROC NEAR								;AN000;
 04B9  50                    C		PUSH	AX								;AN000;
 04BA  53                    C		PUSH	BX								;AN000;
 04BB  51                    C		PUSH	CX								;AN000;
			     C											;AN000;
 04BC  8B 1E 0000 E          C		MOV	BX,CUR_MODE_PTR 	; BX := Displaymode info record.	;AN000;
			     C											;AN000;
 04C0  33 C9                 C		XOR	CX,CX			; CX := Number of bytes to print	;AN000;
 04C2  8A 4F 11              C		MOV	CL,[BX].NUM_SETUP_ESC	;					;AN000;
			     C	.IF <CL G 0>				; If there is at least one		;AN000;
 04C5  80 F9 00              C3						cmp CL,0 
 04C8  7E 0F                 C5						jnG $l95 
			     C	.THEN					; byte to be printed:			;AN000;
 04CA  8B 5F 12              C		MOV	BX,[BX].SETUP_ESC_PTR	; BX := Offset sequence to send 	;AN000;
 04CD  03 DD                 C		ADD	BX,BP								;AN000;
			     C											;AN000;
 04CF                        C	SEND_1_SETUP_BYTE:								;AN000;
 04CF  8A 07                 C		MOV	AL,[BX] 		; AL := byte to print			;AN000;
 04D1  E8 053A R             C		CALL	PRINT_BYTE		; Send it to the printer		;AN000;
 04D4  72 03                 C		JC	SETUP_PRT_END		; If printer error, quit the loop	;AN000;
 04D6  43                    C		INC	BX			; Get next byte 			;AN000;
 04D7  E2 F6                 C		LOOP	SEND_1_SETUP_BYTE						;AN000;
			     C	.ENDIF										;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-50


 04D9                        C2	$l95: 
 04D9                        C	SETUP_PRT_END:									;AN000;
 04D9  59                    C		POP	CX								;AN000;
 04DA  5B                    C		POP	BX								;AN000;
 04DB  58                    C		POP	AX								;AN000;
 04DC  C3                    C		RET									;AN000;
 04DD                        C	SETUP_PRT ENDP									;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-51


			     C	PAGE										;AN000;
			     C	;===============================================================================;AN000;
			     C	;										;AN000;
			     C	; RESTORE_PRT : RESTORE THE PRINTER TO ITS INITIAL STATUS			;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	;	INPUT: CUR_MODE_PTR = Offset of the DISPLAYMODE information		;AN000;
			     C	;				 record for the current mode			;AN000;
			     C	;										;AN000;
			     C	;	OUTPUT: PRINTER 							;AN000;
			     C	;										;AN000;
			     C	;	CALLED BY: PRINT_COLOR							;AN000;
			     C	;		   PRT_BW_APA							;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; DESCRIPTION: Extract the RESTORE escape sequence from the DISPLAYMODE 	;AN000;
			     C	; information record; Send this escape sequence to the printer. 		;AN000;
			     C	;										;AN000;
			     C	; LOGIC:									;AN000;
			     C	;										;AN000;
			     C	; Number of bytes to print := CUR_MODE_PTR.NUM_RESTORE_ESC			;AN000;
			     C	;										;AN000;
			     C	; Get the escape sequence:							;AN000;
			     C	; SI := CUR_MODE_PTR.RESTORE_ESC_PTR						;AN000;
			     C	; FOR each byte to be printed							;AN000;
			     C	;   PRINT_BYTE [SI]			; Send the byte to the printer		;AN000;
			     C	;   INC SI				; Get the next byte			;AN000;
			     C	;										;AN000;
 04DD                        C	RESTORE_PRT PROC NEAR								;AN000;
 04DD  50                    C		PUSH	AX								;AN000;
 04DE  53                    C		PUSH	BX								;AN000;
 04DF  51                    C		PUSH	CX								;AN000;
			     C											;AN000;
 04E0  8B 1E 0000 E          C		MOV	BX,CUR_MODE_PTR 	; BX := Displaymode info record.	;AN000;
			     C											;AN000;
 04E4  33 C9                 C		XOR	CX,CX			; CX := Number of bytes to print	;AN000;
 04E6  8A 4F 14              C		MOV	CL,[BX].NUM_RESTORE_ESC 					;AN000;
			     C	.IF <CL G 0>				; If there is at least one		;AN000;
 04E9  80 F9 00              C3						cmp CL,0 
 04EC  7E 0F                 C5						jnG $l98 
			     C	.THEN					; byte to be printed:			;AN000;
 04EE  8B 5F 15              C		MOV	BX,[BX].RESTORE_ESC_PTR ; BX := Offset sequence to send 	;AN000;
 04F1  03 DD                 C		ADD	BX,BP								;AN000;
			     C											;AN000;
 04F3                        C	SEND_1_RESTORE_BYTE:								;AN000;
 04F3  8A 07                 C		MOV	AL,[BX] 		; AL := byte to print			;AN000;
 04F5  E8 053A R             C		CALL	PRINT_BYTE		; Send it to the printer		;AN000;
 04F8  72 03                 C		JC	RESTORE_PRT_END 	; If printer error, quit the loop	;AN000;
 04FA  43                    C		INC	BX			; Get next byte 			;AN000;
 04FB  E2 F6                 C		LOOP	SEND_1_RESTORE_BYTE						;AN000;
			     C	.ENDIF										;AN000;
 04FD                        C2	$l98: 
 04FD                        C	RESTORE_PRT_END:								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-52


 04FD  59                    C		POP	CX								;AN000;
 04FE  5B                    C		POP	BX								;AN000;
 04FF  58                    C		POP	AX								;AN000;
 0500  C3                    C		RET									;AN000;
 0501                        C	RESTORE_PRT ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-53


			     C	PAGE										;AN000;
			     C	;===============================================================================;AN000;
			     C	;										;AN000;
			     C	; NEW_PRT_LINE : INITIALIZE THE PRINTER FOR A GRAPHIC LINE			;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	;	INPUT: CUR_MODE_PTR = Offset of the DISPLAYMODE information		;AN000;
			     C	;				 record for the current mode			;AN000;
			     C	;	       CUR_SCAN_LNE_LENGTH = Number of bytes to send to the printer.	;AN000;
			     C	;										;AN000;
			     C	;	OUTPUT: PRINTER 							;AN000;
			     C	;										;AN000;
			     C	;	CALLED BY: PRINT_BAND							;AN000;
			     C	;		   PRT_BW_APA							;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; DESCRIPTION: Extract the GRAPHICS escape sequence from the DISPLAYMODE	;AN000;
			     C	; information record; Send this escape sequence to the printer. 		;AN000;
			     C	; Then, send the number of bytes that will follow.				;AN000;
			     C	;										;AN000;
			     C	; LOGIC:									;AN000;
			     C	;										;AN000;
			     C	; Number of bytes to print := CUR_MODE_PTR.NUM_GRAPHICS_ESC			;AN000;
			     C	;										;AN000;
			     C	; Get the escape sequence:							;AN000;
			     C	; Set up the 2 bytes containing the number of bytes to send in this sequence.	;AN000;
			     C	; SI := CUR_MODE_PTR.GRAPHICS_ESC_PTR						;AN000;
			     C	;										;AN000;
			     C	; FOR each byte to be printed							;AN000;
			     C	;   PRINT_BYTE [SI]			; Send the byte to the printer		;AN000;
			     C	;   INC SI				; Get the next byte			;AN000;
			     C	;										;AN000;
			     C	; Send the byte count								;AN000;
			     C	;										;AN000;
			     C											;AN000;
 0501                        C	NEW_PRT_LINE PROC NEAR								;AN000;
 0501  50                    C		PUSH	AX								;AN000;
 0502  53                    C		PUSH	BX								;AN000;
 0503  51                    C		PUSH	CX								;AN000;
 0504  52                    C		PUSH	DX								;AN000;
 0505  57                    C		PUSH	DI								;AN000;
			     C											;AN000;
 0506  8B 1E 0000 E          C		MOV	BX,CUR_MODE_PTR 	; BX := Displaymode info record.	;AN000;
			     C											;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	; Set up the 2 bytes containing the number of bytes to send in the GRAPHICS seq.;AN000;
			     C	; NOTE: number of bytes to send is "CUR_SCAN_LNE_LENGTH * BOX_W"                ;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 050A  A0 0000 E             C		MOV	AL,BOX_W		;   cur_scan_lne_length *		;AN000;
 050D  98                    C		CBW				;   printer box width = nb bytes to send;AN000;
 050E  F7 26 0000 E          C		MUL	CUR_SCAN_LNE_LENGTH	;     (result in DX AX) 		;AN000;
			     C						;					;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-54


			     C	;-------AX := Number of bytes to print						;AN000;
 0512  8B 7F 0D              C		MOV	DI,[BX].LOW_BYT_COUNT_PTR; DI := Offset of LOW byte of		;AN000;
 0515  03 FD                 C		ADD	DI,BP			;	 byte count			;AN000;
 0517  88 05                 C		MOV	[DI],AL 		; Store low byte			;AN000;
 0519  8B 7F 0F              C		MOV	DI,[BX].HGH_BYT_COUNT_PTR; DI := Offset of HIGH byte of 	;AN000;
 051C  03 FD                 C		ADD	DI,BP			;	 byte count			;AN000;
 051E  88 25                 C		MOV	[DI],AH 		; Store high byte			;AN000;
			     C											;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	; Send the GRAPHICS escape sequence to the printer:				;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 0520  33 C9                 C		XOR	CX,CX				; CX := Length of the escape seq;AN000;
 0522  8A 4F 0A              C		MOV	CL,[BX].NUM_GRAPHICS_ESC					;AN000;
 0525  8B 5F 0B              C		MOV	BX,[BX].GRAPHICS_ESC_PTR	; BX := Offset sequence to send ;AN000;
 0528  03 DD                 C		ADD	BX,BP								;AN000;
			     C											;AN000;
 052A                        C	SEND_1_GRAPHICS_BYTE:								;AN000;
 052A  8A 07                 C		MOV	AL,[BX] 		; AL := byte to print			;AN000;
 052C  E8 053A R             C		CALL	PRINT_BYTE		; Send it to the printer		;AN000;
 052F  72 03                 C		JC	NEW_PRT_LINE_ENDP	; If printer error, quit the loop	;AN000;
 0531  43                    C		INC	BX			; Get next byte 			;AN000;
 0532  E2 F6                 C		LOOP	SEND_1_GRAPHICS_BYTE						;AN000;
			     C											;AN000;
 0534                        C	NEW_PRT_LINE_ENDP:								;AN000;
 0534  5F                    C		POP	DI								;AN000;
 0535  5A                    C		POP	DX								;AN000;
 0536  59                    C		POP	CX								;AN000;
 0537  5B                    C		POP	BX								;AN000;
 0538  58                    C		POP	AX								;AN000;
 0539  C3                    C		RET									;AN000;
 053A                        C	NEW_PRT_LINE ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-55


			     C	PAGE										;AN000;
			     C	;===============================================================================;AN000;
			     C	;										;AN000;
			     C	; PRINT_BYTE : SEND A BYTE TO THE PRINTER AT LPT1				;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	;	INPUT:	AL		= Byte to be printed				;AN000;
			     C	;										;AN000;
			     C	;	OUTPUT: PRINTER 							;AN000;
			     C	;		ERROR_CODE	= PRINTER_ERROR if an error is detected.	;AN000;
			     C	;		Carry flag is set in case of error.				;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
 053A                        C	PRINT_BYTE PROC    NEAR 							;AN000;
 053A  50                    C		PUSH	AX								;AN000;
 053B  52                    C		PUSH	DX								;AN000;
			     C											;AN000;
 053C  BA 0000               C		MOV	DX,0000 	; PRINTER NUMBER				;AN000;
 053F  B4 00                 C		MOV	AH,00		; REQUEST PRINT 				;AN000;
 0541  CD 17                 C		INT	17H		; CALL BIOS : SEND THE CHARACTER		;AN000;
			     C											;AN000;
 0543  80 E4 29              C		AND	AH,00101001B	; Test error code returned in AH for		;AN000;
			     C					;   "Out of paper", "I/O error" and "Time-out". ;AN000;
 0546  75 02                 C		JNZ	PRINT_BYTE_ERROR; Set the error code if error			;AN000;
 0548  EB 06                 C		JMP	SHORT PRINT_BYTE_END ; else, return normally			;AN000;
 054A                        C	PRINT_BYTE_ERROR:								;AN000;
 054A  C6 06 0000 E 08       C		MOV	ERROR_CODE,PRINTER_ERROR					;AN000;
 054F  F9                    C		STC			; Set the carry flag to indicate ERROR		;AN000;
 0550                        C	PRINT_BYTE_END: 								;AN000;
 0550  5A                    C		POP	DX								;AN000;
 0551  58                    C		POP	AX								;AN000;
 0552  C3                    C		RET									;AN000;
 0553                        C	PRINT_BYTE ENDP 								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-56


			     C	PAGE										;AN000;
			     C	;===============================================================================;AN000;
			     C	;										;AN000;
			     C	; READ_DOT: READ A PIXEL - RETURN A COLOR TRANSLATION TABLE INDEX		;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	;	INPUT:	CUR_MODE   = Current video mode.				;AN000;
			     C	;		CUR_ROW,							;AN000;
			     C	;		CUR_COLUMN = Coordinates of the pixel to be read.		;AN000;
			     C	;		CUR_PAGE   = Active page number 				;AN000;
			     C	;										;AN000;
			     C	;	OUTPUT: AL	   = Index into COLOR TRANSLATION TABLE.		;AN000;
			     C	;										;AN000;
			     C	;	DEPENDENCIES : COLOR TRANSLATION TABLE entries must be bytes		;AN000;
			     C	;										;AN000;
			     C	;										;AN000;
			     C	;-------------------------------------------------------------------------------;AN000;
			     C	;										;AN000;
			     C	; DESCRIPTION: Use VIDEO BIOS INTERRUPT 10H "READ DOT CALL".                    ;AN000;
			     C	;										;AN000;
			     C	; Depending on the video hardware, the dot returned by BIOS has 		;AN000;
			     C	; different meanings.								;AN000;
			     C	; With an EGA it is an index into the Palette registers,			;AN000;
			     C	; With a CGA it is a number from 0 to 3,  mapping to a specific color		;AN000;
			     C	; depending on the background color and the color palette currently		;AN000;
			     C	; selected.									;AN000;
			     C	;										;AN000;
			     C	; The Color Translation table has been set up to hold the correct color 	;AN000;
			     C	; mapping for any "dot" in any mode.  Therefore, the dot number returned        ;AN000;
			     C	; by INT 10H can be used with any mode as a direct index within that		;AN000;
			     C	; table.									;AN000;
			     C	;										;AN000;
			     C	; With APA Monochrome mode 0FH there are 4 different dots: white,		;AN000;
			     C	; blinking white, high-intensity white, and black.				;AN000;
			     C	;										;AN000;
			     C	; For mode 0FH, the dot returned by interrupt 10 "read dot" call is a byte      ;AN000;
			     C	; where only bits 0 and 2 are significant.  These 2 bits must be appended	;AN000;
			     C	; together in order to obtain a binary number (from 0 to 3) that will be used	;AN000;
			     C	; as an index in the Color Translation table.					;AN000;
			     C	;										;AN000;
			     C	; For mode 11H, the dot is either 0 (for background color) or 7 (for the	;AN000;
			     C	; foreground color) only the LSB is returned.  That is, we return either	;AN000;
			     C	; 0 or 1.									;AN000;
			     C	;										;AN000;
			     C	; LOGIC:									;AN000;
			     C	;										;AN000;
			     C	; Call VIDEO BIOS "READ DOT"                                                    ;AN000;
			     C	; IF CUR_MODE = 0FH								;AN000;
			     C	; THEN										;AN000;
			     C	;   Append bits 1 and 3.							;AN000;
			     C	; IF CUR_MODE = 11H								;AN000;
			     C	; THEN										;AN000;
			     C	;   Wipe out bits 1 and 2.							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Page     1-57


			     C	;										;AN000;
 0553                        C	READ_DOT PROC NEAR								;AN000;
 0553  53                    C		PUSH	BX			; Save registers			;AN000;
 0554  51                    C		PUSH	CX								;AN000;
 0555  52                    C		PUSH	DX								;AN000;
			     C											;AN000;
 0556  8A 3E 0000 E          C		MOV	BH,CUR_PAGE							;AN000;
 055A  8B 16 0000 E          C		MOV	DX,CUR_ROW							;AN000;
 055E  8B 0E 0000 E          C		MOV	CX,CUR_COLUMN							;AN000;
 0562  B4 0D                 C		MOV	AH,READ_DOT_CALL						;AN000;
 0564  CD 10                 C		INT	10H			; Call BIOS: AL <-- Dot read		;AN000;
			     C											;AN000;
 0566  80 3E 0000 E 0F       C		CMP	CUR_MODE,0FH		; Is it Mode 0fH ?			;AN000;
 056B  75 0D                 C		JNE	MODE_11H?		; No, look for mode 11h.		;AN000;
			     C	;-------Mode 0Fh is the current mode:						;AN000;
			     C	;-------Convert bits 2 and 0 into a 2 bit number:				;AN000;
 056D  8A D8                 C		MOV	BL,AL			; BL := AL = "Pixel read"               ;AN000;
 056F  80 E3 04              C		AND	BL,00000100B		; Wipe off all bits but bit 2 in BL	;AN000;
 0572  24 01                 C		AND	AL,00000001B		; Wipe off all bits but bit 0 in AL	;AN000;
 0574  D0 EB                 C		SHR	BL,1			;  Move bit 2 to bit 1 in BL		;AN000;
 0576  0A C3                 C		OR	AL,BL			;  Append bit 1 and bit 0		;AN000;
 0578  EB 09                 C		JMP	SHORT READ_DOT_END	;  Quit.				;AN000;
			     C											;AN000;
 057A                        C	MODE_11H?:									;AN000;
 057A  80 3E 0000 E 11       C		CMP	CUR_MODE,11H		; Is it Mode 0fH ?			;AN000;
 057F  75 02                 C		JNE	READ_DOT_END		; No, quit				;AN000;
			     C											;AN000;
			     C	;-------Mode 11H is the current mode:						;AN000;
 0581  24 01                 C		AND	AL,00000001B		; Keep only the Least significant bit	;AN000;
			     C											;AN000;
 0583                        C	READ_DOT_END:									;AN000;
 0583  5A                    C		POP	DX			; Restore registers			;AN000;
 0584  59                    C		POP	CX								;AN000;
 0585  5B                    C		POP	BX								;AN000;
 0586  C3                    C		RET									;AN000;
 0587                        C	READ_DOT ENDP									;AN000;
 = 0587				LEN_OF_COLOR_MODULES EQU $-PRINT_COLOR						;AN000;
 0587				CODE	ENDS									;AN000;
					END									;AN000;

Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              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

Structures and Records:

                N a m e                 Width   # fields
                                        Shift   Width   Mask    Initial

COLORPRINT_STR . . . . . . . . .  	0004	0004
  RED  . . . . . . . . . . . . .  	0000
  GREEN  . . . . . . . . . . . .  	0001
  BLUE . . . . . . . . . . . . .  	0002
  SELECT_MASK  . . . . . . . . .  	0003
COLORSELECT_STR  . . . . . . . .  	0002	0002
  NUM_SELECT_ESC . . . . . . . .  	0000
  SELECT_ESC . . . . . . . . . .  	0001
DISPLAYMODE_STR  . . . . . . . .  	0018	0010
  NEXT_DISP_MODE . . . . . . . .  	0000
  NUM_DISP_MODE  . . . . . . . .  	0002
  DISP_MODE_LIST_PTR . . . . . .  	0003
  BOX_WIDTH  . . . . . . . . . .  	0005
  BOX_HEIGHT . . . . . . . . . .  	0006
  NUM_PATTERNS . . . . . . . . .  	0007
  PATTERN_TAB_PTR  . . . . . . .  	0008
  NUM_GRAPHICS_ESC . . . . . . .  	000A
  GRAPHICS_ESC_PTR . . . . . . .  	000B
  LOW_BYT_COUNT_PTR  . . . . . .  	000D
  HGH_BYT_COUNT_PTR  . . . . . .  	000F
  NUM_SETUP_ESC  . . . . . . . .  	0011
  SETUP_ESC_PTR  . . . . . . . .  	0012
  NUM_RESTORE_ESC  . . . . . . .  	0014
  RESTORE_ESC_PTR  . . . . . . .  	0015
  PRINT_OPTIONS  . . . . . . . .  	0017
PAT_4X2_STR  . . . . . . . . . .  	0005	0005
  MAX_4X2  . . . . . . . . . . .  	0000
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Symbols-2


  C1_4X2 . . . . . . . . . . . .  	0001
  C2_4X2 . . . . . . . . . . . .  	0002
  C3_4X2 . . . . . . . . . . . .  	0003
  C4_4X2 . . . . . . . . . . . .  	0004
PAT_4X4_STR  . . . . . . . . . .  	0005	0005
  MAX_4X4  . . . . . . . . . . .  	0000
  C1_4X4 . . . . . . . . . . . .  	0001
  C2_4X4 . . . . . . . . . . . .  	0002
  C3_4X4 . . . . . . . . . . . .  	0003
  C4_4X4 . . . . . . . . . . . .  	0004
PAT_6X2_STR  . . . . . . . . . .  	0007	0007
  MAX_6X2  . . . . . . . . . . .  	0000
  C1_6X2 . . . . . . . . . . . .  	0001
  C2_6X2 . . . . . . . . . . . .  	0002
  C3_6X2 . . . . . . . . . . . .  	0003
  C4_6X2 . . . . . . . . . . . .  	0004
  C5_6X2 . . . . . . . . . . . .  	0005
  C6_6X2 . . . . . . . . . . . .  	0006
PAT_6X4_STR  . . . . . . . . . .  	0007	0007
  MAX_6X4  . . . . . . . . . . .  	0000
  C1_6X4 . . . . . . . . . . . .  	0001
  C2_6X4 . . . . . . . . . . . .  	0002
  C3_6X4 . . . . . . . . . . . .  	0003
  C4_6X4 . . . . . . . . . . . .  	0004
  C5_6X4 . . . . . . . . . . . .  	0005
  C6_6X4 . . . . . . . . . . . .  	0006
PAT_8X2_STR  . . . . . . . . . .  	0009	0009
  MAX_8X2  . . . . . . . . . . .  	0000
  C1_8X2 . . . . . . . . . . . .  	0001
  C2_8X2 . . . . . . . . . . . .  	0002
  C3_8X2 . . . . . . . . . . . .  	0003
  C4_8X2 . . . . . . . . . . . .  	0004
  C5_8X2 . . . . . . . . . . . .  	0005
  C6_8X2 . . . . . . . . . . . .  	0006
  C7_8X2 . . . . . . . . . . . .  	0007
  C8_8X2 . . . . . . . . . . . .  	0008
PAT_8X4_STR  . . . . . . . . . .  	0009	0009
  MAX_8X4  . . . . . . . . . . .  	0000
  C1_8X4 . . . . . . . . . . . .  	0001
  C2_8X4 . . . . . . . . . . . .  	0002
  C3_8X4 . . . . . . . . . . . .  	0003
  C4_8X4 . . . . . . . . . . . .  	0004
  C5_8X4 . . . . . . . . . . . .  	0005
  C6_8X4 . . . . . . . . . . . .  	0006
  C7_8X4 . . . . . . . . . . . .  	0007
  C8_8X4 . . . . . . . . . . . .  	0008
PAT_8X6_STR  . . . . . . . . . .  	0009	0009
  MAX_8X6  . . . . . . . . . . .  	0000
  C1_8X6 . . . . . . . . . . . .  	0001
  C2_8X6 . . . . . . . . . . . .  	0002
  C3_8X6 . . . . . . . . . . . .  	0003
  C4_8X6 . . . . . . . . . . . .  	0004
  C5_8X6 . . . . . . . . . . . .  	0005
  C6_8X6 . . . . . . . . . . . .  	0006
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Symbols-3


  C7_8X6 . . . . . . . . . . . .  	0007
  C8_8X6 . . . . . . . . . . . .  	0008
PIXEL_STR  . . . . . . . . . . .  	0003	0003
  R  . . . . . . . . . . . . . .  	0000
  G  . . . . . . . . . . . . . .  	0001
  B  . . . . . . . . . . . . . .  	0002
SHARED_DATA_AREA_STR . . . . . .  	000E	000A
  SD_TOTAL_SIZE  . . . . . . . .  	0000
  SWITCHES . . . . . . . . . . .  	0002
  HARDWARE_CONFIG  . . . . . . .  	0003
  PRINTER_TYPE . . . . . . . . .  	0004
  DARKADJUST_VALUE . . . . . . .  	0005
  NUM_PRT_COLOR  . . . . . . . .  	0006
  COLORPRINT_PTR . . . . . . . .  	0007
  NUM_PRT_BANDS  . . . . . . . .  	0009
  COLORSELECT_PTR  . . . . . . .  	000A
  DISPLAYMODE_PTR  . . . . . . .  	000C
TAB_ENTRY  . . . . . . . . . . .  	0009	0006
  TAB_OFFSET . . . . . . . . . .  	0000
  TAB_COPY . . . . . . . . . . .  	0002
  TAB_SIZE . . . . . . . . . . .  	0004
  BOX_W_PAT  . . . . . . . . . .  	0006
  BOX_H_PAT  . . . . . . . . . .  	0007
  NB_INT . . . . . . . . . . . .  	0008

Segments and Groups:

                N a m e         	Length	 Align	Combine Class

CODE . . . . . . . . . . . . . .  	0587	PARA	PUBLIC	'CODE'

Symbols:            

                N a m e         	Type	 Value	 Attr

ALT_SELECT_CALL  . . . . . . . .  	NUMBER	0012	
APA  . . . . . . . . . . . . . .  	NUMBER	0001	

BACKGROUND_SW  . . . . . . . . .  	NUMBER	0002	
BIOS_INT_5H  . . . . . . . . . .  	V WORD	0000	CODE	External
BIOS_SEG . . . . . . . . . . . .  	NUMBER	0040	
BLACK_BOX  . . . . . . . . . . .  	L BYTE	0006	CODE
BLACK_INT  . . . . . . . . . . .  	NUMBER	0000	
BLACK_WHITE  . . . . . . . . . .  	NUMBER	0002	
BLANK  . . . . . . . . . . . . .  	NUMBER	0020	
BOX_H  . . . . . . . . . . . . .  	V BYTE	0000	CODE	External
BOX_W  . . . . . . . . . . . . .  	V BYTE	0000	CODE	External

CHECK_1_COLUMN . . . . . . . . .  	L NEAR	0453	CODE
CHECK_1_PIXEL  . . . . . . . . .  	L NEAR	045D	CODE
CLEAR_BUF  . . . . . . . . . . .  	L NEAR	0291	CODE
COLOR  . . . . . . . . . . . . .  	NUMBER	0001	
CR . . . . . . . . . . . . . . .  	NUMBER	000D	
CUR_BOX  . . . . . . . . . . . .  	V BYTE	0000	CODE	External
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Symbols-4


CUR_CHAR . . . . . . . . . . . .  	L BYTE	0170	CODE
CUR_COLUMN . . . . . . . . . . .  	V WORD	0000	CODE	External
CUR_MODE . . . . . . . . . . . .  	V BYTE	0000	CODE	External
CUR_MODE_PTR . . . . . . . . . .  	V WORD	0000	CODE	External
CUR_PAGE . . . . . . . . . . . .  	V BYTE	0000	CODE	External
CUR_ROW  . . . . . . . . . . . .  	V WORD	0000	CODE	External
CUR_SCAN_LNE_LENGTH  . . . . . .  	V WORD	0000	CODE	External

DET_CUR_SCAN_LNE_LENGTH  . . . .  	N PROC	0426	CODE	Length = 0093
DET_HW_CONFIG  . . . . . . . . .  	L NEAR	0000	CODE	External
DET_LENGTH_END . . . . . . . . .  	L NEAR	04A6	CODE
DISPLAYMODE_INFO_NOT_FOUND . . .  	NUMBER	0002	
DISP_DESC_CALL . . . . . . . . .  	NUMBER	0015	

EGA  . . . . . . . . . . . . . .  	NUMBER	0004	
EGA_INFO_CALL  . . . . . . . . .  	NUMBER	0010	
ERROR_CODE . . . . . . . . . . .  	V BYTE	0000	CODE	External

FOUND  . . . . . . . . . . . . .  	L NEAR	0386	CODE

GET_C_REG_CALL . . . . . . . . .  	NUMBER	1015	
GET_P_REG_CALL . . . . . . . . .  	NUMBER	1007	
GET_SCREEN_INFO  . . . . . . . .  	N PROC	03CE	CODE	Length = 0058
GET_STATE_CALL . . . . . . . . .  	NUMBER	000F	

INIT_1_BLACK_COLUMN  . . . . . .  	L NEAR	034C	CODE
INIT_BLACK_BOX . . . . . . . . .  	N PROC	0339	CODE	Length = 0022

LEN_OF_COLOR_MODULES . . . . . .  	NUMBER	0587		Global
LF . . . . . . . . . . . . . . .  	NUMBER	000A	
LOC_MODE_PRT_INFO  . . . . . . .  	N PROC	035B	CODE	Length = 003B
LOC_MODE_PRT_INFO_END  . . . . .  	L NEAR	0391	CODE

MAX_INT  . . . . . . . . . . . .  	ALIAS	 WHITE_INT		
MODE_11H?  . . . . . . . . . . .  	L NEAR	057A	CODE
MODE_NOT_SUPPORTED . . . . . . .  	NUMBER	0004	
MODE_TYPE  . . . . . . . . . . .  	V BYTE	0000	CODE	External

NB_BOXES_PER_PRT_BUF . . . . . .  	V BYTE	0000	CODE	External
NB_CHAR_COLUMNS  . . . . . . . .  	V BYTE	0000	CODE	External
NB_COLORS  . . . . . . . . . . .  	V WORD	0000	CODE	External
NB_ROWS_OFFSET . . . . . . . . .  	NUMBER	0084	
NB_SCAN_LINES  . . . . . . . . .  	V WORD	0000	CODE	External
NEW_PRT_LINE . . . . . . . . . .  	N PROC	0501	CODE	Length = 0039
NEW_PRT_LINE_ENDP  . . . . . . .  	L NEAR	0534	CODE
NEXT_RECORD  . . . . . . . . . .  	L NEAR	0380	CODE
NO . . . . . . . . . . . . . . .  	NUMBER	0000	
NOT_FOUND  . . . . . . . . . . .  	L NEAR	038C	CODE
NO_ERROR . . . . . . . . . . . .  	NUMBER	0000	

OFF  . . . . . . . . . . . . . .  	NUMBER	0000	
OLD_ADAPTER  . . . . . . . . . .  	NUMBER	0010	
ON . . . . . . . . . . . . . . .  	NUMBER	0001	
ONE_THIRD  . . . . . . . . . . .  	NUMBER	0015	
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Symbols-5



PAGE_STATE_CALL  . . . . . . . .  	NUMBER	101A	
PALACE . . . . . . . . . . . . .  	NUMBER	0001	
PC_CONVERTIBLE . . . . . . . . .  	NUMBER	0008	
PRINTER_ERROR  . . . . . . . . .  	NUMBER	0008	
PRINT_1_BUF_COLUMN . . . . . . .  	L NEAR	03C0	CODE
PRINT_1_CHAR . . . . . . . . . .  	L NEAR	0126	CODE
PRINT_1_COLOR_BAND_APA . . . . .  	L NEAR	01A5	CODE
PRINT_1_COLOR_BAND_TXT . . . . .  	L NEAR	0085	CODE
PRINT_1_COLUMN . . . . . . . . .  	L NEAR	028A	CODE
PRINT_1_TEXT_LINE  . . . . . . .  	L NEAR	0076	CODE
PRINT_BAND_APA . . . . . . . . .  	N PROC	0276	CODE	Length = 0093
PRINT_BAND_APA_END . . . . . . .  	L NEAR	02FB	CODE
PRINT_BAND_TXT . . . . . . . . .  	N PROC	011B	CODE	Length = 0056
PRINT_BAND_TXT_END . . . . . . .  	L NEAR	0168	CODE
PRINT_BUFFER . . . . . . . . . .  	N PROC	03B4	CODE	Length = 001A
PRINT_BUFFER_END . . . . . . . .  	L NEAR	03CA	CODE
PRINT_BYTE . . . . . . . . . . .  	N PROC	053A	CODE	Length = 0019
PRINT_BYTE_END . . . . . . . . .  	L NEAR	0550	CODE
PRINT_BYTE_ERROR . . . . . . . .  	L NEAR	054A	CODE
PRINT_COLOR  . . . . . . . . . .  	N PROC	0000	CODE	Global	Length = 0057
PRINT_COLOR_APA  . . . . . . . .  	N PROC	0171	CODE	Length = 009C
PRINT_COLOR_APA_END  . . . . . .  	L NEAR	0208	CODE
PRINT_COLOR_BEGIN  . . . . . . .  	L NEAR	000B	CODE
PRINT_COLOR_END  . . . . . . . .  	L NEAR	0056	CODE
PRINT_COLOR_TXT  . . . . . . . .  	N PROC	0057	CODE	Length = 0086
PRINT_COLOR_TXT_END  . . . . . .  	L NEAR	00C9	CODE
PRINT_MODULE_START . . . . . . .  	L BYTE	0000	CODE	Global
PRINT_SCAN_LINE  . . . . . . . .  	L NEAR	018C	CODE
PRINT_SCREEN_ALLOWED . . . . . .  	V BYTE	0000	CODE	External
PRT_BUF  . . . . . . . . . . . .  	V BYTE	0000	CODE	External
PRT_SCR  . . . . . . . . . . . .  	L NEAR	0000	CODE	External

READ_CHAR_CALL . . . . . . . . .  	NUMBER	0008	
READ_CONFIG_CALL . . . . . . . .  	NUMBER	1A00	
READ_CURSOR_CALL . . . . . . . .  	NUMBER	0003	
READ_DOT . . . . . . . . . . . .  	N PROC	0553	CODE	Length = 0034
READ_DOT_CALL  . . . . . . . . .  	NUMBER	000D	
READ_DOT_END . . . . . . . . . .  	L NEAR	0583	CODE
REQ_BAND_MASK  . . . . . . . . .  	L BYTE	000A	CODE
RESTORE_PRT  . . . . . . . . . .  	N PROC	04DD	CODE	Length = 0024
RESTORE_PRT_END  . . . . . . . .  	L NEAR	04FD	CODE
REVERSE_SW . . . . . . . . . . .  	NUMBER	0001	
RGB  . . . . . . . . . . . . . .  	V BYTE	0000	CODE	External
ROTATE . . . . . . . . . . . . .  	NUMBER	0001	
ROTATE_SW  . . . . . . . . . . .  	V BYTE	0000	CODE	External
ROUNDUP  . . . . . . . . . . . .  	NUMBER	0002	

SCAN_1_CHAR  . . . . . . . . . .  	L NEAR	00F1	CODE
SCAN_1_COLUMN  . . . . . . . . .  	L NEAR	0224	CODE
SCAN_1_DISPLAYMODE_RECORD  . . .  	L NEAR	0369	CODE
SCAN_1_PIXEL . . . . . . . . . .  	L NEAR	0233	CODE
SCAN_FOR_BANDS_APA . . . . . . .  	N PROC	020D	CODE	Length = 0069
SCAN_FOR_BANDS_TXT . . . . . . .  	N PROC	00DD	CODE	Length = 003E
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Symbols-6


SCAN_LINE_MAX_LENGTH . . . . . .  	V WORD	0000	CODE	External
SCAN_LIST_OF_MODES . . . . . . .  	L NEAR	0373	CODE
SCREEN_HEIGHT  . . . . . . . . .  	V WORD	0000	CODE	External
SCREEN_WIDTH . . . . . . . . . .  	V WORD	0000	CODE	External
SEND_1_COLORSELECT_BYTE  . . . .  	L NEAR	032B	CODE
SEND_1_GRAPHICS_BYTE . . . . . .  	L NEAR	052A	CODE
SEND_1_RESTORE_BYTE  . . . . . .  	L NEAR	04F3	CODE
SEND_1_SETUP_BYTE  . . . . . . .  	L NEAR	04CF	CODE
SETUP_PRT  . . . . . . . . . . .  	N PROC	04B9	CODE	Length = 0024
SETUP_PRT_END  . . . . . . . . .  	L NEAR	04D9	CODE
SET_COLOR_BAND . . . . . . . . .  	N PROC	0320	CODE	Length = 0019
SET_COLOR_BAND_END . . . . . . .  	L NEAR	0335	CODE
SET_CURSOR . . . . . . . . . . .  	N PROC	0309	CODE	Length = 0017
SET_CURSOR_CALL  . . . . . . . .  	NUMBER	0002	
SOLID_BOX  . . . . . . . . . . .  	NUMBER	00DB	
STORE_1_BYTE . . . . . . . . . .  	L NEAR	03A2	CODE
STORE_1_PIXEL  . . . . . . . . .  	L NEAR	02AA	CODE
STORE_BOX  . . . . . . . . . . .  	N PROC	0396	CODE	Length = 001E
STORE_BOX_END  . . . . . . . . .  	L NEAR	03B0	CODE

TWO_THIRD  . . . . . . . . . . .  	NUMBER	002A	
TXT  . . . . . . . . . . . . . .  	NUMBER	0000	

UNABLE_TO_PRINT  . . . . . . . .  	NUMBER	0001	

WHITE_BOX  . . . . . . . . . . .  	L BYTE	0002	CODE
WHITE_INT  . . . . . . . . . . .  	NUMBER	003F	

XLT_TAB  . . . . . . . . . . . .  	V BYTE	0000	CODE	External

YES  . . . . . . . . . . . . . .  	NUMBER	0001	

$L1  . . . . . . . . . . . . . .  	L NEAR	0056	CODE
$L10 . . . . . . . . . . . . . .  	L NEAR	0041	CODE
$L11 . . . . . . . . . . . . . .  	L NEAR	0053	CODE
$L14 . . . . . . . . . . . . . .  	L NEAR	00A7	CODE
$L17 . . . . . . . . . . . . . .  	L NEAR	009C	CODE
$L2  . . . . . . . . . . . . . .  	L NEAR	0017	CODE
$L23 . . . . . . . . . . . . . .  	L NEAR	015D	CODE
$L24 . . . . . . . . . . . . . .  	L NEAR	015B	CODE
$L27 . . . . . . . . . . . . . .  	L NEAR	0156	CODE
$L31 . . . . . . . . . . . . . .  	L NEAR	0188	CODE
$L34 . . . . . . . . . . . . . .  	L NEAR	01D6	CODE
$L37 . . . . . . . . . . . . . .  	L NEAR	01CA	CODE
$L40 . . . . . . . . . . . . . .  	L NEAR	01BC	CODE
$L46 . . . . . . . . . . . . . .  	L NEAR	0203	CODE
$L47 . . . . . . . . . . . . . .  	L NEAR	01F5	CODE
$L5  . . . . . . . . . . . . . .  	L NEAR	0028	CODE
$L50 . . . . . . . . . . . . . .  	L NEAR	024C	CODE
$L51 . . . . . . . . . . . . . .  	L NEAR	0248	CODE
$L54 . . . . . . . . . . . . . .  	L NEAR	0268	CODE
$L55 . . . . . . . . . . . . . .  	L NEAR	0264	CODE
$L58 . . . . . . . . . . . . . .  	L NEAR	02C0	CODE
$L59 . . . . . . . . . . . . . .  	L NEAR	02BA	CODE
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35
DOS GRAPHICS Command  -	Color printing modules              Symbols-7


$L62 . . . . . . . . . . . . . .  	L NEAR	02D1	CODE
$L63 . . . . . . . . . . . . . .  	L NEAR	02CD	CODE
$L66 . . . . . . . . . . . . . .  	L NEAR	02E8	CODE
$L69 . . . . . . . . . . . . . .  	L NEAR	02F9	CODE
$L70 . . . . . . . . . . . . . .  	L NEAR	02F5	CODE
$L73 . . . . . . . . . . . . . .  	L NEAR	0344	CODE
$L75 . . . . . . . . . . . . . .  	L NEAR	0422	CODE
$L76 . . . . . . . . . . . . . .  	L NEAR	0407	CODE
$L79 . . . . . . . . . . . . . .  	L NEAR	044F	CODE
$L8  . . . . . . . . . . . . . .  	L NEAR	0048	CODE
$L80 . . . . . . . . . . . . . .  	L NEAR	0446	CODE
$L83 . . . . . . . . . . . . . .  	L NEAR	0472	CODE
$L84 . . . . . . . . . . . . . .  	L NEAR	046E	CODE
$L87 . . . . . . . . . . . . . .  	L NEAR	0483	CODE
$L88 . . . . . . . . . . . . . .  	L NEAR	047F	CODE
$L91 . . . . . . . . . . . . . .  	L NEAR	04A4	CODE
$L92 . . . . . . . . . . . . . .  	L NEAR	049C	CODE
$L95 . . . . . . . . . . . . . .  	L NEAR	04D9	CODE
$L98 . . . . . . . . . . . . . .  	L NEAR	04FD	CODE
$LL1 . . . . . . . . . . . . . .  	NUMBER	0001	
$LL11  . . . . . . . . . . . . .  	NUMBER	000B	
$LL14  . . . . . . . . . . . . .  	NUMBER	000E	
$LL17  . . . . . . . . . . . . .  	NUMBER	0011	
$LL23  . . . . . . . . . . . . .  	NUMBER	0017	
$LL31  . . . . . . . . . . . . .  	NUMBER	001F	
$LL34  . . . . . . . . . . . . .  	NUMBER	0022	
$LL37  . . . . . . . . . . . . .  	NUMBER	0025	
$LL40  . . . . . . . . . . . . .  	NUMBER	0028	
$LL46  . . . . . . . . . . . . .  	NUMBER	002E	
$LL5 . . . . . . . . . . . . . .  	NUMBER	0005	
$LL50  . . . . . . . . . . . . .  	NUMBER	0032	
$LL54  . . . . . . . . . . . . .  	NUMBER	0036	
$LL58  . . . . . . . . . . . . .  	NUMBER	003A	
$LL62  . . . . . . . . . . . . .  	NUMBER	003E	
$LL66  . . . . . . . . . . . . .  	NUMBER	0042	
$LL69  . . . . . . . . . . . . .  	NUMBER	0045	
$LL73  . . . . . . . . . . . . .  	NUMBER	0049	
$LL75  . . . . . . . . . . . . .  	NUMBER	004B	
$LL79  . . . . . . . . . . . . .  	NUMBER	004F	
$LL8 . . . . . . . . . . . . . .  	NUMBER	0008	
$LL83  . . . . . . . . . . . . .  	NUMBER	0053	
$LL87  . . . . . . . . . . . . .  	NUMBER	0057	
$LL91  . . . . . . . . . . . . .  	NUMBER	005B	
$LL95  . . . . . . . . . . . . .  	NUMBER	005F	
$LL98  . . . . . . . . . . . . .  	NUMBER	0062	
@CPU . . . . . . . . . . . . . .  	TEXT  0101h		
@FILENAME  . . . . . . . . . . .  	TEXT  grcolprt		
@VERSION . . . . . . . . . . . .  	TEXT  510		

Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:35

DOS GRAPHICS Command  -	Color printing modules              Symbols-8






   3092 Source  Lines
  14818 Total   Lines
    505 Symbols

  45950 + 164679 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
