home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Name casemap -- Perform DOS character case map
- ;
- ; Synopsis outch = casemap(ch,pads)
- ; char outch Resulting (folded) character
- ; char ch Character to be folded to upper case
- ; ADS *pads Address of ADS structure containing
- ; address of case mapping routine
- ;
- ; Description This routine performs a far call to the DOS routine
- ; which maps characters to their upper case equivalents,
- ; taking into account a national character set.
- ;
- ; If *pads is the null pointer (0:0), ch will be returned
- ; as outch without conversion. Great harm may result if
- ; *pads points improperly.
- ;
- ; Returns outch Resulting character folded to upper case.
- ;
- ; Version 3.0 (C)Copyright Blaise Computing Inc. 1986
- ;
-
- name casemap
-
- LONGPROG = 0 ; initialize constants for
- LONGDATA = 0 ; Pass1 of the assembler
-
- include compiler.mac ; Specifies the C compiler
-
- if LAT200 or LAT210 or LAT300
- include dos.mac
- LONGPROG = LPROG
- LONGDATA = LDATA
-
- pseg
- public casemap
- if LPROG
- x equ 6 ; parameter offset
- casemap proc far
- else
- x equ 4
- casemap proc near
- endif
- y equ x + 2 ; offset of pads
- endif
-
-
- if CI201A
- include model.h
- include prologue.h
- LONGPROG = @bigmodel
- LONGDATA = @bigmodel
-
- public casemap
- if @bigmodel
- x equ 6 ; parameter offset
- casemap proc far
- else
- x equ 4
- casemap proc near
- endif
- y equ x + 2 ; offset of pads
- endif
-
- if MSC300
- include dos.mac
- LONGPROG = LPROG
- LONGDATA = LDATA
-
- pseg casemap
- public _casemap
- if LPROG
- x equ 6 ; parameter offset
- _casemap proc far
- else
- x equ 4
- _casemap proc near
- endif
- y equ x + 2 ; offset of pads
- endif
-
- push bp ; Save the frame pointer
- mov bp,sp
- if MSC300
- push di ; Save register variables
- push si
- endif
-
-
- if LONGDATA ; Get the code address
- les si,dword ptr [bp + y]
- mov ax,es:[si] ; Check if null pointer
- or ax,es:[si + 2]
- mov al,[bp + x] ; The character to be folded
- jz err_done
- call dword ptr es:[si]
- else
- mov si,[bp + y] ; Get the code address
- mov ax,[si] ; Check if null pointer
- or ax,[si + 2]
- mov al,[bp + x] ; The character to be folded
- jz err_done
- call dword ptr [si]
- endif
-
-
- err_done:
- if MSC300
- pop si ; Recover index registers
- pop di ; (used for register variables)
- cld ; MSC 3 expects DF cleared
- endif
- pop bp ; Get the original frame pointer.
- ret
- if MSC300
- _casemap endp
- else
- casemap endp
- endif
-
-
- if LAT200 or LAT210 or LAT300
- endps
- endif
-
- if CI201A
- include epilogue.h
- endif
-
- if MSC300
- endps casemap
- endif
-
- end