Skip to content

Commit ad95075

Browse files
authored
Merge pull request #1103 from boriel-basic/tests/add_test_for_zx81sd
test: add tests for zx81sd arch
2 parents c3dfb4c + e440ad3 commit ad95075

401 files changed

Lines changed: 197476 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
org $0000
2+
jp $0100
3+
org $0008
4+
di
5+
halt
6+
org $0010
7+
di
8+
halt
9+
org $0018
10+
di
11+
halt
12+
org $0020
13+
di
14+
halt
15+
org $0028
16+
jp .core.FP_CALC_ENTRY
17+
org $0030
18+
di
19+
halt
20+
org $0038
21+
push af
22+
.core.__RST38_WAIT:
23+
in a, ($AF)
24+
and $7E
25+
jr z, .core.__RST38_WAIT
26+
pop af
27+
ret
28+
org $0066
29+
retn
30+
org 256
31+
.core.__START_PROGRAM:
32+
ld b, 9
33+
ld a, 1
34+
ld c, 0xe7
35+
out (c), a
36+
ld b, 10
37+
ld a, 2
38+
ld c, 0xe7
39+
out (c), a
40+
ld b, 11
41+
ld a, 3
42+
ld c, 0xe7
43+
out (c), a
44+
ld b, 12
45+
ld a, 4
46+
ld c, 0xe7
47+
out (c), a
48+
ld b, 13
49+
ld a, 5
50+
ld c, 0xe7
51+
out (c), a
52+
ld b, 15
53+
ld a, 7
54+
ld c, 0xe7
55+
out (c), a
56+
ld sp, 0x7fff
57+
jp .core.__MAIN_PROGRAM__
58+
.core.ZXBASIC_USER_DATA:
59+
; Defines USER DATA Length in bytes
60+
.core.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_END - .core.ZXBASIC_USER_DATA
61+
.core.__LABEL__.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_LEN
62+
.core.__LABEL__.ZXBASIC_USER_DATA EQU .core.ZXBASIC_USER_DATA
63+
_a:
64+
DEFB 00, 00
65+
_b:
66+
DEFB 00, 00
67+
.core.ZXBASIC_USER_DATA_END:
68+
.core.__MAIN_PROGRAM__:
69+
ld hl, (_a)
70+
ld (_b), hl
71+
ld hl, (_a)
72+
inc hl
73+
ld (_b), hl
74+
ld hl, (_a)
75+
ld (_b), hl
76+
ld hl, (_a)
77+
inc hl
78+
ld (_b), hl
79+
ld de, (_a)
80+
ld hl, (_a)
81+
add hl, de
82+
ld (_b), hl
83+
ld hl, 0
84+
ld b, h
85+
ld c, l
86+
.core.__END_PROGRAM:
87+
di
88+
halt
89+
;; --- end of user code ---
90+
END
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
' TEST for ADD16
2+
3+
DIM a as UInteger
4+
DIM b as UInteger
5+
6+
b = a + 0
7+
b = a + 1
8+
b = 0 + a
9+
b = 1 + a
10+
b = a + a
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
org $0000
2+
jp $0100
3+
org $0008
4+
di
5+
halt
6+
org $0010
7+
di
8+
halt
9+
org $0018
10+
di
11+
halt
12+
org $0020
13+
di
14+
halt
15+
org $0028
16+
jp .core.FP_CALC_ENTRY
17+
org $0030
18+
di
19+
halt
20+
org $0038
21+
push af
22+
.core.__RST38_WAIT:
23+
in a, ($AF)
24+
and $7E
25+
jr z, .core.__RST38_WAIT
26+
pop af
27+
ret
28+
org $0066
29+
retn
30+
org 256
31+
.core.__START_PROGRAM:
32+
ld b, 9
33+
ld a, 1
34+
ld c, 0xe7
35+
out (c), a
36+
ld b, 10
37+
ld a, 2
38+
ld c, 0xe7
39+
out (c), a
40+
ld b, 11
41+
ld a, 3
42+
ld c, 0xe7
43+
out (c), a
44+
ld b, 12
45+
ld a, 4
46+
ld c, 0xe7
47+
out (c), a
48+
ld b, 13
49+
ld a, 5
50+
ld c, 0xe7
51+
out (c), a
52+
ld b, 15
53+
ld a, 7
54+
ld c, 0xe7
55+
out (c), a
56+
ld sp, 0x7fff
57+
jp .core.__MAIN_PROGRAM__
58+
.core.ZXBASIC_USER_DATA:
59+
; Defines USER DATA Length in bytes
60+
.core.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_END - .core.ZXBASIC_USER_DATA
61+
.core.__LABEL__.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_LEN
62+
.core.__LABEL__.ZXBASIC_USER_DATA EQU .core.ZXBASIC_USER_DATA
63+
_a:
64+
DEFB 00, 00
65+
.core.ZXBASIC_USER_DATA_END:
66+
.core.__MAIN_PROGRAM__:
67+
ld de, (_a)
68+
ld hl, (_a)
69+
add hl, de
70+
ex de, hl
71+
ld hl, (_a)
72+
add hl, de
73+
ld (_a), hl
74+
ld hl, 0
75+
ld b, h
76+
ld c, l
77+
.core.__END_PROGRAM:
78+
di
79+
halt
80+
;; --- end of user code ---
81+
END
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
REM another ADD16 tests
3+
DIM a As Integer
4+
a = a + a + a
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
org $0000
2+
jp $0100
3+
org $0008
4+
di
5+
halt
6+
org $0010
7+
di
8+
halt
9+
org $0018
10+
di
11+
halt
12+
org $0020
13+
di
14+
halt
15+
org $0028
16+
jp .core.FP_CALC_ENTRY
17+
org $0030
18+
di
19+
halt
20+
org $0038
21+
push af
22+
.core.__RST38_WAIT:
23+
in a, ($AF)
24+
and $7E
25+
jr z, .core.__RST38_WAIT
26+
pop af
27+
ret
28+
org $0066
29+
retn
30+
org 256
31+
.core.__START_PROGRAM:
32+
ld b, 9
33+
ld a, 1
34+
ld c, 0xe7
35+
out (c), a
36+
ld b, 10
37+
ld a, 2
38+
ld c, 0xe7
39+
out (c), a
40+
ld b, 11
41+
ld a, 3
42+
ld c, 0xe7
43+
out (c), a
44+
ld b, 12
45+
ld a, 4
46+
ld c, 0xe7
47+
out (c), a
48+
ld b, 13
49+
ld a, 5
50+
ld c, 0xe7
51+
out (c), a
52+
ld b, 15
53+
ld a, 7
54+
ld c, 0xe7
55+
out (c), a
56+
ld sp, 0x7fff
57+
jp .core.__MAIN_PROGRAM__
58+
.core.ZXBASIC_USER_DATA:
59+
; Defines USER DATA Length in bytes
60+
.core.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_END - .core.ZXBASIC_USER_DATA
61+
.core.__LABEL__.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_LEN
62+
.core.__LABEL__.ZXBASIC_USER_DATA EQU .core.ZXBASIC_USER_DATA
63+
_a:
64+
DEFB 00, 00
65+
.core.ZXBASIC_USER_DATA_END:
66+
.core.__MAIN_PROGRAM__:
67+
ld de, (_a)
68+
ld hl, (_a)
69+
add hl, de
70+
push hl
71+
ld hl, (_a)
72+
inc hl
73+
inc hl
74+
ex de, hl
75+
ld hl, (_a)
76+
add hl, de
77+
ex de, hl
78+
pop hl
79+
add hl, de
80+
ld (_a), hl
81+
ld hl, 0
82+
ld b, h
83+
ld c, l
84+
.core.__END_PROGRAM:
85+
di
86+
halt
87+
;; --- end of user code ---
88+
END
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
REM another ADD16 tests
3+
DIM a As Integer
4+
a = a + a + (a + 2 + a)
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
org $0000
2+
jp $0100
3+
org $0008
4+
di
5+
halt
6+
org $0010
7+
di
8+
halt
9+
org $0018
10+
di
11+
halt
12+
org $0020
13+
di
14+
halt
15+
org $0028
16+
jp .core.FP_CALC_ENTRY
17+
org $0030
18+
di
19+
halt
20+
org $0038
21+
push af
22+
.core.__RST38_WAIT:
23+
in a, ($AF)
24+
and $7E
25+
jr z, .core.__RST38_WAIT
26+
pop af
27+
ret
28+
org $0066
29+
retn
30+
org 256
31+
.core.__START_PROGRAM:
32+
ld b, 9
33+
ld a, 1
34+
ld c, 0xe7
35+
out (c), a
36+
ld b, 10
37+
ld a, 2
38+
ld c, 0xe7
39+
out (c), a
40+
ld b, 11
41+
ld a, 3
42+
ld c, 0xe7
43+
out (c), a
44+
ld b, 12
45+
ld a, 4
46+
ld c, 0xe7
47+
out (c), a
48+
ld b, 13
49+
ld a, 5
50+
ld c, 0xe7
51+
out (c), a
52+
ld b, 15
53+
ld a, 7
54+
ld c, 0xe7
55+
out (c), a
56+
ld sp, 0x7fff
57+
jp .core.__MAIN_PROGRAM__
58+
.core.ZXBASIC_USER_DATA:
59+
; Defines USER DATA Length in bytes
60+
.core.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_END - .core.ZXBASIC_USER_DATA
61+
.core.__LABEL__.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_LEN
62+
.core.__LABEL__.ZXBASIC_USER_DATA EQU .core.ZXBASIC_USER_DATA
63+
_a:
64+
DEFB 00, 00, 00, 00
65+
_b:
66+
DEFB 00, 00, 00, 00
67+
.core.ZXBASIC_USER_DATA_END:
68+
.core.__MAIN_PROGRAM__:
69+
ld hl, (_a)
70+
ld de, (_a + 2)
71+
ld (_b), hl
72+
ld (_b + 2), de
73+
ld de, 0
74+
ld hl, 1
75+
ld bc, (_a)
76+
add hl, bc
77+
ex de, hl
78+
ld bc, (_a + 2)
79+
adc hl, bc
80+
ex de, hl
81+
ld (_b), hl
82+
ld (_b + 2), de
83+
ld hl, (_a)
84+
ld de, (_a + 2)
85+
ld (_b), hl
86+
ld (_b + 2), de
87+
ld de, 0
88+
ld hl, 1
89+
ld bc, (_a)
90+
add hl, bc
91+
ex de, hl
92+
ld bc, (_a + 2)
93+
adc hl, bc
94+
ex de, hl
95+
ld (_b), hl
96+
ld (_b + 2), de
97+
ld hl, (_a)
98+
ld de, (_a + 2)
99+
ld bc, (_a)
100+
add hl, bc
101+
ex de, hl
102+
ld bc, (_a + 2)
103+
adc hl, bc
104+
ex de, hl
105+
ld (_b), hl
106+
ld (_b + 2), de
107+
ld hl, 0
108+
ld b, h
109+
ld c, l
110+
.core.__END_PROGRAM:
111+
di
112+
halt
113+
;; --- end of user code ---
114+
END

0 commit comments

Comments
 (0)