2024-12-22 03:47:35 +01:00
|
|
|
%import textio
|
2024-12-22 08:26:21 +01:00
|
|
|
%import math
|
2024-12-22 03:47:35 +01:00
|
|
|
|
|
|
|
%zeropage basicsafe
|
|
|
|
%option no_sysinit
|
|
|
|
|
|
|
|
|
2024-11-14 00:54:07 +01:00
|
|
|
main {
|
2024-12-15 15:55:48 +01:00
|
|
|
sub start() {
|
2024-12-22 08:26:21 +01:00
|
|
|
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()
|
2024-11-30 00:06:02 +01:00
|
|
|
}
|
2024-11-05 23:56:58 +01:00
|
|
|
}
|