mirror of
https://github.com/irmen/prog8.git
synced 2025-01-11 13:29:45 +00:00
37 lines
664 B
Lua
37 lines
664 B
Lua
%import textio
|
|
%zeropage basicsafe
|
|
|
|
main
|
|
{
|
|
sub start()
|
|
{
|
|
uword zc = 54321
|
|
ubyte zb = 123
|
|
ubyte shift = 2
|
|
|
|
txt.print_uw(zc<<shift)
|
|
txt.nl()
|
|
txt.print_uw(zc>>shift)
|
|
txt.nl()
|
|
txt.print_ub(zb<<shift)
|
|
txt.nl()
|
|
txt.print_ub(zb>>shift)
|
|
txt.nl()
|
|
|
|
word szc = -12345
|
|
byte szb = -123
|
|
txt.print_w(szc<<shift)
|
|
txt.nl()
|
|
txt.print_w(szc>>shift)
|
|
txt.nl()
|
|
txt.print_b(szb<<shift)
|
|
txt.nl()
|
|
txt.print_b(szb>>shift)
|
|
txt.nl()
|
|
|
|
|
|
; cx16.r1L = (zc<<shift) as ubyte
|
|
; txt.print_ub(cx16.r1L)
|
|
}
|
|
}
|