prog8/examples/test.p8

49 lines
786 B
Plaintext
Raw Normal View History

2024-06-01 15:03:01 +02:00
%import textio
%option no_sysinit
%zeropage basicsafe
2024-07-21 13:35:28 +02:00
main {
sub start() {
ubyte @shared v1,v2,v3
v1 = %10011001
v2 = %10101010
v3 = %00111100
2024-07-21 13:35:28 +02:00
v1 &= %00011111
v1++
txt.print_ubbin(v1, true)
txt.nl()
2024-07-21 13:35:28 +02:00
v1 &= ~v2
v1++
txt.print_ubbin(v1, true)
txt.nl()
2024-07-21 13:35:28 +02:00
v1 |= 100
v1++
txt.print_ubbin(v1, true)
txt.nl()
2024-07-21 13:35:28 +02:00
v1 |= v2
v1++
txt.print_ubbin(v1, true)
txt.nl()
v1 |= v2 & v3
v1++
txt.print_ubbin(v1, true)
txt.nl()
v1 &= v2|v3
v1++
txt.print_ubbin(v1, true)
txt.nl()
v1 &= ~(v2|v3)
v1++
txt.print_ubbin(v1, true)
txt.nl()
2024-07-21 13:35:28 +02:00
}
}