Skip to content

Commit dc13694

Browse files
committed
Adds tests for SIO statement and SERR() function.
This needs newer version of mini65 emulator, using an emulated disk drive to write and read sectors.
1 parent 87ad063 commit dc13694

3 files changed

Lines changed: 51 additions & 1 deletion

File tree

testsuite/mini65

testsuite/tests/stmt-sio.bas

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
' Test SIO statement
2+
? "Start"
3+
DIM buf1(128) byte, buf2(128) byte
4+
' Write some data into buffer
5+
FOR i=0 TO 128 : buf1(i)=255-i : NEXT
6+
7+
' Try reading buf1 from sector 0 (invalid)
8+
SIO $31, 1, $52, 64, &buf1, 15, 128, 0, 0
9+
? SERR()
10+
' Write buf1 to emulated sector 719
11+
SIO $31, 1, $50, 128, &buf1, 15, 128, 719 & 255, 719/256
12+
? SERR()
13+
' Write buf2 to emulated sector 720
14+
SIO $31, 1, $50, 128, &buf2, 15, 128, 720 & 255, 720/256
15+
? SERR()
16+
' Read buf2 from emulated sector 719
17+
SIO $31, 1, $52, 64, &buf2, 15, 128, 719 & 255, 719/256
18+
? SERR()
19+
' Read buf1 from emulated sector 720
20+
SIO $31, 1, $52, 64, &buf1, 15, 128, 720 & 255, 720/256
21+
? SERR()
22+
23+
' Check values of buf1
24+
? "1:";
25+
FOR i=0 TO 127
26+
If buf1(i) <> 0
27+
? " "; i; "="; buf1(i);
28+
Endif
29+
NEXT
30+
?
31+
32+
' Check values of buf2
33+
? "2:";
34+
FOR i=0 TO 127
35+
If buf2(i) <> 255-i
36+
? " "; i; "="; buf2(i);
37+
Endif
38+
NEXT
39+
?

testsuite/tests/stmt-sio.chk

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Name: Test SIO statement
2+
Test: run
3+
Output:
4+
Start
5+
139
6+
1
7+
1
8+
1
9+
1
10+
1:
11+
2:

0 commit comments

Comments
 (0)