2019-07-01 21:41:30 +00:00
|
|
|
%import c64utils
|
|
|
|
%zeropage basicsafe
|
2019-03-29 01:13:28 +00:00
|
|
|
|
2019-03-19 00:22:26 +00:00
|
|
|
~ main {
|
2019-04-21 01:04:13 +00:00
|
|
|
|
2019-07-08 13:13:24 +00:00
|
|
|
sub start() {
|
2019-07-09 18:39:08 +00:00
|
|
|
ubyte aa = 100
|
|
|
|
ubyte yy = 22
|
|
|
|
uword uw = (aa as uword)*yy
|
2019-07-09 02:09:29 +00:00
|
|
|
|
2019-07-09 17:44:59 +00:00
|
|
|
c64scr.print("stack (255?): ")
|
|
|
|
c64scr.print_ub(X)
|
|
|
|
c64.CHROUT('\n')
|
2019-07-09 07:02:56 +00:00
|
|
|
|
2019-07-09 18:39:08 +00:00
|
|
|
aa=30
|
|
|
|
yy=2
|
|
|
|
|
2019-07-09 22:25:21 +00:00
|
|
|
c64scr.print_ub(7)
|
|
|
|
c64scr.print("?: ")
|
|
|
|
check(3, 4)
|
|
|
|
|
2019-07-09 18:39:08 +00:00
|
|
|
c64scr.print_ub(aa+yy)
|
|
|
|
c64scr.print("?: ")
|
|
|
|
check(aa, yy)
|
2019-07-09 19:29:20 +00:00
|
|
|
aa++
|
|
|
|
c64scr.print_ub(aa+yy)
|
|
|
|
c64scr.print("?: ")
|
|
|
|
check(aa, yy)
|
|
|
|
aa++
|
2019-07-09 18:39:08 +00:00
|
|
|
c64scr.print_ub(aa+yy)
|
|
|
|
c64scr.print("?: ")
|
|
|
|
check(aa, yy)
|
|
|
|
|
2019-07-09 17:44:59 +00:00
|
|
|
c64scr.print_uw(uw)
|
|
|
|
c64scr.print("?: ")
|
2019-07-09 19:29:20 +00:00
|
|
|
checkuw(uw)
|
|
|
|
uw++
|
|
|
|
c64scr.print_uw(uw)
|
|
|
|
c64scr.print("?: ")
|
|
|
|
checkuw(uw)
|
|
|
|
uw++
|
|
|
|
c64scr.print_uw(uw)
|
|
|
|
c64scr.print("?: ")
|
|
|
|
checkuw(uw)
|
|
|
|
|
|
|
|
c64scr.print("stack (255?): ")
|
|
|
|
c64scr.print_ub(X)
|
|
|
|
}
|
|
|
|
|
|
|
|
sub checkuw(uword uw) {
|
2019-07-09 02:09:29 +00:00
|
|
|
when uw {
|
2019-07-09 17:44:59 +00:00
|
|
|
12345 -> c64scr.print("12345")
|
|
|
|
12346 -> c64scr.print("12346")
|
|
|
|
2200 -> c64scr.print("2200")
|
2019-07-09 18:39:08 +00:00
|
|
|
2202 -> c64scr.print("2202")
|
2019-07-09 17:44:59 +00:00
|
|
|
12347 -> c64scr.print("12347")
|
2019-07-09 18:39:08 +00:00
|
|
|
else -> c64scr.print("not in table")
|
2019-07-09 02:09:29 +00:00
|
|
|
}
|
2019-07-09 17:44:59 +00:00
|
|
|
c64.CHROUT('\n')
|
2019-07-09 18:39:08 +00:00
|
|
|
}
|
2019-07-08 22:02:38 +00:00
|
|
|
|
2019-07-09 18:39:08 +00:00
|
|
|
sub check(ubyte a, ubyte y) {
|
|
|
|
when a+y {
|
2019-07-08 22:45:15 +00:00
|
|
|
10 -> {
|
|
|
|
c64scr.print("ten")
|
|
|
|
}
|
2019-07-09 22:25:21 +00:00
|
|
|
5, 6, 7 -> c64scr.print("five or six or seven")
|
2019-07-08 22:45:15 +00:00
|
|
|
30 -> c64scr.print("thirty")
|
2019-07-09 02:09:29 +00:00
|
|
|
31 -> c64scr.print("thirty1")
|
|
|
|
32 -> c64scr.print("thirty2")
|
|
|
|
33 -> c64scr.print("thirty3")
|
2019-07-08 22:45:15 +00:00
|
|
|
99 -> c64scr.print("nn")
|
|
|
|
55 -> {
|
|
|
|
; should be optimized away
|
|
|
|
}
|
|
|
|
56 -> {
|
|
|
|
; should be optimized away
|
|
|
|
}
|
|
|
|
else -> {
|
2019-07-09 18:39:08 +00:00
|
|
|
c64scr.print("not in table")
|
2019-07-08 22:02:38 +00:00
|
|
|
}
|
|
|
|
}
|
2019-07-09 17:44:59 +00:00
|
|
|
c64.CHROUT('\n')
|
2019-07-08 13:13:24 +00:00
|
|
|
}
|
2019-04-11 22:04:15 +00:00
|
|
|
}
|