prog8/examples/test.p8

32 lines
641 B
Plaintext
Raw Normal View History

2024-12-22 03:47:35 +01:00
%import textio
%import math
2024-12-22 03:47:35 +01:00
%zeropage basicsafe
%option no_sysinit
main {
2024-12-15 15:55:48 +01:00
sub start() {
str input = iso:"the quick brown fox jumps over the lazy dog"
txt.print_uwhex(math.crc16(input, len(input)), true)
txt.nl()
math.crc32(input, len(input))
txt.print_uwhex(cx16.r15, true)
txt.print_uwhex(cx16.r14, false)
txt.nl()
math.crc32_start()
for cx16.r0L in input
math.crc32_update(cx16.r0L)
uword hiw,low
hiw,low = math.crc32_end_result()
txt.print_uwhex(hiw, true)
txt.print_uwhex(low, false)
txt.nl()
}
}