Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:13
CP/DOS DosGetCtryInfo mapper                                Page     1-1


				;
				page 60,132
				;
				title CP/DOS DosGetCtryInfo mapper
				
 0000				Buffer  segment word public 'buffer'
 0000  40			CountryInfo     db      64
 0001				Buffer  ends
				
 0000				dosxxx  segment byte public 'dos'
				        assume  cs:dosxxx,ds:nothing,es:nothing,ss:nothing
				
				;**********************************************************************
				;*
				;*   MODULE:   dosgetctryinfo
				;*
				;*   FUNCTION:get country information
				;*
				;*   CALLING SEQUENCE:
				;*
				;*       push      word   data area length
				;*       push      word   country code
				;*       push@     struc  data area
				;*       call      dosgetctryinfo
				;*
				;*   MODULES CALLED:  PC-DOS Int 21h, ah=38h, get cntry info
				;*
				;*********************************************************************
				
				            public   dosgetctryinfo
				            .sall
				            include  macros.inc
			     C	;
			     C	
			     C	
			     C	pushal  macro
			     C	        push    bx
			     C	        push    cx
			     C	        push    dx
			     C	        push    si
			     C	        push    di
			     C	        push    ds
			     C	        push    es
			     C	        push    ss
			     C	        push    bp
			     C	        endm
			     C	;
			     C	popal   macro
			     C	        pop     bp
			     C	        pop     ss
			     C	        pop     es
			     C	        pop     ds
			     C	        pop     di
			     C	        pop     si
			     C	        pop     dx
			     C	        pop     cx
Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:13
CP/DOS DosGetCtryInfo mapper                                Page     1-2


			     C	        pop     bx
			     C	        endm
			     C	;
			     C	Enter   macro   Routine
			     C	
			     C	        push    bp
			     C	        mov     bp,sp
			     C	        pushal
			     C	
			     C	        endm
			     C	;
			     C	Mexit   macro
			     C	
			     C	        popal
			     C	        mov     sp,bp
			     C	        pop     bp
			     C	
			     C	        endm
			     C	
				
				
				str         struc
 0000  0000			old_bp          dw      ?
 0002  00000000			return          dd      ?
 0006  00000000			ReturnLength    dd      ?
 000A  00000000			BufferPtr       dd      ?
 000E  00000000			CountryCodePtr  dd      ?
 0012  0000			BufferLength    dw      ?
 0014				str         ends
				
				
				cntry       struc                       ;country info. sturctrue
 0000  0000			ctry_code       dw      ?
 0002  0000			code_page       dw      ?
 0004  0000			dformat         dw      ?
 0006  0005[			curr_sym        db      5  dup(?)
	   ??			
			 ]	
				
 000B  0000			thous_sep       dw      ?
 000D  0000			decimal_sep     dw      ?
 000F  0000			date_sep        dw      ?
 0011  0000			time_sep        dw      ?
 0013  00			bit_field       db      ?
 0014  00			curr_cents      db      ?
 0015  00			tformat         db      ?
 0016  00000000			map_call        dd      ?
 001A  0000			data_sep        dw      ?
 001C  0005[			ra              db      5  dup(?)
	   ??			
			 ]	
				
 0021				cntry       ends
				
				
				Doscntry       struc                       ;country info. sturctrue
Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:13
CP/DOS DosGetCtryInfo mapper                                Page     1-3


 0000  0000			 Ddformat         dw      ?
 0002  0005[			 Dcurr_sym        db      5  dup(?)
	   ??			
			 ]	
				
 0007  0000			 Dthous_sep       dw      ?
 0009  0000			 Ddecimal_sep     dw      ?
 000B  0000			 Ddate_sep        dw      ?
 000D  0000			 Dtime_sep        dw      ?
 000F  00			 Dbit_field       db      ?
 0010  00			 Dsig_digit       db      ?
 0011  00			 Dtformat         db      ?
 0012  00000000			 Dmap_call        dd      ?
 0016  0000			 Ddata_sep        dw      ?
 0018  0005[			 DResv            db      5  dup(?)
	   ??			
			 ]	
				
 001D				Doscntry       ends
				
				
 0000				dosgetctryinfo  proc far
				
				        Enter   Dosgetcntryinfo       ; save registers
				
 000C  C5 76 0E			        lds     si,[bp].CountryCodePtr
 000F  8B 04			        mov     ax,ds:[si]            ; get country code pointer
				
 0011  3D 0100			        cmp     ax,256                ; 16 bit country code
 0014  72 04			        jc      getinfo
				
 0016  8B D8			        mov     bx,ax                 ; if so, load into bx
 0018  B0 FF			        mov     al,0ffH               ; and tell DOS it is get country
				
 001A				getinfo:
 001A  BA ---- R		        mov     dx,seg buffer
 001D  8E DA			        mov     ds,dx
				        assume  ds:buffer
 001F  BA 0000 R		        mov     dx,offset buffer:CountryInfo
				
 0022  B4 38			        mov     ah,38h          ; remember: the al value was set above!!!
 0024  CD 21			        int     21h             ; get country information
 0026  72 35			        jc      ErrorExit
				
 0028  BE 0000 R		        mov     si,offset buffer:CountryInfo     ;pointer to DOS cntry infor
 002B  C4 7E 0A			        les     di,[bp].BufferPtr                ;pointer to return data area
				
 002E  8B 04			        mov     ax,[si].ddformat                 ;copy date format
 0030  26: 89 45 04		        mov     es:[di].dformat,ax
 0034  8B 44 0B			        mov     ax,[si].ddate_sep                ;copy date seperator
 0037  26: 89 45 0F		        mov     es:[di].date_sep,ax
 003B  8B 44 0D			        mov     ax,[si].dtime_sep                ;copy time separator
 003E  26: 89 45 11		        mov     es:[di].time_sep,ax
 0042  8A 44 11			        mov     al,[si].dtformat                 ;copy time format
 0045  26: 88 45 15		        mov     es:[di].tformat,al
				
Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:13
CP/DOS DosGetCtryInfo mapper                                Page     1-4


 0049  8B 4E 12			        mov     cx,[bp].BufferLength  ;was buffer larger than pc-dos gave us?
 004C  83 E9 22			        sub     cx,34
 004F  72 0A			        jc      NoFillNecessary       ; no fill necessary
				
 0051  C4 7E 0A			        les     di,[bp].BufferPtr     ; else fill the remaining area
 0054  83 C7 22			        add     di,34                 ;   with zeros
 0057  B0 00			        mov     al,0
 0059  F3/ AA			        rep     stosb
				
 005B				NoFillNecessary:
 005B  2B C0			        sub     ax,ax                 ; set good return code
				
 005D				ErrorExit:
				        Mexit                         ; pop registers
				
 0069  CA 000E			        ret     size str - 6          ; return
				
 006C				dosgetctryinfo endp
				
 006C				dosxxx      ends
				
				            end

Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:13
CP/DOS DosGetCtryInfo mapper                                Symbols-1


