mov bx, CodePageID ;code page to return sequence for
mov cx, 5 ;size of buffer (must be at least 5)
mov dx, CountryCode ;country code to return sequence for
mov di, seg Table
mov es, di
mov di, offset Table ;es:di points to buffer for ptr to sequence
mov ax, 6506h ;Get Collate Table
int 21h
jc error_handler ;carry set means error
Get Collate-Sequence Table (Function 6506h) returns the address of the collate-sequence table for the specified code page and country code. This table is a character array of 256 elements; each element specifies the sorting weight of the corresponding character. (The sorting weight is the value used to determine whether a character appears before or after another character in a sorted list.) Sorting weights and character values are not necessarily the same—for example, in a given character set, the sorting weights for the letters A and B might be 1 and 2, even though their character values are 65 and 66.
CodePageID
Identifies the code page to return the collate-sequence table for. This parameter can be one of the following values:
Value | Meaning |
437 | United States |
850 | Multilingual (Latin I) |
852 | Slavic (Latin II) |
860 | Portuguese |
863 | Canadian-French |
865 | Nordic |
If this parameter is 0FFFFh, MS-DOS returns information for the current code page.
CountryCode
Specifies the country code to return the collate-sequence table for. This parameter can be one of the following values:
Value | Meaning |
001 | United States |
002 | Canadian-French |
003 | Latin America |
031 | Netherlands |
032 | Belgium |
033 | France |
034 | Spain |
036 | Hungary |
038 | Yugoslavia |
039 | Italy |
041 | Switzerland |
042 | Czechoslovakia |
044 | United Kingdom |
045 | Denmark |
046 | Sweden |
047 | Norway |
048 | Poland |
049 | Germany |
055 | Brazil |
061 | International English |
351 | Portugal |
358 | Finland |
If this parameter is 0FFFFh, MS-DOS returns the table for the current country.
Table
Points to a buffer in which MS-DOS places the 8-bit identifier (06h) of the collate-sequence table and the 32-bit address (segment:offset) of the table. The buffer must be at least 5 bytes long.
If the function is successful, the carry flag is clear and the 32-bit address to the collate-sequence table is copied to the buffer pointed to by the Table parameter. 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 |
0002h | ERROR_FILE_NOT_FOUND |
This function returns 0001h (ERROR_INVALID_FUNCTION) if the buffer size specified in the CX register is less than 5.
This function returns 0002h (ERROR_FILE_NOT_FOUND) if MS-DOS cannot retrieve country information for the specified code page and country code.
The collate-sequence table starts with a 16-bit value that specifies the length of the table; the remainder of the table specifies the sorting weight for each character.
Function 38h Get/Set Country Information
Function 6501h Get Extended Country Information
Function 6601h Get Global Code Page
Function 6602h Set Global Code Page