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

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / MAPPER / CASEMAP.ASM
1
2 ;
3 page 80,132
4 ;
5 title CP/DOS DosCaseMap
6 ;
7 dosxxx segment byte public 'dos'
8 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
9
10 ;**********************************************************************
11 ;*
12 ;* MODULE: doscasemap
13 ;*
14 ;*
15 ;* CALLING SEQUENCE:
16 ;*
17 ;* PUSH WORD Length
18 ;* PUSH@ DWORD CountryCode
19 ;* PUSH@ DWORD BinaryString
20 ;* DosCaseMap
21 ;*
22 ;* MODULES CALLED: none
23 ;*
24 ;*********************************************************************
25
26 public doscasemap
27 .sall
28 include macros.inc
29
30 str struc
31 old_bp dw ?
32 return dd ?
33 StringPtr dd ? ; binary string pointer
34 CountryCodePtr dd ? ; country code pointer
35 StringLength dw ? ; lenght of the string
36 str ends
37
38 DosCaseMap proc far
39
40 Enter DosCaseMap ; save registers
41
42 ; Get the country, so we can then get the country case map stuff
43
44 lds si,[bp].CountryCodePtr
45 mov ax,ds:[si]
46
47 ; Note: do the country selection later (maybe never)
48
49 lds si,[bp].StringPtr
50 mov cx,[bp].StringLength
51
52 MapLoop: ; convert characters to upper case
53 lodsb
54 cmp al,'a'
55 jc ThisCharDone
56
57 cmp al,'z'+1
58 jnc ThisCharDone
59
60 add al,'A' - 'a'
61 mov ds:[si-1],al
62
63 ThisCharDone:
64 loop MapLoop ; loop until string is complete
65
66 MExit ; pop registers
67 ret size str - 6 ; return
68 ;
69 DosCaseMap endp
70
71 dosxxx ends
72
73 end