-
Notifications
You must be signed in to change notification settings - Fork 21
/
a8_os_test.mfk
51 lines (40 loc) · 851 Bytes
/
a8_os_test.mfk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Quick test for a8_os.mfk module
// By Freddy Offenga, 2019
import stdio
void print_hex(word w) {
putchar(hi_nibble_to_hex(w.hi))
putchar(lo_nibble_to_hex(w.hi))
putchar(hi_nibble_to_hex(w.lo))
putchar(lo_nibble_to_hex(w.lo))
}
void main() {
// test const byte
putchar(os_ATBEL)
// test const word
print_hex(os_B00600)
// test const '<char>'
// test volatile byte zp
os_LMARGN = os_LMARGN - 2
putchar(os_ATEOL)
putchar(os_DISK)
// test volatile byte adr
os_COLOR4 = os_COLOR1
// test volatile word zp
const array text = "Hello world!" atasciiscr
pointer scr
byte i
scr = os_SAVMSC + 120
for i,0,to,text.lastindex {
scr[i] = text[i]
}
// test volatile word adr
os_CDTMV4 = 1000
while (os_CDTMV4 != 0) {
print_hex(os_CDTMV4)
for i,0,to,3 {
putchar(os_ATLRW)
}
}
os_COLOR2 = 0
while (true) {}
}