mirror of
https://github.com/catseye/SixtyPical.git
synced 2024-11-22 01:32:13 +00:00
Expand example with code that will likely become library support.
This commit is contained in:
parent
03a682ff08
commit
0ec8970c76
@ -1,14 +1,43 @@
|
|||||||
byte lives
|
byte lives
|
||||||
|
|
||||||
|
byte table[16] hexchars : "0123456789ABCDEF"
|
||||||
|
|
||||||
|
define prbyte routine
|
||||||
|
inputs a, hexchars
|
||||||
|
trashes a, z, n, c, v
|
||||||
|
{
|
||||||
|
save x {
|
||||||
|
save a {
|
||||||
|
st off, c
|
||||||
|
shr a
|
||||||
|
shr a
|
||||||
|
shr a
|
||||||
|
shr a
|
||||||
|
and a, 15
|
||||||
|
ld x, a
|
||||||
|
ld a, hexchars + x
|
||||||
|
call chrout
|
||||||
|
}
|
||||||
|
save a {
|
||||||
|
and a, 15
|
||||||
|
ld x, a
|
||||||
|
ld a, hexchars + x
|
||||||
|
call chrout
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
define main routine
|
define main routine
|
||||||
inputs lives
|
inputs lives, hexchars
|
||||||
outputs lives
|
outputs lives
|
||||||
trashes a, x, z, n, c, v
|
trashes a, x, z, n, c, v
|
||||||
{
|
{
|
||||||
ld a, 0
|
ld a, 0
|
||||||
st a, lives
|
st a, lives
|
||||||
ld x, lives
|
ld x, lives
|
||||||
st off, c
|
st off, c
|
||||||
add x, 1
|
inc x
|
||||||
st x, lives
|
st x, lives
|
||||||
}
|
ld a, lives
|
||||||
|
call prbyte
|
||||||
|
}
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
define main routine
|
|
||||||
inputs a
|
|
||||||
outputs a
|
|
||||||
trashes z, n, c
|
|
||||||
{
|
|
||||||
cmp a, 42
|
|
||||||
if z {
|
|
||||||
ld a, 7
|
|
||||||
} else {
|
|
||||||
ld a, 23
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user