Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  Function 38H (decimal 56) allows DOS to adjust to different international
  currency and date format conventions. In DOS version 2, this function
  reports a very small set of country-dependent information. In DOS version
  3, function 38H reports a more detailed list of country-dependent items;
  in this version of DOS, a program can also change the country-dependent
  information with a call to function 38H.

  To get country-dependent information from DOS, call function 38H with
  DS:DX containing the address of a 32-byte buffer. (In DOS versions 3.0 and
  later, the size of the buffer must be 34 bytes.) Register AL must be set
  to 00H to get the current country information. For DOS versions 3.0 and
  later, register AL can also be set to a predefined country code. (The
  country code is the same 3-digit code used as the country's international
  telephone access code.) To specify a country code of 255 or greater, AL
  can be set to FFH (decimal 255), and the country code can be put into
  register BX.

  If the requested country code is invalid, DOS sets the carry flag (CF) and
  places an error code in AX. Otherwise, register BX contains the country
  code, and the buffer at DS:DX is filled in with the country-specific
  information shown in Figures 17-4 and 17-5.

  To set the current country code in DOS version 3, set DX equal to FFFFH
  and call function 38H with AL equal to the country code (or if the code is
  greater than 254, set AL equal to FFH and register BX equal to the country
  code).

  The country-dependent information is used by DOS utilities like DATE and
  TIME. A program can call function 38H to obtain the information DOS uses
  to configure itself for country-dependent conventions.

  The date format is an integer word whose value specifies the display
  format for the date. This word has three predefined values and three
  corresponding date formats. (See Figure 17-6.) Room is reserved so that
  others might be added in the future.

  The currency symbol is the symbol used in displaying an amount of money:
  In the United States, the currency symbol is a dollar sign ($); in the
  United Kingdom, it's the pound symbol (j); in Japan, it's the yen symbol
  (J). In DOS versions 2.0 and 2.1, the currency symbol can only be a single
  character, but in DOS version 3, a string up to four characters in length
  can be used. For example, one of the currency strings that could be used
  in DOS version 3.3 is DKR, which stands for Danish kroner.

    Offset           Size
  Hex      Dec       (bytes)  Description
  --------------------------------------------------------------------------
  00H      0          2       Date format
  02H      2          2       Currency symbol string (ASCIIZ format)
  04H      4          2       Thousands separator string (ASCIIZ format)
  06H      6          2       Decimal separator string (ASCIIZ format)
  08H      8         24       (Reserved)
  --------------------------------------------------------------------------

  Figure 17-4.  The country-dependent information reported by function 38H
  in DOS version 2.

    Offset           Size
  Hex      Dec       (bytes)  Description
  --------------------------------------------------------------------------
  00H       0         2       Date format
  02H       2         5       Currency symbol string (ASCIIZ format)
  07H       7         2       Thousands separator string (ASCIIZ format)
  09H       9         2       Decimal separator string (ASCIIZ format)
  0BH      11         2       Date separator string (ASCIIZ format)
  0DH      13         2       Time separator string (ASCIIZ format)
  0FH      15         1       Currency symbol location
  10H      16         1       Currency decimal places
  11H      17         1       Time format: 1 = 24-hour clock; 0 = 12-hour
  12H      18         4       Extended ASCII map call address
  16H      22         2       List separator string (ASCIIZ format)
  18H      24        10       (Reserved)
  --------------------------------------------------------------------------

  Figure 17-5.  The country-dependent information returned by function 38H
  in DOS version 3.

  Value              Use               Date
  --------------------------------------------------------------------------
  00H                American          month day year
  01H                European          day month year
  02H                Japanese          year month day
  --------------------------------------------------------------------------

  Figure 17-6.  The three predefined date formats returned by function 38H.

  The thousands separator is the symbol used to punctuate the thousands mark
  in numbers. The U.S. uses a comma as a thousands separator, as in the
  number 12,345; other countries use a period or a blank.

  The decimal separator is the symbol used to punctuate decimal places. The
  U.S. uses a period as a decimal separator, as in 3.0; other countries use
  a comma.

  The date separator and time separator are the punctuation used in
  displaying the date (for example, - as in 7-4-1988) and in displaying the
  time (for example, : as in 12:34).

  The currency symbol location indicates where the currency symbol should be
  placed. A value of 00H places the currency symbol immediately before the
  amount (J1500); 01H places the symbol immediately after the amount (15.);
  02H places the symbol before the amount with an intervening space (FFr
  15); 03H places the symbol after the amount with an intervening space (15
  DKR); and 04H replaces the decimal separator with the currency symbol.

  The currency decimal places value specifies how many decimal places are
  used in the currency. For example, the value would be 02H for U.S.
  currency (dollars and cents) and 00H for Italian currency (lire).

  The time format field specifies whether time appears in a 12-hour or
  24-hour format. Only the low-order bit (bit 0) is currently used; if the
  bit is set to 0, a 12-hour clock is used; if it is set to 1, a 24-hour
  clock is used.

  The extended ASCII map call address is the segmented address of a routine
  that maps ASCII characters 80H through FFH to characters in the range 00H
  through 7FH. Not all printers or plotters can display extended ASCII
  characters in the range 80H-FFH, so the routine at this address is called
  when it is necessary to map such characters into the usual range of ASCII
  characters (00H-7FH).

  The list separator indicates the symbol used to separate items in a list,
  such as the commas in the list A, B, C, and D.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson