Function 6501h Get Extended Country Information

mov bx, CodePageID ;code page to return info for

mov cx, InfoSize ;size of buffer for country info

mov dx, CountryCode ;country code to return info for

mov di, seg Information

mov es, dx

mov di, offset Information ;es:di points to EXTCOUNTRYINFO structure

mov ax, 6501h ;Get Extended Country Information

int 21h

jc error_handler ;carry set means error

Get Extended Country Information (Function 6501h) returns the country information that MS-DOS uses to control the keyboard and screen.

Parameters

CodePageID

Identifies the code page to return the country information 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 about the current code page for the keyboard/screen.

InfoSize

Specifies the size of the buffer for the country information. The buffer must be at least 5 bytes long.

CountryCode

Specifies the country code to return information 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 information about the current country.

Information

Points to a buffer that receives country information. The buffer consists of a single byte followed by an EXTCOUNTRYINFO structure. The EXTCOUNTRYINFO structure has the following form:

EXTCOUNTRYINFO STRUC

eciLength dw ? ;size of the structure, in bytes

eciCountryCode dw ? ;country code

eciCodePageID dw ? ;code-page identifier

eciDateFormat dw ? ;date format

eciCurrency db 5 dup (?) ;currency symbol (ASCIIZ)

eciThousands db 2 dup (?) ;thousands separator (ASCIIZ)

eciDecimal db 2 dup (?) ;decimal separator (ASCIIZ)

eciDateSep db 2 dup (?) ;date separator (ASCIIZ)

eciTimeSep db 2 dup (?) ;time separator (ASCIIZ)

eciBitField db ? ;currency format

eciCurrencyPlaces db ? ;places after decimal point

eciTimeFormat db ? ;12- or 24-hour format

eciCaseMap dd ? ;address of case-mapping routine

eciDataSep db 2 dup (?) ;data-list separator (ASCIIZ)

eciReserved db 10 dup (?) ;reserved

EXTCOUNTRYINFO ENDS

For a full description of the EXTCOUNTRYINFO structure, see Chapter 6, “National Language Support.”

Return Value

If the function is successful, the carry flag is clear and the country information is copied to the EXTCOUNTRYINFO structure. 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

Comments

This function returns 0001h (ERROR_INVALID_FUNCTION) if the value specified in InfoSize is less than 5. If the InfoSize value is greater than 5 but less than the size of the country information, the information is truncated and no error is returned.

This function returns 0002h (ERROR_FILE_NOT_FOUND) if MS-DOS cannot retrieve country information for the specified code page and country code.

See Also

Function 38h Get/Set Country Information
Function 6601h Get Global Code Page
Function 6602h Set Global Code Page