diff options
Diffstat (limited to 'v4.0/src/MAPPER/GETCNTRY.ASM')
| -rw-r--r-- | v4.0/src/MAPPER/GETCNTRY.ASM | 135 |
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 | ; | ||
| 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 | ;* 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 | |||
| 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 dw ? | ||
| 51 | decimal_sep dw ? | ||
| 52 | date_sep dw ? | ||
| 53 | time_sep dw ? | ||
| 54 | bit_field db ? | ||
| 55 | curr_cents db ? | ||
| 56 | tformat db ? | ||
| 57 | map_call dd ? | ||
| 58 | data_sep dw ? | ||
| 59 | ra db 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 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(?) | ||
| 76 | Doscntry ends | ||
| 77 | |||
| 78 | |||
| 79 | dosgetctryinfo 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 | |||
| 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 ; 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 | |||
| 123 | NoFillNecessary: | ||
| 124 | sub ax,ax ; set good return code | ||
| 125 | |||
| 126 | ErrorExit: | ||
| 127 | Mexit ; pop registers | ||
| 128 | |||
| 129 | ret size str - 6 ; return | ||
| 130 | |||
| 131 | dosgetctryinfo endp | ||
| 132 | |||
| 133 | dosxxx ends | ||
| 134 | |||
| 135 | end | ||