2018-02-08 15:05:37 +00:00
|
|
|
//
|
|
|
|
// Demonstrates vector tables.
|
|
|
|
// Prints "AABAB".
|
|
|
|
//
|
|
|
|
|
2018-02-07 13:43:41 +00:00
|
|
|
vector routine
|
|
|
|
trashes a, z, n
|
|
|
|
print
|
|
|
|
|
|
|
|
vector (routine
|
|
|
|
trashes a, z, n)
|
|
|
|
table[32] vectors
|
|
|
|
|
|
|
|
routine chrout
|
|
|
|
inputs a
|
|
|
|
trashes a
|
|
|
|
@ 65490
|
|
|
|
|
|
|
|
routine printa
|
|
|
|
trashes a, z, n
|
|
|
|
{
|
|
|
|
ld a, 65
|
|
|
|
call chrout
|
|
|
|
}
|
|
|
|
|
|
|
|
routine printb
|
|
|
|
trashes a, z, n
|
|
|
|
{
|
|
|
|
ld a, 66
|
|
|
|
call chrout
|
|
|
|
}
|
|
|
|
|
|
|
|
routine main
|
|
|
|
inputs vectors
|
|
|
|
outputs vectors
|
|
|
|
trashes print, a, x, z, n, c
|
|
|
|
{
|
|
|
|
ld x, 0
|
2018-02-08 15:05:37 +00:00
|
|
|
copy printa, vectors + x
|
2018-02-07 13:43:41 +00:00
|
|
|
inc x
|
2018-02-07 13:56:17 +00:00
|
|
|
copy printa, print
|
|
|
|
copy print, vectors + x
|
2018-02-07 13:43:41 +00:00
|
|
|
inc x
|
2018-02-07 13:56:17 +00:00
|
|
|
copy printb, print
|
|
|
|
copy print, vectors + x
|
2018-02-07 13:43:41 +00:00
|
|
|
inc x
|
2018-02-08 15:05:37 +00:00
|
|
|
copy printa, vectors + x
|
2018-02-07 13:43:41 +00:00
|
|
|
inc x
|
2018-02-08 15:05:37 +00:00
|
|
|
copy printb, vectors + x
|
2018-02-07 13:43:41 +00:00
|
|
|
|
|
|
|
ld x, 0
|
|
|
|
repeat {
|
|
|
|
copy vectors + x, print
|
|
|
|
call print
|
|
|
|
inc x
|
|
|
|
cmp x, 5
|
|
|
|
} until z
|
|
|
|
}
|