summaryrefslogtreecommitdiff
path: root/v4.0/src/MAPPER/GETCNTRY.ASM
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/MAPPER/GETCNTRY.ASM
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/MAPPER/GETCNTRY.ASM')
-rw-r--r--v4.0/src/MAPPER/GETCNTRY.ASM135
1 files changed, 135 insertions, 0 deletions
diff --git a/v4.0/src/MAPPER/GETCNTRY.ASM b/v4.0/src/MAPPER/GETCNTRY.ASM
new file mode 100644
index 0000000..d107b9d
--- /dev/null
+++ b/v4.0/src/MAPPER/GETCNTRY.ASM
@@ -0,0 +1,135 @@
1;
2page 60,132
3;
4title CP/DOS DosGetCtryInfo mapper
5
6Buffer segment word public 'buffer'
7CountryInfo db 64
8Buffer ends
9
10dosxxx segment byte public 'dos'
11 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
12
13;**********************************************************************
14;*
15;* MODULE: dosgetctryinfo
16;*
17;* FUNCTION:get country information
18;*
19;* CALLING SEQUENCE:
20;*
21;* push word data area length
22;* push word country code
23;* push@ struc data area
24;* call dosgetctryinfo
25;*
26;* MODULES CALLED: PC-DOS Int 21h, ah=38h, get cntry info
27;*
28;*********************************************************************
29
30 public dosgetctryinfo
31 .sall
32 include macros.inc
33
34
35str struc
36old_bp dw ?
37return dd ?
38ReturnLength dd ?
39BufferPtr dd ?
40CountryCodePtr dd ?
41BufferLength dw ?
42str ends
43
44
45cntry struc ;country info. sturctrue
46ctry_code dw ?
47code_page dw ?
48dformat dw ?
49curr_sym db 5 dup(?)
50thous_sep dw ?
51decimal_sep dw ?
52date_sep dw ?
53time_sep dw ?
54bit_field db ?
55curr_cents db ?
56tformat db ?
57map_call dd ?
58data_sep dw ?
59ra db 5 dup(?)
60cntry ends
61
62
63Doscntry struc ;country info. sturctrue
64 Ddformat dw ?
65 Dcurr_sym db 5 dup(?)
66 Dthous_sep dw ?
67 Ddecimal_sep dw ?
68 Ddate_sep dw ?
69 Dtime_sep dw ?
70 Dbit_field db ?
71 Dsig_digit db ?
72 Dtformat db ?
73 Dmap_call dd ?
74 Ddata_sep dw ?
75 DResv db 5 dup(?)
76Doscntry ends
77
78
79dosgetctryinfo proc far
80
81 Enter Dosgetcntryinfo ; save registers
82
83 lds si,[bp].CountryCodePtr
84 mov ax,ds:[si] ; get country code pointer
85
86 cmp ax,256 ; 16 bit country code
87 jc getinfo
88
89 mov bx,ax ; if so, load into bx
90 mov al,0ffH ; and tell DOS it is get country
91
92getinfo:
93 mov dx,seg buffer
94 mov ds,dx
95 assume ds:buffer
96 mov dx,offset buffer:CountryInfo
97
98 mov ah,38h ; remember: the al value was set above!!!
99 int 21h ; get country information
100 jc ErrorExit
101
102 mov si,offset buffer:CountryInfo ;pointer to DOS cntry infor
103 les di,[bp].BufferPtr ;pointer to return data area
104
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
113
114 mov cx,[bp].BufferLength ;was buffer larger than pc-dos gave us?
115 sub cx,34
116 jc NoFillNecessary ; no fill necessary
117
118 les di,[bp].BufferPtr ; else fill the remaining area
119 add di,34 ; with zeros
120 mov al,0
121 rep stosb
122
123NoFillNecessary:
124 sub ax,ax ; set good return code
125
126ErrorExit:
127 Mexit ; pop registers
128
129 ret size str - 6 ; return
130
131dosgetctryinfo endp
132
133dosxxx ends
134
135 end