Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-1


					PAGE	,132								;AN000;
														;AN000;
					TITLE	DOS GRAPHICS Command  -	Print screen Control module
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;					;AN000;
				;; DOS - GRAPHICS Command
				;; (c) Copyright 1988 Microsoft
				;;										;AN000;
				;; File Name:  GRCTRL.ASM							;AN000;
				;; ----------									;AN000;
				;;										;AN000;
				;; Description: 								;AN000;
				;; ------------ 								;AN000;
				;;	 This file contains the code for the Print Screen control module.	;AN000;
				;;										;AN000;
				;; Documentation Reference:							;AN000;
				;; ------------------------							;AN000;
				;;	 OASIS High Level Design						;AN000;
				;;	 OASIS GRAPHICS I1 Overview						;AN000;
				;;										;AN000;
				;; Procedures Contained in This File:						;AN000;
				;; ----------------------------------						;AN000;
				;;	PRT_SCR 								;AN000;
				;;	  DET_HW_CONFIG 							;AN000;
				;;	  DET_MODE_STATE							;AN000;
				;;	  GET_MODE_ATTR 							;AN000;
				;;	  SET_UP_XLT_TAB							;AN000;
				;;	    SET_CGA_XLT_TAB							;AN000;
				;;	      CGA_COL2RGB							;AN000;
				;;	      RGB2XLT_TAB							;AN000;
				;;	    SET_EGA_XLT_TAB							;AN000;
				;;	      EGA_COL2RGB							;AN000;
				;;	    SET_MODE_F_XLT_TAB							;AN000;
				;;	    SET_MODE_13H_XLT_TAB						;AN000;
				;;	    SET_ROUNDUP_XLT_TAB 						;AN000;
				;;	 SET_BACKG_IN_XLT_TAB							;AN000;
				;;	 RGB2BAND								;AN000;
				;;	 RGB2INT								;AN000;
				;;										;AN000;
				;;										;AN000;
				;; Include Files Required:							;AN000;
				;; -----------------------							;AN000;
				;;	 GRINST.EXT - Externals for GRINST.ASM					;AN000;
				;;										;AN000;
				;;										;AN000;
				;; External Procedure References:						;AN000;
				;; ------------------------------						;AN000;
				;;	 FROM FILE  GRINST.ASM: 						;AN000;
				;;	      GRAPHICS_INSTALL - Main module for installation.			;AN000;
				;;										;AN000;
				;; Linkage Instructions:							;AN000;
				;; -------------------- 							;AN000;
				;;	 Refer to GRAPHICS.ASM							;AN000;
				;;										;AN000;
				;; Change History:								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-2


				;; ---------------								;AN000;
				;;										;AN000;
				;;										;AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;					;AN000;
 0000				CODE	SEGMENT PUBLIC 'CODE'                                                   ;AN000;
					ASSUME		CS:CODE,DS:CODE 					;AN000;
														;AN000;
			     C	.LIST										;AN000;
			     C	   EXTRN   PRINT_BW_APA:NEAR							;AN000;
			     C	   EXTRN   LEN_OF_BW_MODULES:ABS	;;					;AN000;
				INCLUDE GRCOLPRT.EXT								;AN000;
			     C	.LIST										;AN000;
			     C	   EXTRN   PRINT_MODULE_START:NEAR	;;					;AN000;
			     C	   EXTRN   PRINT_COLOR:NEAR							;AN000;
			     C	   EXTRN   LEN_OF_COLOR_MODULES:ABS	;;					;AN000;
				INCLUDE GRSHAR.STR								;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;
			     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;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-3


 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;
 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;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-4


 = 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;
			     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;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-5


 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;
 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;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-6


 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;
				INCLUDE GRPATTRN.EXT								;AN000;
			     C	PAGE	,132									;AN000;
			     C	.LIST										;AN000;
			     C	EXTRN PAT_4X2:BYTE								;AN000;
			     C	EXTRN PAT_4X4:BYTE								;AN000;
			     C	EXTRN PAT_6X2:BYTE								;AN000;
			     C	EXTRN PAT_8X2:BYTE								;AN000;
			     C	EXTRN PAT_6X4:BYTE								;AN000;
			     C	EXTRN PAT_8X4:BYTE								;AN000;
			     C	EXTRN PAT_8X6:BYTE								;AN000;
			     C	EXTRN TAB_DIRECTORY:NEAR							;AN000;
			     C	EXTRN TAB_DIR_NB_ENTRIES: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
 = 0000                      C	$LoopEnd = 0
 = 0000                      C	$LeaveFound = 0
 =-0001                      C	$LastLabel = -1
 = 0000                      C	$LastLabelOrg = $
 = 0003                      C	$DefDist= $Short
			     C	$Push	%$NoType
				.LIST										;AN000;
 0000				PRT_SCR PROC NEAR								;AN000;
 0000  E9 012E R			JMP PRT_SCR_BEGIN							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-7


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; GRAPHICS INTERRUPT DRIVER'S DATA:                                             ;AN000;
				;										;AN000;
				;===============================================================================;AN000;
				.list										;AN000;
				INCLUDE GRCTRL.STR								;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:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-8


 = 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;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; ENTRY POINT TO BIOS HARDWARE INTERRUPT 5 HANDLER				;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0003  0000			BIOS_INT_5H	DW	?		; Pointer to BIOS int 5h		;AN000;
 0005  0000					DW	?							;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-9


				; PRINT SCREEN ERROR CODE (Used at print screen time, see GRCTRL.STR for	;AN000;
				;			   error codes allowed) 				;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0007  00			ERROR_CODE	DB	0		; ERROR CODE 0 = NO ERROR		;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; SCREEN PIXEL: INTERNAL REPRESENTATION 					;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0008  00			RGB	PIXEL_STR < , , >	  ; PIXEL := RED, GREEN, BLUE Values		;AN000;
 0009  00			
 000A  00			
				
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; COLOR TRANSLATION TABLE:							;AN000;
				;										;AN000;
				; This table is used to translate the color numbers returned by 		;AN000;
				; Interrupt 10H Read Dot and Read Character calls into print			;AN000;
				; information.	The table consists of 256 entries, one byte each,		;AN000;
				; indexed by color number.							;AN000;
				; In the case of black and white printing, the table				;AN000;
				; entries are grey scale intensities from 0 to 63.  In the case 		;AN000;
				; of color printing each table entry contains a "band mask" indicating          ;AN000;
				; which color print bands are required to generate the required color.		;AN000;
				; The band masks are simply bit masks where each bit corresponds to one 	;AN000;
				; of the printer bands. 							;AN000;
				;										;AN000;
				; The table is set up at the beginning of the print screen processing,		;AN000;
				; before any data is read from the screen.  From then on, translating		;AN000;
				; from screen information into print information is done quickly by		;AN000;
				; accessing this table.  Not all 256 entries are initialized for each		;AN000;
				; screen print.  The number of entries used is equal to the number		;AN000;
				; of colors available concurrently with the given display mode. 		;AN000;
				;-------------------------------------------------------------------------------;AN000;
 000B  0100[			XLT_TAB DB	  256 DUP(32)  ; COLOR TRANSLATION TABLE			;AN000;
	   20			
			 ]	
				
							       ; This table is used to translate the Color Dot	;AN000;
							       ; or Byte Attribute to a Band Mask for color	;AN000;
							       ; printing or to a Grey Intensity for Mono-	;AN000;
							       ; chrome printing.				;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; CURRENT VIDEO MODE ATTRIBUTES 						;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 010B  00			MODE_TYPE	DB	?	; Mode types (bit mask) APA or TXT		;AN000;
														;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-10


 010C  0000			CUR_MODE_PTR	DW	?	; DISPLAYMODE INFO RECORD for the current	;AN000;
								;   mode (defined in the shared data area).	;AN000;
 010E  00			CUR_MODE	DB	?	; Current video mode number			;AN000;
 010F  0000			NB_COLORS	DW	?	; Number of colors supported by this mode	;AN000;
 0111  0000			SCREEN_HEIGHT	DW	?	; Number of rows on the screen (chars or pixels);AN000;
 0113  0000			SCREEN_WIDTH	DW	?	; Number of columns on the screen (chars/pixels);AN000;
								;  (for text modes is equal to NB_CHAR_COLUMNS) ;AN000;
 0115  00			NB_CHAR_COLUMNS DB	?	; Number of columns on the screen if in txt mode;AN000;
 0116  00			CUR_PAGE	DB	?	; Active page number				;AN000;
 0117  00			ROTATE_SW	DB	?	; Switch: if "ON" then, must print sideways     ;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; ACTIVE SCREEN ATTRIBUTES							;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0118  0000			CUR_COLUMN	DW	?	; Current pixel/char column number		;AN000;
 011A  0000			CUR_ROW 	DW	?	; Current pixel/char row number 		;AN000;
 011C  0000			NB_SCAN_LINES	DW	?	; Number of screen scan lines			;AN000;
 011E  0000			SCAN_LINE_MAX_LENGTH DW ?	; Maximum number of dots/chars per scan line	;AN000;
 0120  0000			CUR_SCAN_LNE_LENGTH DW	?	; Length in pels/chars of the current scan line ;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; PRINTER VARIABLES								;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0122  00 00 00 00		PRT_BUF DB	?,?,?,? 	; PRINT BUFFER					;AN000;
 0126  00			NB_BOXES_PER_PRT_BUF DB ?	; Number of boxes fitting in the print buffer	;AN000;
 0127  00 00 00 00		CUR_BOX DB	?,?,?,? 	; BOX = PRINTER REPRESENTATION OF 1 PIXEL	;AN000;
 012B  00			BOX_H	DB	?		; HEIGHT OF THE BOX				;AN000;
 012C  00			BOX_W	DB	?		; WIDTH OF THE BOX				;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; CONTROL VARIABLES:								;AN000;
				;										;AN000;
				; This data is used to communicate between the Installation Modules		;AN000;
				; and the Resident Print Screen Modules.					;AN000;
				;-------------------------------------------------------------------------------;AN000;
 012D  01			PRINT_SCREEN_ALLOWED	DB   YES; Used to avoid print screens			;AN000;
								;  while the GRAPHICS installation		;AN000;
								;   (or re-install) is in progress		;AN000;
								; Set by GRAPHICS_INSTALL module.		;AN000;
														;AN000;
														;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-11


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; INTERRUPT 5 DRIVER'S CODE:                                                    ;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; PRT_SCR : PRINT THE ACTIVE SCREEN						;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT: SHARED_DATA_AREA_PTR = Offset of the data area used for		;AN000;
				;				      passing data between the			;AN000;
				;				      Installation process and the Print	;AN000;
				;				      Screen process.				;AN000;
				;	      PRINT_SCREEN_ALLOWED  = Switch. Set to "No" if currently          ;AN000;
				;				      installing GRAPHICS.COM			;AN000;
				;										;AN000;
				;				NOTE: These 2 variables are declared within	;AN000;
				;				      PRT_SCR but initialized by the		;AN000;
				;				      Installation process GRAPHICS_INIT	;AN000;
				;	OUTPUT: PRINTER 							;AN000;
				;										;AN000;
				;	CALLED BY: INTERRUPT 5							;AN000;
				;										;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; DESCRIPTION:									;AN000;
				;										;AN000;
				; PRINT THE ACTIVE SCREEN for all TEXT and  All Points Addressable (APA)	;AN000;
				; display modes  available  with  either  a MONO, CGA, EGA, or VGA video	;AN000;
				; adapter on a Black and White or Color printer.				;AN000;
				;										;AN000;
				; INITIALIZATION:								;AN000;
				;										;AN000;
				; Each pixel  or  character  on the screen has a color attribute.  These	;AN000;
				; colors must be translated into different internal representations:		;AN000;
				;										;AN000;
				;	For printing in colors, each color is translated to a BAND MASK.	;AN000;
				;	The Band Mask indicates how to obtain this color on the printer.	;AN000;
				;										;AN000;
				;	For printing  in  Black and White, each color is translated to a	;AN000;
				;	GREY INTENSITY number between 0 (black) and 63 (white). 		;AN000;
				;										;AN000;
				; The  BAND  MASK  or  the  GREY INTENSITIES  are  found  in  the  COLOR	;AN000;
				; TRANSLATION TABLE.  This  table is initialized  before  calling any of	;AN000;
				; the print screen modules.							;AN000;
				;										;AN000;
				; PRINT SCREEN TIME:								;AN000;
				;										;AN000;
				; When a pixel or character  is read  off the screen by one of the print	;AN000;
				; screen modules, its  color is  used as  an index  into the translation	;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-12


				; table.									;AN000;
				;										;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;										;AN000;
				; IF SCREEN_PRINTS_ALLOWED=NO	; Block print screens until Installation	;AN000;
				;   THEN IRET			;  Process (or re-install!) is finished.	;AN000;
				; ELSE										;AN000;
				;										;AN000;
				;   CALL DET_HW_CONFIG		  ; Determine hardware configuration		;AN000;
				;   CALL DET_MODE_STATE 	  ; Determine video mode and active page	;AN000;
				;   CALL GET_MODE_ATTR		  ; Get video attributes (TXT or APA, etc)	;AN000;
				;										;AN000;
				;  IF MODE_TYPE = TXT AND Number of colors = 0					;AN000;
				;    THEN Invoke BIOS INTERRUPT 5						;AN000;
				;  ELSE 									;AN000;
				;    IF PRINTER_TYPE = BLACK_WHITE						;AN000;
				;      THEN									;AN000;
				;      IF MODE_TYPE = TXT							;AN000;
				;	 THEN Invoke BIOS INTERRUPT 5						;AN000;
				;      ELSE ; Mode is APA							;AN000;
				;	 CALL SET_UP_XLT_TAB	 ; Set up the color translation table		;AN000;
				;	 CALL PRINT_BW_APA	 ; Print the active screen on a B&W printer	;AN000;
				;    ELSE ; Color printer attached						;AN000;
				;      CALL SET_UP_XLT_TAB	 ; Set up the color translation table		;AN000;
				;      CALL PRINT_COLOR 	 ; Print the active screen on a Color prt.	;AN000;
				;    IRET									;AN000;
				;										;AN000;
 012E				PRT_SCR_BEGIN:									;AN000;
 012E  50			  PUSH	  AX		  ; Save Registers					;AN000;
 012F  53			  PUSH	  BX		  ;							;AN000;
 0130  51			  PUSH	  CX		  ;							;AN000;
 0131  52			  PUSH	  DX		  ;							;AN000;
 0132  56			  PUSH	  SI		  ;							;AN000;
 0133  57			  PUSH	  DI		  ;							;AN000;
 0134  55			  PUSH	  BP		  ;							;AN000;
 0135  1E			  PUSH	  DS		  ;							;AN000;
 0136  06			  PUSH	  ES		  ;							;AN000;
							  ;							;AN000;
 0137  FC			  CLD			  ; Clear direction flag				;AN000;
 0138  0E			  PUSH	  CS		  ; DS := CS						;AN000;
 0139  1F			  POP	  DS									;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Verify if we are allowed to print (not allowed if currently installing	;AN000;
				; GRAPHICS or printing a screen):						;AN000;
				;-------------------------------------------------------------------------------;AN000;
 013A  80 3E 012D R 00		  CMP	  PRINT_SCREEN_ALLOWED,NO	  ; IF not allowed to print		;AN000;
 013F  74 52			  JE	  PRT_SCR_RETURN		  ; THEN quit				;AN000;
									  ; ELSE print the screen:		;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; INITIALIZATION:								;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0141				PRT_SCR_INIT:				  ; Disable print screen while		;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-13


 0141  C6 06 012D R 00		  MOV	  PRINT_SCREEN_ALLOWED,NO	  ;  we are printing the current	;AN000;
									  ;   screen.				;AN000;
 0146  8B 2E 0000 E		  MOV	  BP,SHARED_DATA_AREA_PTR	  ; BP := Offset Shared Data Area	;AN000;
 014A  C6 06 0007 R 00		  MOV	  ERROR_CODE,NO_ERROR		  ; No error so far.			;AN000;
 014F  E8 01B2 R		  CALL	  DET_HW_CONFIG   ; Determine the type of display adapter		;AN000;
 0152  E8 022C R		  CALL	  DET_MODE_STATE  ; Init CUR_PAGE, CUR_MODE				;AN000;
 0155  E8 0240 R		  CALL	  GET_MODE_ATTR   ; Determine if APA or TXT, nb. of colors,		;AN000;
							  ;  and screen dimensions in pels or characters.	;AN000;
				 ;										;AN000;
				 ; Test the error code returned by GET_MODE_ATTR:				;AN000;
				 ;										;AN000;
 0158  F6 06 0007 R 04		  TEST	  ERROR_CODE,MODE_NOT_SUPPORTED    ;If mode not supported then, 	;AN000;
 015D  75 3E			  JNZ	  EXIT_TO_BIOS			   ; let BIOS give it a try.		;AN000;
														;AN000;
				 ;------------------------------------------------------------------------------;AN000;
				 ; Check the printer type:							;AN000;
				 ;------------------------------------------------------------------------------;AN000;
				 .IF <DS:[BP].PRINTER_TYPE EQ BLACK_WHITE> ; Is a black and white printer	;AN000;
 015F  3E: 80 7E 04 02       3						cmp DS:[BP].PRINTER_TYPE,BLACK_WHITE 
 0164  75 0B                 6						jne $l2 
				 .THEN					   ;  attached ?			;AN000;
				 ;------------------------------------------------------------------------------;AN000;
				 ; A Black and White printer is attached					;AN000;
				 ;------------------------------------------------------------------------------;AN000;
 0166  80 3E 010B R 00		   CMP	   MODE_TYPE,TXT	   ; Is the screen in text mode ?		;AN000;
 016B  75 14			   JNE	   INVOKE_PRINT_ROUTINE    ; No, call GRAPHICS B&W routine		;AN000;
 016D  EB 2E			   JMP	   SHORT EXIT_TO_BIOS	   ; Yes, give control to BIOS INTERRUPT 5	;AN000;
				 .ELSE										;AN000;
 016F  EB 10                 3						jmp short $l1 
 0171                        2	$l2: 
				 ;------------------------------------------------------------------------------;AN000;
				 ; A Color printer is attached							;AN000;
				 ;------------------------------------------------------------------------------;AN000;
 0171  83 3E 010F R 00		   CMP	   NB_COLORS,0		   ; Is the screen in a Monochrome		;AN000;
 0176  75 09			   JNE	   INVOKE_PRINT_ROUTINE 						;AN000;
 0178  F6 06 010B R 00		   TEST    MODE_TYPE,TXT	   ;   text mode ?				;AN000;
 017D  75 02			   JNZ	   INVOKE_PRINT_ROUTINE 						;AN000;
 017F  EB 1C			   JMP	   SHORT EXIT_TO_BIOS	   ; Yes, let BIOS INTERRUPT 5 handle it	;AN000;
								   ; No, we handle it.				;AN000;
				.ENDIF				   ; ENDIF black and white or color printer	;AN000;
 0181                        2	$l1: 
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Call the print routine (which is either PRINT_COLOR or PRINT_BW_APA)		;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0181				INVOKE_PRINT_ROUTINE:								;AN000;
 0181  E8 0317 R		   CALL    SET_UP_XLT_TAB	   ; Set up the color translation table 	;AN000;
 0184  E8 0000 E		   CALL    PRINT_MODULE_START	   ; Call the print modules that were		;AN000;
								   ;  made resident at Install time.		;AN000;
 0187  C6 06 012D R 01		   MOV	   PRINT_SCREEN_ALLOWED,YES; Enable PrtScr for next calls		;AN000;
				  ;-----------------------------------------------------------------------------;AN000;
				  ; Test the error code returned by either PRINT_COLOR or PRT_BW_APA		;AN000;
				  ;-----------------------------------------------------------------------------;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-14


 018C  F6 06 0007 R 01		   TEST    ERROR_CODE,UNABLE_TO_PRINT ; If unable to print the screen		;AN000;
 0191  75 0A			   JNZ	   SHORT EXIT_TO_BIOS	      ; then, let BIOS give it a try		;AN000;
														;AN000;
 0193				PRT_SCR_RETURN: 								;AN000;
								   ; Restore registers				;AN000;
 0193  07			  POP	  ES			   ;						;AN000;
 0194  1F			  POP	  DS			   ;						;AN000;
 0195  5D			  POP	  BP			   ;						;AN000;
 0196  5F			  POP	  DI			   ;						;AN000;
 0197  5E			  POP	  SI			   ;						;AN000;
 0198  5A			  POP	  DX			   ;						;AN000;
 0199  59			  POP	  CX			   ;						;AN000;
 019A  5B			  POP	  BX			   ;						;AN000;
 019B  58			  POP	  AX			   ;						;AN000;
								   ;						;AN000;
 019C  CF			  IRET				   ; Return control to interrupted		;AN000;
								   ;  process					;AN000;
 019D				EXIT_TO_BIOS:									;AN000;
								   ; Restore registers				;AN000;
 019D  07			  POP	  ES			   ;						;AN000;
 019E  1F			  POP	  DS			   ;						;AN000;
 019F  5D			  POP	  BP			   ;						;AN000;
 01A0  5F			  POP	  DI			   ;						;AN000;
 01A1  5E			  POP	  SI			   ;						;AN000;
 01A2  5A			  POP	  DX			   ;						;AN000;
 01A3  59			  POP	  CX			   ;						;AN000;
 01A4  5B			  POP	  BX			   ;						;AN000;
 01A5  58			  POP	  AX			   ;						;AN000;
 01A6  FA			  CLI				   ; Disable interrupts 			;AN000;
 01A7  2E: C6 06 012D R 01	  MOV	  CS:PRINT_SCREEN_ALLOWED,YES ; Enable PrtScr for next calls		;AN000;
 01AD  2E: FF 2E 0003 R		  JMP	  DWORD PTR CS:BIOS_INT_5H ; Exit to BIOS INTERRUPT 5			;AN000;
														;AN000;
 01B2				PRT_SCR ENDP									;AN000;
														;AN000;
														;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; PRT_SCR MODULES:								;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-15


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; DET_HW_CONFIG : DETERMINE WHAT TYPE OF VIDEO HARDWARE IS PRESENT		;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT:	   BP		   = Offset of the shared data area		;AN000;
				;										;AN000;
				;	OUTPUT:    HARDWARE_CONFIG is updated in the shared data area		;AN000;
				;										;AN000;
				;	CALLED BY: PRT_SCR							;AN000;
				;										;AN000;
				;	EXTERNAL CALLS: BIOS INT 10H						;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;    Issue BIOS INT10H Get Display Configuration Code (AX=1A00H)		;AN000;
				;    IF AL = 1AH THEN	 /* VGA (PS/2 OR BRECON-B)	  */			;AN000;
				;	/* BL = active DCC				  */			;AN000;
				;	/* BH = alternate DCC				  */			;AN000;
				;	/* Display Code:				  */			;AN000;
				;	/*   1 - Mono Adapter				  */			;AN000;
				;	/*   2 - CGA					  */			;AN000;
				;	/*   4 - EGA with Mono Display			  */			;AN000;
				;	/*   5 - EGA with Color Display 		  */			;AN000;
				;	/*   7 - PS/2 Mod 50,60,80 OR BRECON-B with Mono Display */		;AN000;
				;	/*   8 - PS/2 Mod 50,60,80 OR BRECON-B with Color Display */		;AN000;
				;	/*   B - PS/2 Mod 30 with Mono Display		  */			;AN000;
				;	/*   C - PS/2 Mod 30 with Color Display 	  */			;AN000;
				;    IF AL = 1AH THEN	 /* Call is supported */				;AN000;
				;	Set HARDWARE_CONFIG byte based on DCC returned in DL			;AN000;
				;    ELSE									;AN000;
				;	Issue INT 10H EGA Info (AH=12H BL=10H)					;AN000;
				;	IF BL <> 10H  THEN     /* EGA  */					;AN000;
				;	   Set EGA bit in HARDWARE_CONFIG					;AN000;
				;	ELSE		  /* CGA or */						;AN000;
				;	  Issue INT 10H PC CONVERTIBLE Physical display description param.	;AN000;
				;	  request. (AH=15H)							;AN000;
				;	  IF ES:[DI] = 5140H							;AN000;
				;	  THEN									;AN000;
				;	   Set PC_CONVERTIBLE bit in HARDWARE_CONFIG				;AN000;
				;	  ELSE									;AN000;
				;	   Set OLD_ADAPTER bit in HARDWARE_CONFIG				;AN000;
				;	  ENDIF 								;AN000;
				;	ENDIF									;AN000;
				;    ENDIF									;AN000;
				;    RETURN									;AN000;
				;										;AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	;AN000;
 01B2				DET_HW_CONFIG PROC NEAR 							;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-16


				;										;AN000;
				; Try to read display combination code (PS/2 call):				;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 01B2  B8 1A00				MOV	AX,READ_CONFIG_CALL						;AN000;
 01B5  CD 10				INT	10H			; Call video BIOS			;AN000;
														;AN000;
				       .IF <AL EQ 1AH>			; If call is supported			;AN000;
 01B7  3C 1A                 3						cmp AL,1AH 
 01B9  75 47                 6						jne $l6 
				       .THEN									;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Call is supported, PS/2 BIOS is present (Model 39,50,60,80 or BRECON-B card), ;AN000;
				; Determine what is the primary video adapter:					;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
					 .SELECT								;AN000;
					   .WHEN    <BL EQ 1> OR	    ; MONO or				;AN000;
 01BB  80 FB 01              3						cmp BL,1 
 01BE  74 05                 6						je $l10 
					   .WHEN    <BL EQ 2>		    ; CGA				;AN000;
 01C0  80 FB 02              3						cmp BL,2 
 01C3  75 08                 6						jne $l9 
 01C5                        3	$l10: 
 01C5  3E: C6 46 03 10			      MOV     DS:[BP].HARDWARE_CONFIG,OLD_ADAPTER			;AN000;
					   .WHEN    <BL EQ 4> OR	    ; EGA with Mono or			;AN000;
 01CA  EB 5F                 3						jmp short $l5 
 01CC  90                    3						nop 
 01CD                        2	$l9: 
 01CD  80 FB 04              3						cmp BL,4 
 01D0  74 05                 6						je $l12 
					   .WHEN    <BL EQ 5>		    ; EGA with Color			;AN000;
 01D2  80 FB 05              3						cmp BL,5 
 01D5  75 08                 6						jne $l11 
 01D7                        3	$l12: 
 01D7  3E: C6 46 03 04			      MOV     DS:[BP].HARDWARE_CONFIG,EGA				;AN000;
					   .WHEN    <BL EQ 7> OR	    ; BRECON-B with Mono or		;AN000;
 01DC  EB 4D                 3						jmp short $l5 
 01DE  90                    3						nop 
 01DF                        2	$l11: 
 01DF  80 FB 07              3						cmp BL,7 
 01E2  74 05                 6						je $l14 
					   .WHEN    <BL EQ 8>		    ; BRECON-B with Color		;AN000;
 01E4  80 FB 08              3						cmp BL,8 
 01E7  75 08                 6						jne $l13 
 01E9                        3	$l14: 
 01E9  3E: C6 46 03 02			      MOV     DS:[BP].HARDWARE_CONFIG,ROUNDUP				;AN000;
					   .WHEN    <BL EQ 0Bh> OR	    ; PS/2 Model 30 with Mono or	;AN000;
 01EE  EB 3B                 3						jmp short $l5 
 01F0  90                    3						nop 
 01F1                        2	$l13: 
 01F1  80 FB 0B              3						cmp BL,0Bh 
 01F4  74 05                 6						je $l16 
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-17


					   .WHEN    <BL EQ 0Ch> 	    ; PS/2 Model 30 with Color		;AN000;
 01F6  80 FB 0C              3						cmp BL,0Ch 
 01F9  75 30                 6						jne $l5 
 01FB                        3	$l16: 
 01FB  3E: C6 46 03 01			      MOV     DS:[BP].HARDWARE_CONFIG,PALACE				;AN000;
					 .ENDSELECT								;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; PS/2 call is not supported, try the EGA info call:				;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				       .ELSE									;AN000;
 0200  EB 29                 3						jmp short $l5 
 0202                        2	$l6: 
 0202  B4 12				  MOV	  AH,ALT_SELECT_CALL	  ; Request Alternate select's          ;AN000;
 0204  B3 10				  MOV	  BL,EGA_INFO_CALL	  ;  "return EGA information call"      ;AN000;
 0206  CD 10				  INT	  10H			  ; Call video BIOS			;AN000;
					 .IF	  <BL NE EGA_INFO_CALL>   ; If a memory value is returned	;AN000;
 0208  80 FB 10              3						cmp BL,EGA_INFO_CALL 
 020B  74 07                 6						je $l19 
					 .THEN				  ; then, there is an EGA		;AN000;
 020D  3E: C6 46 03 04			    MOV     DS:[BP].HARDWARE_CONFIG,EGA 				;AN000;
					 .ELSE				  ; else, call is not supported:	;AN000;
 0212  EB 17                 3						jmp short $l5 
 0214                        2	$l19: 
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; EGA call is not supported, try the PC CONVERTIBLE display description call:	;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0214  B4 15				    MOV     AH,DISP_DESC_CALL						;AN000;
 0216  CD 10				    INT     10H 		    ; Call BIOS, ES:DI :=Offset of parms;AN000;
					   .IF	    <ES:[DI] EQ 5140H>	    ; If LCD display type,		;AN000;
 0218  26: 81 3D 5140        3						cmp ES:[DI],5140H 
 021D  75 07                 6						jne $l23 
					   .THEN			    ;	set LCD bit in Shared Data area ;AN000;
 021F  3E: C6 46 03 08			      MOV     DS:[BP].HARDWARE_CONFIG,PC_CONVERTIBLE			;AN000;
					   .ELSE			    ; else, we have an old adapter.	;AN000;
 0224  EB 05                 3						jmp short $l5 
 0226                        2	$l23: 
 0226  3E: C6 46 03 10			      MOV     DS:[BP].HARDWARE_CONFIG,OLD_ADAPTER ; (either MONO or CGA);AN000;
					   .ENDIF   ; Display type is LCD					;AN000;
					 .ENDIF ; EGA BIOS is present						;AN000;
				       .ENDIF ; PS/2 BIOS is present						;AN000;
 022B                        2	$l5: 
 022B  C3				RET									;AN000;
 022C				DET_HW_CONFIG ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-18


				PAGE										;AN000;
				;=======================================================================	;AN000;
				;										;AN000;
				; DET_MODE_STATE : Determine the current video mode and the active page.	;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				;	INPUT:	HARDWARE_CONFIG = Type of video hardware attached		;AN000;
				;										;AN000;
				;	OUTPUT: CUR_MODE = Video mode number (0-13H)				;AN000;
				;		CUR_PAGE = Video page number (0-8)				;AN000;
				;		NB_CHAR_COLUMNS = Number of columns if in a text mode.		;AN000;
				;										;AN000;
				;										;AN000;
				;	CALLED BY: PRT_SCR							;AN000;
				;										;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; DESCRIPTION:	Use the BIOS interface to					;AN000;
				; obtain the current mode and active page.					;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;										;AN000;
				;   Call BIOS INTERRUPT 10H: "Return current video state" (AH = 0fh)            ;AN000;
				;										;AN000;
 022C				DET_MODE_STATE PROC NEAR							;AN000;
 022C  50				PUSH	AX								;AN000;
 022D  53				PUSH	BX								;AN000;
 022E  B4 0F				MOV	AH,GET_STATE_CALL						;AN000;
 0230  CD 10				INT	10H			; CALL BIOS				;AN000;
 0232  A2 010E R			MOV	CUR_MODE,AL							;AN000;
 0235  88 26 0115 R			MOV	NB_CHAR_COLUMNS,AH						;AN000;
 0239  88 3E 0116 R			MOV	CUR_PAGE,BH							;AN000;
														;AN000;
 023D  5B				POP	BX								;AN000;
 023E  58				POP	AX								;AN000;
 023F  C3				RET									;AN000;
 0240				DET_MODE_STATE ENDP								;AN000;
														;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-19


				PAGE										;AN000;
				;=======================================================================	;AN000;
				;										;AN000;
				; GET_MODE_ATTR: Obtain attributes of current video mode.			;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				;	INPUT:	CUR_MODE   = Current video mode (1 BYTE)			;AN000;
				;										;AN000;
				;	OUTPUT: MODE_TYPE  = Video mode type (TXT or APA)			;AN000;
				;		NB_COLORS  = Maximum number of colors (0-256) (0=B&W)		;AN000;
				;		ERROR_CODE = Error code if error occurred.			;AN000;
				;		SCREEN_HEIGHT= Number of rows (in pixels if APA or char if TEXT);AN000;
				;		SCREEN_WIDTH = Number of columns (in pixels/char)		;AN000;
				;										;AN000;
				;	CALLED BY: PRT_SCR							;AN000;
				;										;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; DESCRIPTION: Scan the 2 local video mode attribute tables until the		;AN000;
				; current mode is located.  Return the attributes.				;AN000;
				; For APA modes SCREEN_HEIGHT and SCREEN_WIDTH are in pixels,			;AN000;
				; for TEXT modes they are in characters.					;AN000;
				;										;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;										;AN000;
				; Scan the APA_ATTR_TABLE							;AN000;
				; IF FOUND									;AN000;
				;   MODE_TYPE  := APA								;AN000;
				;   NB_COLORS  := mode.MAX_COLORS						;AN000;
				;   SCREEN_HEIGHT := mode.NB_L							;AN000;
				;   SCREEN_WIDTH  := mode.NB_C							;AN000;
				; ELSE										;AN000;
				;   Scan the TXT_ATTR_TABLE							;AN000;
				;   When FOUND									;AN000;
				;     MODE_TYPE := TXT								;AN000;
				;     NB_COLORS := mode.NUM_COLORS						;AN000;
				;     SCREEN_WIDTH := NB_CHAR_COLUMNS						;AN000;
				;     SCREEN_HEIGHT := Byte in ROM BIOS at 40:84				;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
 0240				GET_MODE_ATTR	PROC	NEAR							;AN000;
 0240  EB 54				JMP	SHORT GET_MODE_ATTR_BEGIN					;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; LOCAL DATA									;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
														;AN000;
				APA_ATTR   STRUC      ; ATTRIBUTES FOR APA MODES:				;AN000;
 0000  00			  APA_MODE   DB ?     ;   Mode number						;AN000;
 0001  0000			  NB_C	     DW ?     ;   Number of columns					;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-20


 0003  0000			  NB_L	     DW ?     ;   Number of lines					;AN000;
 0005  0000			  MAX_COLORS DW ?     ;   Maximum number of colors available (0=B&W)		;AN000;
 0007				APA_ATTR   ENDS 								;AN000;
														;AN000;
				TXT_ATTR   STRUC      ; ATTRIBUTES FOR TXT MODES:				;AN000;
 0000  00			  TXT_MODE   DB ?     ;   Mode number						;AN000;
 0001  00			  NUM_COLORS DB ?     ;   Number of colors					;AN000;
 0002				TXT_ATTR   ENDS 								;AN000;
														;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; APA MODE ATTRIBUTES:								;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
 0242  000A			NB_APA_MODES	DW  10								;AN000;
 0244				APA_ATTR_TABLE LABEL WORD							;AN000;
 0244  04			MODE04	APA_ATTR <  4,320,200,	4>						;AN000;
 0245  4001			
 0247  C800			
 0249  0400			
				
 024B  05			MODE05	APA_ATTR <  5,320,200,	4>						;AN000;
 024C  4001			
 024E  C800			
 0250  0400			
				
 0252  06			MODE06	APA_ATTR <  6,640,200,	2>						;AN000;
 0253  8002			
 0255  C800			
 0257  0200			
				
 0259  0D			MODE0D	APA_ATTR <0DH,320,200, 16>						;AN000;
 025A  4001			
 025C  C800			
 025E  1000			
				
 0260  0E			MODE0E	APA_ATTR <0EH,640,200, 16>						;AN000;
 0261  8002			
 0263  C800			
 0265  1000			
				
 0267  0F			MODE0F	APA_ATTR <0FH,640,350,	4>						;AN000;
 0268  8002			
 026A  5E01			
 026C  0400			
				
 026E  10			MODE10H APA_ATTR <10H,640,350, 16>						;AN000;
 026F  8002			
 0271  5E01			
 0273  1000			
				
 0275  11			MODE11H APA_ATTR <11H,640,480,	2>						;AN000;
 0276  8002			
 0278  E001			
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-21


 027A  0200			
				
 027C  12			MODE12H APA_ATTR <12H,640,480, 16>						;AN000;
 027D  8002			
 027F  E001			
 0281  1000			
				
 0283  13			MODE13H APA_ATTR <13H,320,200,256>						;AN000;
 0284  4001			
 0286  C800			
 0288  0001			
				
														;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; TXT MODE ATTRIBUTES:								;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
 028A  0005			NB_TXT_MODES	DW  5								;AN000;
 028C				TXT_ATTR_TABLE LABEL WORD							;AN000;
 028C  00			MODE00 TXT_ATTR <  0, 16>							;AN000;
 028D  10			
				
 028E  01			MODE01 TXT_ATTR <  1, 16>							;AN000;
 028F  10			
				
 0290  02			MODE02 TXT_ATTR <  2, 16>							;AN000;
 0291  10			
				
 0292  03			MODE03 TXT_ATTR <  3, 16>							;AN000;
 0293  10			
				
 0294  07			MODE07 TXT_ATTR <  7,  0>							;AN000;
 0295  00			
				
														;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; BEGIN OF GET_MODE_ATTR							;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
 0296				GET_MODE_ATTR_BEGIN:								;AN000;
 0296  50				PUSH	AX								;AN000;
 0297  53				PUSH	BX								;AN000;
 0298  51				PUSH	CX								;AN000;
 0299  52				PUSH	DX								;AN000;
 029A  8A 16 010E R			MOV	DL,CUR_MODE		; DL = CURRENT MODE			;AN000;
				;										;AN000;
				; Scan the APA_ATTR_TABLE							;AN000;
				;										;AN000;
 029E  8B 0E 0242 R			MOV	CX,NB_APA_MODES 	; CS <-- Number of APA modes		;AN000;
 02A2  BB 0244 R			MOV	BX,OFFSET APA_ATTR_TABLE; BX <-- Offset of APA mode table	;AN000;
 02A5				      SCAN_APA: 								;AN000;
 02A5  3A 17				CMP	DL,[BX].APA_MODE	; IF mode found 			;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-22


 02A7  74 07				JE	SHORT ITS_APA		; THEN get its attributes		;AN000;
 02A9  83 C3 07				ADD	BX,SIZE APA_ATTR						;AN000;
 02AC  E2 F7			      LOOP    SCAN_APA			; ELSE keep scanning			;AN000;
 02AE  EB 19				JMP	SHORT SCAN_TXT_INIT	; NOT in this table: scan txt modes	;AN000;
 02B0				ITS_APA:									;AN000;
 02B0  C6 06 010B R 01			MOV	MODE_TYPE,APA		; MODE = APA				;AN000;
 02B5  8B 47 05				MOV	AX,[BX].MAX_COLORS						;AN000;
 02B8  A3 010F R			MOV	NB_COLORS,AX		; Get number of colors			;AN000;
 02BB  8B 47 03				MOV	AX,[BX].NB_L							;AN000;
 02BE  A3 0111 R			MOV	SCREEN_HEIGHT,AX	; Get number of lines			;AN000;
 02C1  8B 47 01				MOV	AX,[BX].NB_C							;AN000;
 02C4  A3 0113 R			MOV	SCREEN_WIDTH,AX 	; Get number of columns 		;AN000;
 02C7  EB 49				JMP	SHORT GET_MODE_ATTR_END 					;AN000;
														;AN000;
				;										;AN000;
				; Scan the TXT_ATTR_TABLE							;AN000;
				;										;AN000;
 02C9				SCAN_TXT_INIT:									;AN000;
 02C9  8B 0E 028A R			MOV	CX,NB_TXT_MODES 	; CX <-- Number of TXT modes		;AN000;
 02CD  BB 028C R			MOV	BX,OFFSET TXT_ATTR_TABLE; BX <-- Offset of TXT mode table	;AN000;
 02D0				      SCAN_TXT: 								;AN000;
 02D0  3A 17				CMP	DL,[BX].TXT_MODE	; IF mode found 			;AN000;
 02D2  74 05				JE	SHORT ITS_TXT		; THEN get its attributes		;AN000;
 02D4  83 C3 02				ADD	BX,SIZE TXT_ATTR						;AN000;
 02D7  E2 F7			      LOOP    SCAN_TXT			; ELSE keep scanning			;AN000;
 02D9				ITS_TXT:									;AN000;
 02D9  C6 06 010B R 00			MOV	MODE_TYPE,TXT		; MODE = TXT				;AN000;
 02DE  8A 47 01				MOV	AL,[BX].NUM_COLORS						;AN000;
 02E1  98				CBW									;AN000;
 02E2  A3 010F R			MOV	NB_COLORS,AX		; Get number of colors			;AN000;
 02E5  A0 0115 R			MOV	AL,NB_CHAR_COLUMNS	; Get number of columns 		;AN000;
 02E8  98				CBW									;AN000;
 02E9  A3 0113 R			MOV	SCREEN_WIDTH,AX 						;AN000;
				       .IF  <DS:[BP].HARDWARE_CONFIG EQ OLD_ADAPTER>; If an old adapter is there;AN000;
 02EC  3E: 80 7E 03 10       3						cmp DS:[BP].HARDWARE_CONFIG,OLD_ADAPTER 
 02F1  75 08                 6						jne $l27 
				       .THEN ; The number of lines is 25					;AN000;
 02F3  C7 06 0111 R 0019		  MOV	  SCREEN_HEIGHT,25						;AN000;
				       .ELSE									;AN000;
 02F9  EB 10                 3						jmp short $l26 
 02FB                        2	$l27: 
 02FB  B8 0040				  MOV	  AX,BIOS_SEG		; Get number of rows			;AN000;
 02FE  8E C0				  MOV	  ES,AX 		;  from BIOS Data Area			;AN000;
 0300  BB 0084				  MOV	  BX,NB_ROWS_OFFSET	;   at 0040:0084			;AN000;
 0303  26: 8A 07			  MOV	  AL,ES:[BX]							;AN000;
 0306  98				  CBW									;AN000;
 0307  40				  INC	  AX								;AN000;
 0308  A3 0111 R			  MOV	  SCREEN_HEIGHT,AX						;AN000;
				       .ENDIF									;AN000;
 030B                        2	$l26: 
 030B  EB 05				JMP	SHORT GET_MODE_ATTR_END 					;AN000;
														;AN000;
				;										;AN000;
				; The current mode was not found in any of the tables				;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-23


				;										;AN000;
 030D  C6 06 0007 R 04			MOV	ERROR_CODE,MODE_NOT_SUPPORTED					;AN000;
														;AN000;
 0312				GET_MODE_ATTR_END:								;AN000;
 0312  58				POP	AX								;AN000;
 0313  5B				POP	BX								;AN000;
 0314  59				POP	CX								;AN000;
 0315  5A				POP	DX								;AN000;
 0316  C3				RET									;AN000;
 0317				GET_MODE_ATTR ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-24


				PAGE										;AN000;
				;=======================================================================	;AN000;
				;										;AN000;
				; SET_UP_XLT_TABLE : SET UP A COLOR MAPPING FOR EACH COLOR AVAILABLE		;AN000;
				;		     WITH THE CURRENT MODE					;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				;	INPUT: CUR_MODE        = Current video mode.				;AN000;
				;	       HARDWARE_CONFIG = Type of display adapter.			;AN000;
				;	       PRINTER_TYPE    = Type of printer attached (Color or B&W)	;AN000;
				;	       XLT_TAB	       = Color translation table.			;AN000;
				;	       CUR_PAGE        = Active page number				;AN000;
				;	       BP	       = Offset of the shared data area 		;AN000;
				;										;AN000;
				;										;AN000;
				;	OUTPUT: XLT_TAB IS UPDATED						;AN000;
				;										;AN000;
				;	CALLED BY: PRT_SCR							;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; DESCRIPTION: The table is updated to hold a mapping for each color		;AN000;
				; available in the current video mode either TEXT or APA.			;AN000;
				;										;AN000;
				; For example, if the current mode supports 16 colors then the first		;AN000;
				; sixteen bytes of the table will hold the corresponding Color printer		;AN000;
				; or Black and White printer mappings for these colors. 			;AN000;
				;										;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;										;AN000;
				; IF HARDWARE_CONFIG = CGA OR HARDWARE_CONFIG = PC_CONVERTIBLE			;AN000;
				; THEN										;AN000;
				;   CALL SET_CGA_XLT_TAB							;AN000;
				;										;AN000;
				; ELSE IF HARDWARE_CONFIG = EGA 						;AN000;
				;   THEN									;AN000;
				;   CALL SET_EGA_XLT_TAB							;AN000;
				;										;AN000;
				; ELSE IF CUR_MODE = 0FH							;AN000;
				;   THEN									;AN000;
				;   CALL SET_MODE_F_XLT_TAB							;AN000;
				;										;AN000;
				; ELSE IF CUR_MODE = 19 							;AN000;
				;   THEN									;AN000;
				;   CALL SET_MODE_13H_XLT_TAB							;AN000;
				;										;AN000;
				; ELSE										;AN000;
				;   CALL SET_ROUNDUP_XLT_TAB							;AN000;
				;										;AN000;
				; CALL SET_BACKG_IN_XLT_TAB   ; Update the background in the translation table	;AN000;
				;										;AN000;
 0317				SET_UP_XLT_TAB PROC NEAR							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-25


				;-------------------------------------------------------------------------------;AN000;
				; For old display modes: set up translation table as for a Color Graphics Adapt.;AN000;
				; Either 4 or 16 colors are set up depending if the mode is an APA or text mode.;AN000;
				;										;AN000;
				; NOTE: SET_UP_XLT_TAB cannot be invoked if the display adater is a Monochrome	;AN000;
				;	display adater. (When a Mono. adapter is attached, a jump is made to	;AN000;
				;	the ROM BIOS for printing the screen, and no translation table is set). ;AN000;
				;-------------------------------------------------------------------------------;AN000;
				.IF <BIT DS:[BP].HARDWARE_CONFIG  NZ OLD_ADAPTER> OR ; IF it is a CGA		;AN000;
 0317  3E: F6 46 03 10       3						test DS:[BP].HARDWARE_CONFIG,OLD_ADAPTER 
 031C  75 07                 5						jNZ $l32 
				.IF <BIT DS:[BP].HARDWARE_CONFIG  NZ PC_CONVERTIBLE> ; or a PC convertible	;AN000;
 031E  3E: F6 46 03 08       3						test DS:[BP].HARDWARE_CONFIG,PC_CONVERTIBLE 
 0323  74 06                 6						jz $l31 
 0325                        3	$l32: 
				.THEN						     ; THEN set up CGA colors	;AN000;
 0325  E8 0406 R		   CALL    SET_CGA_XLT_TAB			     ;				;AN000;
				.ELSEIF <BIT DS:[BP].HARDWARE_CONFIG NZ EGA>	     ; ELSEIF it is an EGA	;AN000;
 0328  EB 37                 3						jmp short $l30 
 032A  90                    3						nop 
 032B                        2	$l31: 
 032B  3E: F6 46 03 04       3						test DS:[BP].HARDWARE_CONFIG,EGA 
 0330  74 06                 6						jz $l33 
 0332  E8 038F R		   CALL    SET_EGA_XLT_TAB			     ;	  set up EGA colors.	;AN000;
				.ELSEIF <CUR_MODE EQ 0FH>			     ; ELSEIF we are in mode 15 ;AN000;
 0335  EB 2A                 3						jmp short $l30 
 0337  90                    3						nop 
 0338                        2	$l33: 
 0338  80 3E 010E R 0F       3						cmp CUR_MODE,0FH 
 033D  75 06                 6						jne $l35 
 033F  E8 04DF R		   CALL    SET_MODE_F_XLT_TAB			     ;	  set up its 4 shades	;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; A PS/2 system is attached: (we either have a PALACE [Model 30] or a ROUNDUP)	;AN000;
				;-------------------------------------------------------------------------------;AN000;
				.ELSEIF <CUR_MODE EQ 13H>			    ; ELSEIF current mode is 13h;AN000;
 0342  EB 1D                 3						jmp short $l30 
 0344  90                    3						nop 
 0345                        2	$l35: 
 0345  80 3E 010E R 13       3						cmp CUR_MODE,13H 
 034A  75 06                 6						jne $l37 
 034C  E8 0517 R		   CALL    SET_MODE_13H_XLT_TAB 		    ;	  set up 256 colors	;AN000;
				.ELSEIF <BIT DS:[BP].HARDWARE_CONFIG NZ PALACE>     ; ELSEIF PS/2 Model 30(MCGA);AN000;
 034F  EB 10                 3						jmp short $l30 
 0351  90                    3						nop 
 0352                        2	$l37: 
 0352  3E: F6 46 03 01       3						test DS:[BP].HARDWARE_CONFIG,PALACE 
 0357  74 05                 6						jz $l39 
 0359  E8 0406 R		   CALL    SET_CGA_XLT_TAB			    ;	  handle it like a CGA	;AN000;
				.ELSE						    ; ELSE we have a ROUNDUP	;AN000;
 035C  EB 03                 3						jmp short $l30 
 035E                        2	$l39: 
				;-------------------------------------------------------------------------------;AN000;
				; A PS/2 model 50, 60 or 80 or an ADA 'B' card is attached (in 16 color mode):  ;AN000;
				;-------------------------------------------------------------------------------;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-26


 035E  E8 0549 R		   CALL    SET_ROUNDUP_XLT_TAB			;   set up 16 colors		;AN000;
				.ENDIF										;AN000;
 0361                        2	$l30: 
				;-------------------------------------------------------------------------------;AN000;
				; Finish setting up the translation table:					;AN000;
				;-------------------------------------------------------------------------------;AN000;
														;AN000;
 0361  E8 0365 R		CALL SET_BACKG_IN_XLT_TAB   ; Update the background in the translation table	;AN000;
							    ;  according to the command line switch setting	;AN000;
							    ;	(i.e.,/R /B)					;AN000;
 0364  C3			   RET										;AN000;
 0365				SET_UP_XLT_TAB ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-27


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; SET_BACKG_IN_XLT_TAB : ADJUST THE MAPPING FOR THE BACKGROUND COLOR IN THE	;AN000;
				;			 XLT_TAB ACCORDING TO PRINTER TYPE AND /R /B.		;AN000;
				;										;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; INPUT:  BP = Offset of shared data area  (SWITCHES)				;AN000;
				;	  XLT_TAB = The color translation table.				;AN000;
				;										;AN000;
				; OUTPUT: XLT_TAB IS UPDATED							;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; DESCRIPTION: If there is a black and white printer and /R is NOT specified	;AN000;
				; then the background color should not be printed and it is replaced in the	;AN000;
				; translation table by the Intensity for white (will print nothing).		;AN000;
				;										;AN000;
				; If a color printer is attached and /B is not specified then the background	;AN000;
				; color is replaced by the Print Band mask for white.				;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				; IF  (a black and white printer is attached) AND (/R is OFF)			;AN000;
				; THEN										;AN000;
				;   MOV 	XLT_TAB, WHITE_INT	; Store white in translation table	;AN000;
				; ELSE (a color printer is attached)						;AN000;
				;   IF (/B is ON)								;AN000;
				;   THEN									;AN000;
				;      RGB.R := MAX_INT 							;AN000;
				;      RGB.G := MAX_INT 							;AN000;
				;      RGB.B := MAX_INT 							;AN000;
				;      CALL RGB2BAND			; Convert RGB for white to a Band Mask	;AN000;
				;      MOV	XLT_TAB,AL		; Store the band mask in the xlt table	;AN000;
				;										;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0365				SET_BACKG_IN_XLT_TAB PROC NEAR							;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Test if a black and white printer is attached.				;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				.IF <BIT DS:[BP].PRINTER_TYPE NZ BLACK_WHITE> AND    ; IF black and white	;AN000;
 0365  3E: F6 46 04 02       3						test DS:[BP].PRINTER_TYPE,BLACK_WHITE 
 036A  74 0F                 6						jz $l43 
				.IF <BIT DS:[BP].SWITCHES Z REVERSE_SW> 	     ;	   printer and not /R	;AN000;
 036C  3E: F6 46 02 01       3						test DS:[BP].SWITCHES,REVERSE_SW 
 0371  75 08                 5						jnZ $l43 
				.THEN						     ; then, map background	;AN000;
 0373  C6 06 000B R 3F			MOV	XLT_TAB,WHITE_INT		     ;	   to white.		;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-28


				; A Color printer is attached:							;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				.ELSEIF <BIT DS:[BP].PRINTER_TYPE NZ COLOR> AND      ; else, if color printer	;AN000;
 0378  EB 14                 3						jmp short $l42 
 037A  90                    3						nop 
 037B                        2	$l43: 
 037B  3E: F6 46 04 01       3						test DS:[BP].PRINTER_TYPE,COLOR 
 0380  74 0C                 6						jz $l42 
				.IF <BIT DS:[BP].SWITCHES Z BACKGROUND_SW>	     ;	      and  /B if OFF	;AN000;
 0382  3E: F6 46 02 02       3						test DS:[BP].SWITCHES,BACKGROUND_SW 
 0387  75 05                 5						jnZ $l42 
				.THEN						     ;				;AN000;
										     ; Store a null band mask	;AN000;
 0389  C6 06 000B R 00			MOV	XLT_TAB,0			     ;	the translation table.	;AN000;
				.ENDIF										;AN000;
 038E                        2	$l42: 
 038E  C3				RET									;AN000;
 038F				SET_BACKG_IN_XLT_TAB  ENDP							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-29


				PAGE										;AN000;
				;=======================================================================	;AN000;
				;										;AN000;
				; SET_EGA_XLT_TAB : SET UP COLOR TRANSLATION TABLE FOR ENHANCED GRAPHIC 	;AN000;
				;		    ADAPTER							;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				;	INPUT: XLT_TAB = Color translation table.				;AN000;
				;	       PRINTER_TYPE    = Type of printer attached (Color or B&W)	;AN000;
				;	       SWITCHES        = GRAPHICS command line parameters.		;AN000;
				;										;AN000;
				;	OUTPUT: XLT_TAB IS UPDATED						;AN000;
				;										;AN000;
				;	CALLED BY: SET_UP_XLT_TABLE						;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; NOTES: With the EGA, "VIDEO BIOS READ DOT call" returns an index into         ;AN000;
				; the 16 EGA palette registers. 						;AN000;
				;										;AN000;
				; These registers contain the actual colors stored as rgbRGB components 	;AN000;
				; (see EGA_COL2RGB for details) for mode hex 10.  Under mode hex E these	;AN000;
				; registers contain the actual colors as I0RGB components (see CGA_COL2RGB	;AN000;
				; for details). 								;AN000;
				;										;AN000;
				; These registers can be Revised by the user but, are 'WRITE ONLY'.            ;AN000;
				; However, it is possible to define a SAVE AREA where BIOS will maintain	;AN000;
				; a copy of the palette registers.						;AN000;
				;										;AN000;
				; This area is called the "DYNAMIC SAVE AREA" and is defined via the            ;AN000;
				; BIOS EGA SAVE_PTR AREA. Whenever the palette registers are changed by 	;AN000;
				; the user, BIOS updates the EGA_SAVE_AREA.					;AN000;
				;										;AN000;
				; The 16 palette registers are the first 16 bytes of the DYNAMIC SAVE AREA.	;AN000;
				;										;AN000;
				; This program takes advantage of this feature and consults the EGA DYNAMIC	;AN000;
				; SAVE AREA in order to obtain the colors used in the active screen.		;AN000;
				;										;AN000;
				;										;AN000;
				; DESCRIPTION: Obtain each color available with an EGA by reading its		;AN000;
				; palette register in the EGA_SAVE_AREA:					;AN000;
				;										;AN000;
				; Calculate the mapping for this color, either a BAND_MASK or a 		;AN000;
				; GREY INTENSITY and store it in the color translation table.			;AN000;
				;										;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;										;AN000;
				; Obtain the DYNAMIC EGA SAVE AREA offset from the BIOS SAVE_PTR_AREA.		;AN000;
				;										;AN000;
				; If current mode is either 4,5 or 6						;AN000;
				; Then, 									;AN000;
				;   CALL SET_CGA_XLT_TAB							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-30


				;   Get the background color by reading palette register number 0		;AN000;
				; Else, 									;AN000;
				;   For each register number (0 to 15): 					;AN000;
				;     Get the register contents (rgbRGB values) from the EGA SAVE AREA		;AN000;
				;     CALL EGA_COL2RGB		  ; Obtain the Red, Green, Blue values		;AN000;
				;     CALL RGB2XLT_TAB		  ; Obtain a Band Mask or a Grey Intensity	;AN000;
				;				  ; and store the result in the XLT_TAB 	;AN000;
				;										;AN000;
 038F				SET_EGA_XLT_TAB PROC NEAR							;AN000;
 038F  50				PUSH	AX			; Save the registers used		;AN000;
 0390  53				PUSH	BX								;AN000;
 0391  51				PUSH	CX								;AN000;
 0392  52				PUSH	DX								;AN000;
 0393  57				PUSH	DI								;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Obtain the pointer to the DYNAMIC SAVE AREA from the SAVE AREA POINTER TABLE: ;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 = 04A8				EGA_SAVE_PTR	EQU	4A8H		; EGA BIOS pointer to table of		;AN000;
									; pointer to save areas.		;AN000;
 0394  33 C0				XOR	AX,AX			; ES segment := paragraph 0		;AN000;
 0396  8E C0				MOV	ES,AX								;AN000;
														;AN000;
 0398  26: C4 1E 04A8			LES	BX,ES:DWORD PTR EGA_SAVE_PTR ; ES:BX := Pointer to ptr table	;AN000;
 039D  26: C4 5F 04			LES	BX,ES:[BX]+4		; ES:BX :=  Pointer to dynamic save area;AN000;
									;  (NOTE: It is the second pointer in	;AN000;
									;   the table)				;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Set up one entry in the translation table for each color available.		;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				.IF <CUR_MODE EQ 4> OR			; If the current mode is an old CGA	;AN000;
 03A1  80 3E 010E R 04       3						cmp CUR_MODE,4 
 03A6  74 0E                 6						je $l49 
				.IF <CUR_MODE EQ 5> OR			;  GRAPHICS mode:			;AN000;
 03A8  80 3E 010E R 05       3						cmp CUR_MODE,5 
 03AD  74 07                 6						je $l49 
				.IF <CUR_MODE EQ 6>								;AN000;
 03AF  80 3E 010E R 06       3						cmp CUR_MODE,6 
 03B4  75 1B                 6						jne $l48 
 03B6                        3	$l49: 
				.THEN										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Current mode is either mode 4, 5 or 6;					;AN000;
				; Store each color of the old CGA All Points Addressable mode:			;AN000;
				;-------------------------------------------------------------------------------;AN000;
 03B6  E8 0406 R			CALL	SET_CGA_XLT_TAB 	; Set up  colors in the translation	;AN000;
									;  table, NOTE: The background color	;AN000;
									;   will not be set properly since the	;AN000;
									;    EGA BIOS does not update memory	;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-31


									;     location 40:66 with the value	;AN000;
									;      of the background color as CGA	;AN000;
									;	does.				;AN000;
				;------Adjust the background color in the translation table:			;AN000;
				;------The background color is obtained from the EGA DYNAMIC SAVE AREA		;AN000;
				;------ES:BX = Address of the EGA DYNAMIC SAVE AREA				;AN000;
				;------NOTE : For CGA compatible modes EGA BIOS stores the color in the 	;AN000;
				;------DYNAMIC SAVE AREA as a I0RGB value.					;AN000;
 03B9  33 FF				XOR	DI,DI			; DI:=register number = index in XLT_TAB;AN000;
 03BB  26: 8A 01			MOV	AL,ES:[BX][DI]		; AL:=Palette register 0 = Back. color	;AN000;
 03BE  8A E0				MOV	AH,AL			;  Convert I0RGB to IRGB (CGA color)	;AN001;
 03C0  24 07				AND	AL,111B 		;    Isolate RGB bits			;AN001;
 03C2  80 E4 10				AND	AH,10000B		;    Isolate I bit			;AN001;
 03C5  D0 EC				SHR	AH,1			;    Move I bit from position 5 to 4	;AN001;
 03C7  0A C4				OR	AL,AH			;    Get IRGB byte.			;AN001;
 03C9  E8 04A1 R			CALL	CGA_COL2RGB		; Convert IRGB to R,G,B values		;AN001;
 03CC  E8 048D R			CALL	RGB2XLT_TAB		; Convert RGB to an entry in XLT_TAB	;AN000;
														;AN000;
				.ELSE					; ELSE, we have an EGA graphics mode:	;AN000;
 03CF  EB 2F                 3						jmp short $l47 
 03D1                        2	$l48: 
				;-------------------------------------------------------------------------------;AN000;
				; The current mode is a either a text mode or one of the EGA enhanced mode;	;AN000;
				; Store in the translation table each color available (these modes have 16 col.);AN000;
				;-------------------------------------------------------------------------------;AN000;
 03D1  B9 0010				MOV	CX,16			; CX := Number of palette registers	;AN000;
									;	to read 			;AN000;
 03D4  33 FF				XOR	DI,DI			; DI := Palette register number 	;AN000;
									;  and index in the translation table	;AN000;
 03D6				STORE_1_EGA_COLOR:								;AN000;
 03D6  26: 8A 01			MOV	AL,ES:[BX][DI]		; AL := Palette register		;AN000;
				       .IF   <CUR_MODE EQ 14> OR	; If mode E (hex) OR mode D (hex)	;AN000;
 03D9  80 3E 010E R 0E       3						cmp CUR_MODE,14 
 03DE  74 07                 6						je $l53 
				       .IF   <CUR_MODE EQ 13>		; the colors are			;AN000;
 03E0  80 3E 010E R 0D       3						cmp CUR_MODE,13 
 03E5  75 10                 6						jne $l52 
 03E7                        3	$l53: 
				       .THEN				;  stored as I0CGA colors		;AN000;
 03E7  8A E0				  MOV	  AH,AL 		;  Convert I0RGB to IRGB (CGA color)	;AN000;
 03E9  24 07				  AND	  AL,111B		;    Isolate RGB bits			;AN000;
 03EB  80 E4 10				  AND	  AH,10000B		;    Isolate I bit			;AN000;
 03EE  D0 EC				  SHR	  AH,1			;    Move I bit from position 5 to 4	;AN000;
 03F0  0A C4				  OR	  AL,AH 		;    Get IRGB byte.			;AN000;
 03F2  E8 04A1 R			  CALL	  CGA_COL2RGB		;  Convert IRGB to R,G,B values 	;AN000;
				       .ELSE				; Else, they are stored as (rgbRGB);	;AN000;
 03F5  EB 03                 3						jmp short $l51 
 03F7                        2	$l52: 
 03F7  E8 0600 R			  CALL	  EGA_COL2RGB		;   Convert register to R,G,B values	;AN000;
				       .ENDIF									;AN000;
 03FA                        2	$l51: 
 03FA  E8 048D R			CALL	RGB2XLT_TAB		; Convert RGB to an entry in XLT_TAB	;AN000;
 03FD  47				INC	DI			; Get next palette register number	;AN000;
 03FE  E2 D6				LOOP	STORE_1_EGA_COLOR						;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-32


				.ENDIF					; ENDIF 4 colors or 16 colors		;AN000;
 0400                        2	$l47: 
														;AN000;
 0400  5F				POP	DI			; Restore the registers 		;AN000;
 0401  5A				POP	DX								;AN000;
 0402  59				POP	CX								;AN000;
 0403  5B				POP	BX								;AN000;
 0404  58				POP	AX								;AN000;
 0405  C3				RET									;AN000;
 0406				SET_EGA_XLT_TAB ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-33


				PAGE										;AN000;
				;=======================================================================	;AN000;
				;										;AN000;
				; SET_CGA_XLT_TAB : SET UP COLOR TRANSLATION TABLE FOR COLOR GRAPHIC		;AN000;
				;		    ADAPTER							;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				;	INPUT: XLT_TAB	       = Color translation table.			;AN000;
				;	       PRINTER_TYPE    = Type of printer attached (Color or B&W)	;AN000;
				;	       SWITCHES        = GRAPHICS command line parameters.		;AN000;
				;										;AN000;
				;	OUTPUT: XLT_TAB IS UPDATED						;AN000;
				;										;AN000;
				;	CALLED BY: SET_UP_XLT_TABLE						;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; NOTES: With the CGA, the "VIDEO BIOS READ DOT call" returns a number          ;AN000;
				; from 0 to 3. A dot of value 0 is of the background color.			;AN000;
				;										;AN000;
				; The actual value of the background color is stored in BIOS VIDEO		;AN000;
				; DISPLAY DATA AREA as a PIIRGB value (see CGA_COL2RGB for details) and 	;AN000;
				; can be any of 16 colors.							;AN000;
				;										;AN000;
				; A dot of value 1,2, or 3 represents any of 2 specific colors depending	;AN000;
				; on the current color palette. 						;AN000;
				;										;AN000;
				; The palette number is obtained from the BIOS VIDEO DISPLAY DATA AREA		;AN000;
				; (It is the "P" bit or bit number 5)                                           ;AN000;
				;										;AN000;
				; The dot values 1,2,3 expressed in binary actually represent the RG		;AN000;
				; (Red, Green) components of the color. 					;AN000;
				;										;AN000;
				; The palette number represents the B (Blue) component therefore, when		;AN000;
				; the palette number is appended to the color number we obtain the RGB		;AN000;
				; components for that color.							;AN000;
				;										;AN000;
				;  (E.G.,  COLOR  =  010	; COLOR # 2					;AN000;
				;	   PALETTE=    0	; PALETTE # 0					;AN000;
				;										;AN000;
				;	   IRGB   =  0100	; Intensity = 0  Ä¿				;AN000;
				;				; Red	    = 1   ÃÄÄÄ> color = Red		;AN000;
				;				; Green     = 0   ³				;AN000;
				;				; Blue	    = 0  ÄÙ				;AN000;
				;										;AN000;
				;										;AN000;
				; DESCRIPTION:									;AN000;
				;										;AN000;
				; For each color available with a CGA:						;AN000;
				;	 Calculate the color mapping, either a BAND_MASK or a GREY		;AN000;
				;	 INTENSITY and store it in the color translation table. 		;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-34


				;										;AN000;
				; ; Obtain the background color from VIDEO BIOS DATA AREA			;AN000;
				; ;  and the paletter number							;AN000;
				;										;AN000;
				; ; Store the Background color: 						;AN000;
				; CALL CGA_COL2RGB		  ; Convert IRGB components to RGB values	;AN000;
				; CALL RGB2XLT_TAB		  ; Convert RGB to an entry in the translation	;AN000;
				;				  ; table					;AN000;
				; ; Store all other colors:							;AN000;
				; FOR IRG := 1 TO 3		  ; Obtain the color number			;AN000;
				;   Append palette number (B) to IRG						;AN000;
				;   CALL CGA_COL2RGB		  ; Convert color to RGB values 		;AN000;
				;   CALL RGB2XLT_TAB		  ; Convert RGB to an entry in the translation	;AN000;
				;				  ; table					;AN000;
				;										;AN000;
 0406				SET_CGA_XLT_TAB  PROC NEAR							;AN000;
 0406  50				PUSH	AX								;AN000;
 0407  53				PUSH	BX								;AN000;
 0408  51				PUSH	CX								;AN000;
 0409  57				PUSH	DI								;AN000;
 040A  06				PUSH	ES								;AN000;
														;AN000;
				.IF <CUR_MODE EQ 4> OR								;AN000;
 040B  80 3E 010E R 04       3						cmp CUR_MODE,4 
 0410  74 07                 6						je $l57 
				.IF <CUR_MODE EQ 5>								;AN000;
 0412  80 3E 010E R 05       3						cmp CUR_MODE,5 
 0417  75 2E                 6						jne $l56 
 0419                        3	$l57: 
				;===============================================================================;AN000;
				;										;AN000;
				; THE CURRENT MODE IS MODE 4 OR 5						;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				.THEN										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Read the CRT palette from the BIOS ROM to obtain the background color and	;AN000;
				; the current palette number; store the palette number in BL			;AN000;
				;-------------------------------------------------------------------------------;AN000;
 = 0040				ROM_BIOS_SEG	EQU 40H    ; CGA BIOS SEGMENT					;AN000;
 = 0066				CRT_PALETTE_OFF EQU 66H    ; BIOS Current palette setting			;AN000;
 = 0020				P_BIT_MASK   EQU 100000B   ;   bit 5 = Current palette				;AN000;
 = 0008				I_BIT_MASK   EQU   1000B   ;   bit 4 = Intensity bit				;AN000;
 = 0004				R_BIT_MASK   EQU    100B   ;   bit 2 = Red bit					;AN000;
 = 0002				G_BIT_MASK   EQU     10B   ;   bit 1 = Green bit				;AN000;
 = 0001				B_BIT_MASK   EQU      1B   ;   bit 0 = Blue bit 				;AN000;
														;AN000;
 0419  B8 0040				MOV	AX,ROM_BIOS_SEG      ; ES := ROM BIOS SEGMENT			;AN000;
 041C  50				PUSH	AX								;AN000;
 041D  07				POP	ES								;AN000;
														;AN000;
 041E  26: A0 0066			MOV	AL,ES:CRT_PALETTE_OFF; AL := CRT Palette  (00PIIRGB)		;AN000;
 0422  B3 20				MOV	BL,P_BIT_MASK	     ; LOW NIBBLE = BACKGROUND COLOR		;AN000;
 0424  22 D8				AND	BL,AL		     ; BL := Palette number			;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-35


 0426  B1 05				MOV	CL,5								;AN000;
 0428  D2 EB				SHR	BL,CL								;AN000;
														;AN000;
 042A  33 FF				XOR	DI,DI		     ; DI := Index in the XLT_TAB		;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Store the background color, (obtained from low 4 bits of the byte at 40:66)	;AN000;
				;-------------------------------------------------------------------------------;AN000;
 042C  E8 04A1 R			CALL	CGA_COL2RGB	     ; Convert color (in AL) to R, G, B values	;AN000;
 042F  E8 048D R			CALL	RGB2XLT_TAB	     ; Convert RGB to an entry in XLT_TAB	;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Store the 3 foreground colors for mode 4 and 5				;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0432  B9 0003				MOV	CX,3		     ; For each color, but the background:	;AN000;
 0435				STORE_1_CGA_MODE4_COLOR:							;AN000;
 0435  47				INC	DI		     ; Increment index in the translation table ;AN000;
 0436  8B C7				MOV	AX,DI		     ; AL := IRG				;AN000;
 0438  D0 E0				SHL	AL,1								;AN000;
 043A  0A C3				OR	AL,BL		     ; AL := IRGB				;AN000;
 043C  E8 04A1 R			CALL	CGA_COL2RGB	     ; Convert color (in AL) to R, G, B values	;AN000;
 043F  E8 048D R			CALL	RGB2XLT_TAB	     ; Convert RGB to an entry in XLT_TAB	;AN000;
 0442  E2 F1				LOOP	STORE_1_CGA_MODE4_COLOR 					;AN000;
				.ELSEIF <CUR_MODE EQ 6> 							;AN000;
 0444  EB 41                 3						jmp short $l55 
 0446  90                    3						nop 
 0447                        2	$l56: 
 0447  80 3E 010E R 06       3						cmp CUR_MODE,6 
 044C  75 29                 6						jne $l58 
				;===============================================================================;AN000;
				;										;AN000;
				; THE CURRENT MODE IS MODE 6							;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				.THEN										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Store background color for mode 6 (mode 6 is a 2 colors, APA mode)		;AN000;
				; Background is stored as BLACK 						;AN000;
				;-------------------------------------------------------------------------------;AN000;
 044E  33 FF				XOR	DI,DI		  ; DI := Index of color in translation table	;AN000;
 0450  C6 06 0008 R 00			MOV	RGB.R,BLACK_INT   ; Foreground color is white			;AN000;
 0455  C6 06 0009 R 00			MOV	RGB.G,BLACK_INT   ; RGB := RGB of white 			;AN000;
 045A  C6 06 000A R 00			MOV	RGB.B,BLACK_INT   ;						;AN000;
 045F  E8 048D R			CALL	RGB2XLT_TAB	  ; Convert RGB to an entry in XLT_TAB		;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Store foreground color for mode 6 (mode 6 is a 2 colors, APA mode)		;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0462  47				INC	DI		  ; DI := Index of color in translation table	;AN000;
 0463  C6 06 0008 R 3F			MOV	RGB.R,WHITE_INT   ; Background color is BLACK			;AN000;
 0468  C6 06 0009 R 3F			MOV	RGB.G,WHITE_INT   ; RGB := RGB of BLACK 			;AN000;
 046D  C6 06 000A R 3F			MOV	RGB.B,WHITE_INT   ;						;AN000;
 0472  E8 048D R			CALL	RGB2XLT_TAB	  ; Convert RGB to an entry in XLT_TAB		;AN000;
				.ELSE										;AN000;
 0475  EB 10                 3						jmp short $l55 
 0477                        2	$l58: 
				;===============================================================================;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-36


				;										;AN000;
				; THE CURRENT MODE IS A TEXT MODE:						;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0477  33 FF				XOR	DI,DI		  ; DI := Index in the translation table	;AN000;
 0479  B9 0010				MOV	CX,16		  ; For each of the 16 colors:			;AN000;
 047C				STORE_1_CGA_TEXT_COLOR: 							;AN000;
 047C  8B C7				MOV	AX,DI		  ; AL := IRGB					;AN000;
 047E  E8 04A1 R			CALL	CGA_COL2RGB	  ; Convert color (in AL) to R, G, B values	;AN000;
 0481  E8 048D R			CALL	RGB2XLT_TAB	  ; Convert RGB to an entry in XLT_TAB		;AN000;
 0484  47				INC	DI		  ; Increment index in the translation table	;AN000;
 0485  E2 F5				LOOP	STORE_1_CGA_TEXT_COLOR						;AN000;
				.ENDIF				  ;						;AN000;
 0487                        2	$l55: 
														;AN000;
 0487  07				POP	ES								;AN000;
 0488  5F				POP	DI								;AN000;
 0489  59				POP	CX								;AN000;
 048A  5B				POP	BX								;AN000;
 048B  58				POP	AX								;AN000;
														;AN000;
 048C  C3				RET									;AN000;
 048D				SET_CGA_XLT_TAB  ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-37


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; RGB2XLT_TAB: CONVERT R,G,B VALUES TO EITHER A BAND MASK OR AN INTENSITY	;AN000;
				;	   STORE THE RESULT IN THE TRANSLATION TABLE				;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT:	 DI  = Index in the translation table				;AN000;
				;		 RGB = Red Green Blue values of the color to be stored. 	;AN000;
				;										;AN000;
				;	OUTPUT:  XLT_TAB is updated						;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; DESCRIPTION: Convert the RGB values to either a Band mask or an intensity	;AN000;
				; depending on the printer type; store the result in the translation table.	;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;   IF PRINTER_TYPE = COLOR							;AN000;
				;     THEN									;AN000;
				;     CALL RGB2BAND		  ; Obtain a Band Mask				;AN000;
				;   ELSE ; Printer is Monochrome						;AN000;
				;     CALL RGB2INT		  ; Obtain a Grey Intensity			;AN000;
				;   Store the result in the XLT_TAB						;AN000;
				;										;AN000;
 048D				RGB2XLT_TAB PROC NEAR								;AN000;
				       .IF <DS:[BP].PRINTER_TYPE EQ COLOR>; Color printer ?			;AN000;
 048D  3E: 80 7E 04 01       3						cmp DS:[BP].PRINTER_TYPE,COLOR 
 0492  75 05                 6						jne $l62 
				       .THEN									;AN000;
				;-------A color printer is attached:						;AN000;
 0494  E8 06EB R			  CALL	  RGB2BAND		; Yes, convert RGB to color band (in AL);AN000;
				       .ELSE									;AN000;
 0497  EB 03                 3						jmp short $l61 
 0499                        2	$l62: 
				;-------A black and white printer is attached:					;AN000;
 0499  E8 0646 R			  CALL	  RGB2INT		; No, RGB to an intensity in AL 	;AN000;
				       .ENDIF									;AN000;
 049C                        2	$l61: 
				;-------Store the result							;AN000;
 049C  88 85 000B R			MOV	XLT_TAB[DI],AL							;AN000;
 04A0  C3			       RET									;AN000;
 04A1				RGB2XLT_TAB ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-38


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; CGA_COL2RGB : CONVERT A COLOR FROM THE CGA TO RED GREEN BLUE VALUES		;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT: AL      = 0000IRGB    ONE BYTE WHERE BIT:			;AN000;
				;										;AN000;
				;					I = Intensity bit			;AN000;
				;					R = Red component			;AN000;
				;					G = Green component			;AN000;
				;					B = Blue component			;AN000;
				;										;AN000;
				;										;AN000;
				;	OUTPUT: RGB.R	    = RED   component (0-63)				;AN000;
				;		RGB.G	    = GREEN component (0-63)				;AN000;
				;		RGB.B	    = BLUE  component (0-63)				;AN000;
				;										;AN000;
				;	CALLED BY: SET_UP_CGA_XLT_TABLE 					;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; DESCRIPTION: If either the RED, GREEN, or BLUE bit is on (in an IRGB		;AN000;
				; byte) then, the corresponding color gun on the display is firing 2/3		;AN000;
				; of its capacity, giving a color intensity of "2/3".                           ;AN000;
				;										;AN000;
				; If the INTENSITY bit is on, then 1/3 is added to EACH color.			;AN000;
				;										;AN000;
				; (E.G.,		       IRGB		 R    G    B			;AN000;
				;	   BLACK	 = 00000000	      (  0,   0,   0)			;AN000;
				;	   WHITE	 = 00001111	      (3/3, 3/3, 3/3)			;AN000;
				;	   RED		 = 00000100	      (2/3,   0,   0)			;AN000;
				;	   HIGH INT. RED = 00001100	      (3/3, 1/3, 1/3)			;AN000;
				;										;AN000;
				; Since we want an intensity from 0 to 63,					;AN000;
				; "2/3" of RED means:                                                           ;AN000;
				;		       2/3 * 63 = 42						;AN000;
				;										;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				; Get the intensity.								;AN000;
				; Get the red component 							;AN000;
				; Get the green component							;AN000;
				; Get the blue component							;AN000;
				;										;AN000;
 04A1				CGA_COL2RGB PROC NEAR								;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; Init the R,G,B values:							;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
 04A1  C6 06 0008 R 00			MOV	RGB.R,0 							;AN000;
 04A6  C6 06 0009 R 00			MOV	RGB.G,0 							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-39


 04AB  C6 06 000A R 00			MOV	RGB.B,0 							;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; Test the Intensity bit:							;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				       .IF <BIT AL AND I_BIT_MASK>	; IF, I is on				;AN000;
 04B0  A8 08                 3						test AL,I_BIT_MASK 
 04B2  74 0F                 6						jz $l65 
				       .THEN									;AN000;
 04B4  80 06 0008 R 15			  ADD	  RGB.R,ONE_THIRD	; Then, add one third to each		;AN000;
 04B9  80 06 0009 R 15			  ADD	  RGB.G,ONE_THIRD	; color.				;AN000;
 04BE  80 06 000A R 15			  ADD	  RGB.B,ONE_THIRD						;AN000;
				       .ENDIF									;AN000;
 04C3                        2	$l65: 
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; Test the RGB bits:								;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				       .IF <BIT AL AND R_BIT_MASK>	; If, Red is on 			;AN000;
 04C3  A8 04                 3						test AL,R_BIT_MASK 
 04C5  74 05                 6						jz $l68 
				       .THEN									;AN000;
 04C7  80 06 0008 R 2A			  ADD	  RGB.R,TWO_THIRD	; then, add two third RED		;AN000;
				       .ENDIF									;AN000;
 04CC                        2	$l68: 
														;AN000;
				       .IF <BIT AL AND G_BIT_MASK>	; If, Green is on			;AN000;
 04CC  A8 02                 3						test AL,G_BIT_MASK 
 04CE  74 05                 6						jz $l71 
				       .THEN									;AN000;
 04D0  80 06 0009 R 2A			  ADD	  RGB.G,TWO_THIRD	; then, add two third GREEN		;AN000;
				       .ENDIF									;AN000;
 04D5                        2	$l71: 
														;AN000;
				       .IF <BIT AL AND B_BIT_MASK>	; If, Blue is on			;AN000;
 04D5  A8 01                 3						test AL,B_BIT_MASK 
 04D7  74 05                 6						jz $l74 
				       .THEN									;AN000;
 04D9  80 06 000A R 2A			  ADD	  RGB.B,TWO_THIRD	; then, add two third BLUE		;AN000;
				       .ENDIF									;AN000;
 04DE                        2	$l74: 
														;AN000;
 04DE  C3				RET									;AN000;
 04DF				CGA_COL2RGB ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-40


				PAGE										;AN000;
				;=======================================================================	;AN000;
				;										;AN000;
				; SET_MODE_F_XLT_TAB: SET UP COLOR TRANSLATION TABLE FOR MONOCHROME		;AN000;
				;		      MODE "F"                                                  ;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				;	INPUT: XLT_TAB	     = Color translation table. 			;AN000;
				;	       PRINTER_TYPE  = Type of printer attached (Color or B&W)		;AN000;
				;	       SWITCHES      = GRAPHICS command line parameters.		;AN000;
				;										;AN000;
				;	OUTPUT: XLT_TAB IS UPDATED						;AN000;
				;										;AN000;
				;	CALLED BY: SET_UP_XLT_TABLE						;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; NOTES: In mode F the "VIDEO BIOS READ DOT call" returns a byte where          ;AN000;
				; bit 1 and 3 represent the value of plane 1 and 3.				;AN000;
				; The following colors are available using this mode:				;AN000;
				;										;AN000;
				;		plane 2:   plane 0:	   color:				;AN000;
				;		   0	      0 	   black				;AN000;
				;		   0	      1 	   white				;AN000;
				;		   1	      0 	   blinking white			;AN000;
				;		   1	      1 	   high-intensity white 		;AN000;
				;										;AN000;
				;										;AN000;
				; DESCRIPTION: A local table holds the Red, Green, Blue values for each of	;AN000;
				; the 4 Mono colors available in Mode Fh.					;AN000;
				; Each color is stored as either a Grey intensity if printing in Monochrome	;AN000;
				; or as a Band Mask if printing in color.					;AN000;
				; Black is stored as black.							;AN000;
				; White is stored as a light gray						;AN000;
				; High-intensity white and blinking white are stored as white.			;AN000;
				;										;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				; FOR EACH "COLOR" AVAILABLE WITH MODE F                                        ;AN000;
				; GET ITS R,G,B VALUES								;AN000;
				; CALL RGB2XLT_TAB		; Convert RGB to an entry in the translation	;AN000;
				;				; table 					;AN000;
				;										;AN000;
 04DF				SET_MODE_F_XLT_TAB PROC NEAR							;AN000;
 04DF  50				PUSH	AX								;AN000;
 04E0  56				PUSH	SI								;AN000;
 04E1  57				PUSH	DI								;AN000;
 04E2  EB 0C				JMP	SHORT SET_MODE_F_BEGIN						;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; TABLE OF R,G,B VALUES WE ASSIGN TO THE 4 COLORS AVAILABLE IN MODE F:		;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-41


 04E4				MODE_F_RGB	LABEL	BYTE							;AN000;
 04E4  00 00 00				DB	BLACK_INT,BLACK_INT,BLACK_INT ; Black is mapped to black.	;AN000;
 04E7  2A 2A 2A				DB	TWO_THIRD,TWO_THIRD,TWO_THIRD ; White		--> light grey	;AN000;
 04EA  3F 3F 3F				DB	WHITE_INT,WHITE_INT,WHITE_INT ; Blinking	--> white	;AN000;
 04ED  3F 3F 3F				DB	WHITE_INT,WHITE_INT,WHITE_INT ; High-int. White --> white	;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; STORE THE COLORS AVAILABLE WITH MODE F					;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 04F0				SET_MODE_F_BEGIN:								;AN000;
 04F0  BE 04E4 R			MOV	SI,OFFSET MODE_F_RGB	; SI <-- Offset of RGB table		;AN000;
 04F3  33 FF				XOR	DI,DI			; DI <-- Index into translation table	;AN000;
														;AN000;
				;-------For each color available in mode F:					;AN000;
 04F5				STORE_1_MODE_F_COLOR:								;AN000;
 04F5  8A 04				MOV	AL,[SI] 		; Get the Red component 		;AN000;
 04F7  A2 0008 R			MOV	RGB.R,AL							;AN000;
 04FA  8A 44 01				MOV	AL,[SI]+1		; Get the Green component		;AN000;
 04FD  A2 0009 R			MOV	RGB.G,AL							;AN000;
 0500  8A 44 02				MOV	AL,[SI]+2		; Get the Blue component		;AN000;
 0503  A2 000A R			MOV	RGB.B,AL							;AN000;
														;AN000;
				;-------Convert pixel to either a Color band or an Intensity:			;AN000;
 0506  E8 048D R			CALL	RGB2XLT_TAB		; Convert and store in the xlt table	;AN000;
														;AN000;
 0509  83 C6 03				ADD	SI,3			; Get next R,G,B values 		;AN000;
 050C  47				INC	DI			; One more color has been stored	;AN000;
 050D  3B 3E 010F R			CMP	DI,NB_COLORS		; All stored ?				;AN000;
 0511  7C E2				JL	STORE_1_MODE_F_COLOR						;AN000;
														;AN000;
 0513  5F				POP	DI								;AN000;
 0514  5E				POP	SI								;AN000;
 0515  58				POP	AX								;AN000;
 0516  C3				RET									;AN000;
 0517				SET_MODE_F_XLT_TAB ENDP 							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-42


				PAGE										;AN000;
				;=======================================================================	;AN000;
				;										;AN000;
				; SET_MODE_13H_XLT_TAB: SET UP COLOR TRANSLATION TABLE FOR PALACE VIDEO 	;AN000;
				;		      ADAPTER IN MODE 13H					;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				;	INPUT: XLT_TAB	      = Color translation table.			;AN000;
				;	       PRINTER_TYPE   = Type of printer attached (Color or B&W) 	;AN000;
				;	       SWITCHES       = GRAPHICS command line parameters.		;AN000;
				;										;AN000;
				;	OUTPUT: XLT_TAB IS UPDATED						;AN000;
				;										;AN000;
				;	CALLED BY: SET_UP_XLT_TABLE						;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; NOTES: With the PALACE the "VIDEO BIOS READ DOT call" returns a direct        ;AN000;
				; index to the 256 COLOR REGISTERS.						;AN000;
				;										;AN000;
				; These COLORS REGISTERS hold the R,G,B (Red, Green, Blue) values for		;AN000;
				; each of the 256 colors available at the same time on the screen.		;AN000;
				; Color register number 0 holds the background color.				;AN000;
				;										;AN000;
				; DESCRIPTION: Store a color mapping for each color register.			;AN000;
				; If the REVERSE_SW is off,  exchange white and black.				;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;										;AN000;
				; For each color (0 to 255)							;AN000;
				;   Read the color register	; get the RGB values for this color num.	;AN000;
				;   Store the result in the XLT_TAB						;AN000;
				;										;AN000;
 0517				SET_MODE_13H_XLT_TAB PROC NEAR							;AN000;
 0517  50				PUSH	AX								;AN000;
 0518  53				PUSH	BX								;AN000;
 0519  51				PUSH	CX								;AN000;
 051A  52				PUSH	DX								;AN000;
 051B  57				PUSH	DI								;AN000;
														;AN000;
 051C  C7 06 0547 R 0100		MOV	NB_COLORS_TO_READ,256	; Read 256 color registers		;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Store in the translation table each color available for mode 13h:		;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0522  33 FF				XOR	DI,DI			; DI := Palette register number 	;AN000;
									;  and index in the translation table	;AN000;
 0524				STORE_1_M13H_COLOR:								;AN000;
 0524  8B DF				MOV	BX,DI			; BX := Color register to be read	;AN000;
 0526  B8 1015				MOV	AX,GET_C_REG_CALL	; AX := BIOS Get color register call	;AN000;
 0529  CD 10				INT	10H			; Call BIOS				;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-43


 052B  88 36 0008 R			MOV	RGB.R,DH		; Get Red value 			;AN000;
 052F  88 2E 0009 R			MOV	RGB.G,CH		; Get Green value			;AN000;
 0533  88 0E 000A R			MOV	RGB.B,CL		; Get Blue value			;AN000;
 0537  E8 048D R			CALL	RGB2XLT_TAB		; Convert RGB to an entry in XLT_TAB	;AN000;
 053A  47				INC	DI			; Get next palette register number	;AN000;
 053B  3B 3E 0547 R			CMP	DI,NB_COLORS_TO_READ	; All colors stored ?			;AN000;
 053F  7C E3				JL	STORE_1_M13H_COLOR	; No, get next one			;AN000;
														;AN000;
														;AN000;
 0541  5F				POP	DI								;AN000;
 0542  5A				POP	DX								;AN000;
 0543  59				POP	CX								;AN000;
 0544  5B				POP	BX								;AN000;
 0545  58				POP	AX								;AN000;
 0546  C3				RET									;AN000;
 0547  0000			NB_COLORS_TO_READ DW ?		; Number of colors registers to read with a PS/2;AN000;
 0549				SET_MODE_13H_XLT_TAB ENDP							;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-44


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; SET_ROUNDUP_XLT_TAB: SET UP COLOR TRANSLATION TABLE FOR ROUNDUP VIDEO 	;AN000;
				;		       ADAPTER							;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT: XLT_TAB	       = Color translation table.			;AN000;
				;	       PRINTER_TYPE    = Type of printer attached (Color or B&W)	;AN000;
				;	       SWITCHES        = GRAPHICS command line parameters.		;AN000;
				;										;AN000;
				;	OUTPUT: XLT_TAB IS UPDATED						;AN000;
				;										;AN000;
				;	CALLED BY: SET_UP_XLT_TABLE						;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; NOTES: With the ROUNDUP the "VIDEO BIOS READ DOT call" returns an             ;AN000;
				; index into the 16 PALETTE REGISTERS.						;AN000;
				;										;AN000;
				; Each palette register holds an index into the current "color page"            ;AN000;
				; within the 256 COLOR REGISTERS.						;AN000;
				;										;AN000;
				; These "color pages" represent all the colors from WHICH TO CHOOSE the         ;AN000;
				; screen colors for an active page; 16 colors can be displayed at the		;AN000;
				; same time on the screen.							;AN000;
				;										;AN000;
				; There are 2 paging modes: either 64 color pages or 16 color pages:		;AN000;
				;										;AN000;
				; In 64 color mode, there are 4 color pages available (the 256 palette		;AN000;
				; registers are partitioned in 4 blocks of 64 colors).				;AN000;
				;										;AN000;
				; The 16 screen colors for the active page are selected from these 64		;AN000;
				; color registers.								;AN000;
				;										;AN000;
				; This scheme allows for quickly changing the contents of the screen by 	;AN000;
				; changing the active page.							;AN000;
				;										;AN000;
				; The COLOR REGISTERS contains the color information stored as RGB (Red,	;AN000;
				; Green, Blue) components. There is one byte for each of these 3		;AN000;
				; components.  The value for each component ranges from 0 to 63 (where		;AN000;
				; 0 = color not present).							;AN000;
				;										;AN000;
				;										;AN000;
				; DESCRIPTION: Determine the paging mode and the active color page.		;AN000;
				; For each color available with the current mode, get the palette		;AN000;
				; register and then, read the corresponding color register in order to		;AN000;
				; obtain its RGB components.							;AN000;
				;										;AN000;
				; For mode 11h, 2 colors only are available. These colors are obtained from	;AN000;
				; palette register 0 (background) and 7 (foreground color). The contents	;AN000;
				; of these 2 palette registers is also used as an index within the color	;AN000;
				; registers.									;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-45


				;										;AN000;
				; If printing is Monochrome, map the RGB to a Grey Intensity.			;AN000;
				; If printing is in colors, map the RGB to a Band Mask. 			;AN000;
				; Store the result in the translation table					;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;										;AN000;
				; Read color page state (BIOS INT 10H - AL = 1AH)				;AN000;
				;										;AN000;
				; If mode 4,5 or 6								;AN000;
				; Then										;AN000;
				;   CALL SET_CGA_XLT_TAB							;AN000;
				;   Adjust the background color.						;AN000;
				; else										;AN000;
				; If mode 11h									;AN000;
				; then										;AN000;
				; For PALETTE_INDEX := 0 to 15							;AN000;
				; IF PAGE_MODE = PAGE_64_REGISTERS						;AN000;
				;   THEN									;AN000;
				;   Read the palette register number "PALETTE_INDEX"                            ;AN000;
				;   COLOR_INDEX := Palette register contents					;AN000;
				;   COLOR_INDEX := (CUR_PAGE_NUM * 64) + COLOR_INDEX				;AN000;
				;   Read color register number "COLOR_INDEX"    ; Obtain R,G,B values.          ;AN000;
				;   CALL    RGB2XLT_TAB       ; Convert RGB to an entry in XLT_TAB		;AN000;
				;										;AN000;
				; ELSE IF PAGE_MODE = PAGE_16_REGISTERS 					;AN000;
				;   COLOR_INDEX := (CUR_PAGE_NUM * 16) + PALETTE_INDEX				;AN000;
				;   Read color register number "COLOR_INDEX"                                    ;AN000;
				;   CALL    RGB2XLT_TAB       ; Convert RGB to an entry in XLT_TAB		;AN000;
				;										;AN000;
				;										;AN000;
 0549				SET_ROUNDUP_XLT_TAB PROC NEAR							;AN000;
 = 0000				PAGING_MODE_64 EQU 0								;AN000;
														;AN000;
 0549  50				PUSH	AX								;AN000;
 054A  53				PUSH	BX								;AN000;
 054B  51				PUSH	CX								;AN000;
 054C  57				PUSH	DI								;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Obtain the color page state							;AN000;
				;-------------------------------------------------------------------------------;AN000;
 054D  B8 101A				MOV	AX,PAGE_STATE_CALL	  ; Call BIOS				;AN000;
 0550  CD 10				INT	10H			  ;  BL := Paging mode			;AN000;
									  ;  BH := Current page 		;AN000;
														;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Check the video mode: 							;AN000;
				;-------------------------------------------------------------------------------;AN000;
				.SELECT 									;AN000;
				.WHEN <CUR_MODE EQ 4> OR		  ; If the current mode is an old CGA	;AN000;
 0552  80 3E 010E R 04       3						cmp CUR_MODE,4 
 0557  74 0E                 6						je $l79 
				.WHEN <CUR_MODE EQ 5> OR		  ;  mode:				;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-46


 0559  80 3E 010E R 05       3						cmp CUR_MODE,5 
 055E  74 07                 6						je $l79 
				.WHEN <CUR_MODE EQ 6>			  ;					;AN000;
 0560  80 3E 010E R 06       3						cmp CUR_MODE,6 
 0565  75 15                 6						jne $l78 
 0567                        3	$l79: 
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Old CGA graphics mode (mode 4, 5 or 6)					;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Store colors of the old CGA modes:						;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0567  E8 0406 R			CALL	SET_CGA_XLT_TAB 	; Set up colors in the translation	;AN000;
									;  table, NOTE: The background color	;AN000;
									;   will not be set properly since the	;AN000;
									;    PS/2 BIOS does not update memory	;AN000;
									;     location 40:66 with the value	;AN000;
									;      of the background color as CGA	;AN000;
									;	does for modes 4 and 5. However ;AN000;
									;	 40:66 holds the current palette;AN000;
									;	  selected.			;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Adjust the background color for modes 4,5 or 6				;AN000;
				;-------------------------------------------------------------------------------;AN000;
 056A  C6 06 05C0 R 00 90		MOV	PAL_REGISTER_NB,0	; Read the palette register number 0	;AN000;
 0570  E8 05C1 R			CALL	GET_PALETTE_RGB 	;  this register points to the color	;AN000;
									;   register that contains the RGB	;AN000;
									;    values of the BACKGROUND color.	;AN000;
 0573  BF 0000				MOV	DI,0			; DI := Index in the translation table	;AN000;
 0576  E8 048D R			CALL	RGB2XLT_TAB		; Store mapping in the translation table;AN000;
														;AN000;
				.WHEN  <CUR_MODE EQ 11H>							;AN000;
 0579  EB 40                 3						jmp short $l77 
 057B  90                    3						nop 
 057C                        2	$l78: 
 057C  80 3E 010E R 11       3						cmp CUR_MODE,11H 
 0581  75 20                 6						jne $l80 
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Mode 11h (2 colors out of 256,000 colors)					;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Get the background color:							;AN000;
				;-------------------------------------------------------------------------------;AN000;
 0583  C6 06 05C0 R 00 90		MOV	PAL_REGISTER_NB,0	; Read the palette register number 0	;AN000;
 0589  E8 05C1 R			CALL	GET_PALETTE_RGB 	; Get the RGB values for this color	;AN000;
 058C  BF 0000				MOV	DI,0			; DI := Index in translation table	;AN000;
 058F  E8 048D R			CALL	RGB2XLT_TAB		; Store mapping in the translation table;AN000;
				;-------------------------------------------------------------------------------;AN000;
				; Get the foreground color:							;AN000;
				;-------------------------------------------------------------------------------;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-47


 0592  C6 06 05C0 R 07 90		MOV	PAL_REGISTER_NB,7	; Read the palette register for the	;AN000;
									;  FOREGROUND color (palette register 7);AN000;
 0598  E8 05C1 R			CALL	GET_PALETTE_RGB 	; Get the RGB values for this color	;AN000;
 059B  BF 0001				MOV	DI,1			; DI := Index in translation table	;AN000;
 059E  E8 048D R			CALL	RGB2XLT_TAB		; Store mapping in the translation table;AN000;
				.OTHERWISE									;AN000;
 05A1  EB 18                 3						jmp short $l77 
 05A3                        2	$l80: 
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; The current mode is a 16 color mode						;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 05A3  33 FF				XOR	DI,DI			; DI := Index in translation table	;AN000;
 05A5  B9 0010				MOV	CX,16			; 16 colors to read and store		;AN000;
 05A8  C6 06 05C0 R 00 90		MOV	PAL_REGISTER_NB,0	; Palette register to read		;AN000;
 05AE				STORE_1_PS2_COLOR:								;AN000;
 05AE  E8 05C1 R			CALL	GET_PALETTE_RGB 	; Get the RGB values for this color	;AN000;
				;										;AN000;
				;-------Convert the RGB values to band mask or intensity and store in XLT_TAB:	;AN000;
														;AN000;
 05B1  E8 048D R			CALL	RGB2XLT_TAB		; Store mapping in the translation table;AN000;
 05B4  47				INC	DI			; Get next palette register number	;AN000;
 05B5  FE 06 05C0 R			INC	PAL_REGISTER_NB 	;					;AN000;
 05B9  E2 F3				LOOP	STORE_1_PS2_COLOR	; Read it.				;AN000;
				.ENDSELECT									;AN000;
 05BB                        2	$l77: 
														;AN000;
 05BB  5F				POP	DI								;AN000;
 05BC  59				POP	CX								;AN000;
 05BD  5B				POP	BX								;AN000;
 05BE  58				POP	AX								;AN000;
 05BF  C3				RET									;AN000;
 05C0  00			PAL_REGISTER_NB DB  ?			; Number of the palette register to read;AN000;
 05C1				SET_ROUNDUP_XLT_TAB ENDP							;AN000;
														;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-48


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; GET_PALETTE_RGB:  ON THE PS/2 MODEL 50, 60 AND 80, GET THE RGB VALUES FOR A	;AN000;
				;		    PALETTE REGISTER BY READING THE CORRESPONDING COLOR REGISTER;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;      INPUT:  PAL_REGISTER_NB = Palette register number			;AN000;
				;	       BH	       = Current page number				;AN000;
				;	       BL	       = Current paging mode				;AN000;
				;										;AN000;
				;      OUTPUT: RGB.R	       = The RGB values obtained from the color register;AN000;
				;	       RGB.G		 corresponding to the palette register specified;AN000;
				;	       RGB.B								;AN000;
				;										;AN000;
				;      CALLED BY: SET_ROUNDUP_XLT_TAB						;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
 05C1				GET_PALETTE_RGB PROC								;AN000;
 05C1  50				PUSH	AX								;AN000;
 05C2  53				PUSH	BX								;AN000;
 05C3  51				PUSH	CX								;AN000;
 05C4  52				PUSH	DX								;AN000;
 05C5  56				PUSH	SI								;AN000;
														;AN000;
 05C6  8A C7				MOV	AL,BH			;  SI := Current page number		;AN000;
 05C8  98				CBW				;					;AN000;
 05C9  8B F0				MOV	SI,AX			;					;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; Calculte the absolute number of the first Color Register for the current page:;AN000;
				; (calculated in SI)								;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				.IF <BL EQ PAGING_MODE_64>		; If mode is 64 Color page		;AN000;
 05CB  80 FB 00              3						cmp BL,PAGING_MODE_64 
 05CE  75 06                 6						jne $l84 
				.THEN					; then					;AN000;
 05D0  B1 06				MOV	CL,6			;    SI := Current page num * 64	;AN000;
 05D2  D3 E6				SHL	SI,CL			;					;AN000;
				.ELSE					; else, Mode is 16 Color page		;AN000;
 05D4  EB 04                 3						jmp short $l83 
 05D6                        2	$l84: 
 05D6  B1 04				MOV	CL,4			;    SI := Current page num * 16	;AN000;
 05D8  D3 E6				SHL	SI,CL			;					;AN000;
				.ENDIF										;AN000;
 05DA                        2	$l83: 
														;AN000;
				;										;AN000;
				;-------Read the PALETTE REGISTER						;AN000;
 05DA  8A 1E 05C0 R			MOV	BL,PAL_REGISTER_NB	; BL := Palette register to be read	;AN000;
 05DE  B8 1007				MOV	AX,GET_P_REG_CALL	; Read palette register call		;AN000;
 05E1  CD 10				INT	10H			; Call BIOS,				;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-49


									;   BH := Color register index		;AN000;
									;	  WITHIN the current page and is;AN000;
									;	  either (0-15) or (0-63)	;AN000;
									;  NOTE: SI = Absolute index (0-255) to ;AN000;
									;  the first color register of the	;AN000;
									;   current page and is a multiple of	;AN000;
									;    either 16 or 64			;AN000;
 05E3  8A DF				MOV	BL,BH			; BX := Index within current color page ;AN000;
 05E5  32 FF				XOR	BH,BH			;					;AN000;
														;AN000;
				;										;AN000;
				;-------Read the Color register:						;AN000;
 05E7  0B DE				OR	BX,SI			; BX := Index of Color register to read ;AN000;
 05E9  B8 1015				MOV	AX,GET_C_REG_CALL	; Read the color register		;AN000;
 05EC  CD 10				INT	10H			; Call BIOS,				;AN000;
 05EE  88 36 0008 R			MOV	RGB.R,DH		; DH := Red value read			;AN000;
 05F2  88 2E 0009 R			MOV	RGB.G,CH		; CH := Green value read		;AN000;
 05F6  88 0E 000A R			MOV	RGB.B,CL		; CL := Blue value read 		;AN000;
														;AN000;
 05FA  5E				POP	SI								;AN000;
 05FB  5A				POP	DX								;AN000;
 05FC  59				POP	CX								;AN000;
 05FD  5B				POP	BX								;AN000;
 05FE  58				POP	AX								;AN000;
 05FF  C3				RET									;AN000;
 0600				GET_PALETTE_RGB ENDP								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-50


				PAGE										;AN000;
				;=======================================================================	;AN000;
				;										;AN000;
				; EGA_COL2RGB : CONVERT A COLOR FROM THE EGA TO RED GREEN BLUE VALUES		;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				;	INPUT: AL      = 00rgbRGB    ONE BYTE WHERE BIT:			;AN000;
				;										;AN000;
				;					r = 1/3 of Red component		;AN000;
				;					g = 1/3 of Green component		;AN000;
				;					b = 1/3 of Blue component		;AN000;
				;					R = 2/3 of Red component		;AN000;
				;					G = 2/3 of Green component		;AN000;
				;					B = 3/3 of Blue component		;AN000;
				;										;AN000;
				;										;AN000;
				;	OUTPUT: RGB.R	    = RED   component (0-63)				;AN000;
				;		RGB.G	    = GREEN component (0-63)				;AN000;
				;		RGB.B	    = BLUE  component (0-63)				;AN000;
				;										;AN000;
				;	CALLED BY: SET_UP_EGA_XLT_TABLE 					;AN000;
				;										;AN000;
				;-----------------------------------------------------------------------	;AN000;
				;										;AN000;
				; DESCRIPTION: Sums up the values for each color component.			;AN000;
				; "2/3 of RED" means that the red gun in the display attached to the EGA        ;AN000;
				; is firing at 2/3 of full intensity.						;AN000;
				;										;AN000;
				; Since the color intensities range from 0 to 63, "1/3" means an                ;AN000;
				; intensity of: 								;AN000;
				;		 1/3 * 63 = 21							;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;										;AN000;
				; Get the red component 							;AN000;
				; Get the green component							;AN000;
				; Get the blue component							;AN000;
				;										;AN000;
 0600				EGA_COL2RGB PROC NEAR								;AN000;
				;										;AN000;
				;-------Get the RED component	(bit 5 and 2)					;AN000;
				;										;AN000;
				;-------Check bit 2								;AN000;
 0600  C6 06 0008 R 00			MOV	RGB.R,0 							;AN000;
 0605  A8 04				TEST	AL,100B 		; "R" is on ?                           ;AN000;
 0607  74 05				JZ	CHECK_BIT_5		; No, check "r"                         ;AN000;
 0609  80 06 0008 R 2A			ADD	RGB.R,TWO_THIRD 	; Yes, add 2/3 RED			;AN000;
 060E				CHECK_BIT_5:									;AN000;
 060E  A8 20				TEST	AL,100000B		; "r" is on ?                           ;AN000;
 0610  74 05				JZ	CHECK_BIT_1		; No, check Green			;AN000;
 0612  80 06 0008 R 15			ADD	RGB.R,ONE_THIRD 	; Yes, add 1/3 RED			;AN000;
				;										;AN000;
				;-------Get the GREEN component (bit 4 and 1)					;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-51


				;										;AN000;
 0617				CHECK_BIT_1:									;AN000;
 0617  C6 06 0009 R 00			MOV	RGB.G,0 							;AN000;
 061C  A8 02				TEST	AL,10B			; "G" is on ?                           ;AN000;
 061E  74 05				JZ	CHECK_BIT_4		; No, check "g"                         ;AN000;
 0620  80 06 0009 R 2A			ADD	RGB.G,TWO_THIRD 	; Yes, add 2/3 GREEN			;AN000;
 0625				CHECK_BIT_4:									;AN000;
 0625  A8 10				TEST	AL,10000B		; "g" is on ?                           ;AN000;
 0627  74 05				JZ	CHECK_BIT_0		; No, check for Blue			;AN000;
 0629  80 06 0009 R 15			ADD	RGB.G,ONE_THIRD 	; Yes, add 1/3 GREEN			;AN000;
				;										;AN000;
				;-------Get the BLUE component (bit 3 and 0)					;AN000;
				;										;AN000;
 062E				CHECK_BIT_0:									;AN000;
 062E  C6 06 000A R 00			MOV	RGB.B,0 							;AN000;
 0633  A8 01				TEST	AL,1B			; "B" is on ?                           ;AN000;
 0635  74 05				JZ	CHECK_BIT_3		; No, check "b"                         ;AN000;
 0637  80 06 000A R 2A			ADD	RGB.B,TWO_THIRD 	; Yes, add 2/3 BLUE			;AN000;
 063C				CHECK_BIT_3:									;AN000;
 063C  A8 08				TEST	AL,1000B		; "b" is on ?                           ;AN000;
 063E  74 05				JZ	EGA_COL2RGB_RETURN	; No, return				;AN000;
 0640  80 06 000A R 15			ADD	RGB.B,ONE_THIRD 	; Yes, add 1/3 BLUE			;AN000;
 0645				EGA_COL2RGB_RETURN:								;AN000;
 0645  C3				RET									;AN000;
 0646				EGA_COL2RGB ENDP								;AN000;
														;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-52


				PAGE										;AN000;
				;===============================================================================;AN000;
				;										;AN000;
				; RGB2INT : MAP RED GREEN BLUE VALUES TO AN INTENSITY.				;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				;	INPUT:	RGB.R		= A RED value (0-63)				;AN000;
				;		RGB.G		= A GREEN value (0-63)				;AN000;
				;		RGB.B		= A BLUE value (0-63)				;AN000;
				;		DARKADJUST_VALUE= THE DARKNESS VALUE (In shared data area).	;AN000;
				;		SWITCHES	= Command line switches 			;AN000;
				;										;AN000;
				;	OUTPUT: AL  = THE INTENSITY  (0-63)  NOTE: 0  = BLACK			;AN000;
				;						   63 = BRIGHT WHITE		;AN000;
				;										;AN000;
				;	WARNING: AH IS LOST							;AN000;
				;										;AN000;
				;-------------------------------------------------------------------------------;AN000;
				;										;AN000;
				; DESCRIPTION: When the RGB values for a pixel are at their maximum		;AN000;
				; value, what we obtain is a bright white pixel on the screen; this is		;AN000;
				; the brightest color achievable and therefore, its intensity is 63.		;AN000;
				;										;AN000;
				; When no color gun is firing on the display: RGB values are 0,0,0 this 	;AN000;
				; is no color at all and therefore maps to intensity 0. 			;AN000;
				;										;AN000;
				; For intermediate colors, experimentation has shown that the eye will		;AN000;
				; see blue as darker than red and red as darker than green.			;AN000;
				;										;AN000;
				; On a grey rainbow from 0 - 10  where 0 is black and 10 is white:		;AN000;
				;										;AN000;
				;     Blue  corresponds to a grey of intensity 1				;AN000;
				;     Red   corresponds to a grey of intensity 3				;AN000;
				;     Green corresponds to a grey of intensity 6				;AN000;
				;										;AN000;
				; Therefore, if we mix all 3 colors we obtain a grey of 			;AN000;
				; intensity 1 + 3 + 6 = 10 (i.e.,white).					;AN000;
				;										;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;										;AN000;
				; Calculate the intensity							;AN000;
				;										;AN000;
				;   AL = (.6 * G) + (.3 * R) + (.1 * B) 					;AN000;
				;										;AN000;
				; Adjust Darkness								;AN000;
				;										;AN000;
				;   AL = AL + DARKADJUST_VALUE							;AN000;
				;										;AN000;
 0646				RGB2INT PROC NEAR								;AN000;
 0646  53				PUSH	BX								;AN000;
 0647  51				PUSH	CX								;AN000;
 0648  52				PUSH	DX								;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-53


														;AN000;
 0649  33 C0				XOR	AX,AX			; AL := Current component intensity	;AN000;
 064B  33 DB				XOR	BX,BX			; BX is used for calculations		;AN000;
 064D  33 D2				XOR	DX,DX			; DL := Running sum for grey intensity	;AN000;
														;AN000;
				;-------Process /R   (Reverse black and white)					;AN000;
				.IF <BIT DS:[BP].SWITCHES Z REVERSE_SW>  ; IF reverse is OFF			;AN000;
 064F  3E: F6 46 02 01       3						test DS:[BP].SWITCHES,REVERSE_SW 
 0654  75 51                 5						jnZ $l87 
				.THEN					 ; THEN REVERSE BLACK AND WHITE:	;AN000;
				;-------Test if the color is BLACK						;AN000;
				       .IF     <RGB.R EQ BLACK_INT> AND ; If black				;AN000;
 0656  80 3E 0008 R 00       3						cmp RGB.R,BLACK_INT 
 065B  75 15                 6						jne $l91 
				       .IF     <RGB.G EQ BLACK_INT> AND ;					;AN000;
 065D  80 3E 0009 R 00       3						cmp RGB.G,BLACK_INT 
 0662  75 0E                 6						jne $l91 
				       .IF     <RGB.B EQ BLACK_INT>	;					;AN000;
 0664  80 3E 000A R 00       3						cmp RGB.B,BLACK_INT 
 0669  75 07                 6						jne $l91 
				       .THEN				; then, replace it with white		;AN000;
 066B  B0 3F				  MOV	  AL,WHITE_INT							;AN000;
 066D  EB 78				  JMP	  SHORT RGB2INT_END						;AN000;
				       .ELSEIF <RGB.R EQ WHITE_INT> AND ; else if, high-intensity white 	;AN000;
 066F  EB 36                 3						jmp short $l87 
 0671  90                    3						nop 
 0672                        2	$l91: 
 0672  80 3E 0008 R 3F       3						cmp RGB.R,WHITE_INT 
 0677  75 15                 6						jne $l93 
				       .IF     <RGB.G EQ WHITE_INT> AND ;					;AN000;
 0679  80 3E 0009 R 3F       3						cmp RGB.G,WHITE_INT 
 067E  75 0E                 6						jne $l93 
				       .IF     <RGB.B EQ WHITE_INT>	;					;AN000;
 0680  80 3E 000A R 3F       3						cmp RGB.B,WHITE_INT 
 0685  75 07                 6						jne $l93 
				       .THEN				; then, replace it with black		;AN000;
 0687  B0 00				  MOV	  AL,BLACK_INT							;AN000;
 0689  EB 5C				  JMP	  SHORT RGB2INT_END						;AN000;
				       .ELSEIF <RGB.R EQ TWO_THIRD> AND ; else if, white			;AN000;
 068B  EB 1A                 3						jmp short $l87 
 068D  90                    3						nop 
 068E                        2	$l93: 
 068E  80 3E 0008 R 2A       3						cmp RGB.R,TWO_THIRD 
 0693  75 12                 6						jne $l87 
				       .IF     <RGB.G EQ TWO_THIRD> AND ;					;AN000;
 0695  80 3E 0009 R 2A       3						cmp RGB.G,TWO_THIRD 
 069A  75 0B                 6						jne $l87 
				       .IF     <RGB.B EQ TWO_THIRD>	;					;AN000;
 069C  80 3E 000A R 2A       3						cmp RGB.B,TWO_THIRD 
 06A1  75 04                 6						jne $l87 
				       .THEN				; then, replace it with black		;AN000;
 06A3  B0 00				  MOV	  AL,BLACK_INT							;AN000;
 06A5  EB 40				  JMP	  SHORT RGB2INT_END						;AN000;
				       .ENDIF									;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-54


				.ENDIF										;AN000;
 06A7                        2	$l87: 
														;AN000;
				;-------Calculate Green component						;AN000;
 06A7  A0 0009 R			MOV	AL,RGB.G		; AL := Green component 		;AN000;
 06AA  B7 06				MOV	BH,6			;					;AN000;
 06AC  F6 E7				MUL	BH			; AX := Green * 6			;AN000;
 06AE  B7 0A				MOV	BH,10			;					;AN000;
 06B0  F6 F7				DIV	BH			; AL := (GREEN * 6) /  10		;AN000;
 06B2  02 D0				ADD	DL,AL			; DL := Cumulative intensity		;AN000;
 06B4  8A EC				MOV	CH,AH			; CH := Cumulative remainder		;AN000;
														;AN000;
				;-------Calculate Red component 						;AN000;
 06B6  A0 0008 R			MOV	AL,RGB.R		; AL := Red component			;AN000;
 06B9  B7 03				MOV	BH,3			;					;AN000;
 06BB  F6 E7				MUL	BH			; AX := Red * 3 			;AN000;
 06BD  B7 0A				MOV	BH,10			;					;AN000;
 06BF  F6 F7				DIV	BH			; AL := (RED * 3) /  10 		;AN000;
 06C1  02 D0				ADD	DL,AL			; DL := Cumulative intensity		;AN000;
 06C3  02 EC				ADD	CH,AH			; CH := Cumulative remainder		;AN000;
														;AN000;
				;-------Calculate Blue component						;AN000;
 06C5  A0 000A R			MOV	AL,RGB.B		; AX := Blue component			;AN000;
 06C8  32 E4				XOR	AH,AH			;					;AN000;
 06CA  F6 F7				DIV	BH			; AL := BLUE / 10			;AN000;
 06CC  02 D0				ADD	DL,AL			; DL := Cumulative intensity		;AN000;
 06CE  02 EC				ADD	CH,AH			; CH := Cumulative remainder		;AN000;
														;AN000;
				;-------Adjust intensity with cumulative remainder				;AN000;
 06D0  33 C0				XOR	AX,AX								;AN000;
 06D2  8A C5				MOV	AL,CH			; AX := Cumulative remainder		;AN000;
 06D4  B7 0A				MOV	BH,10			; BH := 10				;AN000;
 06D6  F6 F7				DIV	BH			; AL := Total remainder / 10		;AN000;
 06D8  02 D0				ADD	DL,AL			; DL := Cumulative intensity		;AN000;
				       .IF <AH GT 4>			; If remainder > 4			;AN000;
 06DA  80 FC 04              3						cmp AH,4 
 06DD  7E 02                 6						jng $l97 
				       .THEN				; Then, add 1				;AN000;
 06DF  FE C2				INC	DL			;  to the intensity			;AN000;
				       .ENDIF									;AN000;
 06E1                        2	$l97: 
														;AN000;
				;-------Adjust darkness 							;AN000;
 06E1  3E: 02 56 05			ADD	DL,DS:[BP].DARKADJUST_VALUE					;AN000;
														;AN000;
				;-------Return result								;AN000;
 06E5  8A C2				MOV	AL,DL			; AL := sum of R,G,B intensities	;AN000;
														;AN000;
 06E7				RGB2INT_END:									;AN000;
 06E7  5A				POP	DX								;AN000;
 06E8  59				POP	CX								;AN000;
 06E9  5B				POP	BX								;AN000;
 06EA  C3				RET									;AN000;
 06EB				RGB2INT ENDP									;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-55


														;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-56


				PAGE										;AN000;
				;============================================================================== ;AN000;
				;										;AN000;
				; RGB2BAND: MAP RED GREEN BLUE VALUES TO A "SELECT COLOR BAND" MASK FOR         ;AN000;
				;	    THE COLOR PRINTER.							;AN000;
				;										;AN000;
				;------------------------------------------------------------------------------ ;AN000;
				;										;AN000;
				;	INPUT:	RGB.R		= A RED value (0-63)				;AN000;
				;		RGB.G		= A GREEN value (0-63)				;AN000;
				;		RGB.B		= A BLUE value (0-63)				;AN000;
				;		BP		= Offset of the Shared Data Area.		;AN000;
				;										;AN000;
				;	OUTPUT: AL = The Band Mask, one byte where:				;AN000;
				;										;AN000;
				;				  bit 0 = Color Band 1 is needed		;AN000;
				;				  bit 1 = Color Band 2 is needed		;AN000;
				;				  bit 2 = Color Band 3 is needed		;AN000;
				;				  bit 3 = Color Band 4 is needed		;AN000;
				;										;AN000;
				;										;AN000;
				;	CALLED BY: SET_CGA_XLT_TAB						;AN000;
				;		   SET_EGA_XLT_TAB						;AN000;
				;		   SET_ROUNDUP_XLT_TAB						;AN000;
				;		   SET_MODE_13H_XLT_TAB 					;AN000;
				;		   SET_MODE_F_XLT_TAB						;AN000;
				;										;AN000;
				;------------------------------------------------------------------------------ ;AN000;
				;										;AN000;
				; NOTES: The RGB values in input describe a color from the screen.		;AN000;
				; Up to 256K different colors can be described with these RGB values.		;AN000;
				;										;AN000;
				; On the color printer, the print ribbon is composed of 4 color bands,		;AN000;
				; each of a different color.  By overlapping these 4 bands when 		;AN000;
				; printing, more colors can be obtained.  However, the number of colors 	;AN000;
				; that can be achieved by overlapping print bands is very limited (4 or 	;AN000;
				; 8 colors).									;AN000;
				;										;AN000;
				; THIS MODULE SELECT THE PRINTER COLOR THAT IS THE CLOSEST TO THE		;AN000;
				; DESIRED SCREEN COLOR. 							;AN000;
				;										;AN000;
				; The Band Mask specifies which color bands have to be overlapped to		;AN000;
				; obtain a color on the printer.						;AN000;
				;										;AN000;
				;										;AN000;
				; DESCRIPTION: Go through the list of printer colors in the SHARED DATA 	;AN000;
				; AREA, for each of these colors, compare its RGB values with those in		;AN000;
				; input.									;AN000;
				; Get the BAND_MASK of the closest printer color.				;AN000;
				;										;AN000;
				; LOGIC:									;AN000;
				;										;AN000;
				; Locate the printer colors info structure in the shared data area:		;AN000;
				; COLORPRINT_PTR := BP + COLORPRINT_PTR 					;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-57


				;										;AN000;
				; Get the number of printer colors from the COLORPRINT info in the Shared	;AN000;
				; data area:									;AN000;
				; Number of colors  := COLORPRINT_PTR.NUM_PRT_COLOR				;AN000;
				;										;AN000;
				; CURRENT_COLOR_PTR : First record in the COLORPRINT info structure		;AN000;
				; BEST_CHOICE := CURRENT_RECORD_PTR.BAND_MASK					;AN000;
				; MIN_DIFF    := Maximum positive value 					;AN000;
				;										;AN000;
				; FOR each printer color:							;AN000;
				;   CUR_DIFF	:= 0								;AN000;
				; (* Calculate the geometric distance between the RGB values from the *)	;AN000;
				; (* input and those of the printer color.			      *)	;AN000;
				;   Red difference   := (R - CURRENT_COLOR_PTR.RED)				;AN000;
				;   Red difference   := Red difference * Red difference 			;AN000;
				;   CUR_DIFF	     := CUR_DIFF + Red difference				;AN000;
				;										;AN000;
				;   Green difference := (G - CURRENT_COLOR_PTR.GREEN)				;AN000;
				;   Green difference := Green difference * Green difference			;AN000;
				;   CUR_DIFF	     := CUR_DIFF + Green difference				;AN000;
				;										;AN000;
				;   Blue difference  := (B - CURRENT_COLOR_PTR.BLUE)				;AN000;
				;   Blue difference  := Blue difference  * Blue difference			;AN000;
				;   CUR_DIFF	     := CUR_DIFF + Blue difference				;AN000;
				;										;AN000;
				;   IF CUR_DIFF < MIN_DIFF							;AN000;
				;   THEN BEGIN									;AN000;
				;	 MIN_DIFF	:=  CUR_DIFF						;AN000;
				;	 BEST_CHOICE	:=  printer color.BAND_MASK				;AN000;
				;	 END									;AN000;
				;										;AN000;
				;   CURRENT_COLOR_PTR := Offset of next color					;AN000;
				; END (For each printer color)							;AN000;
				;										;AN000;
				; Return BEST_CHOICE								;AN000;
				;										;AN000;
				;										;AN000;
 06EB				RGB2BAND PROC NEAR								;AN000;
 06EB  50				PUSH	AX								;AN000;
 06EC  53				PUSH	BX								;AN000;
 06ED  51				PUSH	CX								;AN000;
 06EE  52				PUSH	DX								;AN000;
														;AN000;
				;-------Process /R   (Reverse black and white)					;AN000;
				.IF <BIT DS:[BP].SWITCHES Z REVERSE_SW>  ; IF reverse is OFF			;AN000;
 06EF  3E: F6 46 02 01       3						test DS:[BP].SWITCHES,REVERSE_SW 
 06F4  75 6C                 5						jnZ $l100 
				.THEN					 ; THEN REVERSE BLACK AND WHITE:	;AN000;
				;------------------------------------------------------------------------------ ;AN000;
				;										;AN000;
				; REVERSE BLACK AND WHITE:							;AN000;
				;										;AN000;
				;------------------------------------------------------------------------------ ;AN000;
				;-------Test if the color is BLACK						;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-58


				       .IF     <RGB.R EQ BLACK_INT> AND ; If black				;AN000;
 06F6  80 3E 0008 R 00       3						cmp RGB.R,BLACK_INT 
 06FB  75 1A                 6						jne $l104 
				       .IF     <RGB.G EQ BLACK_INT> AND ;					;AN000;
 06FD  80 3E 0009 R 00       3						cmp RGB.G,BLACK_INT 
 0702  75 13                 6						jne $l104 
				       .IF     <RGB.B EQ BLACK_INT>	;					;AN000;
 0704  80 3E 000A R 00       3						cmp RGB.B,BLACK_INT 
 0709  75 0C                 6						jne $l104 
				       .THEN				; then, replace it with the		;AN000;
 070B  C6 06 07C2 R 00 90		  MOV	  BEST_CHOICE,0 	;	band mask for white		;AN000;
 0711  E9 07BA R			  JMP	  RGB2BAND_END		;	return this band mask		;AN000;
				       .ELSEIF <RGB.R EQ WHITE_INT> AND ; else if, high-intensity white 	;AN000;
 0714  EB 4C                 3						jmp short $l100 
 0716  90                    3						nop 
 0717                        2	$l104: 
 0717  80 3E 0008 R 3F       3						cmp RGB.R,WHITE_INT 
 071C  75 20                 6						jne $l106 
				       .IF     <RGB.G EQ WHITE_INT> AND ;					;AN000;
 071E  80 3E 0009 R 3F       3						cmp RGB.G,WHITE_INT 
 0723  75 19                 6						jne $l106 
				       .IF     <RGB.B EQ WHITE_INT>	;					;AN000;
 0725  80 3E 000A R 3F       3						cmp RGB.B,WHITE_INT 
 072A  75 12                 6						jne $l106 
				       .THEN				; then, replace it with the		;AN000;
 072C  C6 06 0008 R 00			  MOV	  RGB.R,BLACK_INT	;	RGB values of black		;AN000;
 0731  C6 06 0009 R 00			  MOV	  RGB.G,BLACK_INT						;AN000;
 0736  C6 06 000A R 00			  MOV	  RGB.B,BLACK_INT						;AN000;
				       .ELSEIF <RGB.R EQ TWO_THIRD> AND ; else if, white			;AN000;
 073B  EB 25                 3						jmp short $l100 
 073D  90                    3						nop 
 073E                        2	$l106: 
 073E  80 3E 0008 R 2A       3						cmp RGB.R,TWO_THIRD 
 0743  75 1D                 6						jne $l100 
				       .IF     <RGB.G EQ TWO_THIRD> AND ;					;AN000;
 0745  80 3E 0009 R 2A       3						cmp RGB.G,TWO_THIRD 
 074A  75 16                 6						jne $l100 
				       .IF     <RGB.B EQ TWO_THIRD>	;					;AN000;
 074C  80 3E 000A R 2A       3						cmp RGB.B,TWO_THIRD 
 0751  75 0F                 6						jne $l100 
				       .THEN				; then, replace it with the		;AN000;
 0753  C6 06 0008 R 00			  MOV	  RGB.R,BLACK_INT	;	RGB values of black		;AN000;
 0758  C6 06 0009 R 00			  MOV	  RGB.G,BLACK_INT						;AN000;
 075D  C6 06 000A R 00			  MOV	  RGB.B,BLACK_INT						;AN000;
				       .ENDIF									;AN000;
				.ENDIF										;AN000;
 0762                        2	$l100: 
				;------------------------------------------------------------------------------ ;AN000;
				;										;AN000;
				; CALCULATE THE GEOMETRIC DISTANCE BETWEEN THE COLORS OF THE PIXEL AND THOSE OF ;AN000;
				; THE PRINTER:									;AN000;
				;										;AN000;
				;------------------------------------------------------------------------------ ;AN000;
 0762  3E: 8B 5E 07			MOV	BX,DS:[BP].COLORPRINT_PTR	; BX := OFFSET of COLORPRINT	;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-59


 0766  03 DD				ADD	BX,BP								;AN000;
 0768  C7 06 07C3 R 7FFF		MOV	MIN_DIFF,7FFFh			; No match yet, minimum diff.	;AN000;
										;  is maximum POSITIVE value.	;AN000;
 076E  33 C9				XOR	CX,CX								;AN000;
 0770  3E: 8A 4E 06			MOV	CL,DS:[BP].NUM_PRT_COLOR	; CX := Number of print colors	;AN000;
														;AN000;
														;AN000;
 0774				INSPECT_1_PRINT_COLOR:								;AN000;
 0774  C7 06 07C5 R 0000		MOV	CUR_DIFF,0			; Current difference := 0	;AN000;
				;------------------------------------------------------------------------------ ;AN000;
				;	Calculate the Red difference:						;AN000;
				;------------------------------------------------------------------------------ ;AN000;
 077A  A0 0008 R			MOV	AL,RGB.R							;AN000;
 077D  2A 07				SUB	AL,[BX].RED							;AN000;
				;-------Elevate at the power of two						;AN000;
 077F  8A D0				MOV	DL,AL				; DX := Red difference		;AN000;
 0781  F6 EA				IMUL	DL				; AX := Red diff. square	;AN000;
 0783  01 06 07C5 R			ADD	CUR_DIFF,AX			; CURR_DIF + Red diff.		;AN000;
														;AN000;
				;------------------------------------------------------------------------------ ;AN000;
				;	Calculate the Green difference: 					;AN000;
				;------------------------------------------------------------------------------ ;AN000;
 0787  A0 0009 R			MOV	AL,RGB.G							;AN000;
 078A  2A 47 01				SUB	AL,[BX].GREEN							;AN000;
				;-------Elevate at the power of two						;AN000;
 078D  8A D0				MOV	DL,AL				; DX := Red difference		;AN000;
 078F  F6 EA				IMUL	DL				; AX := Red diff. square	;AN000;
 0791  01 06 07C5 R			ADD	CUR_DIFF,AX			; CURR_DIF + Green diff.	;AN000;
														;AN000;
				;------------------------------------------------------------------------------ ;AN000;
				;	Calculate the Blue difference:						;AN000;
				;------------------------------------------------------------------------------ ;AN000;
 0795  A0 000A R			MOV	AL,RGB.B							;AN000;
 0798  2A 47 02				SUB	AL,[BX].BLUE							;AN000;
				;-------Elevate at the power of two						;AN000;
 079B  8A D0				MOV	DL,AL				; DX := Red difference		;AN000;
 079D  F6 EA				IMUL	DL				; AX := Red diff. square	;AN000;
 079F  01 06 07C5 R			ADD	CUR_DIFF,AX			; CURR_DIF + Blue diff. 	;AN000;
														;AN000;
				;------------------------------------------------------------------------------ ;AN000;
				;	Check how close is this print color to the screen color:		;AN000;
				;------------------------------------------------------------------------------ ;AN000;
 07A3  A1 07C5 R			MOV	AX,CUR_DIFF		; If this color is better than what we	;AN000;
				       .IF <AX L MIN_DIFF>		;  had before.				;AN000;
 07A6  3B 06 07C3 R          3						cmp AX,MIN_DIFF 
 07AA  7D 09                 5						jnL $l110 
				       .THEN				;					;AN000;
 07AC  A3 07C3 R			  MOV	  MIN_DIFF,AX		; then, new minimum distance;		;AN000;
 07AF  8A 47 03				  MOV	  AL,[BX].SELECT_MASK	;	get its band mask.		;AN000;
 07B2  A2 07C2 R			  MOV	  BEST_CHOICE,AL	;					;AN000;
				       .ENDIF				;					;AN000;
 07B5                        2	$l110: 
														;AN000;
				;------------------------------------------------------------------------------ ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Page     1-60


				;	Get offset of next COLORPRINT info record:				;AN000;
				;------------------------------------------------------------------------------ ;AN000;
 07B5  83 C3 04				ADD	BX,SIZE COLORPRINT_STR						;AN000;
 07B8  E2 BA				LOOP	INSPECT_1_PRINT_COLOR						;AN000;
														;AN000;
				;------------------------------------------------------------------------------ ;AN000;
				;	BEST_CHOICE contains the print color with the closest RGB values	;AN000;
				;------------------------------------------------------------------------------ ;AN000;
 07BA				RGB2BAND_END:									;AN000;
 07BA  5A				POP	DX								;AN000;
 07BB  59				POP	CX								;AN000;
 07BC  5B				POP	BX								;AN000;
 07BD  58				POP	AX								;AN000;
 07BE  A0 07C2 R			MOV	AL,BEST_CHOICE							;AN000;
 07C1  C3				RET									;AN000;
 07C2  00			BEST_CHOICE	DB	?							;AN000;
 07C3  0000			MIN_DIFF	DW	?							;AN000;
 07C5  0000			CUR_DIFF	DW	?							;AN000;
 07C7				RGB2BAND ENDP									;AN000;
 07C7				CODE	ENDS									;AN000;
					END									;AN000;

Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         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

APA_ATTR . . . . . . . . . . . .  	0007	0004
  APA_MODE . . . . . . . . . . .  	0000
  NB_C . . . . . . . . . . . . .  	0001
  NB_L . . . . . . . . . . . . .  	0003
  MAX_COLORS . . . . . . . . . .  	0005
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
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Symbols-2


  NUM_RESTORE_ESC  . . . . . . .  	0014
  RESTORE_ESC_PTR  . . . . . . .  	0015
  PRINT_OPTIONS  . . . . . . . .  	0017
PAT_4X2_STR  . . . . . . . . . .  	0005	0005
  MAX_4X2  . . . . . . . . . . .  	0000
  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
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Symbols-3


  C2_8X6 . . . . . . . . . . . .  	0002
  C3_8X6 . . . . . . . . . . . .  	0003
  C4_8X6 . . . . . . . . . . . .  	0004
  C5_8X6 . . . . . . . . . . . .  	0005
  C6_8X6 . . . . . . . . . . . .  	0006
  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
TXT_ATTR . . . . . . . . . . . .  	0002	0002
  TXT_MODE . . . . . . . . . . .  	0000
  NUM_COLORS . . . . . . . . . .  	0001

Segments and Groups:

                N a m e         	Length	 Align	Combine Class

CODE . . . . . . . . . . . . . .  	07C7	PARA	PUBLIC	'CODE'

Symbols:            

                N a m e         	Type	 Value	 Attr

ALT_SELECT_CALL  . . . . . . . .  	NUMBER	0012	
APA  . . . . . . . . . . . . . .  	NUMBER	0001	
APA_ATTR_TABLE . . . . . . . . .  	L WORD	0244	CODE

BACKGROUND_SW  . . . . . . . . .  	NUMBER	0002	
BEST_CHOICE  . . . . . . . . . .  	L BYTE	07C2	CODE
BIOS_INT_5H  . . . . . . . . . .  	L WORD	0003	CODE	Global
BIOS_SEG . . . . . . . . . . . .  	NUMBER	0040	
BLACK_INT  . . . . . . . . . . .  	NUMBER	0000	
BLACK_WHITE  . . . . . . . . . .  	NUMBER	0002	
BOX_H  . . . . . . . . . . . . .  	L BYTE	012B	CODE	Global
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Symbols-4


BOX_W  . . . . . . . . . . . . .  	L BYTE	012C	CODE	Global
B_BIT_MASK . . . . . . . . . . .  	NUMBER	0001	

CGA_COL2RGB  . . . . . . . . . .  	N PROC	04A1	CODE	Length = 003E
CHECK_BIT_0  . . . . . . . . . .  	L NEAR	062E	CODE
CHECK_BIT_1  . . . . . . . . . .  	L NEAR	0617	CODE
CHECK_BIT_3  . . . . . . . . . .  	L NEAR	063C	CODE
CHECK_BIT_4  . . . . . . . . . .  	L NEAR	0625	CODE
CHECK_BIT_5  . . . . . . . . . .  	L NEAR	060E	CODE
COLOR  . . . . . . . . . . . . .  	NUMBER	0001	
CR . . . . . . . . . . . . . . .  	NUMBER	000D	
CRT_PALETTE_OFF  . . . . . . . .  	NUMBER	0066	
CUR_BOX  . . . . . . . . . . . .  	L BYTE	0127	CODE	Global
CUR_COLUMN . . . . . . . . . . .  	L WORD	0118	CODE	Global
CUR_DIFF . . . . . . . . . . . .  	L WORD	07C5	CODE
CUR_MODE . . . . . . . . . . . .  	L BYTE	010E	CODE	Global
CUR_MODE_PTR . . . . . . . . . .  	L WORD	010C	CODE	Global
CUR_PAGE . . . . . . . . . . . .  	L BYTE	0116	CODE	Global
CUR_ROW  . . . . . . . . . . . .  	L WORD	011A	CODE	Global
CUR_SCAN_LNE_LENGTH  . . . . . .  	L WORD	0120	CODE	Global

DET_HW_CONFIG  . . . . . . . . .  	N PROC	01B2	CODE	Global	Length = 007A
DET_MODE_STATE . . . . . . . . .  	N PROC	022C	CODE	Length = 0014
DISPLAYMODE_INFO_NOT_FOUND . . .  	NUMBER	0002	
DISP_DESC_CALL . . . . . . . . .  	NUMBER	0015	

EGA  . . . . . . . . . . . . . .  	NUMBER	0004	
EGA_COL2RGB  . . . . . . . . . .  	N PROC	0600	CODE	Length = 0046
EGA_COL2RGB_RETURN . . . . . . .  	L NEAR	0645	CODE
EGA_INFO_CALL  . . . . . . . . .  	NUMBER	0010	
EGA_SAVE_PTR . . . . . . . . . .  	NUMBER	04A8	
ERROR_CODE . . . . . . . . . . .  	L BYTE	0007	CODE	Global
EXIT_TO_BIOS . . . . . . . . . .  	L NEAR	019D	CODE

GET_C_REG_CALL . . . . . . . . .  	NUMBER	1015	
GET_MODE_ATTR  . . . . . . . . .  	N PROC	0240	CODE	Length = 00D7
GET_MODE_ATTR_BEGIN  . . . . . .  	L NEAR	0296	CODE
GET_MODE_ATTR_END  . . . . . . .  	L NEAR	0312	CODE
GET_PALETTE_RGB  . . . . . . . .  	N PROC	05C1	CODE	Length = 003F
GET_P_REG_CALL . . . . . . . . .  	NUMBER	1007	
GET_STATE_CALL . . . . . . . . .  	NUMBER	000F	
G_BIT_MASK . . . . . . . . . . .  	NUMBER	0002	

INSPECT_1_PRINT_COLOR  . . . . .  	L NEAR	0774	CODE
INT_2FH_DRIVER . . . . . . . . .  	L NEAR	0000	CODE	External
INVOKE_PRINT_ROUTINE . . . . . .  	L NEAR	0181	CODE
ITS_APA  . . . . . . . . . . . .  	L NEAR	02B0	CODE
ITS_TXT  . . . . . . . . . . . .  	L NEAR	02D9	CODE
I_BIT_MASK . . . . . . . . . . .  	NUMBER	0008	

LEN_OF_BW_MODULES  . . . . . . .  	NUMBER	0000		Communal
LEN_OF_COLOR_MODULES . . . . . .  	NUMBER	0000		Communal
LF . . . . . . . . . . . . . . .  	NUMBER	000A	

Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Symbols-5


MAX_INT  . . . . . . . . . . . .  	ALIAS	 WHITE_INT		
MIN_DIFF . . . . . . . . . . . .  	L WORD	07C3	CODE
MODE00 . . . . . . . . . . . . .  	L 0002	028C	CODE
MODE01 . . . . . . . . . . . . .  	L 0002	028E	CODE
MODE02 . . . . . . . . . . . . .  	L 0002	0290	CODE
MODE03 . . . . . . . . . . . . .  	L 0002	0292	CODE
MODE04 . . . . . . . . . . . . .  	L 	0244	CODE
MODE05 . . . . . . . . . . . . .  	L 	024B	CODE
MODE06 . . . . . . . . . . . . .  	L 	0252	CODE
MODE07 . . . . . . . . . . . . .  	L 0002	0294	CODE
MODE0D . . . . . . . . . . . . .  	L 	0259	CODE
MODE0E . . . . . . . . . . . . .  	L 	0260	CODE
MODE0F . . . . . . . . . . . . .  	L 	0267	CODE
MODE10H  . . . . . . . . . . . .  	L 	026E	CODE
MODE11H  . . . . . . . . . . . .  	L 	0275	CODE
MODE12H  . . . . . . . . . . . .  	L 	027C	CODE
MODE13H  . . . . . . . . . . . .  	L 	0283	CODE
MODE_F_RGB . . . . . . . . . . .  	L BYTE	04E4	CODE
MODE_NOT_SUPPORTED . . . . . . .  	NUMBER	0004	
MODE_TYPE  . . . . . . . . . . .  	L BYTE	010B	CODE	Global

NB_APA_MODES . . . . . . . . . .  	L WORD	0242	CODE
NB_BOXES_PER_PRT_BUF . . . . . .  	L BYTE	0126	CODE	Global
NB_CHAR_COLUMNS  . . . . . . . .  	L BYTE	0115	CODE	Global
NB_COLORS  . . . . . . . . . . .  	L WORD	010F	CODE	Global
NB_COLORS_TO_READ  . . . . . . .  	L WORD	0547	CODE
NB_ROWS_OFFSET . . . . . . . . .  	NUMBER	0084	
NB_SCAN_LINES  . . . . . . . . .  	L WORD	011C	CODE	Global
NB_TXT_MODES . . . . . . . . . .  	L WORD	028A	CODE
NO . . . . . . . . . . . . . . .  	NUMBER	0000	
NO_ERROR . . . . . . . . . . . .  	NUMBER	0000	

OFF  . . . . . . . . . . . . . .  	NUMBER	0000	
OLD_ADAPTER  . . . . . . . . . .  	NUMBER	0010	
OLD_INT_2FH  . . . . . . . . . .  	V DWORD	0000	CODE	External
ON . . . . . . . . . . . . . . .  	NUMBER	0001	
ONE_THIRD  . . . . . . . . . . .  	NUMBER	0015	

PAGE_STATE_CALL  . . . . . . . .  	NUMBER	101A	
PAGING_MODE_64 . . . . . . . . .  	NUMBER	0000	
PALACE . . . . . . . . . . . . .  	NUMBER	0001	
PAL_REGISTER_NB  . . . . . . . .  	L BYTE	05C0	CODE
PAT_4X2  . . . . . . . . . . . .  	V BYTE	0000	CODE	External
PAT_4X4  . . . . . . . . . . . .  	V BYTE	0000	CODE	External
PAT_6X2  . . . . . . . . . . . .  	V BYTE	0000	CODE	External
PAT_6X4  . . . . . . . . . . . .  	V BYTE	0000	CODE	External
PAT_8X2  . . . . . . . . . . . .  	V BYTE	0000	CODE	External
PAT_8X4  . . . . . . . . . . . .  	V BYTE	0000	CODE	External
PAT_8X6  . . . . . . . . . . . .  	V BYTE	0000	CODE	External
PC_CONVERTIBLE . . . . . . . . .  	NUMBER	0008	
PRINTER_ERROR  . . . . . . . . .  	NUMBER	0008	
PRINT_BW_APA . . . . . . . . . .  	L NEAR	0000	CODE	External
PRINT_COLOR  . . . . . . . . . .  	L NEAR	0000	CODE	External
PRINT_MODULE_START . . . . . . .  	L NEAR	0000	CODE	External
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Symbols-6


PRINT_SCREEN_ALLOWED . . . . . .  	L BYTE	012D	CODE	Global
PRT_BUF  . . . . . . . . . . . .  	L BYTE	0122	CODE	Global
PRT_SCR  . . . . . . . . . . . .  	N PROC	0000	CODE	Global	Length = 01B2
PRT_SCR_2FH_NUMBER . . . . . . .  	NUMBER	0000		Communal
PRT_SCR_BEGIN  . . . . . . . . .  	L NEAR	012E	CODE
PRT_SCR_INIT . . . . . . . . . .  	L NEAR	0141	CODE
PRT_SCR_RETURN . . . . . . . . .  	L NEAR	0193	CODE
P_BIT_MASK . . . . . . . . . . .  	NUMBER	0020	

READ_CHAR_CALL . . . . . . . . .  	NUMBER	0008	
READ_CONFIG_CALL . . . . . . . .  	NUMBER	1A00	
READ_CURSOR_CALL . . . . . . . .  	NUMBER	0003	
READ_DOT_CALL  . . . . . . . . .  	NUMBER	000D	
RESIDENT_CODE_SEG  . . . . . . .  	V WORD	0000	CODE	External
REVERSE_SW . . . . . . . . . . .  	NUMBER	0001	
RGB  . . . . . . . . . . . . . .  	L 	0008	CODE	Global
RGB2BAND . . . . . . . . . . . .  	N PROC	06EB	CODE	Global	Length = 00DC
RGB2BAND_END . . . . . . . . . .  	L NEAR	07BA	CODE
RGB2INT  . . . . . . . . . . . .  	N PROC	0646	CODE	Global	Length = 00A5
RGB2INT_END  . . . . . . . . . .  	L NEAR	06E7	CODE
RGB2XLT_TAB  . . . . . . . . . .  	N PROC	048D	CODE	Length = 0014
ROM_BIOS_SEG . . . . . . . . . .  	NUMBER	0040	
ROTATE . . . . . . . . . . . . .  	NUMBER	0001	
ROTATE_SW  . . . . . . . . . . .  	L BYTE	0117	CODE	Global
ROUNDUP  . . . . . . . . . . . .  	NUMBER	0002	
R_BIT_MASK . . . . . . . . . . .  	NUMBER	0004	

SCAN_APA . . . . . . . . . . . .  	L NEAR	02A5	CODE
SCAN_LINE_MAX_LENGTH . . . . . .  	L WORD	011E	CODE	Global
SCAN_TXT . . . . . . . . . . . .  	L NEAR	02D0	CODE
SCAN_TXT_INIT  . . . . . . . . .  	L NEAR	02C9	CODE
SCREEN_HEIGHT  . . . . . . . . .  	L WORD	0111	CODE	Global
SCREEN_WIDTH . . . . . . . . . .  	L WORD	0113	CODE	Global
SET_BACKG_IN_XLT_TAB . . . . . .  	N PROC	0365	CODE	Length = 002A
SET_CGA_XLT_TAB  . . . . . . . .  	N PROC	0406	CODE	Length = 0087
SET_CURSOR_CALL  . . . . . . . .  	NUMBER	0002	
SET_EGA_XLT_TAB  . . . . . . . .  	N PROC	038F	CODE	Length = 0077
SET_MODE_13H_XLT_TAB . . . . . .  	N PROC	0517	CODE	Length = 0032
SET_MODE_F_BEGIN . . . . . . . .  	L NEAR	04F0	CODE
SET_MODE_F_XLT_TAB . . . . . . .  	N PROC	04DF	CODE	Length = 0038
SET_ROUNDUP_XLT_TAB  . . . . . .  	N PROC	0549	CODE	Length = 0078
SET_UP_XLT_TAB . . . . . . . . .  	N PROC	0317	CODE	Length = 004E
SHARED_DATA_AREA_PTR . . . . . .  	V WORD	0000	CODE	External
STORE_1_CGA_MODE4_COLOR  . . . .  	L NEAR	0435	CODE
STORE_1_CGA_TEXT_COLOR . . . . .  	L NEAR	047C	CODE
STORE_1_EGA_COLOR  . . . . . . .  	L NEAR	03D6	CODE
STORE_1_M13H_COLOR . . . . . . .  	L NEAR	0524	CODE
STORE_1_MODE_F_COLOR . . . . . .  	L NEAR	04F5	CODE
STORE_1_PS2_COLOR  . . . . . . .  	L NEAR	05AE	CODE

TAB_DIRECTORY  . . . . . . . . .  	L NEAR	0000	CODE	External
TAB_DIR_NB_ENTRIES . . . . . . .  	V BYTE	0000	CODE	External
TWO_THIRD  . . . . . . . . . . .  	NUMBER	002A	
TXT  . . . . . . . . . . . . . .  	NUMBER	0000	
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Symbols-7


TXT_ATTR_TABLE . . . . . . . . .  	L WORD	028C	CODE

UNABLE_TO_PRINT  . . . . . . . .  	NUMBER	0001	

WHITE_INT  . . . . . . . . . . .  	NUMBER	003F	

XLT_TAB  . . . . . . . . . . . .  	L BYTE	000B	CODE	Global	Length = 0100

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

$L1  . . . . . . . . . . . . . .  	L NEAR	0181	CODE
$L10 . . . . . . . . . . . . . .  	L NEAR	01C5	CODE
$L100  . . . . . . . . . . . . .  	L NEAR	0762	CODE
$L104  . . . . . . . . . . . . .  	L NEAR	0717	CODE
$L106  . . . . . . . . . . . . .  	L NEAR	073E	CODE
$L11 . . . . . . . . . . . . . .  	L NEAR	01DF	CODE
$L110  . . . . . . . . . . . . .  	L NEAR	07B5	CODE
$L12 . . . . . . . . . . . . . .  	L NEAR	01D7	CODE
$L13 . . . . . . . . . . . . . .  	L NEAR	01F1	CODE
$L14 . . . . . . . . . . . . . .  	L NEAR	01E9	CODE
$L16 . . . . . . . . . . . . . .  	L NEAR	01FB	CODE
$L19 . . . . . . . . . . . . . .  	L NEAR	0214	CODE
$L2  . . . . . . . . . . . . . .  	L NEAR	0171	CODE
$L23 . . . . . . . . . . . . . .  	L NEAR	0226	CODE
$L26 . . . . . . . . . . . . . .  	L NEAR	030B	CODE
$L27 . . . . . . . . . . . . . .  	L NEAR	02FB	CODE
$L30 . . . . . . . . . . . . . .  	L NEAR	0361	CODE
$L31 . . . . . . . . . . . . . .  	L NEAR	032B	CODE
$L32 . . . . . . . . . . . . . .  	L NEAR	0325	CODE
$L33 . . . . . . . . . . . . . .  	L NEAR	0338	CODE
$L35 . . . . . . . . . . . . . .  	L NEAR	0345	CODE
$L37 . . . . . . . . . . . . . .  	L NEAR	0352	CODE
$L39 . . . . . . . . . . . . . .  	L NEAR	035E	CODE
$L42 . . . . . . . . . . . . . .  	L NEAR	038E	CODE
$L43 . . . . . . . . . . . . . .  	L NEAR	037B	CODE
$L47 . . . . . . . . . . . . . .  	L NEAR	0400	CODE
$L48 . . . . . . . . . . . . . .  	L NEAR	03D1	CODE
$L49 . . . . . . . . . . . . . .  	L NEAR	03B6	CODE
$L5  . . . . . . . . . . . . . .  	L NEAR	022B	CODE
$L51 . . . . . . . . . . . . . .  	L NEAR	03FA	CODE
$L52 . . . . . . . . . . . . . .  	L NEAR	03F7	CODE
$L53 . . . . . . . . . . . . . .  	L NEAR	03E7	CODE
$L55 . . . . . . . . . . . . . .  	L NEAR	0487	CODE
$L56 . . . . . . . . . . . . . .  	L NEAR	0447	CODE
$L57 . . . . . . . . . . . . . .  	L NEAR	0419	CODE
$L58 . . . . . . . . . . . . . .  	L NEAR	0477	CODE
$L6  . . . . . . . . . . . . . .  	L NEAR	0202	CODE
$L61 . . . . . . . . . . . . . .  	L NEAR	049C	CODE
$L62 . . . . . . . . . . . . . .  	L NEAR	0499	CODE
$L65 . . . . . . . . . . . . . .  	L NEAR	04C3	CODE
$L68 . . . . . . . . . . . . . .  	L NEAR	04CC	CODE
$L71 . . . . . . . . . . . . . .  	L NEAR	04D5	CODE
$L74 . . . . . . . . . . . . . .  	L NEAR	04DE	CODE
$L77 . . . . . . . . . . . . . .  	L NEAR	05BB	CODE
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:34
DOS GRAPHICS Command  -	Print screen Control module         Symbols-8


$L78 . . . . . . . . . . . . . .  	L NEAR	057C	CODE
$L79 . . . . . . . . . . . . . .  	L NEAR	0567	CODE
$L80 . . . . . . . . . . . . . .  	L NEAR	05A3	CODE
$L83 . . . . . . . . . . . . . .  	L NEAR	05DA	CODE
$L84 . . . . . . . . . . . . . .  	L NEAR	05D6	CODE
$L87 . . . . . . . . . . . . . .  	L NEAR	06A7	CODE
$L9  . . . . . . . . . . . . . .  	L NEAR	01CD	CODE
$L91 . . . . . . . . . . . . . .  	L NEAR	0672	CODE
$L93 . . . . . . . . . . . . . .  	L NEAR	068E	CODE
$L97 . . . . . . . . . . . . . .  	L NEAR	06E1	CODE
$LL1 . . . . . . . . . . . . . .  	NUMBER	0001	
$LL100 . . . . . . . . . . . . .  	NUMBER	0064	
$LL110 . . . . . . . . . . . . .  	NUMBER	006E	
$LL26  . . . . . . . . . . . . .  	NUMBER	001A	
$LL47  . . . . . . . . . . . . .  	NUMBER	002F	
$LL5 . . . . . . . . . . . . . .  	NUMBER	0005	
$LL51  . . . . . . . . . . . . .  	NUMBER	0033	
$LL61  . . . . . . . . . . . . .  	NUMBER	003D	
$LL65  . . . . . . . . . . . . .  	NUMBER	0041	
$LL68  . . . . . . . . . . . . .  	NUMBER	0044	
$LL71  . . . . . . . . . . . . .  	NUMBER	0047	
$LL74  . . . . . . . . . . . . .  	NUMBER	004A	
$LL83  . . . . . . . . . . . . .  	NUMBER	0053	
$LL87  . . . . . . . . . . . . .  	NUMBER	0057	
$LL97  . . . . . . . . . . . . .  	NUMBER	0061	
@CPU . . . . . . . . . . . . . .  	TEXT  0101h		
@FILENAME  . . . . . . . . . . .  	TEXT  grctrl		
@VERSION . . . . . . . . . . . .  	TEXT  510		


   3333 Source  Lines
  25092 Total   Lines
    560 Symbols

  45660 + 158284 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
