4 title CP
/DOS DosGetCtryInfo mapper
6 Buffer
segment word public 'buffer'
10 dosxxx
segment byte public 'dos'
11 assume
cs:dosxxx
,ds:nothing
,es:nothing
,ss:nothing
13 ;**********************************************************************
15 ;* MODULE: dosgetctryinfo
17 ;* FUNCTION:get country information
21 ;* push word data area length
22 ;* push word country code
23 ;* push@ struc data area
24 ;* call dosgetctryinfo
26 ;* MODULES CALLED: PC-DOS Int 21h, ah=38h, get cntry info
28 ;*********************************************************************
45 cntry
struc ;country info. sturctrue
63 Doscntry
struc ;country info. sturctrue
79 dosgetctryinfo proc
far
81 Enter Dosgetcntryinfo
; save registers
83 lds si,[bp].CountryCodePtr
84 mov ax,ds:[si] ; get country code pointer
86 cmp ax,256 ; 16 bit country code
89 mov bx,ax ; if so, load into bx
90 mov al,0ffH ; and tell DOS it is get country
96 mov dx,offset buffer
:CountryInfo
98 mov ah,38h
; remember: the al value was set above!!!
99 int 21h
; get country information
102 mov si,offset buffer
:CountryInfo
;pointer to DOS cntry infor
103 les di,[bp].BufferPtr
;pointer to return data area
105 mov ax,[si].ddformat
;copy date format
106 mov es:[di].dformat
,ax
107 mov ax,[si].ddate_sep
;copy date seperator
108 mov es:[di].date_sep
,ax
109 mov ax,[si].dtime_sep
;copy time separator
110 mov es:[di].time_sep
,ax
111 mov al,[si].dtformat
;copy time format
112 mov es:[di].tformat
,al
114 mov cx,[bp].BufferLength
;was buffer larger than pc-dos gave us?
116 jc NoFillNecessary
; no fill necessary
118 les di,[bp].BufferPtr
; else fill the remaining area
119 add di,34 ; with zeros
124 sub ax,ax ; set good return code
127 Mexit
; pop registers
129 ret size
str - 6 ; return