1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-11-22 01:32:13 +00:00

Add another example. Even more convincing that the order is wrong.

This commit is contained in:
Chris Pressey 2018-11-27 13:05:19 +00:00
parent 2d767e9fe7
commit 046e43cd66
2 changed files with 80 additions and 8 deletions

74
eg/rudiments/cmp-byte.60p Normal file
View File

@ -0,0 +1,74 @@
// Should print ENGGL
byte b
define chrout routine
inputs a
trashes a
@ 65490
define main routine
outputs b
trashes a, x, y, z, n, c, v
{
ld a, 40
st a, b
cmp a, b
if z {
ld a, 69 // E
call chrout
} else {
ld a, 78 // N
call chrout
}
ld a, 41
st a, b
ld a, 40
cmp a, b
if z {
ld a, 69 // E
call chrout
} else {
ld a, 78 // N
call chrout
}
ld a, 20
st a, b
ld a, 21
cmp a, b // 21 >= 20
if c {
ld a, 71 // G
call chrout
} else {
ld a, 76 // L
call chrout
}
ld a, 20
cmp a, b // 20 >= 21
if c {
ld a, 71 // G
call chrout
} else {
ld a, 76 // L
call chrout
}
ld a, 19
cmp a, b // 19 < 21
if c {
ld a, 71 // G
call chrout
} else {
ld a, 76 // L
call chrout
}
}

View File

@ -1,4 +1,4 @@
// Should print ENLGG
// Should print ENGGL
word w1
word w2
@ -36,10 +36,10 @@ define main routine
call chrout
}
copy 20000, w1
copy 20002, w1
copy 20001, w2
cmp w1, w2
cmp w1, w2 // 20002 >= 20001
if c {
ld a, 71 // G
call chrout
@ -49,9 +49,8 @@ define main routine
}
copy 20001, w1
copy 20001, w2
cmp w1, w2
cmp w1, w2 // 20001 >= 20001
if c {
ld a, 71 // G
call chrout
@ -60,10 +59,9 @@ define main routine
call chrout
}
copy 20002, w1
copy 20001, w2
copy 20000, w1
cmp w1, w2
cmp w1, w2 // 20000 < 20001
if c {
ld a, 71 // G
call chrout