mov bx, Handle ;handle of device
mov ch, Category ;device category
mov cl, 4Ah ;Select 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
Select Code Page (Function 440Ch Minor Code 4Ah) selects the code page used by the specified device. The code page must be in the list of prepared code pages for the device.
Handle
Identifies the device to set the 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 contains the identifier of the code page to be selected. 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 4Ch Start Code-Page Prepare
Function 440Ch Minor Code 4Dh End Code-Page Prepare
Function 440Ch Minor Code 6Ah Query Selected Code Page
Function 440Ch Minor Code 6Bh Query Code-Page Prepare List