Skip to content

Commit 5954f3a

Browse files
committed
more tests added
CLRB, ISOB, NOTB, SETB, SETBC, SETBNC, SETBNZ, SETBZ, CMPR, SAR
1 parent c91e692 commit 5954f3a

10 files changed

+579
-0
lines changed

Diff for: test_clrb.spin

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
dat
2+
orgh 0
3+
org 0
4+
5+
andn outb, ##$FFFF
6+
or dirb, ##$FFFF
7+
8+
mov cnt, testc
9+
mov ptra, #@tests
10+
11+
_test rdlong d, ptra++
12+
rdlong s, ptra++
13+
rdlong cz, ptra++
14+
15+
setcz cz wc, wz
16+
17+
clrb d, s wc, wz ' TEST INSTRUCTION
18+
19+
setbc cz, #1 ' store C/Z
20+
setbz cz, #0
21+
22+
rdlong r, ptra++ ' get the expected result
23+
rdlong rcz, ptra++ ' get the expected flags
24+
25+
cmp d, r wz
26+
if_nz jmp #_next
27+
28+
cmp cz, rcz wz
29+
if_nz jmp #_next
30+
31+
mov d, testc ' set LED 0 to N
32+
sub d, cnt
33+
setb outb, d
34+
35+
_next
36+
djnz cnt, #_test
37+
38+
end jmp #end
39+
40+
41+
testc long (cnt-tests)/5
42+
' d s cz r rcz
43+
tests long $0000_0000, $0000_0000, %00, $0000_0000, %01
44+
long $0000_0001, $0000_0000, %00, $0000_0000, %11
45+
long $0000_000F, $0000_0003, %00, $0000_0007, %10
46+
long $0000_0007, $0000_0003, %00, $0000_0007, %00
47+
long $AAAA_AAAA, $FFFF_FFE0, %00, $AAAA_AAAA, %00
48+
long $AAAA_AAAA, $FFFF_FFE1, %00, $AAAA_AAA8, %10
49+
50+
cnt res 1
51+
d res 1
52+
s res 1
53+
cz res 1
54+
r res 1
55+
rcz res 1

Diff for: test_cmpr.spin

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
dat
2+
orgh 0
3+
org 0
4+
5+
andn outb, ##$FFFF
6+
or dirb, ##$FFFF
7+
8+
mov cnt, testc
9+
mov ptra, #@tests
10+
11+
_test rdlong d, ptra++
12+
rdlong s, ptra++
13+
rdlong cz, ptra++
14+
15+
setcz cz wc, wz
16+
17+
cmpr d, s wc, wz ' TEST INSTRUCTION
18+
19+
setbc cz, #1 ' store C/Z
20+
setbz cz, #0
21+
22+
rdlong r, ptra++ ' get the expected result
23+
rdlong rcz, ptra++ ' get the expected flags
24+
25+
cmp d, r wz
26+
if_nz jmp #_next
27+
28+
cmp cz, rcz wz
29+
if_nz jmp #_next
30+
31+
mov d, testc ' set LED 0 to N
32+
sub d, cnt
33+
setb outb, d
34+
35+
_next
36+
djnz cnt, #_test
37+
38+
end jmp #end
39+
40+
41+
testc long (cnt-tests)/5
42+
' d s cz r rcz
43+
tests long $0000_0002, $0000_0003, %00, $0000_0002, %00
44+
long $0000_0003, $0000_0003, %00, $0000_0003, %01
45+
long $0000_0004, $0000_0003, %00, $0000_0004, %10
46+
long $7FFF_FFFF, $8000_0000, %00, $7FFF_FFFF, %00
47+
long $8000_0000, $7FFF_FFFF, %00, $8000_0000, %10
48+
long $FFFF_FFFF, $FFFF_FFFE, %00, $FFFF_FFFF, %10
49+
long $FFFF_FFFE, $FFFF_FFFE, %00, $FFFF_FFFE, %01
50+
long $FFFF_FFFD, $FFFF_FFFE, %00, $FFFF_FFFD, %00
51+
52+
cnt res 1
53+
d res 1
54+
s res 1
55+
cz res 1
56+
r res 1
57+
rcz res 1

