2024-07-16 21:28:49 +02:00
|
|
|
%import buffers
|
2024-06-01 15:03:01 +02:00
|
|
|
%import textio
|
2024-06-29 15:41:39 +02:00
|
|
|
%option no_sysinit
|
2024-07-16 00:25:29 +02:00
|
|
|
%zeropage basicsafe
|
2023-12-31 01:02:33 +01:00
|
|
|
|
2024-07-21 13:35:28 +02:00
|
|
|
|
2024-01-07 18:48:18 +01:00
|
|
|
main {
|
2024-07-16 00:25:29 +02:00
|
|
|
sub start() {
|
2024-07-21 13:35:28 +02:00
|
|
|
signed()
|
|
|
|
unsigned()
|
2024-07-04 00:04:45 +02:00
|
|
|
}
|
|
|
|
|
2024-07-21 13:35:28 +02:00
|
|
|
sub signed() {
|
|
|
|
txt.print("signed\n")
|
|
|
|
byte @shared bvalue = -88
|
|
|
|
word @shared wvalue = -8888
|
|
|
|
|
|
|
|
txt.print_b(bvalue/2)
|
2024-07-21 22:08:41 +02:00
|
|
|
txt.spc()
|
|
|
|
txt.print_b(bvalue/4)
|
|
|
|
txt.spc()
|
|
|
|
txt.print_b(bvalue/8)
|
2024-07-21 13:35:28 +02:00
|
|
|
txt.nl()
|
|
|
|
|
|
|
|
bvalue /= 2
|
|
|
|
txt.print_b(bvalue)
|
2024-07-21 22:08:41 +02:00
|
|
|
txt.spc()
|
|
|
|
bvalue /= 8
|
2024-07-21 13:35:28 +02:00
|
|
|
txt.print_b(bvalue)
|
|
|
|
txt.nl()
|
|
|
|
|
2024-07-21 22:08:41 +02:00
|
|
|
txt.print_w(wvalue/2)
|
|
|
|
txt.spc()
|
2024-07-21 13:35:28 +02:00
|
|
|
txt.print_w(wvalue/4)
|
2024-07-21 22:08:41 +02:00
|
|
|
txt.spc()
|
|
|
|
txt.print_w(wvalue/8)
|
2024-07-21 13:35:28 +02:00
|
|
|
txt.nl()
|
|
|
|
|
2024-07-21 22:08:41 +02:00
|
|
|
wvalue /= 2
|
2024-07-21 13:35:28 +02:00
|
|
|
txt.print_w(wvalue)
|
2024-07-21 22:08:41 +02:00
|
|
|
txt.spc()
|
|
|
|
wvalue /= 8
|
2024-07-21 13:35:28 +02:00
|
|
|
txt.print_w(wvalue)
|
|
|
|
txt.nl()
|
|
|
|
}
|
|
|
|
|
|
|
|
sub unsigned() {
|
2024-07-21 20:42:48 +02:00
|
|
|
txt.print("\nunsigned\n")
|
2024-07-21 22:08:41 +02:00
|
|
|
ubyte @shared bvalue = 88
|
|
|
|
uword @shared wvalue = 8888
|
2024-07-21 13:35:28 +02:00
|
|
|
|
2024-07-21 22:08:41 +02:00
|
|
|
txt.print_ub(bvalue/2)
|
|
|
|
txt.spc()
|
|
|
|
txt.print_ub(bvalue/4)
|
|
|
|
txt.spc()
|
|
|
|
txt.print_ub(bvalue/8)
|
2024-07-21 13:35:28 +02:00
|
|
|
txt.nl()
|
|
|
|
|
2024-07-21 22:08:41 +02:00
|
|
|
bvalue /= 2
|
|
|
|
txt.print_ub(bvalue)
|
|
|
|
txt.spc()
|
|
|
|
bvalue /= 8
|
|
|
|
txt.print_ub(bvalue)
|
2024-07-21 13:35:28 +02:00
|
|
|
txt.nl()
|
|
|
|
|
2024-07-21 22:08:41 +02:00
|
|
|
txt.print_uw(wvalue/2)
|
|
|
|
txt.spc()
|
|
|
|
txt.print_uw(wvalue/4)
|
|
|
|
txt.spc()
|
|
|
|
txt.print_uw(wvalue/8)
|
2024-07-21 13:35:28 +02:00
|
|
|
txt.nl()
|
|
|
|
|
2024-07-21 22:08:41 +02:00
|
|
|
wvalue /= 2
|
|
|
|
txt.print_uw(wvalue)
|
|
|
|
txt.spc()
|
|
|
|
wvalue /= 8
|
|
|
|
txt.print_uw(wvalue)
|
2024-07-21 13:35:28 +02:00
|
|
|
txt.nl()
|
|
|
|
}
|
|
|
|
}
|