summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/FC/ITOUPPER.ASM
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/CMD/FC/ITOUPPER.ASM
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/CMD/FC/ITOUPPER.ASM')
-rw-r--r--v4.0/src/CMD/FC/ITOUPPER.ASM119
1 files changed, 119 insertions, 0 deletions
diff --git a/v4.0/src/CMD/FC/ITOUPPER.ASM b/v4.0/src/CMD/FC/ITOUPPER.ASM
new file mode 100644
index 0000000..289c691
--- /dev/null
+++ b/v4.0/src/CMD/FC/ITOUPPER.ASM
@@ -0,0 +1,119 @@
1.xlist
2include version.inc
3include cmacros.inc
4.list
5
6sBegin code
7assumes cs,code
8
9;
10; c = IToupper (c, routine);
11;
12; c is char to be converted
13; routine is case map call in international table
14;
15
16cProc IToupper,<PUBLIC>
17parmW c
18parmD routine
19cBegin
20 mov ax,c
21 or ah,ah
22 jnz donothing
23 cmp al,'a'
24 jb noconv
25 cmp al,'z'
26 ja noconv
27 sub al,20H
28noconv:
29 call routine
30donothing:
31cEnd
32
33
34;Get_Lbtbl
35;
36; Get pointer to LBTBL from DOS if we are running on a version
37; of DOS which supports it. If not, initialize the table with
38; a pointer to a local "default" table with KANJI lead bytes.
39;
40;Input: word pointer to LONG "Lbtbl"
41;Output: long initialized to Lead byte pointer
42;
43
44cProc get_lbtbl,<PUBLIC>
45
46parmW pointer_to_table
47
48; on entry, low word of DWORD pointer has offset of
49; a default table of lead bytes defined within the C program
50; If function 63 is supported, the DWORD pointer to DOS'
51; table will be placed here instead.
52cBegin
53 push si
54 push di
55 mov bx,pointer_to_table ;get pointer
56 mov si,[bx] ;default table pointer in DS:SI
57 push es
58 push ds
59 mov ax,6300h ;make Get Lead Byte call
60 int 21h
61 mov ss:[bx],si ;si didn't change if non ECS dos
62 mov ss:[bx+2],ds ;store segment
63 pop ds
64 pop es
65 pop di
66 pop si
67cEnd
68
69
70;
71; test_ECS(char,DWORD_prt) test the char to find out if it is
72; a valid lead byte using passed DWORD
73; Input: char PTR to the Lead Byte table.
74; DWORD PTR to table
75; Output: AX=FFFF (is_lead) Lead byte table may be default in
76; AX=0 (not_lead) program or ECS table in DOS when
77; running on a version which supports it.
78;
79cProc test_ECS,<PUBLIC> ;test for lead byte ;if Lead, then
80 ; return AX=Is_lead
81 ; else
82 ; return AX=FALSE
83Is_lead EQU 0FFFFH
84Not_lead EQU 0
85
86parmW char
87parmD pointer ;DWORD PTR to Lead Byte Table
88cBegin
89 mov ax,char
90 xchg ah,al
91 push SI
92 push DS
93 LDS SI,pointer
94ktlop:
95 lodsb
96 or al,al
97 jz notlead
98 cmp al,ah
99 ja notlead
100 lodsb
101 cmp ah,al
102 ja ktlop
103 mov ax,Is_lead
104notl_exit:
105 pop ds
106 pop si
107 jmp cexit
108notlead:
109 mov ax,not_lead
110 jmp notl_exit
111cexit:
112cEnd
113
114
115
116
117sEnd
118
119end