Final (for now) cleanup of the example sources.

This commit is contained in:
Chris Pressey committed 2018-12-12 15:27:57 +00:00
1 parent 75449d7271
commit f2570729a4
7 files changed
+58 -28

No files matched your search

-8
View File
@@ -1,8 +0,0 @@
define main routine
inputs a
outputs a
trashes c, z, n, v
{
st off, c
add a, 4
}
-9
View File
@@ -1,9 +0,0 @@
word score
define main routine
inputs score
outputs score
trashes a, c, z, v, n
{
st off, c
add score, 1999
}
+36
View File
@@ -0,0 +1,36 @@
// Include `support/${PLATFORM}.60p` before this source
// Should print YY
word score
define main routine
inputs a, score
outputs score
trashes a, c, z, n, v
{
ld a, 3
st off, c
add a, 4
cmp a, 7
if z {
ld a, 89
call chrout
} else {
ld a, 78
call chrout
}
copy 999, score
st off, c
add score, 1999
cmp score, 2998
if z {
ld a, 89
call chrout
} else {
ld a, 78
call chrout
}
}
+16 -1
View File
@@ -1,3 +1,6 @@
// Include `support/${PLATFORM}.60p` before this source
// Should print Y
buffer[2048] buf
pointer ptr @ 254
byte foo
@@ -5,11 +8,23 @@ byte foo
define main routine
inputs buf
outputs buf, y, foo
trashes a, z, n, ptr
trashes a, z, n, c, ptr
{
ld y, 0
copy ^buf, ptr
copy 123, [ptr] + y
copy [ptr] + y, foo
copy foo, [ptr] + y
// 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
}
}
-10
View File
@@ -1,10 +0,0 @@
byte bar
byte baz
define main routine
inputs baz
outputs bar
trashes a, n, z
{
copy baz, bar
}
+3
View File
@@ -1,3 +1,6 @@
// Include `support/${PLATFORM}.60p` before this source
// Should print 01
byte lives
byte table[16] hexchars : "0123456789ABCDEF"
+3
View File
@@ -1,3 +1,6 @@
// This program is expected to loop forever.
// Be prepared to forcibly terminate your emulator.
define main routine
trashes a, y, z, n, c
{