Macros:

		N a m e			Lines

ENTER  . . . . . . . . . . . . .  	   3
MEXIT  . . . . . . . . . . . . .  	   3
POPAL  . . . . . . . . . . . . .  	   9
PUSHAL . . . . . . . . . . . . .  	   9

Structures and Records:

                N a m e                 Width   # fields
                                        Shift   Width   Mask    Initial

CNTRY  . . . . . . . . . . . . .  	0021	000E
  CTRY_CODE  . . . . . . . . . .  	0000
  CODE_PAGE  . . . . . . . . . .  	0002
  DFORMAT  . . . . . . . . . . .  	0004
  CURR_SYM . . . . . . . . . . .  	0006
  THOUS_SEP  . . . . . . . . . .  	000B
  DECIMAL_SEP  . . . . . . . . .  	000D
  DATE_SEP . . . . . . . . . . .  	000F
  TIME_SEP . . . . . . . . . . .  	0011
  BIT_FIELD  . . . . . . . . . .  	0013
  CURR_CENTS . . . . . . . . . .  	0014
  TFORMAT  . . . . . . . . . . .  	0015
  MAP_CALL . . . . . . . . . . .  	0016
  DATA_SEP . . . . . . . . . . .  	001A
  RA . . . . . . . . . . . . . .  	001C
DOSCNTRY . . . . . . . . . . . .  	001D	000C
  DDFORMAT . . . . . . . . . . .  	0000
  DCURR_SYM  . . . . . . . . . .  	0002
  DTHOUS_SEP . . . . . . . . . .  	0007
  DDECIMAL_SEP . . . . . . . . .  	0009
  DDATE_SEP  . . . . . . . . . .  	000B
  DTIME_SEP  . . . . . . . . . .  	000D
  DBIT_FIELD . . . . . . . . . .  	000F
  DSIG_DIGIT . . . . . . . . . .  	0010
  DTFORMAT . . . . . . . . . . .  	0011
  DMAP_CALL  . . . . . . . . . .  	0012
  DDATA_SEP  . . . . . . . . . .  	0016
  DRESV  . . . . . . . . . . . .  	0018
STR  . . . . . . . . . . . . . .  	0014	0006
  OLD_BP . . . . . . . . . . . .  	0000
  RETURN . . . . . . . . . . . .  	0002
  RETURNLENGTH . . . . . . . . .  	0006
  BUFFERPTR  . . . . . . . . . .  	000A
  COUNTRYCODEPTR . . . . . . . .  	000E
  BUFFERLENGTH . . . . . . . . .  	0012
Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:13
CP/DOS DosGetCtryInfo mapper                                Symbols-2


Segments and Groups:

                N a m e         	Length	 Align	Combine Class

BUFFER . . . . . . . . . . . . .  	0001	WORD	PUBLIC	'BUFFER'
DOSXXX . . . . . . . . . . . . .  	006C	BYTE	PUBLIC	'DOS'

Symbols:            

                N a m e         	Type	 Value	 Attr

COUNTRYINFO  . . . . . . . . . .  	L BYTE	0000	BUFFER

dosgetctryinfo . . . . . . . . .  	F PROC	0000	DOSXXX	Global	Length = 006C

ERROREXIT  . . . . . . . . . . .  	L NEAR	005D	DOSXXX

GETINFO  . . . . . . . . . . . .  	L NEAR	001A	DOSXXX

NOFILLNECESSARY  . . . . . . . .  	L NEAR	005B	DOSXXX

@CPU . . . . . . . . . . . . . .  	TEXT  0101h		
@FILENAME  . . . . . . . . . . .  	TEXT  getcntry		
@VERSION . . . . . . . . . . . .  	TEXT  510		


    181 Source  Lines
    205 Total   Lines
     52 Symbols

  47280 + 317197 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
