2018-12-12 15:27:57 +00:00
|
|
|
// Include `support/${PLATFORM}.60p` before this source
|
|
|
|
// Should print Y
|
|
|
|
|
2017-11-24 13:42:14 +00:00
|
|
|
buffer[2048] buf
|
|
|
|
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
|
2017-12-01 12:36:58 +00:00
|
|
|
copy ^buf, ptr
|
2017-11-24 16:56:55 +00:00
|
|
|
copy 123, [ptr] + y
|
2017-12-01 13:52:56 +00:00
|
|
|
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
|
|
|
}
|