]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/MAPPER/OLDGETCN.ASM

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / MAPPER / OLDGETCN.ASM
1 ;
2 page 60,132
3 ;
4 title CP/DOS DosGetCtryInfo mapper
5
6 Buffer segment word public 'buffer'
7 CountryInfo db 64
8 Buffer ends
9
10 dosxxx 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 ;
35 str struc
36 old_bp dw ?
37 return dd ?
38 ReturnLength dd ?
39 BufferPtr dd ?
40 CountryCodePtr dd ?
41 BufferLength dw ?
42 str ends
43 ;
44
45 cntry struc ;country info. sturctrue
46 ctry_code dw ?
47 code_page dw ?
48 dformat dw ?
49 curr_sym db 5 dup(?)
50 thous_sep db 2 dup(?)
51 decimal_sep db 2 dup(?)
52 date_sep db 2 dup(?)
53 time_sep db 2 dup(?)
54 bit_field dw ?
55 curr_cents dw ?
56 tformat dw ?
57 map_call dd ?
58 data_sep dw ?
59 ra 5 dup(?)
60 cntry ends
61 ;
62
63 Doscntry 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(?)
76 Doscntry ends
77
78
79 dosgetctryinfo 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
92 getinfo:
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 ;
120 NoFillNecessary:
121 sub ax,ax
122
123 ErrorExit:
124 Mexit
125
126 ret size str - 6
127 ;
128 dosgetctryinfo endp
129
130 dosxxx ends
131
132 end