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
|
|
|
|
|
2018-09-09 14:31:35 +00:00
|
|
|
define chrout routine
|
2018-02-07 13:43:41 +00:00
|
|
|
inputs a
|
|
|
|
trashes a
|
|
|
|
@ 65490
|
|
|
|
|
2018-09-09 14:31:35 +00:00
|
|
|
define printa routine
|
2018-02-07 13:43:41 +00:00
|
|
|
trashes a, z, n
|
|
|
|
{
|
|
|
|
ld a, 65
|
|
|
|
call chrout
|
|
|
|
}
|
|
|
|
|
2018-09-09 14:31:35 +00:00
|
|
|
define printb routine
|
2018-02-07 13:43:41 +00:00
|
|
|
trashes a, z, n
|
|
|
|
{
|
|
|
|
ld a, 66
|
|
|
|
call chrout
|
|
|
|
}
|
|
|
|
|
2018-09-09 14:31:35 +00:00
|
|
|
define main routine
|
2018-02-07 13:43:41 +00:00
|
|
|
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
|
|
|
|
}
|