mirror of
https://github.com/catseye/SixtyPical.git
synced 2024-11-29 18:49:22 +00:00
51 lines
781 B
Plaintext
51 lines
781 B
Plaintext
// Demonstrates vector tables.
|
|
// Include `support/${PLATFORM}.60p` before this source
|
|
// Should print AABAB
|
|
|
|
vector routine
|
|
trashes a, z, n
|
|
print
|
|
|
|
vector (routine
|
|
trashes a, z, n)
|
|
table[32] vectors
|
|
|
|
define printa routine
|
|
trashes a, z, n
|
|
{
|
|
ld a, 65
|
|
call chrout
|
|
}
|
|
|
|
define printb routine
|
|
trashes a, z, n
|
|
{
|
|
ld a, 66
|
|
call chrout
|
|
}
|
|
|
|
define main routine
|
|
inputs vectors
|
|
outputs vectors
|
|
trashes print, a, x, z, n, c
|
|
{
|
|
ld x, 0
|
|
copy printa, vectors + x
|
|
inc x
|
|
copy printa, print
|
|
copy print, vectors + x
|
|
inc x
|
|
copy printb, print
|
|
copy print, vectors + x
|
|
inc x
|
|
copy printa, vectors + x
|
|
inc x
|
|
copy printb, vectors + x
|
|
|
|
ld x, 0
|
|
for x up to 4 {
|
|
copy vectors + x, print
|
|
call print
|
|
}
|
|
}
|