Diff for: test_isob.spin

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
dat
2+
orgh 0
3+
org 0
4+
5+
andn outb, ##$FFFF
6+
or dirb, ##$FFFF
7+
8+
mov cnt, testc
9+
mov ptra, #@tests
10+
11+
_test rdlong d, ptra++
12+
rdlong s, ptra++
13+
rdlong cz, ptra++
14+
15+
setcz cz wc, wz
16+
17+
isob d, s wc, wz ' TEST INSTRUCTION
18+
19+
setbc cz, #1 ' store C/Z
20+
setbz cz, #0
21+
22+
rdlong r, ptra++ ' get the expected result
23+
rdlong rcz, ptra++ ' get the expected flags
24+
25+
cmp d, r wz
26+
if_nz jmp #_next
27+
28+
cmp cz, rcz wz
29+
if_nz jmp #_next
30+
31+
mov d, testc ' set LED 0 to N
32+
sub d, cnt
33+
setb outb, d
34+
35+
_next
36+
djnz cnt, #_test
37+
38+
end jmp #end
39+
40+
41+
testc long (cnt-tests)/5
42+
' d s cz r rcz
43+
tests long $0000_0000, $0000_0003, %00, $0000_0000, %01
44+
long $0000_000F, $0000_0000, %00, $0000_0001, %10
45+
long $0000_000F, $0000_0003, %00, $0000_0008, %10
46+
long $0000_00EF, $0000_0004, %00, $0000_0000, %01
47+
long $AAAA_AAAA, $FFFF_FFE0, %00, $0000_0000, %01
48+
long $AAAA_AAAA, $FFFF_FFE1, %00, $0000_0000, %10
49+
50+
cnt res 1
51+
d res 1
52+
s res 1
53+
cz res 1
54+
r res 1
55+
rcz res 1

Diff for: test_notb.spin

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
dat
2+
orgh 0
3+
org 0
4+
5+
andn outb, ##$FFFF
6+
or dirb, ##$FFFF
7+
8+
mov cnt, testc
9+
mov ptra, #@tests
10+
11+
_test rdlong d, ptra++
12+
rdlong s, ptra++
13+
rdlong cz, ptra++
14+
15+
setcz cz wc, wz
16+
17+
notb d, s wc, wz ' TEST INSTRUCTION
18+
19+
setbc cz, #1 ' store C/Z
20+
setbz cz, #0
21+
22+
rdlong r, ptra++ ' get the expected result
23+
rdlong rcz, ptra++ ' get the expected flags
24+
25+
cmp d, r wz
26+
if_nz jmp #_next
27+
28+
cmp cz, rcz wz
29+
if_nz jmp #_next
30+
31+
mov d, testc ' set LED 0 to N
32+
sub d, cnt
33+
setb outb, d
34+
35+
_next
36+
djnz cnt, #_test
37+
38+
end jmp #end
39+
40+
41+
testc long (cnt-tests)/5
42+
' d s cz r rcz
43+
tests long $0000_0000, $0000_0000, %00, $0000_0001, %00
44+
long $0000_0001, $0000_0000, %00, $0000_0000, %11
45+
long $0000_000F, $0000_0003, %00, $0000_0007, %10
46+
long $0000_0007, $0000_0003, %00, $0000_000F, %00
47+
long $AAAA_AAAA, $FFFF_FFE0, %00, $AAAA_AAAB, %00
48+
long $AAAA_AAAA, $FFFF_FFE1, %00, $AAAA_AAA8, %10
49+
50+
cnt res 1
51+
d res 1
52+
s res 1
53+
cz res 1
54+
r res 1
55+
rcz res 1

