mov bx, Handle ;handle of device
mov ch, 03h ;screen device category
mov cl, 5Fh ;Set 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
Set Display Mode (Function 440Ch Minor Code 5Fh) sets the display mode for the screen device.
Handle
Identifies the device to set the display mode for.
Mode
Points to a DISPLAYMODE structure that specifies the mode to set. The dmInfoLevel field must be 0 and the dmDataLength field must be 14. The 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.
Interrupt 2Fh Function 1A00h Get ANSI.SYS Installed State