summaryrefslogtreecommitdiff
path: root/v4.0/src/MAPPER/OLDGETCN.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/OLDGETCN.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/OLDGETCN.ASM')
-rw-r--r--v4.0/src/MAPPER/OLDGETCN.ASM132
1 files changed, 132 insertions, 0 deletions
diff --git a/v4.0/src/MAPPER/OLDGETCN.ASM b/v4.0/src/MAPPER/OLDGETCN.ASM
new file mode 100644
index 0000000..f3dd5a7
--- /dev/null
+++ b/v4.0/src/MAPPER/OLDGETCN.ASM
@@ -0,0 +1,132 @@
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;* FILE NAME: dos024.asm
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 db 2 dup(?)
51decimal_sep db 2 dup(?)
52date_sep db 2 dup(?)
53time_sep db 2 dup(?)
54bit_field dw ?
55curr_cents dw ?
56tformat dw ?
57map_call dd ?
58data_sep dw ?
59ra 5 dup(?)
60cntry ends
61;
62
63Doscntry struc ;country info. sturctrue
64 Ddformat dw ?
65 Dcurr_sym db 5 dup(?)
66 Dthous_sep db 2 dup(?)
67 Ddecimal_sep db 2 dup(?)
68 Ddate_sep db 2 dup(?)
69 Dtime_sep db 2 dup(?)
70 Dbit_field db ?
71 Dsig_digit db ?
72 Dtformat db ?
73 Dmap_call dd ?
74 Ddata_sep dw ?
75 DResv 5 dup(?)
76Doscntry ends
77
78
79dosgetctryinfo proc far
80
81 Enter Dosgetcntryinfo
82
83 lds si,[bp].CountryCodePtr
84 mov ax,ds:[si]
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
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
100 jc ErrorExit
101;
102 mov si,offset buffer:CountryInfo
103 les di,[bp].BufferPtr
104 cld ;string move op.
105
106 mov cx,[bp].BufferLength ;length to move
107
108 rep movsb ;copy all to output area
109
110 mov cx,[bp].BufferLength ;was buffer larger than pc-dos gave us?
111 sub cx,34
112 jc NoFillNecessary
113
114 les di,[bp].BufferPtr
115 add di,34
116
117 mov al,0 ;fill with zeroes
118 rep stosb
119;
120NoFillNecessary:
121 sub ax,ax
122
123ErrorExit:
124 Mexit
125
126 ret size str - 6
127;
128dosgetctryinfo endp
129
130dosxxx ends
131
132 end