2018-12-12 15:27:57 +00:00
|
|
|
// Should print Y
|
|
|
|
|
2019-10-22 14:10:55 +00:00
|
|
|
include "chrout.60p"
|
|
|
|
|
2019-04-08 10:50:54 +00:00
|
|
|
byte table[2048] buf
|
2017-11-24 13:42:14 +00:00
|
|
|
pointer ptr @ 254
|
2017-12-01 13:52:56 +00:00
|
|
|
byte foo
|
2017-11-24 13:42:14 +00:00
|
|
|
|
2018-09-09 14:03:43 +00:00
|
|
|
define main routine
|
2017-11-24 13:42:14 +00:00
|
|
|
inputs buf
|
2017-12-01 13:52:56 +00:00
|
|
|
outputs buf, y, foo
|
2018-12-12 15:27:57 +00:00
|
|
|
trashes a, z, n, c, ptr
|
2017-11-24 13:42:14 +00:00
|
|
|
{
|
|
|
|
ld y, 0
|
2019-05-14 07:56:35 +00:00
|
|
|
point ptr into buf {
|
|
|
|
reset ptr 0
|
|
|
|
copy 123, [ptr] + y
|
|
|
|
copy [ptr] + y, foo
|
|
|
|
copy foo, [ptr] + y
|
|
|
|
}
|
2018-12-12 15:27:57 +00:00
|
|
|
|
|
|
|
// TODO: support saying `cmp foo, 123`, maybe
|
|
|
|
ld a, foo
|
|
|
|
cmp a, 123
|
|
|
|
|
|
|
|
if z {
|
|
|
|
ld a, 89
|
|
|
|
call chrout
|
|
|
|
} else {
|
|
|
|
ld a, 78
|
|
|
|
call chrout
|
|
|
|
}
|
2017-11-24 13:42:14 +00:00
|
|
|
}
|