summaryrefslogtreecommitdiff
path: root/v4.0/src/MAPPER/CASEMAP.ASM
blob: 900ad4ffa011f72162ba8e70960896c1372bece4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
;
page 80,132
;
title CP/DOS DosCaseMap
;
dosxxx  segment byte public 'dos'
        assume  cs:dosxxx,ds:nothing,es:nothing,ss:nothing

;**********************************************************************
;*
;*   MODULE:   doscasemap
;*
;*
;*   CALLING SEQUENCE:
;*
;*             PUSH     WORD    Length
;*             PUSH@    DWORD   CountryCode
;*             PUSH@    DWORD   BinaryString
;*             DosCaseMap
;*
;*   MODULES CALLED:  none
;*
;*********************************************************************

        public  doscasemap
        .sall
        include macros.inc

str     struc
old_bp  dw      ?
return  dd      ?
StringPtr       dd      ?       ; binary string pointer
CountryCodePtr  dd      ?       ; country code pointer
StringLength    dw      ?       ; lenght of the string
str     ends

DosCaseMap      proc    far

        Enter  DosCaseMap               ; save registers

; Get the country, so we can then get the country case map stuff

        lds     si,[bp].CountryCodePtr
        mov     ax,ds:[si]

; Note: do the country selection later (maybe never)

        lds     si,[bp].StringPtr
        mov     cx,[bp].StringLength

MapLoop:                                ; convert characters to upper case
        lodsb
        cmp     al,'a'
        jc      ThisCharDone

        cmp     al,'z'+1
        jnc     ThisCharDone

        add     al,'A' - 'a'
        mov     ds:[si-1],al

ThisCharDone:
        loop    MapLoop                 ; loop until string is complete

        MExit                           ; pop registers
        ret     size str - 6            ; return
;
DosCaseMap      endp

dosxxx  ends

        end