1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-24 03:38:05 +11:00
collapseos/blk/603

17 lines
442 B
Plaintext
Raw Normal View History

CODE _sdcSel SDC_CSLOW OUTiA, ;CODE
CODE _sdcDesel SDC_CSHIGH OUTiA, ;CODE
2020-04-25 10:46:01 +10:00
( Computes n into crc c with polynomial 0x1021 )
CODE _crc16 ( c n -- c )
HL POP, ( n ) DE POP, ( c )
2020-04-25 10:46:01 +10:00
A L LDrr, D XORr, D A LDrr,
B 8 LDri,
2020-04-25 10:46:01 +10:00
BEGIN,
E SLA, D RL,
2020-04-25 10:46:01 +10:00
IFC, ( msb is set, apply polynomial )
A D LDrr, 0x10 XORi, D A LDrr,
A E LDrr, 0x21 XORi, E A LDrr,
2020-04-25 10:46:01 +10:00
THEN,
DJNZ, AGAIN,
DE PUSH,
2020-04-24 03:55:00 +10:00
;CODE