mov bx, Handle ;handle of device
mov ch, 03h ;screen device category
mov cl, 7Fh ;Get Display Mode
mov dx, seg Mode
mov ds, dx
mov dx, offset Mode ;points to buffer for display mode
mov ax, 440Ch ;IOCTL for Character Device
int 21h
jc error_handler ;carry set means error
Get Display Mode (Function 440Ch Minor Code 7Fh) retrieves the display mode for the screen device.
Handle
Identifies the device to get the display mode for.
Mode
Points to a DISPLAYMODE structure that receives the display-mode information. Before the function is called, the dmInfoLevel field must be 0 and the dmDataLength field must be 14. The DISPLAYMODE structure has the following form:
DISPLAYMODE STRUC
dmInfoLevel db 0 ;information level (must be zero)
dmReserved1 db ? ;reserved
dmDataLength dw ? ;length of remaining data, in bytes
dmFlags dw ? ;control flags
dmMode db ? ;display mode
dmReserved2 db ? ;reserved
dmColors dw ? ;number of colors
dmWidth dw ? ;screen width, in pixels
dmLength dw ? ;screen length, in pixels
dmColumns dw ? ;columns
dmRows dw ? ;rows
DISPLAYMODE ENDS
For more information about the DISPLAYMODE structure, see Chapter 4, “Character Input and Output.”
If the function is successful, the carry flag is clear. Otherwise, the carry flag is set and the AX register contains an error value, which may be one of the following:
Value | Name |
0001h | ERROR_INVALID_FUNCTION |
0005h | ERROR_ACCESS_DENIED |
0006h | ERROR_INVALID_HANDLE |
The function returns 0001h (ERROR_INVALID_FUNCTION) if the ANSI.SYS driver has not been loaded.
Function 440Ch Minor Code 5Fh Set Display Mode
Interrupt 2Fh Function 1A00h Get ANSI.SYS Installed State