1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-11-25 23:49:17 +00:00
SixtyPical/eg/rudiments/vector-table.60p
2018-09-09 15:31:35 +01:00

59 lines
816 B
Plaintext

//
// Demonstrates vector tables.
// Prints "AABAB".
//
vector routine
trashes a, z, n
print
vector (routine
trashes a, z, n)
table[32] vectors
define chrout routine
inputs a
trashes a
@ 65490
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
repeat {
copy vectors + x, print
call print
inc x
cmp x, 5
} until z
}