Diff for: test_sar.spin

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
dat
2+
orgh 0
3+
org 0
4+
5+
andn outb, ##$FFFF
6+
or dirb, ##$FFFF
7+
8+
mov cnt, testc
9+
mov ptra, #@tests
10+
11+
_test rdlong d, ptra++
12+
rdlong s, ptra++
13+
rdlong cz, ptra++
14+
15+
setcz cz wc, wz
16+
17+
sar d, s wc, wz ' TEST INSTRUCTION
18+
19+
setbc cz, #1 ' store C/Z
20+
setbz cz, #0
21+
22+
rdlong r, ptra++ ' get the expected result
23+
rdlong rcz, ptra++ ' get the expected flags
24+
25+
cmp d, r wz
26+
if_nz jmp #_next
27+
28+
cmp cz, rcz wz
29+
if_nz jmp #_next
30+
31+
mov d, testc ' set LED 0 to N
32+
sub d, cnt
33+
setb outb, d
34+
35+
_next
36+
djnz cnt, #_test
37+
38+
end jmp #end
39+
40+
41+
testc long (cnt-tests)/5
42+
' d s cz r rcz
43+
tests long $FFFF_FF9C, $0000_0001, %00, $FFFF_FFCE, %00
44+
long $FFFF_FF9C, $0000_0002, %00, $FFFF_FFE7, %00
45+
long $FFFF_FF9C, $0000_0003, %00, $FFFF_FFF3, %00
46+
long $FFFF_FF93, $0000_0001, %00, $FFFF_FFF9, %10
47+
long $FFFF_FFF9, $0000_0001, %00, $FFFF_FFFC, %10
48+
long $FFFF_FF9C, $0000_0001, %00, $FFFF_FFFE, %00
49+
long $0000_0006, $0000_0001, %00, $0000_0003, %00
50+
long $0000_0006, $0000_0002, %00, $0000_0001, %00
51+
long $0000_0006, $0000_0003, %00, $0000_0000, %01
52+
53+
cnt res 1
54+
d res 1
55+
s res 1
56+
cz res 1
57+
r res 1
58+
rcz res 1

Diff for: test_setb.spin

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
dat
2+
orgh 0
3+
org 0
4+
5+
andn outb, ##$FFFF
6+
or dirb, ##$FFFF
7+
8+
mov cnt, testc
9+
mov ptra, #@tests
10+
11+
_test rdlong d, ptra++
12+
rdlong s, ptra++
13+
rdlong cz, ptra++
14+
15+
setcz cz wc, wz
16+
17+
setb d, s wc, wz ' TEST INSTRUCTION
18+
19+
setbc cz, #1 ' store C/Z
20+
setbz cz, #0
21+
22+
rdlong r, ptra++ ' get the expected result
23+
rdlong rcz, ptra++ ' get the expected flags
24+
25+
cmp d, r wz
26+
if_nz jmp #_next
27+
28+
cmp cz, rcz wz
29+
if_nz jmp #_next
30+
31+
mov d, testc ' set LED 0 to N
32+
sub d, cnt
33+
setb outb, d
34+
35+
_next
36+
djnz cnt, #_test
37+
38+
end jmp #end
39+
40+
41+
testc long (cnt-tests)/5
42+
' d s cz r rcz
43+
tests long $0000_0000, $0000_0000, %00, $0000_0001, %00
44+
long $0000_0001, $0000_0000, %00, $0000_0001, %10
45+
long $0000_000F, $0000_0003, %00, $0000_000F, %10
46+
long $0000_0007, $0000_0003, %00, $0000_000F, %00
47+
long $AAAA_AAAA, $FFFF_FFE0, %00, $AAAA_AAAB, %00
48+
long $AAAA_AAAA, $FFFF_FFE1, %00, $AAAA_AAAA, %10
49+
50+
cnt res 1
51+
d res 1
52+
s res 1
53+
cz res 1
54+
r res 1
55+
rcz res 1

0 commit comments

Comments
 (0)