mov bx, Handle ;handle of device
mov ch, Category ;device category
mov cl, 6Ah ;Query Code Page
mov dx, seg CodePageID
mov ds, dx
mov dx, offset CodePageID ;ds:dx points to CODEPAGE structure
mov ax, 440Ch ;IOCTL for Character Device
int 21h
jc error_handler ;carry set means error
Query Selected Code Page (Function 440Ch Minor Code 6Ah) returns the currently selected code page for the specified device.
Handle
Identifies the device to return the selected code page for.
Category
Specifies the type of device. This parameter must be one of the following values:
Value | Device |
01h | Serial device |
03h | Console (screen) |
05h | Parallel printer |
CodePageID
Points to a CODEPAGE structure that receives the identifier for the selected code page. The CODEPAGE structure has the following form:
CODEPAGE STRUC
cpLength dw 2 ;structure size, excluding this field (always 2)
cpId dw ? ;code-page identifier
CODEPAGE ENDS
For a full description of the CODEPAGE structure, see Chapter 6, “National Language Support.”
If the function is successful, the carry flag is clear. Otherwise, the carry flag is set.
Function 440Ch Minor Code 4Ah Select Code Page
Function 440Ch Minor Code 4Ch Start Code-Page Prepare
Function 440Ch Minor Code 4Dh End Code-Page Prepare
Function 440Ch Minor Code 6Bh Query Code-Page Prepare List