Skip to content

Commit 2eb2420

Browse files
committed
Don't use character classification functions in OS rtl
This is to force the character classification functions to use the static, modified maptab that represents CP437 rather than ASCII. No functions currently operate with ASCII, while the graphx library operates with CP437. If this changes in the future, we should implement the LC_CTYPE category of locaale.h.
1 parent de96c7a commit 2eb2420

22 files changed

+306
-425
lines changed

CEdev/lib/src/std/os_functions_linked/isalnum.asm

-11
This file was deleted.

CEdev/lib/src/std/os_functions_linked/isalpha.asm

-10
This file was deleted.

CEdev/lib/src/std/os_functions_linked/iscntrl.asm

-10
This file was deleted.

CEdev/lib/src/std/os_functions_linked/isdigit.asm

-10
This file was deleted.

CEdev/lib/src/std/os_functions_linked/isgraph.asm

-11
This file was deleted.

CEdev/lib/src/std/os_functions_linked/islower.asm

-11
This file was deleted.

CEdev/lib/src/std/os_functions_linked/isprint.asm

-11
This file was deleted.

CEdev/lib/src/std/os_functions_linked/ispunct.asm

-11
This file was deleted.

CEdev/lib/src/std/os_functions_linked/isspace.asm

-12
This file was deleted.

CEdev/lib/src/std/os_functions_linked/isupper.asm

-11
This file was deleted.

CEdev/lib/src/std/os_functions_linked/isxdigit.asm

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
.def _isalnum
2-
.ref ___maptab
3-
.assume adl=1
4-
5-
; original source
6-
; int isalnum(int c) {
7-
; if( (unsigned char)c & (unsigned char)0x80 )
8-
; return (0);
9-
; return(__maptab[c] & (unsigned char)(UC|LC|DIG));
10-
; }
11-
12-
_isalnum:
13-
pop hl
14-
pop de
15-
push de
16-
push hl
17-
or a,a
18-
sbc hl,hl
19-
bit 7,e
20-
ret nz
21-
ex de,hl
22-
ld de,___maptab
23-
add hl,de
24-
ld a,(hl)
25-
and a,13
26-
sbc hl,hl
27-
ld l,a
28-
ret
1+
.def _isalnum
2+
.ref ___maptab
3+
.assume adl=1
4+
5+
; original source
6+
; int isalnum(int c) {
7+
; if( (unsigned char)c & (unsigned char)0x80 )
8+
; return (0);
9+
; return(__maptab[c] & (unsigned char)(UC|LC|DIG));
10+
; }
11+
12+
_isalnum:
13+
pop hl
14+
pop de
15+
push de
16+
push hl
17+
or a,a
18+
sbc hl,hl
19+
bit 7,e
20+
ret nz
21+
ex de,hl
22+
ld de,___maptab
23+
add hl,de
24+
ld a,(hl)
25+
and a,13
26+
sbc hl,hl
27+
ld l,a
28+
ret
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
.def _isalpha
2-
.ref ___maptab
3-
.assume adl=1
4-
5-
; original source
6-
; int isalnum(int c) {
7-
; if( (unsigned char)c & (unsigned char)0x80 )
8-
; return (0);
9-
; return(__maptab[c] & (unsigned char)(UC|LC));
10-
11-
_isalpha:
12-
pop hl
13-
pop de
14-
push de
15-
push hl
16-
or a,a
17-
sbc hl,hl
18-
bit 7,e
19-
ret nz
20-
ex de,hl
21-
ld de,___maptab
22-
add hl,de
23-
ld a,(hl)
24-
and a,12
25-
sbc hl,hl
26-
ld l,a
27-
ret
1+
.def _isalpha
2+
.ref ___maptab
3+
.assume adl=1
4+
5+
; original source
6+
; int isalnum(int c) {
7+
; if( (unsigned char)c & (unsigned char)0x80 )
8+
; return (0);
9+
; return(__maptab[c] & (unsigned char)(UC|LC));
10+
11+
_isalpha:
12+
pop hl
13+
pop de
14+
push de
15+
push hl
16+
or a,a
17+
sbc hl,hl
18+
bit 7,e
19+
ret nz
20+
ex de,hl
21+
ld de,___maptab
22+
add hl,de
23+
ld a,(hl)
24+
and a,12
25+
sbc hl,hl
26+
ld l,a
27+
ret
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
.def _iscntrl
2-
.ref ___maptab
3-
.assume adl=1
4-
5-
;int iscntrl(int c) {
6-
; if( (unsigned char)c & (unsigned char)0x80 )
7-
; return (0);
8-
; return(__maptab[c] & (unsigned char)(CTL));
9-
;}
10-
11-
_iscntrl:
12-
pop hl
13-
pop de
14-
push de
15-
push hl
16-
or a,a
17-
sbc hl,hl
18-
bit 7,e
19-
ret nz
20-
ex de,hl
21-
ld de,___maptab
22-
add hl,de
23-
ld a,(hl)
24-
and a,128
25-
sbc hl,hl
26-
ld l,a
27-
ret
1+
.def _iscntrl
2+
.ref ___maptab
3+
.assume adl=1
4+
5+
;int iscntrl(int c) {
6+
; if( (unsigned char)c & (unsigned char)0x80 )
7+
; return (0);
8+
; return(__maptab[c] & (unsigned char)(CTL));
9+
;}
10+
11+
_iscntrl:
12+
pop hl
13+
pop de
14+
push de
15+
push hl
16+
or a,a
17+
sbc hl,hl
18+
bit 7,e
19+
ret nz
20+
ex de,hl
21+
ld de,___maptab
22+
add hl,de
23+
ld a,(hl)
24+
and a,128
25+
sbc hl,hl
26+
ld l,a
27+
ret
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
.def _isdigit
2-
.ref ___maptab
3-
.assume adl=1
4-
5-
;int isdigit(int c) {
6-
; if( (unsigned char)c & (unsigned char)0x80 )
7-
; return (0);
8-
; return(__maptab[c] & (unsigned char)(DIG));
9-
;}
10-
11-
_isdigit:
12-
pop hl
13-
pop de
14-
push de
15-
push hl
16-
or a,a
17-
sbc hl,hl
18-
bit 7,e
19-
ret nz
20-
ex de,hl
21-
ld de,___maptab
22-
add hl,de
23-
ld a,(hl)
24-
and a,1
25-
sbc hl,hl
26-
ld l,a
27-
ret
1+
.def _isdigit
2+
.ref ___maptab
3+
.assume adl=1
4+
5+
;int isdigit(int c) {
6+
; if( (unsigned char)c & (unsigned char)0x80 )
7+
; return (0);
8+
; return(__maptab[c] & (unsigned char)(DIG));
9+
;}
10+
11+
_isdigit:
12+
pop hl
13+
pop de
14+
push de
15+
push hl
16+
or a,a
17+
sbc hl,hl
18+
bit 7,e
19+
ret nz
20+
ex de,hl
21+
ld de,___maptab
22+
add hl,de
23+
ld a,(hl)
24+
and a,1
25+
sbc hl,hl
26+
ld l,a
27+
ret

0 commit comments

Comments
 (0)