mov bx, Handle ;handle of device
mov ch, Category ;device category
mov cl, 4Ch ;Start Code-Page Prepare
mov dx, seg PrepareIDs
mov ds, dx
mov dx, offset PrepareIDs ;ds:dx points to CPPREPARE structure
mov ax, 440Ch ;IOCTL for Character Device
int 21h
jc error_handler ;carry set means error
Start Code-Page Prepare (Function 440Ch Minor Code 4Ch) instructs a device driver to begin to prepare a new code-page list.
Handle
Identifies the device to set code pages 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 |
PrepareIDs
Points to a CPPREPARE structure that contains information for the new code-page list. The CPPREPARE structure has the following form:
CPPREPARE STRUC
cppFlags dw 0 ;flags (device-specific)
cppLength dw (CODEPAGE_IDS+1)*2 ;structure length, in bytes,
;excluding first two fields
cppIds dw CODEPAGE_IDS ;number of code pages in list
cppId dw CODEPAGE_IDS dup(?) ;array of code pages
CPPREPARE ENDS
For a full description of the CPPREPARE structure, see Chapter 6, “National Language Support.”
If the function is successful, the carry flag is clear. Otherwise, the carry flag is set.
After calling Start Code-Page Prepare, a program must write data defining the code-page fonts to the device driver by using Send Control Data to Character Device (Function 4403h). The code-page data is device-specific. The program must end the code-page preparation by using End Code-Page Prepare (Function 440Ch Minor Code 4Dh).
A program can instruct the device driver to set up the device with the most recently prepared code page by calling Start Code-Page Prepare with all code-page numbers set to 0FFFFh. This operation must be followed immediately with a call to End Code-Page Prepare (Function 440Ch Minor Code 4Dh).
Function 4403h Send Control Data to Character Device
Function 440Ch Minor Code 4Ah Select Code Page
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