2024-03-16 00:45:25 +01:00
|
|
|
%import math
|
2024-03-12 23:39:54 +01:00
|
|
|
%import textio
|
|
|
|
%zeropage basicsafe
|
|
|
|
%option no_sysinit
|
2023-12-31 01:02:33 +01:00
|
|
|
|
2024-03-16 00:45:25 +01:00
|
|
|
; $029f
|
|
|
|
|
2024-01-07 18:48:18 +01:00
|
|
|
main {
|
2024-03-02 14:26:02 +01:00
|
|
|
sub start() {
|
2024-03-16 00:45:25 +01:00
|
|
|
txt.print("crc16\n")
|
|
|
|
txt.print_uwhex(math.crc16($0800, 32768), true)
|
|
|
|
txt.nl()
|
|
|
|
|
|
|
|
cx16.r15 = 0
|
|
|
|
math.crc16_start()
|
|
|
|
for cx16.r9 in $0800 to $0800+32768-1 {
|
|
|
|
math.crc16_update(@(cx16.r9))
|
2024-03-13 22:33:25 +01:00
|
|
|
}
|
2024-03-16 00:45:25 +01:00
|
|
|
txt.print_uwhex(math.crc16_end(), true)
|
|
|
|
txt.nl()
|
2024-03-14 22:13:41 +01:00
|
|
|
|
2024-03-16 00:45:25 +01:00
|
|
|
txt.print("crc32\n")
|
|
|
|
cx16.r0 = cx16.r1 = 0
|
|
|
|
math.crc32($0800, 32768)
|
|
|
|
txt.print_uwhex(cx16.r15, true)
|
|
|
|
txt.print_uwhex(cx16.r14, false)
|
|
|
|
txt.nl()
|
|
|
|
|
|
|
|
cx16.r0 = cx16.r1 = 0
|
|
|
|
math.crc32_start()
|
|
|
|
for cx16.r9 in $0800 to $0800+32768-1 {
|
|
|
|
math.crc32_update(@(cx16.r9))
|
2024-03-15 01:04:51 +01:00
|
|
|
}
|
2024-03-16 00:45:25 +01:00
|
|
|
math.crc32_end()
|
|
|
|
txt.print_uwhex(cx16.r15, true)
|
|
|
|
txt.print_uwhex(cx16.r14, false)
|
|
|
|
txt.nl()
|
2024-03-14 22:13:41 +01:00
|
|
|
}
|
2024-03-01 19:45:16 +01:00
|
|
|
}
|
2024-03-16 00:45:25 +01:00
|
|
|
|
|
|
|
|