prog8/examples/test.p8

46 lines
1.1 KiB
Plaintext
Raw Normal View History

%import textio
%import string
%zeropage basicsafe
%option no_sysinit
main {
sub start() {
2024-02-08 21:45:36 +00:00
str name1 = "name1"
str name2 = "name2"
uword[] @split names = [name1, name2, "name3"]
uword[] addresses = [0,0,0]
names = [1111,2222,3333]
addresses = names
;foo("zzz")
}
2024-02-08 01:22:37 +00:00
sub foo (str sarg) {
2024-02-08 21:45:36 +00:00
ubyte[3] svar
2024-02-08 01:22:37 +00:00
txt.print_uwhex(svar, true)
txt.nl()
2024-02-08 01:22:37 +00:00
txt.print_uwhex(&svar, true)
txt.nl()
2024-02-08 01:22:37 +00:00
txt.print_uwhex(&svar[2], true)
txt.nl()
2024-02-08 21:45:36 +00:00
cx16.r1L = 3
txt.print_uwhex(&svar[cx16.r1L], true)
txt.nl()
2024-02-08 21:45:36 +00:00
txt.nl()
2024-02-08 01:22:37 +00:00
txt.print_uwhex(sarg, true)
txt.nl()
2024-02-08 01:22:37 +00:00
txt.print_uwhex(&sarg, true)
txt.nl()
2024-02-08 01:22:37 +00:00
txt.print_uwhex(sarg+2, true)
txt.nl()
2024-02-08 01:22:37 +00:00
cx16.r0 = &sarg[2]
txt.print_uwhex(cx16.r0, true) ; TODO should be the same as the previous one sarg+2 (13)!
txt.nl()
2024-02-08 21:45:36 +00:00
cx16.r1L=3
cx16.r0 = &sarg[cx16.r1L]
txt.print_uwhex(cx16.r0, true) ; TODO should be the same as the previous one sarg+2 (13)!
txt.nl()
}
}