Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-1


				PAGE    ,132
				TITLE   ANSI Generic IOCTL Code
				
				;****************** START OF SPECIFICATIONS **************************
				;
				;  MODULE NAME: IOCTL.ASM
				;
				;  DESCRIPTIVE NAME: PERFORM THE GENERIC IOCTL CALL IN ANSI.SYS
				;
				;  FUNCTION: THE GENERIC DEVICE IOCTL IS USED TO SET AND GET THE
				;            MODE OF THE DISPLAY DEVICE ACCORDING TO PARAMETERS PASSED
				;            IN A BUFFER. ADDITIONALLY, THE CALL CAN TOGGLE THE
				;            USE OF THE INTENSITY BIT, AND CAN LOAD THE 8X8 CHARACTER
				;            SET, EFFECTIVELY GIVING MORE LINES PER SCREEN. THE
				;            AVAILABILITY OF THIS FUNCTION VARIES STRONGLY WITH HARDWARE
				;            ATTACHED.
				;
				;  ENTRY POINT: GENERIC_IOCTL
				;
				;  INPUT: LOCATION OF REQUEST PACKET STORED DURING STRATEGY CALL.
				;
				;  AT EXIT:
				;     NORMAL: CARRY CLEAR - DEVICE CHARACTERISTICS SET
				;
				;     ERROR: CARRY SET - ERROR CODE IN AX.
				;            AX = 1  - INVALID FUNCTION. EXTENDED ERROR = 20
				;            AX = 10 - UNSUPPORTED FUNCTION ON CURRENT HARDWARE.
				;                      EXTENDED ERROR = 29
				;            AX = 12 - DISPLAY.SYS DOES NOT HAVE 8X8 RAM CHARACTER SET.
				;                      EXTENDED ERROR = 31
				;
				;  INTERNAL REFERENCES:
				;
				;     ROUTINES: GET_IOCTL - PERFORMS THE GET DEVICE CHARACTERISTICS
				;               SET_IOCTL - PERFORMS THE SET DEVICE CHARACTERISTICS
				;               TEST_LENGTH - TESTS FOR VALIDITY OF A SCREEN SIZE VALUE
				;               CTL_FLAG - READS THE CURRENT USE FOR THE INT/BLINK BIT
				;               SET_CTL_FLAG - SETS THE USE FOR THE INT/BLINK BIT
				;               GET_SEARCH - SEARCHES THE INTERNAL VIDEO TABLE FOR THE
				;                            CURRENT MODE MATCH
				;               SET_SEARCH - SEARCHES THE INTERNAL VIDEO TABEL FOR THE
				;                            CURRENT MODE MATCH
				;               SET_CURSOR_EMUL - SETS THE BIT THAT CONTROLS CURSOR EMULATION
				;               INT10_COM - INTERRUPT 10H HANDLER TO KEEP CURRENT SCREEN SIZE
				;               INT2F_COM - INTERRUPT 2FH INTERFACE TO GENERIC IOCTL
				;               MAP_DOWN - PERFORMS CURSOR TYPE MAPPING FOR EGA WITH MONOCHROME
				;               SET_VIDEO_MODE - SETS THE VIDEO MODE
				;               ROM_LOAD_8X8 - LOADS THE 8X8 CHARACTER SET.
				;               PROCESS_NORMAL - DOES THE SET PROCESS FOR ADAPTERS OTHER THAN
				;                                THE VGA
				;               PROCESS_VGA - DOES THE SET PROCESS FOR THE VGA ADAPTER
				;               CHECK_FOR_DISPLAY - CHECKS FOR DISPLAY.SYS SUPPORT
				;
				;     DATA AREAS: SCAN_LINE_TABLE - HOLDS SCAN LINE INFORMATION FOR PS/2
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-2


				;                 FUNC_INFO - BUFFER FOR PS/2 FUNCTIONALITY CALL.
				;
				;
				;  EXTERNAL REFERENCES:
				;
				;     ROUTINES: INT 10H SERVICES
				;
				;     DATA AREAS: VIDEO_MODE_TABLE - INTERNAL TABLE FOR CHARACTERISTICS TO MODE
				;                                    MATCH-UPS
				;
				;  NOTES:
				;
				;  REVISION HISTORY:
				;
				;      Label: "DOS ANSI.SYS Device Driver"
				;             "Version 4.00 (C) Copyright 1988 Microsoft"
				;             "Licensed Material - Program Property of Microsoft"
				;
				;****************** END OF SPECIFICATIONS ****************************
				;Modification history *********************************************************
				;AN001; P1350 Codepage switching not working on EGA                10/10/87 J.K.
				;AN002; P1626 ANSI does not allow lines=43 with PS2,Monochrome     10/15/87 J.K.
				;AN003; p1774 Lines=43 after selecting cp 850 does not work        10/20/87 J.K.
				;AN004; p1740 MODE CON LINES command causes problem with PE2 w PS/210/24/87 J.K.
				;AN005; p2167 Does'nt say EGA in medium resol. cannot do 43 lines  10/30/87 J.K.
				;AN006; p2236 After esc [=0h, issuing INT10h,AH=fh returns mode=1. 11/3/87  J.K.
				;AN007; p2305 With ANSI loaded, loading RDTE hangs the system      11/06/87 J.K.
				;AN008; P2617 Order dependecy problem with Display.sys             11/23/87 J.K.
				;AN009; p2716 HOT key of VITTORIA does not work properly           12/03/87 J.K.
				;AN010; d398  /L option for Enforcing the number of lines          12/17/87 J.K.
				;AN011; D425 For OS2 compatibiltiy box, /L option status query     01/14/88 J.K.
				;******************************************************************************
				
				INCLUDE     ANSI.INC                                                                               ;
				AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	;   Equates and Strucs.
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;------------------------------------------------------------------------------
			     C	;AN001; D425 For OS2 compatibiltiy box, /L option status query     01/14/88 J.K.
			     C	;AN002; D493 New INIT request structure for error message          02/25/88 J.K.
			     C	;AN003; P4934 Change ANSI 2F function number t0 1Ah                05/20/88 F.G.
			     C	;------------------------------------------------------------------------------
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	;      DEVICE  Header     DS:[SI]      -- to locate the next CON header
			     C	;      NEXT device header ES:[DI]
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 = DS:[SI]                   C	HP      EQU     DS:[SI]                 ;                                      ;AN000;
 = ES:[DI]                   C	NHD     EQU     ES:[DI]                 ;                                      ;AN000;
			     C	                                        ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-3


 = 0008                      C	NAME_LEN EQU    8                       ;                                      ;AN000;
			     C	                                        ;
			     C	DHS     STRUC                           ;                                      ;AN000;
 0000  0000                  C	DH_NEXTO DW     ?                       ; offset of pointer to next header     ;AN000;
 0002  0000                  C	DH_NEXTS DW     ?                       ; segment of pointer to next header    ;AN000;
 0004  0000                  C	        DW      ?                       ; attribute                            ;AN000;
 0006  0000                  C	DH_STRAO DW     ?                       ; offset to strategy routine           ;AN000;
 0008  0000                  C	DH_INTRO DW     ?                       ; offset to interrupt routine          ;AN000;
 000A  0008[                 C	DH_NAME DB      NAME_LEN DUP(0)         ; device name in this header           ;AN000;
	   00                C	
			 ]   C	
			     C	
 0012                        C	DHS     ENDS                            ; end of common portion                ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	; CON data structure  CS:[BX]
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 = CS:[BX]                   C	CONPTR  EQU     CS:[BX]                 ;                                      ;AN000;
			     C	                                        ; STATES                               ;AN000;
			     C	BUF_DATA STRUC                          ;                                      ;AN000;
 0000  FFFF                  C	DEV_HDRO DW     -1                      ; device driver header offset          ;AN000;
 0002  FFFF                  C	DEV_HDRS DW     -1                      ;                                      ;AN000;
 0004  FFFF                  C	CON_STRAO DW    -1                      ; dos CON strategy offset              ;AN000;
 0006  FFFF                  C	CON_STRAS DW    -1                      ;                                      ;AN000;
 0008  FFFF                  C	CON_INTRO DW    -1                      ; dos CON strategy offset              ;AN000;
 000A  FFFF                  C	CON_INTRS DW    -1                      ;                                      ;AN000;
 000C                        C	BUF_DATA ENDS                           ;                                      ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;                                      ;AN000;
			     C	;
			     C	;  INIT Structures and equates
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 = 0040                      C	ROM_BIOS        EQU     40h             ; Segment of ROM_BIOS data area        ;AN000;
 = 0010                      C	EQUIP_FLAG      EQU     10h             ; equipment flag. (for LCD)            ;AN000;
 = 0096                      C	KBD_FLAG_3      EQU     96h             ; offset of KBD_FLAG_3 in data area    ;AN000;
 = 0084                      C	NUM_ROWS        EQU     84h             ; offset of number of rows in data area;AN000;
 = 0010                      C	EXT16_FLAG      EQU     00010000b       ; mask for Extended INT16 bit          ;AN000;
 = FFCF                      C	INIT_VID_MASK   EQU     0FFCFh          ; mask for equipment list              ;AN000;
 = 0020                      C	LCD_COLOR_MODE  EQU     20h             ; LCD as color                         ;AN000;
 = 0030                      C	LCD_MONO_MODE   EQU     30h             ; LCD as MONOchrome                    ;AN000;
 = 8103                      C	UNKNOWN_CMD     EQU     8103H           ; unknown command status byte          ;AN000;
 =-0001                      C	RC_EOL          EQU     -1              ; parser return code for EOL           ;AN000;
 = 0000                      C	RC_NO_ERROR     EQU     0               ; parser return code for not in switch list  ;AN000;
 = 000A                      C	INVALID_PARM    EQU     10              ; PARSE Invalid parameter message number     ;AN000;
 = 0003                      C	SSTRING         EQU     3               ; PARSE Too many parameters message    ;AN000;
 = 001B                      C	FUNC_CALL       EQU     1BH             ; VGA functionality call               ;AN000;
 = 0012                      C	ALT_SELECT      EQU     12H             ; EGA alternate select call            ;AN000;
 = 0010                      C	EGA_INFO        EQU     10H             ; EGA return information subcall       ;AN000;
 = 0020                      C	ALT_PRT_SC      EQU     20H             ; select alternate print screen subcall;AN000;
 = 0001                      C	MONOCHROME      EQU     1               ; monochrome attached to EGA           ;AN000;
 = 0000                      C	COLOR           EQU     0               ; some color attached to EGA           ;AN000;
 = 0007                      C	PS2_MONO        EQU     7               ; display adapter types...             ;AN000;
 = 0008                      C	PS2_COLOR       EQU     8               ;                                      ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-4


 = 000B                      C	MOD30_MONO      EQU     0BH             ;                                      ;AN000;
 = 000C                      C	MOD30_COLOR     EQU     0CH             ;                                      ;AN000;
 = 00F9                      C	LCD_MODEL       EQU     0F9H            ; Convertible model byte value         ;AN000;
 = 00C0                      C	GET_SYS_ID      EQU     0C0H            ; INT15H call for system identification;AN000;
 = 0043                      C	GET_STATUS      EQU     43H             ; read system status (Convertible)     ;AN000;
 = B000                      C	MONO_ADDRESS    EQU     0B000H          ; base address for monochrome          ;AN000;
 = B800                      C	COLOR_ADDRESS   EQU     0B800H          ; base address for CGA                 ;AN000;
 =-0001                      C	UNOCCUPIED      EQU     -1              ; value in VIDEO_MODE_TABLE if space unused  ;AN000;
 = 0001                      C	LCD_ACTIVE      EQU     00000001B       ; LCD adapter is present               ;AN000;
 = 0002                      C	MONO_ACTIVE     EQU     00000010B       ; monochrome adapter is present        ;AN000;
 = 0004                      C	CGA_ACTIVE      EQU     00000100B       ; CGA adapter is present               ;AN000;
 = 0008                      C	MCGA_ACTIVE     EQU     00001000B       ; MCGA is present                      ;AN000;
 = 0010                      C	E5151_ACTIVE    EQU     00010000B       ; EGA with monochrome is present       ;AN000;
 = 0020                      C	E5153_ACTIVE    EQU     00100000B       ; EGA with color display is present    ;AN000;
 = 0040                      C	E5154_ACTIVE    EQU     01000000B       ; EGA with enhanced color display is present ;AN000;
 = 0080                      C	VGA_ACTIVE      EQU     10000000B       ; VGA is present                       ;AN000;
 = 0040                      C	INT10_LOW       EQU     (4*10H)         ; interrupt 10 vector location         ;AN000;
 = 0042                      C	INT10_HI        EQU     (4*10H)+2       ;                                      ;AN000;
 = 00BC                      C	INT2F_LOW       EQU     (4*2FH)         ; interrupt 2F vector location         ;AN000;
 = 00BE                      C	INT2F_HI        EQU     (4*2FH)+2       ;                                      ;AN000;
 = 0001                      C	ONE             EQU     1               ;                                      ;AN000;
 = 0003                      C	THREE           EQU     3               ;                                      ;AN000;
 = 0008                      C	EIGHT           EQU     8               ;                                      ;AN000;
 = 0009                      C	NINE            EQU     9               ;                                      ;AN000;
 = 000E                      C	FOURTEEN        EQU     14              ;                                      ;AN000;
 = 0003                      C	REQ_CRSR_POS    EQU     3               ; function call to return cursor position    ;AN000;
 = 0007                      C	MODE7           EQU     7               ;                                      ;AN000;
 = 000D                      C	MODE13          EQU     13              ;                                      ;AN000;
 = 000F                      C	MODE15          EQU     15              ;                                      ;AN000;
 = 0013                      C	MODE19          EQU     19              ;                                      ;AN000;
			     C	                                        ;                                      ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;                                      ;AN000;
			     C	;
			     C	;  Request Header Structure (INIT)
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	INIT_REQ_HDR    STRUC                   ; INIT Request header structure        ;AN000;
 0000  000D[                 C	                DB   13 DUP(?)          ; standard request header              ;AN000;
	   ??                C	
			 ]   C	
			     C	
 000D  00                    C	NUM_UNITS       DB   ?                  ; number of units (N/A)                ;AN000;
 000E  0000                  C	END_ADDRESS_O   DW   ?                  ; ending address of resident code      ;AN000;
 0010  0000                  C	END_ADDRESS_S   DW   ?                  ;                                      ;AN000;
 0012  00000000              C	ARG_PTR         DD   ?                  ; ptr. to remaining arguments          ;AN000;
 0016  00                    C	DRIVE_NUM       DB   ?                  ; drive number (N/A)                   ;AN000;
 0017  0000                  C	CONFIG_ERRMSG   dw   0                  ;Flag to control "Error in CONFIG.SYS.." msg.;AN002;
 0019                        C	INIT_REQ_HDR    ENDS                    ;                                      ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	; Information Block Structure
			     C	;    (for functionality call)
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-5


			     C	INFO_BLOCK      STRUC                   ; information block for functionality call   ;AN000;
 0000  00000000              C	STATIC_ADDRESS  DD   ?                  ; address of static functionality table      ;AN000;
 0004  0021[                 C	                DB   33 DUP(?)          ; don't care                           ;AN000;
	   ??                C	
			 ]   C	
			     C	
 0025  00                    C	ACTIVE_DISPLAY  DB   ?                  ; active display code                  ;AN000;
 0026  00                    C	ALT_DISPLAY     DB   ?                  ; alternate display code               ;AN000;
 0027  0003[                 C	                DB   3  DUP(?)          ; don't care                           ;AN000;
	   ??                C	
			 ]   C	
			     C	
 002A  00                    C	CURRENT_SCANS   DB   ?                  ; current number of scan lines         ;AN000;
 002B  0002[                 C	                DB   2  DUP(?)          ; don't care                           ;AN000;
	   ??                C	
			 ]   C	
			     C	
 002D  00                    C	MISC_INFO       DB   ?                  ; miscellaneous state information      ;AN000;
 002E  0012[                 C	                DB   18 DUP(?)          ; don't care                           ;AN000;
	   ??                C	
			 ]   C	
			     C	
 0040                        C	INFO_BLOCK      ENDS                    ;                                      ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	; Video table entry structure
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	MODE_TABLE      STRUC                   ;                                      ;AN000;
 0000  FF                    C	V_MODE          DB    -1                ; video mode                           ;AN000;
 0001  FF                    C	D_MODE          DB    -1                ; display mode                         ;AN000;
 0002  00                    C	RESERVED_BYTE   DB    0                 ; reserved                             ;AN000;
 0003  FFFF                  C	COLORS          DW    -1                ; colors                               ;AN000;
 0005  FFFF                  C	SCR_WIDTH       DW    -1                ; screen width (pels)                  ;AN000;
 0007  FFFF                  C	SCR_LENGTH      DW    -1                ; screen length (pels)                 ;AN000;
 0009  FFFF                  C	SCR_COLS        DW    -1                ; number columns                       ;AN000;
 000B  FFFF                  C	SCR_ROWS        DW    -1                ; number rows                          ;AN000;
 000D                        C	MODE_TABLE      ENDS                    ;                                      ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	; Structure of Static Block
			     C	;  (for functionality call
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	STATIC_BLOCK    STRUC                   ; format of static functionality table ;AN000;
 0000  0007[                 C	                DB   7  DUP(?)          ; don't care                           ;AN000;
	   ??                C	
			 ]   C	
			     C	
 0007  00                    C	SCAN_TEXT       DB   ?                  ; available scan lines in text modes   ;AN000;
 0008                        C	STATIC_BLOCK    ENDS                    ;                                      ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	; Structure of System ID call return block
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-6


			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	SYS_ID          STRUC                   ; format of return system config data  ;AN000;
 0000  0000                  C	                DW   ?                  ; don't care                           ;AN000;
 0002  00                    C	MODEL_BYTE      DB   ?                  ; model byte                           ;AN000;
 0003                        C	SYS_ID          ENDS                    ;                                      ;AN000;
			     C	
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	; INT2f Strucs and Equates
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 = 001A                      C	MULT_ANSI       EQU     1Ah             ; ANSI multiplex number                ;AC003;
			     C	;Catagory code
 = 0000                      C	INSTALL_CHECK   EQU     0               ; install check for ANSI               ;AN000;
 = 0001                      C	IOCTL_2F        EQU     1               ; 2F interface to IOCTL                ;AN000;
 = 0002                      C	DA_INFO_2F      EQU     2h              ;J.K. Information passing to ANSI.
			     C	;Subfunction code for IOCTL_2F
 = 007F                      C	GET_SUBFUNC   EQU    7FH                ; WGR Same structure as GET_IOCTL(ANSI);AN000;
			     C	
			     C	;Info Struture for DA_INFO_2F. (DS:DX point to this packet)
			     C	;J.K. Note: For DOS 4.00, DA_INFO_PACKET is used by DISPLAY.SYS to signal ANSI.SYS that
			     C	;DISPLAY.SYS is calling/finishing INT 10h SET MODE call.  ANSI.SYS needs this
			     C	;infomration since it also hooks INT 10h vector.
			     C	;For this DA_SETMODE_FLAG purpose, DA_INFO_LEVEL and DA_INFO_DIRECTION should always be
			     C	;set to 0.  This can be extended for another information passing scheme between
			     C	;DISPLAY.SYS and ANSI.SYS in the future version.
			     C	;For DA_SETMODE_FLAG, DISPLAY.SYS should be extremely careful that when it calls
			     C	;with DA_SETMODE_FLAG =1, then it should calls with DA_SETMODE_FLAG=0
			     C	;when it finished INT 10h function call. Otherwise, the system goes .....
			     C	;
			     C	;D425. At the request of OS2 compatibility box, when the user ask to ANSI
			     C	; with DA_INFO_LEVEL=1, then ANSI sets DA_OPTION_L_STATE based on /L option
			     C	; status.
			     C	
			     C	DA_INFO_PACKET   struc
 0000  00                    C	DA_INFO_LEVEL       db      0           ; 0=used for SET_MODE_FLAG 1=for OPTION_L_STATE
 0001  00                    C	DA_SETMODE_FLAG     db      0           ; 1: DISPLAY.SYS is calling INT 10h call, SET MODE. 0=finish
				ed.
 0002  00                    C	DA_OPTION_L_STATE   db      0           ; 1 = /L active, 0 = /L inactive
 0003                        C	DA_INFO_PACKET   ends
			     C	
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	; GENERIC IOCTL Strucs and Equates
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	                                        ;                                      ;AN000;
 = 0003                      C	DISPLAY_TYPE    EQU     3               ; MAJ_FUNC type for display            ;AN000;
 = 007F                      C	GET_FUNC        EQU     7FH             ; MIN_FUNC for get subfunction         ;AN000;
 = 005F                      C	SET_FUNC        EQU     5FH             ; MIN_FUNC for set subfunction         ;AN000;
 = 000F                      C	REQ_VID_MODE    EQU     0FH             ; request video mode INT10h function call    ;AN000;
 = 0100                      C	DONE            EQU     0100H           ; set done bit for IOCTL status        ;AN000;
 = 8000                      C	CMD_ERROR       EQU     8000H           ; set error bit for IOCTL status       ;AN000;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-7


 = 0001                      C	INVALID_FUNC    EQU     1               ; invalid function                     ;AN000;
 = 000A                      C	NOT_SUPPORTED   EQU     10              ; return code non-supported ioctl function   ;AN000;
 = 000C                      C	NOT_AVAILABLE   EQU     12              ; return code for font not available   ;AN000;
 = 0001                      C	TEXT_MODE       EQU     1               ; text mode = 1 in request packet      ;AN000;
 = 0002                      C	GRAPHICS_MODE   EQU     2               ; graphics mode = 2                    ;AN000;
 = 0019                      C	DEFAULT_LENGTH  EQU     25              ; normal screen length                 ;AN000;
 = 0000                      C	OFF             EQU     0000H           ;                                      ;AN000;
 = 0001                      C	ON              EQU     0001H           ;                                      ;AN000;
 = 0020                      C	INT_BIT         EQU     00100000b       ; mask for int. bit from functionality call  ;AN000;
 = 0001                      C	FOUND           EQU     1               ; flag value for FOUND                 ;AN000;
 = 0000                      C	NOT_FOUND       EQU     0               ; flag value for not FOUND             ;AN000;
 = 0000                      C	SET_MODE        EQU     0               ; set mode INT10H function number      ;AN000;
 = AD00                      C	DISPLAY_CHECK   EQU     0AD00H          ; install check for DISPLAY.SYS        ;AN000;
 = AD02                      C	CHECK_ACTIVE    EQU     0AD02H          ; active code page check for DISPLAY.SY;AN000;
 = 00FF                      C	INSTALLED       EQU     0FFH            ; present in AL if installed           ;AN000;
 = 1112                      C	LOAD_8X8        EQU     1112H           ; register value for 8x8 ROM load      ;AN000;
 = 1103                      C	SET_BLOCK_0     EQU     1103H           ; activate block = 0.                  ;AN000;
 = AD10                      C	CHECK_FOR_FONT  EQU     0AD10H          ; check for 8x8 RAM font - DISPLAY.SYS ;AN000;
 = 0030                      C	SELECT_SCAN     EQU     30H             ; subfunction to set scan lines (VGA)  ;AN000;
 = 0000                      C	SET_INTENSIFY   EQU     0               ; value to enable intensify.           ;AN000;
 = 0001                      C	SET_BLINK       EQU     1               ; value to enable blink.               ;AN000;
 = 1003                      C	BLINK_TOGGLE    EQU     1003H           ; INT10 call to toggle int/blink bit.  ;AN000;
 = 0087                      C	CURSOR_FLAG     EQU     87H             ; cursor flag byte in ROM_BIOS         ;AN000;
 = 0001                      C	SET_CURSOR_CALL EQU     1               ; INT10 function call to set cursor typ;AN000;
 = 007F                      C	VIDEO_MASK      EQU     7FH             ; turn of clear buffer bit of mode value     ;AN000;
 = 001A                      C	MULT_ANSI       EQU     1Ah             ; ANSI multiplex number                ;AC003;
 = 0000                      C	INSTALL_CHECK   EQU     0               ; install check for ANSI               ;AN000;
 = 0001                      C	IOCTL_2F        EQU     1               ; 2F interface to IOCTL                ;AN000;
 = FFFE                      C	NOT_CY          EQU     0FFFEH          ; turn carry bit off                   ;AN000;
 = 0001                      C	CY              EQU     1               ; turn carry bit off                   ;AN000;
 = FFFE                      C	INVALID_FLAGS   EQU     0FFFEH          ; test for invalid flags in control word     ;AN000;
 = 00FE                      C	TURN_OFF        EQU     0FEH            ; values to turn off and on cursor..   ;AN000;
 = FF01                      C	TURN_ON         EQU     NOT TURN_OFF    ; emulation                            ;AN000;
 = 000B                      C	SUB_SIZE        EQU     11              ; sublist size                         ;AN000;
 = 0010                      C	LEFT_ASCIIZ     EQU     00010000B       ; left-aligned asciiz string           ;AN000;
 = 0000                      C	UNLIMITED       EQU     0               ; unlimited message size.              ;AN000;
			     C	                                        ;                                      ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	;  Request Header Structure (Generic IOCTL)
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	INIT_REQ_HDR    STRUC                   ;                                      ;AN000;
 0000  000D[                 C	                DB   13 DUP(?)          ; standard request header              ;AN000;
	   ??                C	
			 ]   C	
			     C	
 000D  00                    C	MAJ_FUNC        DB   ?                  ; major function                       ;AN000;
 000E  00                    C	MIN_FUNC        DB   ?                  ; minor function                       ;AN000;
 000F  0000                  C	IOCTL_SI        DW   ?                  ; contents of SI                       ;AN000;
 0011  0000                  C	IOCTL_DI        DW   ?                  ; contents of DI                       ;AN000;
 0013  00000000              C	REQ_PCKT_PTR    DD   ?                  ; pointer to request packet            ;AN000;
 0017                        C	INIT_REQ_HDR    ENDS                    ;                                      ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-8


			     C	;
			     C	; REQUEST PACKET STRUCTURE (Generic IOCTL)
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	REQ_PCKT        STRUC                   ;                                      ;AN000;
 0000  00                    C	INFO_LEVEL      DB   ?                  ; information level (should be 0)      ;AN000;
 0001  00                    C	                DB   ?                  ; reserved                             ;AN000;
 0002  0000                  C	DATA_LENGTH     DW   ?                  ; length of remaining data             ;AN000;
 0004  0000                  C	RP_FLAGS        DW   ?                  ; control flags                        ;AN000;
 0006  00                    C	RP_MODE         DB   ?                  ; display mode                         ;AN000;
 0007  00                    C	RESERVED2       DB   ?                  ; reserved                             ;AN000;
 0008  0000                  C	RP_COLORS       DW   ?                  ; # of colors                          ;AN000;
 000A  0000                  C	RP_WIDTH        DW   ?                  ; screen width                         ;AN000;
 000C  0000                  C	RP_LENGTH       DW   ?                  ; screen length                        ;AN000;
 000E  0000                  C	RP_COLS         DW   ?                  ; columns                              ;AN000;
 0010  0000                  C	RP_ROWS         DW   ?                  ; rows                                 ;AN000;
 0012                        C	REQ_PCKT        ENDS                    ;                                      ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	; Scan Lines available structure
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	SCAN_LINE_STR   STRUC                   ;                                      ;AN000;
 0000  0000                  C	NUM_LINES       DW   ?                  ; number of scan lines                 ;AN000;
 0002  00                    C	REP_1BH         DB   ?                  ; representation in 1Bh call           ;AN000;
 0003  00                    C	REP_12H         DB   ?                  ; representation in 12h call           ;AN000;
 0004                        C	SCAN_LINE_STR   ENDS                    ;                                      ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	; SUBLIST struc
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	SUB_STRUC       STRUC                   ;                                      ;AN000;
 0000  0002[                 C	                DB  2 DUP(?)            ;                                      ;AN000;
	   ??                C	
			 ]   C	
			     C	
 0002  0000                  C	SUB_PTR_O       DW  ?                   ;                                      ;AN000;
 0004  0000                  C	SUB_PTR_S       DW  ?                   ;                                      ;AN000;
 0006                        C	SUB_STRUC       ENDS                    ;                                      ;AN000;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	;
			     C	; RESULT BUFFER struc
			     C	;
			     C	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			     C	RESULT_STRUC    STRUC                   ;                                      ;AN000;
 0000  00                    C	RESULT_TYPE     DB  ?                   ;                                      ;AN000;
 0001  00                    C	                DB  ?                   ;                                      ;AN000;
 0002  0000                  C	RES_SYN_PTR     DW  ?                   ;                                      ;AN000;
 0004  00000000              C	RES_PTR         DD  ?                   ;                                      ;AN000;
 0008                        C	RESULT_STRUC    ENDS                    ;                                      ;AN000;
				.LIST                                                                                              ;
				AN000;
				                                                                                                   ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-9


				AN000;
				PUBLIC      GENERIC_IOCTL                                                                          ;
				AN000;
				PUBLIC      FUNC_INFO                                                                              ;
				AN000;
				PUBLIC      MAX_SCANS                                                                              ;
				AN000;
				PUBLIC      INT10_COM                                                                              ;
				AN000;
				PUBLIC      ROM_INT10                                                                              ;
				AN000;
				PUBLIC      INT2F_COM                                                                              ;
				AN000;
				PUBLIC      ROM_INT2F                                                                              ;
				AN000;
				PUBLIC      ABORT                                                                                  ;
				AN000;
				PUBLIC      REQ_TXT_LENGTH                                                                         ;
				AN000;
				PUBLIC      GRAPHICS_FLAG                                                                          ;
				AN000;
				public      Display_Loaded_Before_Me            ;AN008;
				                                                                                                   ;
				AN000;
 0000				CODE        SEGMENT  PUBLIC  BYTE                                                                  ;
				AN000;
				            ASSUME CS:CODE,DS:CODE                                                                 ;
				AN000;
				                                                                                                   ;
				AN000;
				EXTRN       PTRSAV:DWORD                                                                           ;
				AN000;
				EXTRN       NO_OPERATION:NEAR                                                                      ;
				AN000;
				EXTRN       ERR1:NEAR                                                                              ;
				AN000;
				EXTRN       VIDEO_MODE_TABLE:BYTE                                                                  ;
				AN000;
				extrn       MAX_VIDEO_TAB_NUM:ABS
				EXTRN       HDWR_FLAG:WORD                                                                         ;
				AN000;
				EXTRN       SCAN_LINES:BYTE                                                                        ;
				AN000;
				extrn       Switch_L:Byte                       ;AN010;Defined in ANSI.ASM
				                                                                                                   ;
				AN000;
				                                                                                                   ;
				AN000;
 0000				SCAN_LINE_TABLE  LABEL    BYTE                                                                     ;
				AN000;
 0000  C800			   SCAN_LINE_STR <200,000000001B,0>            ; 200 scan lines                                    ;
				AN000;
 0002  01			
 0003  00			
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-10


				
 0004  5801			   SCAN_LINE_STR <344,000000010B,1>            ; 350 scan lines                                    ;
				AN000;
 0006  02			
 0007  01			
				
 0008  9001			   SCAN_LINE_STR <400,000000100B,2>            ; 400 scan lines                                    ;
				AN000;
 000A  04			
 000B  02			
				
 = 0003				SCANS_AVAILABLE  EQU  ($ - SCAN_LINE_TABLE)/TYPE SCAN_LINE_STR                                     ;
				AN000;
				                                                                                                  ;A
				N000;
				;This is used when ANSI calls Get_IOCTL, Set_IOCTL by itself.
 000C  00			In_Generic_IOCTL_flag   db      0                               ;AN004;
 = 0001				I_AM_IN_NOW          EQU     00000001b                          ;AN004;
 = 0002				SET_MODE_BY_DISPLAY  EQU     00000010b                          ;AN004;Display.sys calls Set mode IN
				T 10h.
 = 0004				CALLED_BY_INT10COM   EQU     00000100b                          ;AN009;To prevent from calling set m
				ode int 10h again.
				
 000D  FF			INT10_V_Mode    db      0ffh                                    ;AN006;Used by INT10_COM
				
 000E  00			My_IOCTL_Req_Packet REQ_PCKT <0,0,0Eh,0,?,0,?,?,?,?,?>          ;AN004;
 000F  00			
 0010  0E00			
 0012  0000			
 0014  00			
 0015  00			
 0016  0000			
 0018  0000			
 001A  0000			
 001C  0000			
 001E  0000			
				
				                                                                                                   ;
				AN000;
 0020  00000000			FUNC_INFO        INFO_BLOCK <>                 ; data block for functionality call                 ;
				AN000;
 0024  0021[			
	   ??			
			 ]	
 0045  00			
 0046  00			
 0047  0003[			
	   ??			
			 ]	
 004A  00			
 004B  0002[			
	   ??			
			 ]	
 004D  00			
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-11


 004E  0012[			
	   ??			
			 ]	
				
 0060  0000			ROM_INT10        DW    ?                       ; segment and offset of original..                  ;
				AN000;
 0062  0000			                 DW    ?                       ; interrupt 10h vector.                             ;
				AN000;
 0064  0000			ROM_INT2F        DW    ?                       ; segment and offset of original..                  ;
				AN000;
 0066  0000			                 DW    ?                       ; interrupt 2Fh vector.                             ;
				AN000;
 0068  0000			INTENSITY_FLAG   DW    OFF                     ; intensity flag initially off                      ;
				AN000;
 006A  0019			REQ_TXT_LENGTH   DW    DEFAULT_LENGTH          ; requested text screen length                      ;
				AN000;
 006C  00			SCAN_DESIRED     DB    0                       ; scan lines desired                                ;
				AN000;
 006D  00			MAX_SCANS        DB    0                       ; maximum scan line setting                         ;
				AN000;
 006E  01			GRAPHICS_FLAG    DB    TEXT_MODE               ; flag for graphics mode                            ;
				AN000;
 006F  00			ERROR_FLAG       DB    OFF                     ; flag for error conditions                         ;
				AN000;
 0070  00			Display_Loaded_Before_Me db     0              ;AN008;flag
 0071  00			ANSI_SetMode_Call_Flag   db     0              ;AN008;Ansi is issuing INT10,AH=0.
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: GENERIC_IOCTL
				;
				; FUNCTION:
				; TO GET OR SET DEVICE CHARACTERISTICS ACCORDING TO THE BUFFER PASSED
				; IN THE REQUEST PACKET.
				;
				; AT ENTRY:
				;
				; AT EXIT:
				;    NORMAL: CARRY CLEAR - DEVICE CHARACTERISTICS SET
				;
				;    ERROR: CARRY SET - ERROR CODE IN AL. (SEE MODULE DESCRIPTION ABOVE).
				;
				; NOTE: THIS PROC IS PERFORMED AS A JMP AS WITH THE OLD ANSI CALLS.
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 0072				GENERIC_IOCTL:                                 ;                                                   ;
				AN000;
 0072  C4 1E 0000 E		        LES     BX,[PTRSAV]                    ; establish addressability to request header        ;
				AN000;
				        .SELECT                                ; check for get or set subfunction                  ;
				AN000;
				          .WHEN <ES:[BX].MIN_FUNC EQ GET_FUNC> ; is this the get subfunction?                      ;
				AN000;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-12


 0076  26: 80 7F 0E 7F       3						cmp ES:[BX].MIN_FUNC,GET_FUNC 
 007B  75 0A                 6						jne $l2 
 007D  26: C4 7F 13		            LES     DI,ES:[BX].REQ_PCKT_PTR    ; point to request packet                           ;
				AN000;
 0081  E8 00A5 R		            CALL    GET_IOCTL                  ; yes...execute routine                             ;
				AN000;
				          .WHEN <ES:[BX].MIN_FUNC EQ SET_FUNC> ; is this the set subfunction?                      ;
				AN000;
 0084  EB 14                 3						jmp short $l1 
 0086  90                    3						nop 
 0087                        2	$l2: 
 0087  26: 80 7F 0E 5F       3						cmp ES:[BX].MIN_FUNC,SET_FUNC 
 008C  75 09                 6						jne $l4 
 008E  26: C4 7F 13		            LES     DI,ES:[BX].REQ_PCKT_PTR    ; point to request packet                           ;
				AN000;
 0092  E8 0119 R		            CALL    SET_IOCTL                  ; yes....execute routine                            ;
				AN000;
				          .OTHERWISE                           ; not for us....so..                                ;
				AN000;
 0095  EB 03                 3						jmp short $l1 
 0097                        2	$l4: 
 0097  E9 0000 E		            JMP     NO_OPERATION               ; call lower CON device                             ;
				AN000;
				        .ENDSELECT                             ;                                                   ;
				AN000;
 009A                        2	$l1: 
				        .IF C                                  ; error?....                                        ;
				AN000;
 009A  73 03                 5						jnC $l7 
 009C  0D 8000			          OR     AX,CMD_ERROR                  ; yes...set error bit in status                     ;
				AN000;
				        .ENDIF                                 ;                                                   ;
				AN000;
 009F                        2	$l7: 
 009F  0D 0100			        OR     AX,DONE                         ; add done bit to status                            ;
				AN000;
 00A2  E9 0000 E		        JMP    ERR1                            ; return with status in AX                          ;
				AN000;
				                                                                                                   ;
				AN000;
				                                                                                                   ;
				AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: GET_IOCTL
				;
				; FUNCTION:
				; THIS PROCEDURE RETURNS DEVICE CHARACTERISTICS.
				;
				; AT ENTRY: ES:DI POINTS TO REQUEST BUFFER
				;
				; AT EXIT:
				;    NORMAL: CARRY CLEAR - REQUEST BUFFER CONTAINS DEVICE CHARACTERISTICS
				;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-13


				;    ERROR: CARRY SET - ERROR CONDITION IN AX
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 00A5				GET_IOCTL PROC    NEAR                                                                             ;
				AN000;
				     .IF <ES:[DI].INFO_LEVEL NE 0> OR            ; check for valid info level                      ;
				AN000;
 00A5  26: 80 3D 00          3						cmp ES:[DI].INFO_LEVEL,0 
 00A9  75 07                 5						jNE $l12 
				     .IF <ES:[DI].DATA_LENGTH LT <TYPE MODE_TABLE+1>> ; and buffer size.                           ;
				AN000;
 00AB  26: 83 7D 02 0E       3						cmp ES:[DI].DATA_LENGTH,TYPE MODE_TABLE+1 
 00B0  7D 06                 6						jnl $l11 
 00B2                        3	$l12: 
 00B2  B8 0001			       MOV    AX,INVALID_FUNC                    ; not valid...unsupported                         ;
				AN000;
 00B5  F9			       STC                                       ; function..set error flag and                    ;
				AN000;
				     .ELSE                                       ;                                                 ;
				AN000;
 00B6  EB 60                 3						jmp short $l10 
 00B8                        2	$l11: 
 00B8  26: C6 45 01 00		       MOV     ES:[DI].INFO_LEVEL+1,0            ; set reserved byte to 0.                         ;
				AN000;
 00BD  B4 0F			       MOV     AH,REQ_VID_MODE                   ; request current video mode                      ;
				AN000;
 00BF  CD 10			       INT     10H                               ;                                                 ;
				AN000;
 00C1  24 7F			       AND     AL,VIDEO_MASK                     ;                                                 ;
				AN000;
 00C3  8D 36 0000 E		       LEA     SI,VIDEO_MODE_TABLE               ; point to resident video table                   ;
				AN000;
 00C7  E8 0384 R		       CALL    GET_SEARCH                        ; perform search                                  ;
				AN000;
				       .IF C                                     ; found?                                          ;
				AN000;
 00CA  73 05                 5						jnC $l15 
 00CC  B8 000A			         MOV     AX,NOT_SUPPORTED                ; no....load unsupported function                 ;
				AN000;
				       .ELSE                                     ;                                                 ;
				AN000;
 00CF  EB 47                 3						jmp short $l10 
 00D1                        2	$l15: 
 00D1  57			         push    di                              ;AN001;AN003;Save Request Buffer pointer
 00D2  26: C7 45 02 000E	         MOV     WORD PTR ES:[DI].DATA_LENGTH,(TYPE MODE_TABLE)+1 ;length of data is struc size    ;
				AN000;
 00D8  46			         INC     SI                              ; skip mode value                                 ;
				AN000;
 00D9  83 C7 04			         ADD     DI,RP_FLAGS                     ; point to flag word                              ;
				AN000;
				         .IF <HDWR_FLAG GE MCGA_ACTIVE>          ; if we have an EGA or better                     ;
				AN000;
 00DC  83 3E 0000 E 08       3						cmp HDWR_FLAG,MCGA_ACTIVE 
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-14


 00E1  7C 05                 5						jnGE $l19 
 00E3  E8 02AA R		           CALL    CTL_FLAG                      ; then ..process control flag                     ;
				AN000;
				         .ELSE                                   ; else...                                         ;
				AN000;
 00E6  EB 05                 3						jmp short $l18 
 00E8                        2	$l19: 
 00E8  26: C7 05 0000		           MOV     WORD PTR ES:[DI],OFF          ; we always have blink.                           ;
				AN000;
				         .ENDIF                                  ;                                                 ;
				AN000;
 00ED                        2	$l18: 
 00ED  47			         INC     DI                              ; point to next field..                           ;
				AN000;
 00EE  47			         INC     DI                              ; ..(display mode)                                ;
				AN000;
 00EF  B9 000C			         MOV     CX,(TYPE MODE_TABLE)-1          ; load count                                      ;
				AN000;
 00F2  F3/ A4			         REP     MOVSB                           ; transfer data from video table to request packet;
				AN000;
 00F4  83 EE 0D			         SUB     SI,TYPE MODE_TABLE              ; point back to start of mode data                ;
				AN000;
				         .IF <[SI].D_MODE EQ TEXT_MODE> AND      ; if we are in text mode and..                    ;
				AN000;
 00F7  80 7C 01 01           3						cmp [SI].D_MODE,TEXT_MODE 
 00FB  75 17                 6						jne $l22 
				         .IF <[SI].SCR_ROWS NE DEFAULT_LENGTH>   ; length <> 25 then we have an EGA or VGA         ;
				AN000;
 00FD  83 7C 0B 19           3						cmp [SI].SCR_ROWS,DEFAULT_LENGTH 
 0101  74 11                 6						je $l22 
 0103  4F			           DEC    DI                             ; point back to length entry in req packet        ;
				AN000;
 0104  4F			           DEC    DI                             ;                                                 ;
				AN000;
 0105  1E			           PUSH   DS                             ;                                                 ;
				AN000;
 0106  B8 0040			           MOV    AX,ROM_BIOS                    ; load ROM BIOS data area segment                 ;
				AN000;
 0109  8E D8			           MOV    DS,AX                          ;                                                 ;
				AN000;
 010B  A0 0084			           MOV    AL,BYTE PTR DS:[NUM_ROWS]      ; load current number of rows                     ;
				AN000;
 010E  98			           CBW                                   ;                                                 ;
				AN000;
 010F  40			           INC    AX                             ; add 1 to row count                              ;
				AN000;
 0110  26: 89 05		           MOV    WORD PTR ES:[DI],AX            ; and copy to request packet                      ;
				AN000;
 0113  1F			           POP    DS                             ;                                                 ;
				AN000;
				         .ENDIF                                  ;                                                 ;
				AN000;
 0114                        2	$l22: 
 0114  33 C0			         XOR    AX,AX                            ; no errors                                       ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-15


				AN000;
 0116  F8			         CLC                                     ; clear error flag                                ;
				AN000;
 0117  5F			         pop    di                               ;AN001; AN003;Restore Request Buffer pointer
				       .ENDIF                                    ;                                                 ;
				AN000;
				     .ENDIF                                      ;                                                 ;
				AN000;
 0118                        2	$l10: 
 0118  C3			     RET                                         ; return to calling module                        ;
				AN000;
 0119				GET_IOCTL ENDP                                                                                     ;
				AN000;
				                                                                                                   ;
				AN000;
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: SET_IOCTL
				;
				; FUNCTION:
				; THIS PROCEDURE SETS THE VIDEO MODE AND CHARACTER SET ACCORDING
				; TO THE CHARACTERSTICS PROVIDED.
				;
				; AT ENTRY:
				;    ES:[DI] POINTS TO REQUEST BUFFER
				;
				; AT EXIT:
				;    NORMAL: CLEAR CARRY - VIDEO MODE SET
				;
				;    ERROR: CARRY SET - ERROR CONDITION IN AX
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 0119				SET_IOCTL PROC  NEAR                                                                               ;
				AN000;
 0119  2E: 80 0E 000C R 01	     or cs:In_Generic_IOCTL_Flag, I_AM_IN_NOW  ;AN004; Signal GENERIC_IOCTL request being processed
 011F  C6 06 006F R 00		     MOV    ERROR_FLAG,OFF                     ; clear any errors                                  ;
				AN000;
				    .IF <ES:[DI].INFO_LEVEL NE 0> OR           ; check for valid info level                        ;
				AN000;
 0124  26: 80 3D 00          3						cmp ES:[DI].INFO_LEVEL,0 
 0128  75 1F                 5						jNE $l27 
				    .IF <ES:[DI].DATA_LENGTH NE <TYPE MODE_TABLE+1>> OR ; and buffer size.                         ;
				AN000;
 012A  26: 83 7D 02 0E       3						cmp ES:[DI].DATA_LENGTH,TYPE MODE_TABLE+1 
 012F  75 18                 5						jNE $l27 
 0131  26: 8B 45 04		     MOV    AX,ES:[DI].RP_FLAGS                ; test for invalid flags.                           ;
				AN000;
				    .IF <BIT AX AND INVALID_FLAGS> OR          ;                                                   ;
				AN000;
 0135  A9 FFFE               3						test AX,INVALID_FLAGS 
 0138  75 0F                 6						jnz $l27 
				    .IF <BIT ES:[DI].RP_FLAGS AND ON> AND      ; if intensity is requested and..                   ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-16


				AN000;
 013A  26: F7 45 04 0001     3						test ES:[DI].RP_FLAGS,ON 
 0140  74 11                 6						jz $l26 
				    .IF <HDWR_FLAG LT MCGA_ACTIVE>             ; hardware does not support it then..               ;
				AN000;
 0142  83 3E 0000 E 08       3						cmp HDWR_FLAG,MCGA_ACTIVE 
 0147  7D 0A                 6						jnl $l26 
 0149                        3	$l27: 
 0149  B8 0001			        MOV    AX,INVALID_FUNC                 ; not valid...unsupported..                         ;
				AN000;
 014C  C6 06 006F R 01		        MOV    ERROR_FLAG,ON                   ; function..set error and..                         ;
				AN000;
				    .ELSE                                      ;                                                   ;
				AN000;
 0151  EB 6C                 3						jmp short $l25 
 0153                        2	$l26: 
 0153  E8 02FB R		        CALL    SET_SEARCH                     ; search table for match                            ;
				AN000;
				       .IF C                                   ; if match not found then..                         ;
				AN000;
 0156  73 0A                 5						jnC $l30 
 0158  B8 000A			          MOV    AX,NOT_SUPPORTED              ; not supported....                                 ;
				AN000;
 015B  C6 06 006F R 01		          MOV    ERROR_FLAG,ON                 ;                                                   ;
				AN000;
				       .ELSE                                   ;                                                   ;
				AN000;
 0160  EB 5D                 3						jmp short $l25 
 0162                        2	$l30: 
				         .IF <[SI].D_MODE EQ TEXT_MODE>        ; is a text mode being requested?                   ;
				AN000;
 0162  80 7C 01 01           3						cmp [SI].D_MODE,TEXT_MODE 
 0166  75 3E                 6						jne $l34 
 0168  FF 36 006A R		            PUSH   REQ_TXT_LENGTH              ; save old value in case of error                   ;
				AN000;
 016C  26: 8B 45 10		            MOV    AX,ES:[DI].RP_ROWS          ; save new requested value.                         ;
				AN000;
 0170  A3 006A R		            MOV    REQ_TXT_LENGTH,AX           ;                                                   ;
				AN000;
				;           .IF <[SI].SCR_ROWS NE UNOCCUPIED>   ; yes...check for VGA support..                     
				;AN000;
				;             CALL   PROCESS_NORMAL             ; no..process other adapters..                      
				;AN000;
				;           .ELSE                               ; VGA support available..                           
				;AN000;
				;             CALL   PROCESS_VGA                ; process the VGA support code.                     
				;AN000;
				;           .ENDIF                              ;                                                   
				;AN000;
				           .IF <[SI].SCR_ROWS E UNOCCUPIED> OR ;AN002;
 0173  83 7C 0B FF           3						cmp [SI].SCR_ROWS,UNOCCUPIED 
 0177  74 08                 5						jE $l38 
				           .IF <BIT Hdwr_Flag AND VGA_ACTIVE>  ;AN002;
 0179  F7 06 0000 E 0080     3						test Hdwr_Flag,VGA_ACTIVE 
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-17


 017F  74 05                 6						jz $l37 
 0181                        3	$l38: 
 0181  E8 0204 R		               call  process_VGA               ;AN002;
				           .ELSE                               ;AN002;
 0184  EB 03                 3						jmp short $l36 
 0186                        2	$l37: 
 0186  E8 01D3 R		               call  process_Normal            ;AN002;
				           .ENDIF                              ;AN002;
 0189                        2	$l36: 
				           .IF <ERROR_FLAG EQ OFF>             ; if we had no errors then..                        ;
				AN000;
 0189  80 3E 006F R 00       3						cmp ERROR_FLAG,OFF 
 018E  75 10                 6						jne $l41 
 0190  58			              POP    AX                        ; discard saved text length                         ;
				AN000;
 0191  E8 023C R		              call   DO_ROWS                   ;AN004;
				             .IF <HDWR_FLAG GE E5151_ACTIVE>   ; does hardware support gt 25 lines?                ;
				AN000;
 0194  83 3E 0000 E 10       3						cmp HDWR_FLAG,E5151_ACTIVE 
 0199  7C 0E                 5						jnGE $l33 
 019B  E8 03AA R		                CALL   SET_CURSOR_EMUL         ; yes..ensure cursor emulation is..                 ;
				AN000;
				             .ENDIF                            ; set accordingly.                                  ;
				AN000;
				           .ELSE                               ;                                                   ;
				AN000;
 019E  EB 09                 3						jmp short $l33 
 01A0                        2	$l41: 
 01A0  8F 06 006A R		              POP    REQ_TXT_LENGTH            ; error...so restore old value.                     ;
				AN000;
				           .ENDIF                              ;                                                   ;
				AN000;
				         .ELSE                                 ; request is for graphics mode                      ;
				AN000;
 01A4  EB 03                 3						jmp short $l33 
 01A6                        2	$l34: 
 01A6  E8 059D R		            CALL   SET_VIDEO_MODE              ; so set video mode.                                ;
				AN000;
				         .ENDIF                                ;                                                   ;
				AN000;
 01A9                        2	$l33: 
				         .IF <ERROR_FLAG EQ OFF> AND           ; no errors? then..                                 ;
				AN000;
 01A9  80 3E 006F R 00       3						cmp ERROR_FLAG,OFF 
 01AE  75 0F                 6						jne $l25 
				         .IF <HDWR_FLAG GE MCGA_ACTIVE> AND    ; for the EGA and better ....                       ;
				AN000;
 01B0  83 3E 0000 E 08       3						cmp HDWR_FLAG,MCGA_ACTIVE 
 01B5  7C 08                 5						jnGE $l25 
				         .IF <[SI].V_MODE EQ TEXT_MODE>        ; and in text mode do...                            ;
				AN000;
 01B7  80 3C 01              3						cmp [SI].V_MODE,TEXT_MODE 
 01BA  75 03                 6						jne $l25 
 01BC  E8 02DD R		             CALL   SET_CTL_FLAG               ; set intensity bit to control value                ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-18


				AN000;
				         .ENDIF                                ;                                                   ;
				AN000;
				       .ENDIF                                  ;                                                   ;
				AN000;
				    .ENDIF                                     ;                                                   ;
				AN000;
 01BF                        2	$l25: 
 01BF  2E: 80 26 000C R FE	     and cs:In_Generic_IOCTL_Flag, NOT I_AM_IN_NOW  ;AN004; Turn the flag off
				    .IF <ERROR_FLAG EQ OFF>                    ; no errors?                                        ;
				AN000;
 01C5  80 3E 006F R 00       3						cmp ERROR_FLAG,OFF 
 01CA  75 05                 6						jne $l52 
 01CC  33 C0			       XOR    AX,AX                            ; clear error register                              ;
				AN000;
 01CE  F8			       CLC                                     ; clear error flag                                  ;
				AN000;
				    .ELSE                                      ;                                                   ;
				AN000;
 01CF  EB 01                 3						jmp short $l51 
 01D1                        2	$l52: 
 01D1  F9			       STC                                     ;                                                   ;
				AN000;
				    .ENDIF                                     ; yes...set error flag                              ;
				AN000;
 01D2                        2	$l51: 
 01D2  C3			     RET                                       ;                                                   ;
				AN000;
 01D3				SET_IOCTL ENDP                                                                                     ;
				AN000;
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: PROCESS_NORMAL
				;
				; FUNCTION:
				; THIS PROCEDURE PROCESSES THE SET IOCTL FOR ADAPTERS OTHER THAN
				; THE VGA.
				;
				; AT ENTRY: AX - SCREEN LENGTH DESIRED
				;           DS:SI - POINTS TO MODE RECORD IN VIDEO TABLE.
				;
				; AT EXIT:
				;    NORMAL: MODE SET
				;
				;    ERROR: ERROR_FLAG IS ON. ERROR CODE IN AX.
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 01D3				PROCESS_NORMAL PROC   NEAR                                                                         ;
				AN000;
				             .IF <AX NE DEFAULT_LENGTH>  AND   ; no..see if length requested..                     ;
				AN000;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-19


 01D3  3D 0019               3						cmp AX,DEFAULT_LENGTH 
 01D6  74 0F                 6						je $l56 
				             .IF <AX NE [SI].SCR_ROWS>         ; is valid....                                      ;
				AN000;
 01D8  3B 44 0B              3						cmp AX,[SI].SCR_ROWS 
 01DB  74 0A                 6						je $l56 
 01DD  B8 000A			               MOV    AX,NOT_SUPPORTED         ; not valid....so                                   ;
				AN000;
 01E0  C6 06 006F R 01		               MOV    ERROR_FLAG,ON            ; set error flag and..                              ;
				AN000;
				             .ELSE                             ; length is valid so..                              ;
				AN000;
 01E5  EB 1C                 3						jmp short $l55 
 01E7                        2	$l56: 
 01E7  E8 05F9 R		               CALL   CHECK_FOR_DISPLAY        ; see if we need and have DISPLAY.SYS..             ;
				AN000;
				               .IF NC                          ; support...if no problems then..                   ;
				AN000;
 01EA  72 0F                 6						jc $l60 
				                 .IF <HDWR_FLAG GE E5151_ACTIVE>; yes...check for cursor emulation                 ;
				AN000;
 01EC  83 3E 0000 E 10       3						cmp HDWR_FLAG,E5151_ACTIVE 
 01F1  7C 03                 5						jnGE $l62 
 01F3  E8 03AA R		                   CALL    SET_CURSOR_EMUL     ;                                                   ;
				AN000;
				                 .ENDIF                        ;                                                   ;
				AN000;
 01F6                        2	$l62: 
 01F6  E8 059D R		                 CALL    SET_VIDEO_MODE        ; ..and set the mode.                               ;
				AN000;
				               .ELSE                           ; no..                                              ;
				AN000;
 01F9  EB 08                 3						jmp short $l55 
 01FB                        2	$l60: 
 01FB  B8 000C			                 MOV     AX,NOT_AVAILABLE      ; font not available..                              ;
				AN000;
 01FE  C6 06 006F R 01		                 MOV     ERROR_FLAG,ON         ;                                                   ;
				AN000;
				               .ENDIF                          ;                                                   ;
				AN000;
				             .ENDIF                            ;                                                   ;
				AN000;
 0203                        2	$l55: 
 0203  C3			             RET
 0204				PROCESS_NORMAL ENDP
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: PROCESS_VGA
				;
				; FUNCTION:
				; THIS PROCEDURE PROCESSES THE SET IOCTL FOR THE VGA ADAPTER
				;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-20


				; AT ENTRY: AX - SCREEN LENGTH DESIRED
				;           DS:SI - POINTS TO MODE RECORD IN VIDEO TABLE.
				;
				; AT EXIT:
				;    NORMAL: MODE SET
				;
				;    ERROR: ERROR_FLAG IS ON. ERROR CODE IN AX.
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 0204				PROCESS_VGA  PROC    NEAR                                                                          ;
				AN000;
 0204  E8 025F R		             CALL    TEST_LENGTH               ; check to see if screen length                     ;
				AN000;
				             .IF C                             ; is applicable....                                 ;
				AN000;
 0207  73 0A                 5						jnC $l67 
 0209  B8 000A			               MOV    AX,NOT_SUPPORTED         ; no..so set error condition                        ;
				AN000;
 020C  C6 06 006F R 01		               MOV    ERROR_FLAG,ON            ;                                                   ;
				AN000;
				             .ELSE                             ;                                                   ;
				AN000;
 0211  EB 28                 3						jmp short $l66 
 0213                        2	$l67: 
 0213  E8 05F9 R		               CALL   CHECK_FOR_DISPLAY        ; see if we need and have DISPLAY.SYS..             ;
				AN000;
				               .IF NC                          ; support.....yes so..                              ;
				AN000;
 0216  72 1B                 6						jc $l71 
				                 .IF <REQ_TXT_LENGTH EQ DEFAULT_LENGTH> ; 25 lines requested?                      ;
				AN000;
 0218  83 3E 006A R 19       3						cmp REQ_TXT_LENGTH,DEFAULT_LENGTH 
 021D  75 06                 6						jne $l73 
 021F  A0 006D R		                   MOV    AL,MAX_SCANS         ; desired scan setting should be..                  ;
				AN000;
 0222  A2 006C R		                   MOV    SCAN_DESIRED,AL      ; the maximum.                                      ;
				AN000;
				                 .ENDIF                        ;                                                   ;
				AN000;
 0225                        2	$l73: 
 0225  B4 12			                 MOV    AH,ALT_SELECT          ; set the appropriate number..                      ;
				AN000;
 0227  B3 30			                 MOV    BL,SELECT_SCAN         ; of scan lines..                                   ;
				AN000;
 0229  A0 006C R		                 MOV    AL,SCAN_DESIRED        ;                                                   ;
				AN000;
 022C  CD 10			                 INT    10H                    ;                                                   ;
				AN000;
 022E  E8 059D R		                 CALL   SET_VIDEO_MODE         ; and set the mode.                                 ;
				AN000;
				               .ELSE                           ; DISPLAY.SYS does not have the font.               ;
				AN000;
 0231  EB 08                 3						jmp short $l66 
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-21


 0233                        2	$l71: 
 0233  B8 000C			                 MOV    AX,NOT_AVAILABLE       ; so...load error code..                            ;
				AN000;
 0236  C6 06 006F R 01		                 MOV    ERROR_FLAG,ON          ;                                                   ;
				AN000;
				               .ENDIF                          ;                                                   ;
				AN000;
				             .ENDIF                            ;                                                   ;
				AN000;
 023B                        2	$l66: 
 023B  C3			             RET                                                                                   ;
				AN000;
 023C				PROCESS_VGA  ENDP                                                                                  ;
				AN000;
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				; Procedure name: DO_ROWS
				; Function:
				;  Only called for TEXT_MODE.
				;  If (REQ_TXT_LENGTH <> DEFAULT_LENGTH) &
				;     (DISPLAY.SYS not loaded or CODEPAGE not active)
				;  then
				;     LOAD ROM 8X8 charater.
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 023C				DO_ROWS         proc    near                            ;AN004;
				       .IF <REQ_TXT_LENGTH NE DEFAULT_LENGTH>           ;AN004;
 023C  83 3E 006A R 19       3						cmp REQ_TXT_LENGTH,DEFAULT_LENGTH 
 0241  74 1B                 6						je $l77 
 0243  1E			           push ds                                      ;AN004;
 0244  06			           push es                                      ;AN004;
 0245  57			           push di                                      ;AN004;
 0246  56			           push si                                      ;AN004;
 0247  B8 AD00			           mov  ax, DISPLAY_CHECK                       ;AN004;
 024A  CD 2F			           int  2fh                                     ;AN004;
				          .IF <al NE INSTALLED> OR                      ;AN004;
 024C  3C FF                 3						cmp al,INSTALLED 
 024E  75 07                 5						jNE $l82 
 0250  B8 AD02			           mov  ax, CHECK_ACTIVE                        ;AN004;
 0253  CD 2F			           int  2fh                                     ;AN004;
				          .IF  C                                        ;AN004;
 0255  73 03                 5						jnC $l80 
 0257                        3	$l82: 
 0257  E8 05E2 R		               call     ROM_LOAD_8X8                    ;AN004;
				          .ENDIF                                        ;AN004;
 025A                        2	$l80: 
 025A  5E			           pop  si                                      ;AN004;
 025B  5F			           pop  di                                      ;AN004;
 025C  07			           pop  es                                      ;AN004;
 025D  1F			           pop  ds                                      ;AN004;
				       .ENDIF                                           ;AN004;
 025E                        2	$l77: 
 025E  C3			        ret                                             ;AN004;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-22


 025F				DO_ROWS         endp                                    ;AN004;
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: TEST_LENGTH
				;
				; FUNCTION:
				; THIS PROCEDURE ENSURES THAT THE SCREEN LENGTH REQUESTED CAN BE
				; OBTAINED USING THE AVAILABLE SCAN LINE SETTINGS.  (VGA ONLY!)
				;
				; AT ENTRY:
				;
				;
				; AT EXIT:
				;    NORMAL: CARRY CLEAR - SCAN_DESIRED CONTAINS SETTING REQUIRED
				;
				;    ERROR: CARRY SET
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 025F				TEST_LENGTH PROC   NEAR                                                                            ;
				AN000;
 025F  55			            push   bp                        ;AN007;
 0260  A1 006A R		            MOV    AX,REQ_TXT_LENGTH         ; load AX with length requested                       ;
				AN000;
 0263  BD 0008			            MOV    BP,EIGHT                  ;                                                     ;
				AN000;
 0266  F7 E5			            MUL    BP                        ; mulitply by 8 to get scan lines                     ;
				AN000;
 0268  8D 1E 0000 R		            LEA    BX,SCAN_LINE_TABLE        ; load BX with scan line table start                  ;
				AN000;
 026C  B9 0003			            MOV    CX,SCANS_AVAILABLE        ; total number of scan lines settings                 ;
				AN000;
 026F  BD 0000			            MOV    BP,NOT_FOUND              ; set flag                                            ;
				AN000;
				            .WHILE <BP EQ NOT_FOUND> AND     ; while not found and still valid..                   ;
				AN000;
 0272                        2	$l83: 
 0272  83 FD 00              3						cmp BP,NOT_FOUND 
 0275  75 21                 6						jne $l84 
				            .WHILE <CX NE 0>                 ; settings left..do..                                 ;
				AN000;
 0277  83 F9 00              3						cmp CX,0 
 027A  74 1C                 6						je $l84 
				              .IF <AX EQ [BX].NUM_LINES>     ; pointing at the right setting..                     ;
				AN000;
 027C  3B 07                 3						cmp AX,[BX].NUM_LINES 
 027E  75 12                 6						jne $l87 
 0280  8A 57 02			                MOV    DL,[BX].REP_1BH       ;                                                     ;
				AN000;
				                .IF <BIT SCAN_LINES AND DL>  ; does the hardware have it?..                        ;
				AN000;
 0283  84 16 0000 E          3						test SCAN_LINES,DL 
 0287  74 05                 6						jz $l90 
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-23


 0289  BD 0001			                  MOV    BP,FOUND            ; yes....found!!                                      ;
				AN000;
				                .ELSE                        ;                                                     ;
				AN000;
 028C  EB E4                 3						jmp short $l83 
 028E                        2	$l90: 
 028E  33 C9			                  XOR    CX,CX               ; no...set CX to exit loop.                           ;
				AN000;
				                .ENDIF                       ;                                                     ;
				AN000;
				              .ELSE                          ;                                                     ;
				AN000;
 0290  EB E0                 3						jmp short $l83 
 0292                        2	$l87: 
 0292  83 C3 04			                ADD    BX,TYPE SCAN_LINE_STR ; not this setting..point to next                     ;
				AN000;
 0295  49			                DEC    CX                    ; record and decrement count                          ;
				AN000;
				              .ENDIF                         ;                                                     ;
				AN000;
				            .ENDWHILE                        ;                                                     ;
				AN000;
 0296  EB DA                 3						jmp $l83 
 0298                        2	$l84: 
				            .IF <BP EQ NOT_FOUND>            ; was it found and available?                         ;
				AN000;
 0298  83 FD 00              3						cmp BP,NOT_FOUND 
 029B  75 03                 6						jne $l95 
 029D  F9			              STC                            ; no....set error flag                                ;
				AN000;
				            .ELSE                            ; yes so.....                                         ;
				AN000;
 029E  EB 08                 3						jmp short $l94 
 02A0                        2	$l95: 
 02A0  8A 4F 03			              MOV    CL,[BX].REP_12H         ; store value to set it.                              ;
				AN000;
 02A3  88 0E 006C R		              MOV    SCAN_DESIRED,CL         ;                                                     ;
				AN000;
 02A7  F8			              CLC                            ; clear error flag                                    ;
				AN000;
				            .ENDIF                           ;                                                     ;
				AN000;
 02A8                        2	$l94: 
 02A8  5D			            pop  bp                          ;AN007;
 02A9  C3			            RET                              ; return to calling module                            ;
				AN000;
 02AA				TEST_LENGTH ENDP                                                                                   ;
				AN000;
				                                                                                                   ;
				AN000;
				                                                                                                   ;
				AN000;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-24


				; PROCEDURE_NAME: CTL_FLAG
				;
				; FUNCTION:
				; THIS PROCEDURE RETURNS THE CURRENT USE FOR THE INTENSITY/BLINKING
				; BIT.
				;
				; AT ENTRY:
				;
				; AT EXIT:
				;    NORMAL:
				;      VGA,MCGA: VALUE RETURNED FROM FUNCTIONALITY CALL
				;      EGA: VALUE LAST SET THROUGH IOCTL. DEFAULT IS BLINKING.
				;      CGA,MONO: BLINKING
				;
				;    ERROR: N/A
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				                                                                                                   ;
				AN000;
 02AA				CTL_FLAG  PROC    NEAR                                                                             ;
				AN000;
				          .IF <BIT HDWR_FLAG AND VGA_ACTIVE>      ; VGA supported?                                 ;
				AN000;
 02AA  F7 06 0000 E 0080     3						test HDWR_FLAG,VGA_ACTIVE 
 02B0  74 24                 6						jz $l98 
 02B2  06			            PUSH    ES                            ; yes...prepare for                              ;
				AN000;
 02B3  57			            PUSH    DI                            ; functionality call                             ;
				AN000;
 02B4  1E			            PUSH    DS                            ;                                                ;
				AN000;
 02B5  07			            POP     ES                            ;                                                ;
				AN000;
 02B6  8D 3E 0020 R		            LEA     DI,FUNC_INFO                  ; point to data block                            ;
				AN000;
 02BA  B4 1B			            MOV     AH,FUNC_CALL                  ; load function number                           ;
				AN000;
 02BC  33 DB			            XOR     BX,BX                         ; implementation type 0                          ;
				AN000;
 02BE  CD 10			            INT     10H                           ;                                                ;
				AN000;
 02C0  26: 8A 45 2D		            MOV     AL,ES:[DI].MISC_INFO          ; load misc info byte                            ;
				AN000;
				            .IF <BIT AL AND INT_BIT>              ; is blink bit set?                              ;
				AN000;
 02C4  A8 20                 3						test AL,INT_BIT 
 02C6  74 07                 6						jz $l102 
 02C8  83 26 0068 R FE		              AND    INTENSITY_FLAG,NOT ON        ; yes....turn off intensity flag                 ;
				AN000;
				            .ELSE                                 ; no...                                          ;
				AN000;
 02CD  EB 05                 3						jmp short $l101 
 02CF                        2	$l102: 
 02CF  83 0E 0068 R 01		              OR     INTENSITY_FLAG,ON            ; ensure that intensity is set                   ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-25


				AN000;
				            .ENDIF                                ;                                                ;
				AN000;
 02D4                        2	$l101: 
 02D4  5F			            POP     DI                            ; restore registers                              ;
				AN000;
 02D5  07			            POP     ES                            ;                                                ;
				AN000;
				          .ENDIF                                  ;                                                ;
				AN000;
 02D6                        2	$l98: 
 02D6  A1 0068 R		          MOV     AX,INTENSITY_FLAG               ; write the control flag..                       ;
				AN000;
 02D9  26: 89 05		          MOV     ES:[DI],AX                      ; to the request packet                          ;
				AN000;
 02DC  C3			          RET                                     ;                                                ;
				AN000;
 02DD				CTL_FLAG  ENDP                                                                                     ;
				AN000;
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: SET_CTL_FLAG
				;
				; FUNCTION:
				; THIS PROCEDURE SET THE TOGGLE/INTENSITY BIT AS SPECIFIED IN THE
				; CONTROL FLAG IOCTL SET SUBFUNCTION. THIS ROUTINE IS ONLY CALLED FOR
				; AN EGA, MCGA, OR VGA.
				;
				; AT ENTRY: ES:DI POINTS TO REQUEST BUFFER
				;
				; AT EXIT:
				;    NORMAL: INTENSITY_FLAG SET APPROPRIATELY AND SYSTEM BIT SET
				;
				;    ERROR: N/A
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 02DD				SET_CTL_FLAG PROC   NEAR                                                                           ;
				AN000;
				             .IF <BIT ES:[DI].RP_FLAGS AND ON>                                                     ;
				AN000;
 02DD  26: F7 45 04 0001     3						test ES:[DI].RP_FLAGS,ON 
 02E3  74 09                 6						jz $l106 
 02E5  83 0E 0068 R 01		               OR     INTENSITY_FLAG,ON                                                            ;
				AN000;
 02EA  B3 00			               MOV    BL,SET_INTENSIFY                                                             ;
				AN000;
				             .ELSE                                                                                 ;
				AN000;
 02EC  EB 07                 3						jmp short $l105 
 02EE                        2	$l106: 
 02EE  83 26 0068 R FE		               AND    INTENSITY_FLAG,NOT ON                                                        ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-26


				AN000;
 02F3  B3 01			               MOV    BL,SET_BLINK                                                                 ;
				AN000;
				             .ENDIF                                                                                ;
				AN000;
 02F5                        2	$l105: 
 02F5  B8 1003			             MOV    AX,BLINK_TOGGLE                                                                ;
				AN000;
 02F8  CD 10			             INT    10H                                                                            ;
				AN000;
 02FA  C3			             RET                                                                                   ;
				AN000;
 02FB				SET_CTL_FLAG ENDP
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: SET_SEARCH
				;
				; FUNCTION:
				; THIS PROCEDURE SEARCHES THE RESIDENT VIDEO TABLE IN ATTEMPT TO
				; FIND A MODE THAT MATHCES THE CHARACTERISTICS REQUESTED.
				;
				; AT ENTRY:
				;
				; AT EXIT:
				;    NORMAL: CARRY CLEAR - SI POINTS TO APPLICABLE RECORD
				;
				;    ERROR: CARRY SET
				;
				;AN006; When INT10_V_Mode <> 0FFH, then assumes that the user
				;       issuing INT10h, Set mode function call.  Unlike Generic IOCTL
				;       set mode call, the user already has taken care of the video mode.
				;       So, we also find the matching V_MODE.
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				                                                                                                   ;
				AN000;
 02FB				SET_SEARCH PROC   NEAR                                                                             ;
				AN000;
 02FB  55			            push   bp                               ;AN007;
 02FC  8D 36 0000 E		            LEA    SI,VIDEO_MODE_TABLE              ; point to video table                         ;
				AN000;
 0300  BD 0000			            MOV    BP,NOT_FOUND                     ; set flag indicating not found                ;
				AN000;
 0303  B9 0000 E		            MOV    CX,MAX_VIDEO_TAB_NUM             ; load counter, # of tables                    ;
				AN000;
				           .WHILE <BP EQ NOT_FOUND> AND             ; while not found and we still..               ;
				AN000;
 0306                        2	$l109: 
 0306  83 FD 00              3						cmp BP,NOT_FOUND 
 0309  75 65                 6						jne $l110 
				           .WHILE <[SI].V_MODE NE UNOCCUPIED> AND   ; have valid entries..                         ;
				AN000;
 030B  80 3C FF              3						cmp [SI].V_MODE,UNOCCUPIED 
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-27


 030E  74 60                 6						je $l110 
				           .WHILE <CX NE 0>                         ; do...                                        ;
				AN000;
 0310  83 F9 00              3						cmp CX,0 
 0313  74 5B                 6						je $l110 
 0315  2E: A0 000D R		             mov al, cs:INT10_V_Mode                ;AN006;
				            .if <AL NE 0FFh> AND                    ;AN006;if issued by INT10h Set Mode call,
 0319  3C FF                 3						cmp AL,0FFh 
 031B  74 0A                 6						je $l113 
				            .if <[SI].V_MODE NE AL>                 ;AN006; and V_MODE <> AL
 031D  38 04                 3						cmp [SI].V_MODE,AL 
 031F  74 06                 6						je $l113 
 0321  83 C6 0D			               add si, type MODE_TABLE              ;AN006; then, this is not the correct entry.
 0324  49			               dec cx                               ;AN006;Let's find the next entry.
				            .else                                   ;AN006; Else, continue...
 0325  EB DF                 3						jmp short $l109 
 0327                        2	$l113: 
 0327  26: 8A 45 06		               MOV    AL,ES:[DI].RP_MODE             ; load register for compare.                   
				;AN000;
				              .IF <[SI].D_MODE EQ AL>                ; match?......                                 
				;AN000;
 032B  38 44 01              3						cmp [SI].D_MODE,AL 
 032E  75 3A                 6						jne $l116 
 0330  26: 8B 45 08		                 MOV    AX,ES:[DI].RP_COLORS         ; yes...prepare next field                     
				;AN000;
				                .IF <[SI].COLORS EQ AX>              ; match?...                                    
				;AN000;
 0334  39 44 03              3						cmp [SI].COLORS,AX 
 0337  75 31                 6						jne $l116 
				                  .IF <ES:[DI].RESERVED2 EQ 0>       ; yes...ensure reserved byte is 0              
				;AN000;
 0339  26: 80 7D 07 00       3						cmp ES:[DI].RESERVED2,0 
 033E  75 2A                 6						jne $l116 
				                    .IF <ES:[DI].RP_MODE EQ GRAPHICS_MODE> ; for graphics mode..check the following;
				AN000;.
 0340  26: 80 7D 06 02       3						cmp ES:[DI].RP_MODE,GRAPHICS_MODE 
 0345  75 17                 6						jne $l126 
 0347  26: 8B 45 0A		                       MOV    AX,ES:[DI].RP_WIDTH    ; screen width.                                
				;AN000;
				                      .IF <[SI].SCR_WIDTH EQ AX>     ;                                              
				;AN000;
 034B  39 44 05              3						cmp [SI].SCR_WIDTH,AX 
 034E  75 1A                 6						jne $l116 
 0350  26: 8B 45 0C		                         MOV    AX,ES:[DI].RP_LENGTH ; screen length                                
				;AN000;
				                        .IF <[SI].SCR_LENGTH EQ AX>  ; (ignore #rows and #columns                   
				;AN000;
 0354  39 44 07              3						cmp [SI].SCR_LENGTH,AX 
 0357  75 11                 6						jne $l116 
 0359  BD 0001			                           MOV    BP,FOUND           ; found...set flag                             
				;AN000;
				                        .ENDIF                       ;                                              
				;AN000;
				                      .ENDIF                         ;                                              
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-28


				;AN000;
				                    .ELSE                            ; and for text check the columns..             
				;AN000;
 035C  EB 0C                 3						jmp short $l116 
 035E                        2	$l126: 
 035E  26: 8B 45 0E		                       MOV    AX,ES:[DI].RP_COLS     ; the rows are matched in the main routine.    
				;AN000;
				                      .IF <[SI].SCR_COLS EQ AX>      ;                                              
				;AN000;
 0362  39 44 09              3						cmp [SI].SCR_COLS,AX 
 0365  75 03                 6						jne $l116 
 0367  BD 0001			                         MOV    BP,FOUND             ; found...set flag                             
				;AN000;
				                      .ENDIF                         ;                                              
				;AN000;
				                    .ENDIF                           ;                                              
				;AN000;
				                  .ENDIF                             ;                                              
				;AN000;
				                .ENDIF                               ;                                              
				;AN000;
				              .ENDIF                                 ;                                              
				;AN000;
 036A                        2	$l116: 
 036A  83 C6 0D			               ADD    SI,TYPE MODE_TABLE             ; point to next record and..                   
				;AN000;
 036D  49			               DEC    CX                             ; decrement count                              
				;AN000;
				            .endif                                   ;AN006;
				           .ENDWHILE                                 ;                                              
				;AN000;
 036E  EB 96                 3						jmp $l109 
 0370                        2	$l110: 
				           .IF <BP EQ NOT_FOUND>                     ; if we never found it then..                  
				;AN000;
 0370  83 FD 00              3						cmp BP,NOT_FOUND 
 0373  75 03                 6						jne $l139 
 0375  F9			              STC                                    ; set error flag and..                         
				;AN000;
				           .ELSE                                     ;                                              
				;AN000;
 0376  EB 04                 3						jmp short $l138 
 0378                        2	$l139: 
 0378  83 EE 0D			              SUB    SI,TYPE MODE_TABLE              ; position us at the appropriate record        
				;AN000;
 037B  F8			              CLC                                    ; clear error flag                             
				;AN000;
				           .ENDIF                                    ;                                              
				;AN000;
 037C                        2	$l138: 
 037C  2E: C6 06 000D R FF	            mov cs:INT10_V_Mode, 0FFh                ;AN006; Done. Reset the value
 0382  5D			            pop bp                                   ;AN007;
 0383  C3			            RET                                      ; return to calling module                     
				;AN000;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-29


 0384				SET_SEARCH  ENDP                                                                                    
				;AN000;
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: GET_SEARCH
				;
				; FUNCTION:
				; THIS PROCEDURE SEARCHES THE VIDEO TABLE LOOKING FOR A MATCHING
				; VIDEO MODE.
				;
				; AT ENTRY: DS:SI POINTS TO VIDEO TABLE
				;           AL CONTAINS THE MODE REQUESTED
				;
				; AT EXIT:
				;    NORMAL: CARRY CLEAR, DS:SI POINTS TO MATCHING RECORD
				;
				;    ERROR: CARRY SET
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 0384				GET_SEARCH  PROC   NEAR                                                                            ;
				AN000;
 0384  B9 0000 E		            MOV     CX,MAX_VIDEO_TAB_NUM            ; # of total tables                             
				  ;AN000;
				            .WHILE <[SI].V_MODE NE AL> AND          ; while we are not pointing to                 ;
				AN000;
 0387                        2	$l142: 
 0387  38 04                 3						cmp [SI].V_MODE,AL 
 0389  74 10                 6						je $l143 
				            .WHILE <[SI].V_MODE NE UNOCCUPIED> AND  ; the right mode and we are still              ;
				AN000;
 038B  80 3C FF              3						cmp [SI].V_MODE,UNOCCUPIED 
 038E  74 0B                 6						je $l143 
				            .WHILE <CX NE 0>                        ; looking at valid data..do..                  ;
				AN000;
 0390  83 F9 00              3						cmp CX,0 
 0393  74 06                 6						je $l143 
 0395  83 C6 0D			              ADD     SI,TYPE MODE_TABLE            ; point to the next mode                       ;
				AN000;
 0398  49			              DEC     CX                            ; decrement counter                            ;
				AN000;
				            .ENDWHILE                               ;                                              ;
				AN000;
 0399  EB EC                 3						jmp $l142 
 039B                        2	$l143: 
				            .IF <CX EQ 0> OR                        ; did we find the mode?                        ;
				AN000;
 039B  83 F9 00              3						cmp CX,0 
 039E  74 05                 6						je $l147 
				            .IF <[SI].V_MODE EQ UNOCCUPIED>         ;                                              ;
				AN000;
 03A0  80 3C FF              3						cmp [SI].V_MODE,UNOCCUPIED 
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-30


 03A3  75 03                 6						jne $l146 
 03A5                        3	$l147: 
 03A5  F9			              STC                                   ; no ...so set error flag                      ;
				AN000;
				            .ELSE                                   ;                                              ;
				AN000;
 03A6  EB 01                 3						jmp short $l145 
 03A8                        2	$l146: 
 03A8  F8			              CLC                                   ; yes...clear error flag                       ;
				AN000;
				            .ENDIF                                  ;                                              ;
				AN000;
 03A9                        2	$l145: 
 03A9  C3			            RET                                     ;                                              ;
				AN000;
 03AA				GET_SEARCH  ENDP
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: SET_CURSOR_EMUL
				;
				; FUNCTION:
				; THIS PROCEDURE SETS THE CURSOR EMULATION BIT OFF IN ROM BIOS. THIS
				; IS TO PROVIDE A CURSOR ON THE EGA WITH THE 5154 LOADED WITH AN 8X8
				; CHARACTER SET.
				;
				; AT ENTRY:
				;
				; AT EXIT:
				;    NORMAL: CURSOR EMULATION BIT SET FOR APPLICABLE HARDWARE
				;
				;    ERROR: N/A
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 03AA				SET_CURSOR_EMUL PROC   NEAR                                                                        ;
				AN000;
				                .IF <BIT HDWR_FLAG AND E5154_ACTIVE> ; EGA with 5154?..                            ;
				AN000;
 03AA  F7 06 0000 E 0040     3						test HDWR_FLAG,E5154_ACTIVE 
 03B0  74 1E                 6						jz $l149 
 03B2  56			                  PUSH   SI                          ;                                             ;
				AN000;
 03B3  1E			                  PUSH   DS                          ; yes..so..                                   ;
				AN000;
 03B4  B8 0040			                  MOV    AX,ROM_BIOS                 ; check cursor emulation..                    ;
				AN000;
 03B7  8E D8			                  MOV    DS,AX                       ;                                             ;
				AN000;
 03B9  BE 0087			                  MOV    SI,CURSOR_FLAG              ;                                             ;
				AN000;
 03BC  8A 04			                  MOV    AL,BYTE PTR [SI]            ;                                             ;
				AN000;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-31


				                  .IF <CS:REQ_TXT_LENGTH EQ DEFAULT_LENGTH> gt 25 lines requested?                 ;
				AN000;
 03BE  2E: 83 3E 006A R 19   3						cmp CS:REQ_TXT_LENGTH,DEFAULT_LENGTH 
 03C4  75 04                 6						jne $l153 
 03C6  24 FE			                    AND    AL,TURN_OFF               ; no....set it OFF                            ;
				AN000;
				                  .ELSE                              ;                                             ;
				AN000;
 03C8  EB 02                 3						jmp short $l152 
 03CA                        2	$l153: 
 03CA  0C 01			                    OR     AL,TURN_ON                ; yes...set it ON                             ;
				AN000;
				                  .ENDIF                             ;                                             ;
				AN000;
 03CC                        2	$l152: 
 03CC  88 04			                  MOV    BYTE PTR [SI],AL            ;                                             ;
				AN000;
 03CE  1F			                  POP    DS                          ;                                             ;
				AN000;
 03CF  5E			                  POP    SI                          ;                                             ;
				AN000;
				                .ENDIF                               ;                                             ;
				AN000;
 03D0                        2	$l149: 
 03D0  C3			                RET                                  ; return to calling module                    ;
				AN000;
 03D1				SET_CURSOR_EMUL ENDP                                                                               ;
				AN000;
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: INT10_COM
				;
				; FUNCTION:
				; THIS IS THE INTERRUPT 10H HANDLER TO CAPTURE THE FOLLOWING FUNCTIONS:
				;
				;   AH=1H (SET CURSOR TYPE). CURSOR EMULATION IS PERFORMED IF WE HAVE
				;         AND EGA WITH A 5151 MONITOR, AND 43 LINES IS REQUESTED.
				;
				;   AH=0H (SET MODE) SCREEN LENGTH IS MAINTAINED WHEN POSSIBLE. (IE. IN
				;          TEXT MODES ONLY.)
				;   AN004; Capturing Set Mode call and enforcing the # of Rows based on the
				;          previous Set_IOCTL request lines was a design mistake.  ANSI cannot
				;          covers the all the application program out there which use INT 10h
				;          directly to make a full screen interface by their own way.
				;          This part of logic has been taken out by the management decision.
				;          Instead, for each set mdoe INT 10h function call, if it were not
				;          issued by SET_IOCTL procedures itself, or by DISPLAY.SYS program,
				;          then we assume that it was issued by an APPS, that usually does not
				;          know the new ANSI GET_IOCTL/SET_IOCTL interfaces.
				;          In this case, ANSI is going to call GET_IOCTL and SET_IOCTL function
				;          call - This is not to lose the local data consistency in ANSI.
				;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-32


				; AT ENTRY:
				;
				; AT EXIT:
				;    NORMAL:
				;
				;    ERROR:
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 03D1				INT10_COM  PROC   NEAR                                                                             ;
				AN000;
 03D1  FB			            STI                                      ; restore interrupts                          ;
				AN000;
				           .IF <AH NE SET_CURSOR_CALL> AND           ;                                             ;
				AN000;
 03D2  80 FC 01              3						cmp AH,SET_CURSOR_CALL 
 03D5  74 0A                 6						je $l156 
				           .IF <AH NE SET_MODE>                                                                    ;
				AN000;
 03D7  80 FC 00              3						cmp AH,SET_MODE 
 03DA  74 05                 6						je $l156 
 03DC  2E: FF 2E 0060 R		              JMP    DWORD PTR CS:ROM_INT10          ; no...pass it on.                            ;
				AN000;
				           .ENDIF                                                                                  ;
				AN000;
 03E1                        2	$l156: 
				           .IF <AH EQ SET_CURSOR_CALL>               ;Set cursor call?                             ;
				AN000;
 03E1  80 FC 01              3						cmp AH,SET_CURSOR_CALL 
 03E4  75 3E                 6						jne $l160 
 03E6  50			              PUSH   AX                              ;                                             ;
				AN000;
				             .IF <BIT CS:HDWR_FLAG AND E5151_ACTIVE> AND ; yes...check if we have an ega..         ;
				AN000;
 03E7  2E: F7 06 0000 E 0010 3						test CS:HDWR_FLAG,E5151_ACTIVE 
 03EE  74 2B                 6						jz $l162 
				             .IF <CS:REQ_TXT_LENGTH NE DEFAULT_LENGTH> AND ;                                       ;
				AN000;
 03F0  2E: 83 3E 006A R 19   3						cmp CS:REQ_TXT_LENGTH,DEFAULT_LENGTH 
 03F6  74 23                 6						je $l162 
				             .IF <CS:GRAPHICS_FLAG EQ TEXT_MODE> AND ; with 5151..so perform cursor mapping        ;
				AN000;
 03F8  2E: 80 3E 006E R 01   3						cmp CS:GRAPHICS_FLAG,TEXT_MODE 
 03FE  75 1B                 6						jne $l162 
				             .IF <CL GE 8>                           ;                                             ;
				AN000;
 0400  80 F9 08              3						cmp CL,8 
 0403  7C 16                 5						jnGE $l162 
 0405  8A C5			                MOV    AL,CH                         ; check for cursor..                          ;
				AN000;
				;               AND    AL,06H                        ; off emulation.!!!!!Wrong!!! TypeO error     ;
				AN000;
 0407  24 60			                and    al, 60h                       ; off emulation. J.K.
				               .IF <AL NE 020H>                      ;                                             ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-33


				AN000;
 0409  3C 20                 3						cmp AL,020H 
 040B  74 0E                 6						je $l162 
 040D  8A C5			                  MOV    AL,CH                       ; start position for cursor                   ;
				AN000;
 040F  E8 058E R		                  CALL   MAP_DOWN                    ;                                             ;
				AN000;
 0412  8A E8			                  MOV    CH,AL                       ;                                             ;
				AN000;
 0414  8A C1			                  MOV    AL,CL                       ; end position for cursor                     ;
				AN000;
 0416  E8 058E R		                  CALL   MAP_DOWN                    ;                                             ;
				AN000;
 0419  8A C8			                  MOV    CL,AL                       ;                                             ;
				AN000;
				               .ENDIF                                ;                                             ;
				AN000;
				             .ENDIF                                  ;                                             ;
				AN000;
 041B                        2	$l162: 
 041B  58			              POP    AX                              ;                                             ;
				AN000;
 041C  2E: FF 2E 0060 R		              JMP    DWORD PTR CS:ROM_INT10          ; continue interrupt processing               ;
				AN000;
				           .ELSE NEAR                                ; must be set mode call..                     ;
				AN000;
 0421  E9 04BB R             3						jmp $l159 
 0424                        2	$l160: 
 0424  9C			              PUSHF                                  ; prepare for IRET                            ;
				AN000;
 0425  2E: C6 06 0071 R 01	              mov    cs:ANSI_SetMode_Call_Flag, 1    ;AN008; Used by INT2F_COM
 042B  2E: FF 1E 0060 R		              CALL   DWORD PTR CS:ROM_INT10          ; call INT10 routine                          ;
				AN000;
 0430  2E: C6 06 0071 R 00	              mov    cs:ANSI_SetMode_Call_Flag, 0    ;AN008; Reset it
 0436  55			              push   bp                              ;AN007;
 0437  06			              push   es                              ;AN007;
 0438  1E			              PUSH   DS                              ;                                             ;
				AN000;
 0439  56			              PUSH   SI                              ;                                             ;
				AN000;
 043A  57			              PUSH   DI                              ;                                             ;
				AN000;
 043B  52			              PUSH   DX                              ;                                             ;
				AN000;
 043C  51			              PUSH   CX                              ;                                             ;
				AN000;
 043D  53			              PUSH   BX                              ;                                             ;
				AN000;
 043E  50			              PUSH   AX                              ;                                             ;
				AN000;
 043F  0E			              PUSH   CS                              ;                                             ;
				AN000;
 0440  1F			              POP    DS                              ;                                             ;
				AN000;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-34


 0441  B4 0F			              MOV    AH,REQ_VID_MODE                 ; get current mode..                          ;
				AN000;
 0443  9C			              PUSHF                                  ;                                             ;
				AN000;
 0444  2E: FF 1E 0060 R		              CALL   DWORD PTR CS:ROM_INT10          ;                                             ;
				AN000;
 0449  24 7F			              AND    AL,VIDEO_MASK                   ; mask bit 7 (refresh)                        ;
				AN000;
 044B  F6 06 000C R 03		              test   In_Generic_IOCTL_Flag, (I_AM_IN_NOW + SET_MODE_BY_DISPLAY)  ;AN004; Flag is on?
				             .IF Z   AND                          ;AN010;AN004;If not (I_AM_IN_NOW or SET_MODE_BY_DI
				SPLAY),
 0450  75 2D                 5						jnZ $l169 
				             .if <Switch_L EQ 0>                        ;AN010;
 0452  80 3E 0000 E 00       3						cmp Switch_L,0 
 0457  75 26                 6						jne $l169 
 0459  50			                 push   ax                              ;AN004;Save mode
 045A  06			                 push   es                              ;AN004;
 045B  0E			                 push   cs                              ;AN004;
 045C  07			                 pop    es                              ;AN004;
 045D  BF 000E R		                 mov    di, offset My_IOCTL_Req_Packet  ;AN004;
 0460  A2 000D R		                 mov    INT10_V_Mode, al                ;AN006;Save current mode for SET_SEARCH
 0463  E8 00A5 R		                 call   Get_IOCTL                       ;AN004;
				                .IF NC                                  ;AN004;
 0466  72 10                 6						jc $l172 
 0468  BF 000E R		                    mov    di, offset MY_IOCTL_Req_Packet ;AN004;
 046B  80 0E 000C R 04		                    or     In_Generic_IOCTL_Flag, CALLED_BY_INT10COM ;AN009;Do not set mode INT 10h 
				again. Already done.
 0470  E8 0119 R		                    call   Set_IOCTL                    ;AN004;
 0473  80 26 000C R FB		                    and    In_Generic_IOCTL_Flag, not CALLED_BY_INT10COM ;AN009;
				                .ENDIF                                  ;AN004;
 0478                        2	$l172: 
 0478  07			                 pop    es                              ;AN004;
 0479  58			                 pop    ax                              ;AN004;Restore mode
 047A  C6 06 000D R FF		                 mov    INT10_V_Mode, 0FFh              ;AN006;
				             .ENDIF                                     ;AN004;
 047F                        2	$l169: 
 047F  8D 36 0000 E		              LEA    SI,VIDEO_MODE_TABLE             ;                                             ;
				AN000;
 0483  E8 0384 R		              CALL   GET_SEARCH                      ; look through table for mode selected.       ;
				AN000;
				             .IF NC                                  ; if found then..                             ;
				AN000;
 0486  72 12                 6						jc $l175 
				                .IF <[SI].D_MODE NE TEXT_MODE>       ; text mode?....                              ;
				AN000;
 0488  80 7C 01 01           3						cmp [SI].D_MODE,TEXT_MODE 
 048C  74 07                 6						je $l179 
 048E  C6 06 006E R 02		                   MOV   GRAPHICS_FLAG,GRAPHICS_MODE ; no...set graphics flag.                    ;A
				N000;
				                .ELSE                                ;                                             ;
				AN000;
 0493  EB 05                 3						jmp short $l175 
 0495                        2	$l179: 
 0495  C6 06 006E R 01		                   MOV   GRAPHICS_FLAG,TEXT_MODE     ; yes...set text flag..                       ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-35


				AN000;
				                .ENDIF                               ;                                             ;
				AN000;
				             .ENDIF                                  ;                                             ;
				AN000;
 049A                        2	$l175: 
				
 049A  F6 06 000C R 01		              test   In_Generic_IOCTL_Flag, I_AM_IN_NOW ;AN010;
				             .if z   AND                             ;AN010;
 049F  75 11                 5						jnz $l182 
				             .if <Graphics_Flag EQ TEXT_MODE> AND    ;
 04A1  80 3E 006E R 01       3						cmp Graphics_Flag,TEXT_MODE 
 04A6  75 0A                 6						jne $l182 
				             .if <Switch_L EQ 1>                     ;AN010;
 04A8  80 3E 0000 E 01       3						cmp Switch_L,1 
 04AD  75 03                 6						jne $l182 
 04AF  E8 023C R		                  call  DO_ROWS                      ;AN010;
				             .endif                                  ;AN010;
 04B2                        2	$l182: 
				
				;AN004;The following has been taken out!
				;AN004;              .IF <REQ_TXT_LENGTH NE DEFAULT_LENGTH> ; 25 lines active?                      
				       ;AN000;
				;AN004;                MOV    AX,DISPLAY_CHECK              ; is DISPLAY.SYS there?                 
				       ;AN000;
				;AN004;                INT    2FH                           ;                                       
				       ;AN000;
				;AN004;                .IF <AL NE INSTALLED> OR             ; if not installed or..                 
				       ;AN000;
				;AN004;                MOV    AX,CHECK_ACTIVE               ; if a code page has not..              
				       ;AN000;
				;AN004;                INT    2FH                           ; been selected then..                  
				       ;AN000;
				;AN004;                .IF C                                ;                                       
				       ;AN000;
				;AN004;                  .IF <GRAPHICS_FLAG EQ TEXT_MODE>   ; is this a text mode?                  
				       ;AN000;
				;AN004;                    CALL   ROM_LOAD_8X8              ; yes..load ROM 8x8 character set.      
				       ;AN000;
				;AN004;                  .ENDIF                             ;                                       
				       ;AN000;
				;AN004;                .ENDIF                               ;                                       
				       ;AN000;
				;AN004;              .ENDIF                                 ;                                       
				       ;AN000;
				;AN004;Instead, for each SET mode function int 10h function call, if it is not
				;AN004;issued by ANSI GET_IOCTL and SET_IOCTL procedure themselves, we assume
				;AN004;that the APPS, which usually does not know the ANSI GET_IOCTL/SET_IOCTL
				;AN004;interfaces, intend to change the screen mode.  In this case, ANSI is
				;AN004;kind enough to call GET_IOCTL and SET_IOCTL function call for themselves.
				
 04B2  58			              POP    AX                              ;                                             ;
				AN000;
 04B3  5B			              POP    BX                              ;                                             ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-36


				AN000;
 04B4  59			              POP    CX                              ;                                             ;
				AN000;
 04B5  5A			              POP    DX                              ;                                             ;
				AN000;
 04B6  5F			              POP    DI                              ;                                             ;
				AN000;
 04B7  5E			              POP    SI                              ;                                             ;
				AN000;
 04B8  1F			              POP    DS                              ;                                             ;
				AN000;
 04B9  07			              pop    es                              ;AN007;
 04BA  5D			              pop    bp                              ;AN007;
				           .ENDIF                                    ;                                             ;
				AN000;
 04BB                        2	$l159: 
 04BB  CF			            IRET                                     ;                                             ;
				AN000;
 04BC				INT10_COM  ENDP
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: INT2F_COM
				;
				; FUNCTION:
				; THIS IS THE INTERRUPT 2FH HANDLER TO CAPTURE THE FOLLOWING FUNCTIONS:
				;
				;   AX=1A00H INSTALL REQUEST. ANSI WILL RETURN AL=FFH IF LOADED.
				;
				;   AH=1A01H THIS IS THE INT2FH INTERFACE TO THE GENERIC IOCTL.
				;      NOTE: THE GET CHARACTERISTICS FUNCTION CALL WILL RETURN
				;            THE REQ_TXT_LENGTH IN THE BUFFER AS OPPOSED TO
				;            THE ACTUAL HARDWARE SCREEN_LENGTH
				;   Ax=1A02h This is an information passing from DISPLAY.SYS about
				;            the INT 10h, SET MODE call.
				;
				; AT ENTRY:
				;
				; AT EXIT:
				;    NORMAL:
				;
				;    ERROR:
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 04BC				INT2F_COM  PROC   NEAR                                                                             ;
				AN000;
 04BC  FB			           STI                                  ;                                                  ;
				AN000;
				           .IF <AH NE MULT_ANSI> OR             ; is this for ANSI?                                ;
				AN000;
 04BD  80 FC 1A              3						cmp AH,MULT_ANSI 
 04C0  75 04                 5						jNE $l187 
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-37


				;           .IF <AL GT IOCTL_2F>                 ;                                                  
				;AN000;
				           .IF <AL GT DA_INFO_2F>               ;AN004;=2h
 04C2  3C 02                 3						cmp AL,DA_INFO_2F 
 04C4  7E 05                 6						jng $l185 
 04C6                        3	$l187: 
 04C6  2E: FF 2E 0064 R		             JMP    DWORD PTR CS:ROM_INT2F      ; no....jump to old INT2F                          ;
				AN000;
				           .ENDIF                               ;                                                  ;
				AN000;
 04CB                        2	$l185: 
				           .SELECT                              ;                                                  ;
				AN000;
				             .WHEN <AL EQ INSTALL_CHECK> NEAR   ; if install check then..                          ;
				AN000;
 04CB  3C 00                 3						cmp AL,INSTALL_CHECK 
 04CD  75 09                 6						jne $l189 
 04CF  90                    6					nop 
 04D0  90                    6					nop 
 04D1  90                    6					nop 
 04D2  B0 FF			               MOV     AL,INSTALLED             ; load value to indicate installed                 ;
				AN000;
 04D4  F8			               CLC                              ; clear error flag.                                ;
				AN000;
				;             .WHEN <AL EQ IOCTL_2F>             ; request for IOCTL?                               
				;AN000;
				             .WHEN <AL BE DA_INFO_2F> NEAR      ;AN004;IOCTL or INFO passing?
 04D5  E9 058D R             3						jmp $l188 
 04D8                        2	$l189: 
 04D8  3C 02                 3						cmp AL,DA_INFO_2F 
 04DA  76 03                 5						jBE $+5 
 04DC  E9 058D R             5						jmp $l188 
 04DF  55			               PUSH   BP                        ;                                                  ;
				AN000;
 04E0  50			               PUSH   AX                        ; s                                                ;
				AN000;
 04E1  51			               PUSH   CX                        ;  a                                               ;
				AN000;
 04E2  52			               PUSH   DX                        ;   v                                              ;
				AN000;
 04E3  1E			               PUSH   DS                        ;    e  r                                          ;
				AN000;
 04E4  06			               PUSH   ES                        ;        e                                         ;
				AN000;
 04E5  57			               PUSH   DI                        ;         g                                        ;
				AN000;
 04E6  56			               PUSH   SI                        ;          s.                                      ;
				AN000;
 04E7  53			               PUSH   BX                        ;                                                  ;
				AN000;
 04E8  1E			               PUSH   DS                        ; load ES with DS (for call)                       ;
				AN000;
 04E9  07			               POP    ES                        ;                                                  ;
				AN000;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-38


 04EA  8B FA			               MOV    DI,DX                     ; load DI with DX (for call)                       ;
				AN000;
 04EC  0E			               PUSH   CS                        ; setup local addressability                       ;
				AN000;
 04ED  1F			               POP    DS                        ;                                                  ;
				AN000;
				              .IF <AL EQ IOCTL_2F>              ;IOCTL request
 04EE  3C 01                 3						cmp AL,IOCTL_2F 
 04F0  75 4B                 6						jne $l194 
				                 .IF <CL EQ GET_FUNC>           ; get function requested.                          ;
				AN000;
 04F2  80 F9 7F              3						cmp CL,GET_FUNC 
 04F5  75 36                 6						jne $l197 
 04F7  E8 00A5 R		                    CALL   GET_IOCTL            ;                                                  ;
				AN000;
				                   .IF NC AND                   ; if no error and...                               ;
				AN000;
 04FA  72 6D                 6						jc $l193 
				                   .IF <HDWR_FLAG GE E5151_ACTIVE> AND ; gt 25 lines supported and..               ;
				AN000;
 04FC  83 3E 0000 E 10       3						cmp HDWR_FLAG,E5151_ACTIVE 
 0501  7C 66                 5						jnGE $l193 
				                   .IF <[SI].D_MODE EQ TEXT_MODE> ; this is a text mode then..                     ;
				AN000;
 0503  80 7C 01 01           3						cmp [SI].D_MODE,TEXT_MODE 
 0507  75 60                 6						jne $l193 
				                     .if <cs:Switch_L EQ 1> OR                ;AN010;
 0509  2E: 80 3E 0000 E 01   3						cmp cs:Switch_L,1 
 050F  74 10                 6						je $l204 
				                     .if <cs:ANSI_SetMode_Call_Flag NE 1> OR  ;AN008; if not originated by ANSI thru
				. AH=0, INT10,
 0511  2E: 80 3E 0071 R 01   3						cmp cs:ANSI_SetMode_Call_Flag,1 
 0517  75 08                 5						jNE $l204 
				                     .if <cs:Display_Loaded_Before_me NE 1>   ;AN008;  or Display.sys not loaded bef
				ore ANSI,
 0519  2E: 80 3E 0070 R 01   3						cmp cs:Display_Loaded_Before_me,1 
 051F  74 08                 6						je $l202 
 0521                        3	$l204: 
 0521  8B 1E 006A R		                         MOV    BX,REQ_TXT_LENGTH    ; then use REQ_TXT_LENGTH instead..           ;
				AN000;
 0525  26: 89 5D 10		                         MOV    ES:[DI].RP_ROWS,BX   ;
				                     .endif
 0529                        2	$l202: 
 0529  F8			                      CLC                         ;                                                 
				 ;AN000;
				                   .ENDIF                         ;                                                 
				 ;AN000;
				                 .ELSEIF <CL EQ SET_FUNC>         ;                                                 
				 ;AN000;
 052A  EB 3D                 3						jmp short $l193 
 052C  90                    3						nop 
 052D                        2	$l197: 
 052D  80 F9 5F              3						cmp CL,SET_FUNC 
 0530  75 05                 6						jne $l205 
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-39


 0532  E8 0119 R		                    CALL   SET_IOCTL              ; set function requested.                         
				 ;AN000;
				                 .ELSE                            ; invalid function...                             
				 ;AN000;
 0535  EB 32                 3						jmp short $l193 
 0537                        2	$l205: 
 0537  B8 0001			                    MOV    AX,INVALID_FUNC        ; load error and...                               
				 ;AN000;
 053A  F9			                    STC                           ; set error flag.                                 
				 ;AN000;
				                 .ENDIF                           ;                                                 
				 ;AN000;
				              .ELSE                               ;AN004;Info. passing
 053B  EB 2C                 3						jmp short $l193 
 053D                        2	$l194: 
				                 .IF <ES:[DI].DA_INFO_LEVEL EQ 0> ;AN004; 0 = DA_SETMODE_FLAG request.
 053D  26: 80 3D 00          3						cmp ES:[DI].DA_INFO_LEVEL,0 
 0541  75 17                 6						jne $l210 
				                   .IF  <ES:[DI].DA_SETMODE_FLAG EQ 1>                         ;AN004;
 0543  26: 80 7D 01 01       3						cmp ES:[DI].DA_SETMODE_FLAG,1 
 0548  75 08                 6						jne $l213 
 054A  2E: 80 0E 000C R 02	                        or cs:In_Generic_IOCTL_Flag, SET_MODE_BY_DISPLAY       ;AN004;Turn the flag 
				on
				                   .ELSE                                                       ;AN004;
 0550  EB 16                 3						jmp short $l209 
 0552                        2	$l213: 
 0552  2E: 80 26 000C R FD	                        and cs:In_Generic_IOCTL_Flag, not SET_MODE_BY_DISPLAY  ;AN004;Turn the flag 
				off
				                   .ENDIF                                                      ;AN004;
				                 .ELSE
 0558  EB 0E                 3						jmp short $l209 
 055A                        2	$l210: 
				                   .IF <ES:[DI].DA_INFO_LEVEL EQ 1>        ;AN011; 1 = DA_OPTION_L_STATE query
 055A  26: 80 3D 01          3						cmp ES:[DI].DA_INFO_LEVEL,1 
 055E  75 08                 6						jne $l209 
 0560  2E: A0 0000 E		                        mov al, cs:[Switch_L]              ;AN011;
 0564  26: 88 45 02		                        mov es:[di].DA_OPTION_L_STATE, al  ;AN011;
				                   .ENDIF
				                 .ENDIF                                                        ;AN004;
 0568                        2	$l209: 
 0568  F8			                  clc                           ;AN004;clear carry. There is no Error in DOS 4.00 fo
				r this call.
				              .ENDIF
 0569                        2	$l193: 
 0569  5B			               POP    BX                        ; restore all..                                    ;
				AN000;
 056A  5E			               POP    SI                        ;                                                  ;
				AN000;
 056B  5F			               POP    DI                        ;   registers except..                             ;
				AN000;
 056C  07			               POP    ES                        ;                                                  ;
				AN000;
 056D  1F			               POP    DS                        ;     BP.                                          ;
				AN000;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-40


 056E  5A			               POP    DX                        ;                                                  ;
				AN000;
 056F  59			               POP    CX                        ;                                                  ;
				AN000;
 0570  50			               PUSH   AX                        ; save error condition                             ;
				AN000;
 0571  8B EC			               MOV    BP,SP                     ; setup frame pointer                              ;
				AN000;
 0573  8B 46 0A			               MOV    AX,[BP+10]                ; load stack flags                                 ;
				AN000;
				               .IF NC                           ; carry set?..                                     ;
				AN000;
 0576  72 0C                 6						jc $l221 
 0578  25 FFFE			                 AND    AX,NOT_CY               ; no.. set carry off.                              ;
				AN000;
 057B  89 46 0A			                 MOV    [BP+10],AX              ; put back on stack.                               ;
				AN000;
 057E  58			                 POP    AX                      ; remove error flag from stack                     ;
				AN000;
 057F  58			                 POP    AX                      ; no error so bring back function call             ;
				AN000;
 0580  86 E0			                 XCHG   AH,AL                   ; exchange to show that ANSI present               ;
				AN000;
				               .ELSE                            ;                                                  ;
				AN000;
 0582  EB 08                 3						jmp short $l220 
 0584                        2	$l221: 
 0584  0D 0001			                 OR     AX,CY                   ; yes...set carry on.                              ;
				AN000;
 0587  89 46 0A			                 MOV    [BP+10],AX              ; put back on stack.                               ;
				AN000;
 058A  58			                 POP    AX                      ; restore error flag                               ;
				AN000;
 058B  5D			                 POP    BP                      ; pop off saved value of AX (destroyed)            ;
				AN000;
				               .ENDIF                           ;                                                  ;
				AN000;
 058C                        2	$l220: 
 058C  5D			               POP    BP                        ; restore final register.                          ;
				AN000;
				           .ENDSELECT                           ;                                                  ;
				AN000;
 058D                        2	$l188: 
 058D  CF			ABORT:     IRET                                 ;                                                  ;
				AN000;
 058E				INT2F_COM  ENDP                                                                                    ;
				AN000;
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: MAP_DOWN
				;
				; FUNCTION:
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-41


				; THIS PROCEDURE MAPS THE CURSOR START (END) POSITION FROM A 14 PEL
				; BOX SIZE TO AN 8 PEL BOX SIZE.
				;
				; AT ENTRY: AL HAS THE CURSOR START (END) TO BE MAPPED.
				;
				; AT EXIT:
				;    NORMAL: AL CONTAINS THE MAPPED POSITION FOR CURSOR START (END)
				;
				;    ERROR: N/A
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 058E				MAP_DOWN   PROC   NEAR                                                                             ;
				AN000;
 058E  53			           PUSH   BX                   ;                                                           ;
				AN000;
 058F  32 E4			           XOR    AH,AH                ; clear upper byte of cursor position                       ;
				AN000;
 0591  B3 08			           MOV    BL,EIGHT             ; multiply by current box size.                             ;
				AN000;
 0593  52			           PUSH   DX                   ;    al     x                                               ;
				AN000;
 0594  F6 E3			           MUL    BL                   ;   ---- = ---                                              ;
				AN000;
 0596  5A			           POP    DX                   ;    14     8                                               ;
				AN000;
 0597  B3 0E			           MOV    BL,FOURTEEN          ;                                                           ;
				AN000;
 0599  F6 F3			           DIV    BL                   ; divide by box size expected.                              ;
				AN000;
 059B  5B			           POP    BX                   ;                                                           ;
				AN000;
 059C  C3			           RET                         ;                                                           ;
				AN000;
 059D				MAP_DOWN   ENDP
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: SET_VIDEO_MODE
				;
				; FUNCTION:
				; THIS PROCEDURE SETS THE VIDEO MODE SPECIFIED IN DS:[SI].V_MODE.
				;
				; AT ENTRY: DS:SI.V_MODE CONTAINS MODE NUMBER
				;
				; AT EXIT:
				;    NORMAL: MODE SET
				;
				;    ERROR: N/A
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 059D				SET_VIDEO_MODE PROC   NEAR                                                                         ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-42


				AN000;
				            .if <BIT cs:In_Generic_IOCTL_Flag NAND CALLED_BY_INT10COM> ;AN009;
 059D  2E: F6 06 000C R 04   3						test cs:In_Generic_IOCTL_Flag,CALLED_BY_INT10COM 
 05A3  75 3C                 6						jnz $l224 
 05A5  8A 04			               MOV    AL,[SI].V_MODE             ; ..issue set mode                                ;
				AN000;
				               .IF <BIT HDWR_FLAG AND LCD_ACTIVE> OR ; is this the LCD?                            ;
				AN000;
 05A7  F7 06 0000 E 0001     3						test HDWR_FLAG,LCD_ACTIVE 
 05AD  75 08                 6						jnz $l229 
				               .IF <BIT HDWR_FLAG AND VGA_ACTIVE> ; or VGA (done for BRECON card)                  ;
				AN000;
 05AF  F7 06 0000 E 0080     3						test HDWR_FLAG,VGA_ACTIVE 
 05B5  74 26                 6						jz $l227 
 05B7                        3	$l229: 
 05B7  1E			                 PUSH   DS                       ; yes...                                          ;
				AN000;
 05B8  8A D8			                 MOV    BL,AL                    ; save mode                                       ;
				AN000;
 05BA  B8 0040			                 MOV    AX,ROM_BIOS              ;                                                 ;
				AN000;
 05BD  8E D8			                 MOV    DS,AX                    ; get equipment status flag..                     ;
				AN000;
 05BF  A1 0010			                 MOV    AX,DS:[EQUIP_FLAG]       ;                                                 ;
				AN000;
 05C2  25 FFCF			                 AND    AX,INIT_VID_MASK         ; clear initial video bits..                      ;
				AN000;
				                 .IF <BL EQ MODE7> OR            ; are we setting mono?                            ;
				AN000;
 05C5  80 FB 07              3						cmp BL,MODE7 
 05C8  74 05                 6						je $l232 
				                 .IF <BL EQ MODE15>              ;                                                 ;
				AN000;
 05CA  80 FB 0F              3						cmp BL,MODE15 
 05CD  75 05                 6						jne $l231 
 05CF                        3	$l232: 
 05CF  0D 0030			                   OR    AX,LCD_MONO_MODE        ; yes...set bits as mono                          ;
				AN000;
				                 .ELSE                           ;                                                 ;
				AN000;
 05D2  EB 03                 3						jmp short $l230 
 05D4                        2	$l231: 
 05D4  0D 0020			                   OR    AX,LCD_COLOR_MODE       ; no...set bits as color                          ;
				AN000;
				                 .ENDIF                          ;                                                 ;
				AN000;
 05D7                        2	$l230: 
 05D7  A3 0010			                 MOV    DS:[EQUIP_FLAG],AX       ; replace updated flag.                           ;
				AN000;
 05DA  8A C3			                 MOV    AL,BL                    ; restore mode.                                   ;
				AN000;
 05DC  1F			                 POP    DS                       ;                                                 ;
				AN000;
				               .ENDIF                            ;                                                 ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-43


				AN000;
 05DD                        2	$l227: 
 05DD  B4 00			               MOV    AH,SET_MODE                ; set mode                                        ;
				AN000;
 05DF  CD 10			               INT    10H                                                                          ;
				AN000;
				            .endif                               ;AN009;
 05E1                        2	$l224: 
 05E1  C3			               RET                                                                                 ;
				AN000;
 05E2				SET_VIDEO_MODE ENDP                                                                                ;
				AN000;
				
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: ROM_LOAD_8X8
				;
				; FUNCTION:
				; THIS PROCEDURE LOADS THE ROM 8X8 CHARACTER SET AND ACTIVATES BLOCK=0
				; FONT.
				;
				; AT ENTRY:
				;
				; AT EXIT:
				;    NORMAL: 8X8 ROM CHARACTER SET LOADED
				;
				;    ERROR: N/A
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 05E2				ROM_LOAD_8X8 PROC   NEAR                                                                           ;
				AN000;
 05E2  B8 1112			             MOV    AX,LOAD_8X8              ; load 8x8 ROM font                                   ;
				AN000;
 05E5  32 DB			             XOR    BL,BL                    ;                                                     ;
				AN000;
 05E7  9C			             PUSHF                                                                                 ;
				AN000;
 05E8  2E: FF 1E 0060 R		             CALL   DWORD PTR CS:ROM_INT10                                                         ;
				AN000;
 05ED  B8 1103			             MOV    AX,SET_BLOCK_0           ; activate block = 0                                  ;
				AN000;
 05F0  32 DB			             XOR    BL,BL                                                                          ;
				AN000;
 05F2  9C			             PUSHF                                                                                 ;
				AN000;
 05F3  2E: FF 1E 0060 R		             CALL   DWORD PTR CS:ROM_INT10                                                         ;
				AN000;
 05F8  C3			             RET                                                                                   ;
				AN000;
 05F9				ROM_LOAD_8X8 ENDP                                                                                  ;
				AN000;
				                                                                                                   ;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-44


				AN000;
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;
				; PROCEDURE_NAME: CHECK_FOR_DISPLAY
				;
				; FUNCTION:
				; THIS PROCEDURE CHECKS TO SEE IF WE DISPLAY.SYS IS THERE, AND IF
				; IT IS..IT HAS THE REQUIRED FONT.
				;
				; AT ENTRY: AX - DESIRED SCREEN LENGTH
				;
				; AT EXIT:
				;    NORMAL: CARRY CLEAR IF ALL OKAY
				;
				;    ERROR: CARRY SET IF FONT NOT AVAILABLE.
				;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				
 05F9				CHECK_FOR_DISPLAY PROC   NEAR                                                                      ;
				AN000;
				               .IF <AX EQ DEFAULT_LENGTH> OR   ; is it just 25 lines needed?                       ;
				AN000;
 05F9  3D 0019               3						cmp AX,DEFAULT_LENGTH 
 05FC  74 10                 6						je $l236 
 05FE  B8 AD00			               MOV    AX,DISPLAY_CHECK         ;                                                   ;
				AN000;
 0601  CD 2F			               INT    2FH                      ;                                                   ;
				AN000;
				               .IF <AL NE INSTALLED> OR        ; or is DISPLAY.SYS not there?                      ;
				AN000;
 0603  3C FF                 3						cmp AL,INSTALLED 
 0605  75 07                 5						jNE $l236 
 0607  B8 AD10			               MOV    AX,CHECK_FOR_FONT        ;                                                   ;
				AN000;
 060A  CD 2F			               INT    2FH                      ; or if it is does it have the..                    ;
				AN000;
				               .IF NC                          ; 8X8 font then.                                    ;
				AN000;
 060C  72 03                 6						jc $l235 
 060E                        3	$l236: 
 060E  F8			                 CLC                           ; clear carry                                       ;
				AN000;
				               .ELSE                           ;                                                   ;
				AN000;
 060F  EB 01                 3						jmp short $l234 
 0611                        2	$l235: 
 0611  F9			                 STC                           ; no font...set carry                               ;
				AN000;
				               .ENDIF                          ;                                                   ;
				AN000;
 0612                        2	$l234: 
 0612  C3			               RET                             ;                                                   ;
				AN000;
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Page     1-45


 0613				CHECK_FOR_DISPLAY ENDP
				
 0613				CODE        ENDS
				            END

Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     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

BUF_DATA . . . . . . . . . . . .  	000C	0006
  DEV_HDRO . . . . . . . . . . .  	0000
  DEV_HDRS . . . . . . . . . . .  	0002
  CON_STRAO  . . . . . . . . . .  	0004
  CON_STRAS  . . . . . . . . . .  	0006
  CON_INTRO  . . . . . . . . . .  	0008
  CON_INTRS  . . . . . . . . . .  	000A
DA_INFO_PACKET . . . . . . . . .  	0003	0003
  DA_INFO_LEVEL  . . . . . . . .  	0000
  DA_SETMODE_FLAG  . . . . . . .  	0001
  DA_OPTION_L_STATE  . . . . . .  	0002
DHS  . . . . . . . . . . . . . .  	0012	0006
  DH_NEXTO . . . . . . . . . . .  	0000
  DH_NEXTS . . . . . . . . . . .  	0002
  DH_STRAO . . . . . . . . . . .  	0006
  DH_INTRO . . . . . . . . . . .  	0008
  DH_NAME  . . . . . . . . . . .  	000A
INFO_BLOCK . . . . . . . . . . .  	0040	0009
  STATIC_ADDRESS . . . . . . . .  	0000
  ACTIVE_DISPLAY . . . . . . . .  	0025
  ALT_DISPLAY  . . . . . . . . .  	0026
  CURRENT_SCANS  . . . . . . . .  	002A
  MISC_INFO  . . . . . . . . . .  	002D
INIT_REQ_HDR . . . . . . . . . .  	0017	0006
  MAJ_FUNC . . . . . . . . . . .  	000D
  MIN_FUNC . . . . . . . . . . .  	000E
  IOCTL_SI . . . . . . . . . . .  	000F
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Symbols-2


  IOCTL_DI . . . . . . . . . . .  	0011
  REQ_PCKT_PTR . . . . . . . . .  	0013
MODE_TABLE . . . . . . . . . . .  	000D	0008
  V_MODE . . . . . . . . . . . .  	0000
  D_MODE . . . . . . . . . . . .  	0001
  RESERVED_BYTE  . . . . . . . .  	0002
  COLORS . . . . . . . . . . . .  	0003
  SCR_WIDTH  . . . . . . . . . .  	0005
  SCR_LENGTH . . . . . . . . . .  	0007
  SCR_COLS . . . . . . . . . . .  	0009
  SCR_ROWS . . . . . . . . . . .  	000B
REQ_PCKT . . . . . . . . . . . .  	0012	000B
  INFO_LEVEL . . . . . . . . . .  	0000
  DATA_LENGTH  . . . . . . . . .  	0002
  RP_FLAGS . . . . . . . . . . .  	0004
  RP_MODE  . . . . . . . . . . .  	0006
  RESERVED2  . . . . . . . . . .  	0007
  RP_COLORS  . . . . . . . . . .  	0008
  RP_WIDTH . . . . . . . . . . .  	000A
  RP_LENGTH  . . . . . . . . . .  	000C
  RP_COLS  . . . . . . . . . . .  	000E
  RP_ROWS  . . . . . . . . . . .  	0010
RESULT_STRUC . . . . . . . . . .  	0008	0004
  RESULT_TYPE  . . . . . . . . .  	0000
  RES_SYN_PTR  . . . . . . . . .  	0002
  RES_PTR  . . . . . . . . . . .  	0004
SCAN_LINE_STR  . . . . . . . . .  	0004	0003
  NUM_LINES  . . . . . . . . . .  	0000
  REP_1BH  . . . . . . . . . . .  	0002
  REP_12H  . . . . . . . . . . .  	0003
STATIC_BLOCK . . . . . . . . . .  	0008	0002
  SCAN_TEXT  . . . . . . . . . .  	0007
SUB_STRUC  . . . . . . . . . . .  	0006	0003
  SUB_PTR_O  . . . . . . . . . .  	0002
  SUB_PTR_S  . . . . . . . . . .  	0004
SYS_ID . . . . . . . . . . . . .  	0003	0002
  MODEL_BYTE . . . . . . . . . .  	0002

Segments and Groups:

                N a m e         	Length	 Align	Combine Class

CODE . . . . . . . . . . . . . .  	0613	BYTE	PUBLIC	

Symbols:            

                N a m e         	Type	 Value	 Attr

ABORT  . . . . . . . . . . . . .  	L NEAR	058D	CODE	Global
ALT_PRT_SC . . . . . . . . . . .  	NUMBER	0020	
ALT_SELECT . . . . . . . . . . .  	NUMBER	0012	
ANSI_SETMODE_CALL_FLAG . . . . .  	L BYTE	0071	CODE
ARG_PTR  . . . . . . . . . . . .  		0012	

Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Symbols-3


BLINK_TOGGLE . . . . . . . . . .  	NUMBER	1003	

CALLED_BY_INT10COM . . . . . . .  	NUMBER	0004	
CGA_ACTIVE . . . . . . . . . . .  	NUMBER	0004	
CHECK_ACTIVE . . . . . . . . . .  	NUMBER	AD02	
CHECK_FOR_DISPLAY  . . . . . . .  	N PROC	05F9	CODE	Length = 001A
CHECK_FOR_FONT . . . . . . . . .  	NUMBER	AD10	
CMD_ERROR  . . . . . . . . . . .  	NUMBER	8000	
COLOR  . . . . . . . . . . . . .  	NUMBER	0000	
COLOR_ADDRESS  . . . . . . . . .  	NUMBER	B800	
CONFIG_ERRMSG  . . . . . . . . .  		0017	
CONPTR . . . . . . . . . . . . .  	TEXT  CS:[BX]		
CTL_FLAG . . . . . . . . . . . .  	N PROC	02AA	CODE	Length = 0033
CURSOR_FLAG  . . . . . . . . . .  	NUMBER	0087	
CY . . . . . . . . . . . . . . .  	NUMBER	0001	

DA_INFO_2F . . . . . . . . . . .  	NUMBER	0002	
DEFAULT_LENGTH . . . . . . . . .  	NUMBER	0019	
DISPLAY_CHECK  . . . . . . . . .  	NUMBER	AD00	
Display_Loaded_Before_Me . . . .  	L BYTE	0070	CODE	Global
DISPLAY_TYPE . . . . . . . . . .  	NUMBER	0003	
DONE . . . . . . . . . . . . . .  	NUMBER	0100	
DO_ROWS  . . . . . . . . . . . .  	N PROC	023C	CODE	Length = 0023
DRIVE_NUM  . . . . . . . . . . .  		0016	

E5151_ACTIVE . . . . . . . . . .  	NUMBER	0010	
E5153_ACTIVE . . . . . . . . . .  	NUMBER	0020	
E5154_ACTIVE . . . . . . . . . .  	NUMBER	0040	
EGA_INFO . . . . . . . . . . . .  	NUMBER	0010	
EIGHT  . . . . . . . . . . . . .  	NUMBER	0008	
END_ADDRESS_O  . . . . . . . . .  		000E	
END_ADDRESS_S  . . . . . . . . .  		0010	
EQUIP_FLAG . . . . . . . . . . .  	NUMBER	0010	
ERR1 . . . . . . . . . . . . . .  	L NEAR	0000	CODE	External
ERROR_FLAG . . . . . . . . . . .  	L BYTE	006F	CODE
EXT16_FLAG . . . . . . . . . . .  	NUMBER	0010	

FOUND  . . . . . . . . . . . . .  	NUMBER	0001	
FOURTEEN . . . . . . . . . . . .  	NUMBER	000E	
FUNC_CALL  . . . . . . . . . . .  	NUMBER	001B	
FUNC_INFO  . . . . . . . . . . .  	L 	0020	CODE	Global

GENERIC_IOCTL  . . . . . . . . .  	L NEAR	0072	CODE	Global
GET_FUNC . . . . . . . . . . . .  	NUMBER	007F	
GET_IOCTL  . . . . . . . . . . .  	N PROC	00A5	CODE	Length = 0074
GET_SEARCH . . . . . . . . . . .  	N PROC	0384	CODE	Length = 0026
GET_STATUS . . . . . . . . . . .  	NUMBER	0043	
GET_SUBFUNC  . . . . . . . . . .  	NUMBER	007F	
GET_SYS_ID . . . . . . . . . . .  	NUMBER	00C0	
GRAPHICS_FLAG  . . . . . . . . .  	L BYTE	006E	CODE	Global
GRAPHICS_MODE  . . . . . . . . .  	NUMBER	0002	

HDWR_FLAG  . . . . . . . . . . .  	V WORD	0000	CODE	External
HP . . . . . . . . . . . . . . .  	TEXT  DS:[SI]		
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Symbols-4



INIT_VID_MASK  . . . . . . . . .  	NUMBER	FFCF	
INSTALLED  . . . . . . . . . . .  	NUMBER	00FF	
INSTALL_CHECK  . . . . . . . . .  	NUMBER	0000	
INT10_COM  . . . . . . . . . . .  	N PROC	03D1	CODE	Global	Length = 00EB
INT10_HI . . . . . . . . . . . .  	NUMBER	0042	
INT10_LOW  . . . . . . . . . . .  	NUMBER	0040	
INT10_V_MODE . . . . . . . . . .  	L BYTE	000D	CODE
INT2F_COM  . . . . . . . . . . .  	N PROC	04BC	CODE	Global	Length = 00D2
INT2F_HI . . . . . . . . . . . .  	NUMBER	00BE	
INT2F_LOW  . . . . . . . . . . .  	NUMBER	00BC	
INTENSITY_FLAG . . . . . . . . .  	L WORD	0068	CODE
INT_BIT  . . . . . . . . . . . .  	NUMBER	0020	
INVALID_FLAGS  . . . . . . . . .  	NUMBER	FFFE	
INVALID_FUNC . . . . . . . . . .  	NUMBER	0001	
INVALID_PARM . . . . . . . . . .  	NUMBER	000A	
IN_GENERIC_IOCTL_FLAG  . . . . .  	L BYTE	000C	CODE
IOCTL_2F . . . . . . . . . . . .  	NUMBER	0001	
I_AM_IN_NOW  . . . . . . . . . .  	NUMBER	0001	

KBD_FLAG_3 . . . . . . . . . . .  	NUMBER	0096	

LCD_ACTIVE . . . . . . . . . . .  	NUMBER	0001	
LCD_COLOR_MODE . . . . . . . . .  	NUMBER	0020	
LCD_MODEL  . . . . . . . . . . .  	NUMBER	00F9	
LCD_MONO_MODE  . . . . . . . . .  	NUMBER	0030	
LEFT_ASCIIZ  . . . . . . . . . .  	NUMBER	0010	
LOAD_8X8 . . . . . . . . . . . .  	NUMBER	1112	

MAP_DOWN . . . . . . . . . . . .  	N PROC	058E	CODE	Length = 000F
MAX_SCANS  . . . . . . . . . . .  	L BYTE	006D	CODE	Global
MAX_VIDEO_TAB_NUM  . . . . . . .  	NUMBER	0000		Communal
MCGA_ACTIVE  . . . . . . . . . .  	NUMBER	0008	
MOD30_COLOR  . . . . . . . . . .  	NUMBER	000C	
MOD30_MONO . . . . . . . . . . .  	NUMBER	000B	
MODE13 . . . . . . . . . . . . .  	NUMBER	000D	
MODE15 . . . . . . . . . . . . .  	NUMBER	000F	
MODE19 . . . . . . . . . . . . .  	NUMBER	0013	
MODE7  . . . . . . . . . . . . .  	NUMBER	0007	
MONOCHROME . . . . . . . . . . .  	NUMBER	0001	
MONO_ACTIVE  . . . . . . . . . .  	NUMBER	0002	
MONO_ADDRESS . . . . . . . . . .  	NUMBER	B000	
MULT_ANSI  . . . . . . . . . . .  	NUMBER	001A	
MY_IOCTL_REQ_PACKET  . . . . . .  	L 	000E	CODE

NAME_LEN . . . . . . . . . . . .  	NUMBER	0008	
NHD  . . . . . . . . . . . . . .  	TEXT  ES:[DI]		
NINE . . . . . . . . . . . . . .  	NUMBER	0009	
NOT_AVAILABLE  . . . . . . . . .  	NUMBER	000C	
NOT_CY . . . . . . . . . . . . .  	NUMBER	FFFE	
NOT_FOUND  . . . . . . . . . . .  	NUMBER	0000	
NOT_SUPPORTED  . . . . . . . . .  	NUMBER	000A	
NO_OPERATION . . . . . . . . . .  	L NEAR	0000	CODE	External
NUM_ROWS . . . . . . . . . . . .  	NUMBER	0084	
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Symbols-5


NUM_UNITS  . . . . . . . . . . .  		000D	

OFF  . . . . . . . . . . . . . .  	NUMBER	0000	
ON . . . . . . . . . . . . . . .  	NUMBER	0001	
ONE  . . . . . . . . . . . . . .  	NUMBER	0001	

PROCESS_NORMAL . . . . . . . . .  	N PROC	01D3	CODE	Length = 0031
PROCESS_VGA  . . . . . . . . . .  	N PROC	0204	CODE	Length = 0038
PS2_COLOR  . . . . . . . . . . .  	NUMBER	0008	
PS2_MONO . . . . . . . . . . . .  	NUMBER	0007	
PTRSAV . . . . . . . . . . . . .  	V DWORD	0000	CODE	External

RC_EOL . . . . . . . . . . . . .  	NUMBER	-0001	
RC_NO_ERROR  . . . . . . . . . .  	NUMBER	0000	
REQ_CRSR_POS . . . . . . . . . .  	NUMBER	0003	
REQ_TXT_LENGTH . . . . . . . . .  	L WORD	006A	CODE	Global
REQ_VID_MODE . . . . . . . . . .  	NUMBER	000F	
ROM_BIOS . . . . . . . . . . . .  	NUMBER	0040	
ROM_INT10  . . . . . . . . . . .  	L WORD	0060	CODE	Global
ROM_INT2F  . . . . . . . . . . .  	L WORD	0064	CODE	Global
ROM_LOAD_8X8 . . . . . . . . . .  	N PROC	05E2	CODE	Length = 0017

SCANS_AVAILABLE  . . . . . . . .  	NUMBER	0003	
SCAN_DESIRED . . . . . . . . . .  	L BYTE	006C	CODE
SCAN_LINES . . . . . . . . . . .  	V BYTE	0000	CODE	External
SCAN_LINE_TABLE  . . . . . . . .  	L BYTE	0000	CODE
SELECT_SCAN  . . . . . . . . . .  	NUMBER	0030	
SET_BLINK  . . . . . . . . . . .  	NUMBER	0001	
SET_BLOCK_0  . . . . . . . . . .  	NUMBER	1103	
SET_CTL_FLAG . . . . . . . . . .  	N PROC	02DD	CODE	Length = 001E
SET_CURSOR_CALL  . . . . . . . .  	NUMBER	0001	
SET_CURSOR_EMUL  . . . . . . . .  	N PROC	03AA	CODE	Length = 0027
SET_FUNC . . . . . . . . . . . .  	NUMBER	005F	
SET_INTENSIFY  . . . . . . . . .  	NUMBER	0000	
SET_IOCTL  . . . . . . . . . . .  	N PROC	0119	CODE	Length = 00BA
SET_MODE . . . . . . . . . . . .  	NUMBER	0000	
SET_MODE_BY_DISPLAY  . . . . . .  	NUMBER	0002	
SET_SEARCH . . . . . . . . . . .  	N PROC	02FB	CODE	Length = 0089
SET_VIDEO_MODE . . . . . . . . .  	N PROC	059D	CODE	Length = 0045
SSTRING  . . . . . . . . . . . .  	NUMBER	0003	
SUB_SIZE . . . . . . . . . . . .  	NUMBER	000B	
Switch_L . . . . . . . . . . . .  	V BYTE	0000	CODE	External

TEST_LENGTH  . . . . . . . . . .  	N PROC	025F	CODE	Length = 004B
TEXT_MODE  . . . . . . . . . . .  	NUMBER	0001	
THREE  . . . . . . . . . . . . .  	NUMBER	0003	
TURN_OFF . . . . . . . . . . . .  	NUMBER	00FE	
TURN_ON  . . . . . . . . . . . .  	NUMBER	FF01	

UNKNOWN_CMD  . . . . . . . . . .  	NUMBER	8103	
UNLIMITED  . . . . . . . . . . .  	NUMBER	0000	
UNOCCUPIED . . . . . . . . . . .  	NUMBER	-0001	

VGA_ACTIVE . . . . . . . . . . .  	NUMBER	0080	
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Symbols-6


VIDEO_MASK . . . . . . . . . . .  	NUMBER	007F	
VIDEO_MODE_TABLE . . . . . . . .  	V BYTE	0000	CODE	External

$L1  . . . . . . . . . . . . . .  	L NEAR	009A	CODE
$L10 . . . . . . . . . . . . . .  	L NEAR	0118	CODE
$L101  . . . . . . . . . . . . .  	L NEAR	02D4	CODE
$L102  . . . . . . . . . . . . .  	L NEAR	02CF	CODE
$L105  . . . . . . . . . . . . .  	L NEAR	02F5	CODE
$L106  . . . . . . . . . . . . .  	L NEAR	02EE	CODE
$L109  . . . . . . . . . . . . .  	L NEAR	0306	CODE
$L11 . . . . . . . . . . . . . .  	L NEAR	00B8	CODE
$L110  . . . . . . . . . . . . .  	L NEAR	0370	CODE
$L113  . . . . . . . . . . . . .  	L NEAR	0327	CODE
$L116  . . . . . . . . . . . . .  	L NEAR	036A	CODE
$L12 . . . . . . . . . . . . . .  	L NEAR	00B2	CODE
$L126  . . . . . . . . . . . . .  	L NEAR	035E	CODE
$L138  . . . . . . . . . . . . .  	L NEAR	037C	CODE
$L139  . . . . . . . . . . . . .  	L NEAR	0378	CODE
$L142  . . . . . . . . . . . . .  	L NEAR	0387	CODE
$L143  . . . . . . . . . . . . .  	L NEAR	039B	CODE
$L145  . . . . . . . . . . . . .  	L NEAR	03A9	CODE
$L146  . . . . . . . . . . . . .  	L NEAR	03A8	CODE
$L147  . . . . . . . . . . . . .  	L NEAR	03A5	CODE
$L149  . . . . . . . . . . . . .  	L NEAR	03D0	CODE
$L15 . . . . . . . . . . . . . .  	L NEAR	00D1	CODE
$L152  . . . . . . . . . . . . .  	L NEAR	03CC	CODE
$L153  . . . . . . . . . . . . .  	L NEAR	03CA	CODE
$L156  . . . . . . . . . . . . .  	L NEAR	03E1	CODE
$L159  . . . . . . . . . . . . .  	L NEAR	04BB	CODE
$L160  . . . . . . . . . . . . .  	L NEAR	0424	CODE
$L162  . . . . . . . . . . . . .  	L NEAR	041B	CODE
$L169  . . . . . . . . . . . . .  	L NEAR	047F	CODE
$L172  . . . . . . . . . . . . .  	L NEAR	0478	CODE
$L175  . . . . . . . . . . . . .  	L NEAR	049A	CODE
$L179  . . . . . . . . . . . . .  	L NEAR	0495	CODE
$L18 . . . . . . . . . . . . . .  	L NEAR	00ED	CODE
$L182  . . . . . . . . . . . . .  	L NEAR	04B2	CODE
$L185  . . . . . . . . . . . . .  	L NEAR	04CB	CODE
$L187  . . . . . . . . . . . . .  	L NEAR	04C6	CODE
$L188  . . . . . . . . . . . . .  	L NEAR	058D	CODE
$L189  . . . . . . . . . . . . .  	L NEAR	04D8	CODE
$L19 . . . . . . . . . . . . . .  	L NEAR	00E8	CODE
$L193  . . . . . . . . . . . . .  	L NEAR	0569	CODE
$L194  . . . . . . . . . . . . .  	L NEAR	053D	CODE
$L197  . . . . . . . . . . . . .  	L NEAR	052D	CODE
$L2  . . . . . . . . . . . . . .  	L NEAR	0087	CODE
$L202  . . . . . . . . . . . . .  	L NEAR	0529	CODE
$L204  . . . . . . . . . . . . .  	L NEAR	0521	CODE
$L205  . . . . . . . . . . . . .  	L NEAR	0537	CODE
$L209  . . . . . . . . . . . . .  	L NEAR	0568	CODE
$L210  . . . . . . . . . . . . .  	L NEAR	055A	CODE
$L213  . . . . . . . . . . . . .  	L NEAR	0552	CODE
$L22 . . . . . . . . . . . . . .  	L NEAR	0114	CODE
$L220  . . . . . . . . . . . . .  	L NEAR	058C	CODE
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Symbols-7


$L221  . . . . . . . . . . . . .  	L NEAR	0584	CODE
$L224  . . . . . . . . . . . . .  	L NEAR	05E1	CODE
$L227  . . . . . . . . . . . . .  	L NEAR	05DD	CODE
$L229  . . . . . . . . . . . . .  	L NEAR	05B7	CODE
$L230  . . . . . . . . . . . . .  	L NEAR	05D7	CODE
$L231  . . . . . . . . . . . . .  	L NEAR	05D4	CODE
$L232  . . . . . . . . . . . . .  	L NEAR	05CF	CODE
$L234  . . . . . . . . . . . . .  	L NEAR	0612	CODE
$L235  . . . . . . . . . . . . .  	L NEAR	0611	CODE
$L236  . . . . . . . . . . . . .  	L NEAR	060E	CODE
$L25 . . . . . . . . . . . . . .  	L NEAR	01BF	CODE
$L26 . . . . . . . . . . . . . .  	L NEAR	0153	CODE
$L27 . . . . . . . . . . . . . .  	L NEAR	0149	CODE
$L30 . . . . . . . . . . . . . .  	L NEAR	0162	CODE
$L33 . . . . . . . . . . . . . .  	L NEAR	01A9	CODE
$L34 . . . . . . . . . . . . . .  	L NEAR	01A6	CODE
$L36 . . . . . . . . . . . . . .  	L NEAR	0189	CODE
$L37 . . . . . . . . . . . . . .  	L NEAR	0186	CODE
$L38 . . . . . . . . . . . . . .  	L NEAR	0181	CODE
$L4  . . . . . . . . . . . . . .  	L NEAR	0097	CODE
$L41 . . . . . . . . . . . . . .  	L NEAR	01A0	CODE
$L51 . . . . . . . . . . . . . .  	L NEAR	01D2	CODE
$L52 . . . . . . . . . . . . . .  	L NEAR	01D1	CODE
$L55 . . . . . . . . . . . . . .  	L NEAR	0203	CODE
$L56 . . . . . . . . . . . . . .  	L NEAR	01E7	CODE
$L60 . . . . . . . . . . . . . .  	L NEAR	01FB	CODE
$L62 . . . . . . . . . . . . . .  	L NEAR	01F6	CODE
$L66 . . . . . . . . . . . . . .  	L NEAR	023B	CODE
$L67 . . . . . . . . . . . . . .  	L NEAR	0213	CODE
$L7  . . . . . . . . . . . . . .  	L NEAR	009F	CODE
$L71 . . . . . . . . . . . . . .  	L NEAR	0233	CODE
$L73 . . . . . . . . . . . . . .  	L NEAR	0225	CODE
$L77 . . . . . . . . . . . . . .  	L NEAR	025E	CODE
$L80 . . . . . . . . . . . . . .  	L NEAR	025A	CODE
$L82 . . . . . . . . . . . . . .  	L NEAR	0257	CODE
$L83 . . . . . . . . . . . . . .  	L NEAR	0272	CODE
$L84 . . . . . . . . . . . . . .  	L NEAR	0298	CODE
$L87 . . . . . . . . . . . . . .  	L NEAR	0292	CODE
$L90 . . . . . . . . . . . . . .  	L NEAR	028E	CODE
$L94 . . . . . . . . . . . . . .  	L NEAR	02A8	CODE
$L95 . . . . . . . . . . . . . .  	L NEAR	02A0	CODE
$L98 . . . . . . . . . . . . . .  	L NEAR	02D6	CODE
$LL10  . . . . . . . . . . . . .  	NUMBER	000A	
$LL101 . . . . . . . . . . . . .  	NUMBER	0065	
$LL105 . . . . . . . . . . . . .  	NUMBER	0069	
$LL116 . . . . . . . . . . . . .  	NUMBER	0074	
$LL138 . . . . . . . . . . . . .  	NUMBER	008A	
$LL145 . . . . . . . . . . . . .  	NUMBER	0091	
$LL149 . . . . . . . . . . . . .  	NUMBER	0095	
$LL152 . . . . . . . . . . . . .  	NUMBER	0098	
$LL156 . . . . . . . . . . . . .  	NUMBER	009C	
$LL159 . . . . . . . . . . . . .  	NUMBER	009F	
$LL162 . . . . . . . . . . . . .  	NUMBER	00A2	
$LL169 . . . . . . . . . . . . .  	NUMBER	00A9	
Microsoft (R) Macro Assembler Version 5.10                  5/17/24 09:43:47
ANSI Generic IOCTL Code                                     Symbols-8


$LL172 . . . . . . . . . . . . .  	NUMBER	00AC	
$LL175 . . . . . . . . . . . . .  	NUMBER	00AF	
$LL18  . . . . . . . . . . . . .  	NUMBER	0012	
$LL182 . . . . . . . . . . . . .  	NUMBER	00B6	
$LL185 . . . . . . . . . . . . .  	NUMBER	00B9	
$LL193 . . . . . . . . . . . . .  	NUMBER	00C1	
$LL202 . . . . . . . . . . . . .  	NUMBER	00CA	
$LL209 . . . . . . . . . . . . .  	NUMBER	00D1	
$LL22  . . . . . . . . . . . . .  	NUMBER	0016	
$LL220 . . . . . . . . . . . . .  	NUMBER	00DC	
$LL224 . . . . . . . . . . . . .  	NUMBER	00E0	
$LL227 . . . . . . . . . . . . .  	NUMBER	00E3	
$LL230 . . . . . . . . . . . . .  	NUMBER	00E6	
$LL234 . . . . . . . . . . . . .  	NUMBER	00EA	
$LL25  . . . . . . . . . . . . .  	NUMBER	0019	
$LL33  . . . . . . . . . . . . .  	NUMBER	0021	
$LL36  . . . . . . . . . . . . .  	NUMBER	0024	
$LL51  . . . . . . . . . . . . .  	NUMBER	0033	
$LL55  . . . . . . . . . . . . .  	NUMBER	0037	
$LL62  . . . . . . . . . . . . .  	NUMBER	003E	
$LL66  . . . . . . . . . . . . .  	NUMBER	0042	
$LL7 . . . . . . . . . . . . . .  	NUMBER	0007	
$LL73  . . . . . . . . . . . . .  	NUMBER	0049	
$LL77  . . . . . . . . . . . . .  	NUMBER	004D	
$LL80  . . . . . . . . . . . . .  	NUMBER	0050	
$LL94  . . . . . . . . . . . . .  	NUMBER	005E	
$LL98  . . . . . . . . . . . . .  	NUMBER	0062	
$NOPS  . . . . . . . . . . . . .  	NUMBER	0003	
@CPU . . . . . . . . . . . . . .  	TEXT  0101h		
@FILENAME  . . . . . . . . . . .  	TEXT  ioctl		
@VERSION . . . . . . . . . . . .  	TEXT  510		


   2140 Source  Lines
  39245 Total   Lines
    704 Symbols

  46222 + 155466 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
