prog8/examples/test.p8

68 lines
1.3 KiB
Plaintext
Raw Normal View History

2023-08-09 20:05:23 +02:00
%import textio
%zeropage basicsafe
cbm2 {
sub SETTIM(ubyte a, ubyte b, ubyte c) {
2023-08-12 01:07:46 +02:00
}
sub RDTIM16() -> uword {
return 0
2023-08-12 01:07:46 +02:00
}
}
2023-08-12 01:07:46 +02:00
main {
sub start() {
ubyte value
uword wvalue
ubyte other = 99
uword otherw = 99
2023-08-12 01:07:46 +02:00
value=13
wvalue=99
txt.print_ub(value*value)
2023-08-12 01:07:46 +02:00
txt.spc()
txt.print_uw(wvalue*wvalue)
2023-08-12 01:07:46 +02:00
txt.nl()
2023-08-12 13:42:24 +02:00
txt.print("byte multiply..")
cbm.SETTIM(0,0,0)
repeat 100 {
for value in 0 to 255 {
cx16.r0L = value*other
}
}
txt.print_uw(cbm.RDTIM16())
2023-08-12 13:42:24 +02:00
txt.nl()
txt.print("byte squares...")
cbm.SETTIM(0,0,0)
repeat 100 {
for value in 0 to 255 {
cx16.r0L = value*value
}
}
txt.print_uw(cbm.RDTIM16())
2023-08-12 13:42:24 +02:00
txt.nl()
txt.print("word multiply..")
cbm.SETTIM(0,0,0)
repeat 50 {
for wvalue in 0 to 255 {
cx16.r0 = wvalue*otherw
}
}
txt.print_uw(cbm.RDTIM16())
2023-08-12 13:42:24 +02:00
txt.nl()
txt.print("word squares...")
cbm.SETTIM(0,0,0)
repeat 50 {
for wvalue in 0 to 255 {
cx16.r0 = wvalue*wvalue
}
}
txt.print_uw(cbm.RDTIM16())
2023-08-12 13:42:24 +02:00
txt.nl()
}
}