;---------------------------------------------------------------- ; This is a module in the PL/I-80 utility library ; ; This module do all the 16 bit crc math ; ; CLRCRC Clear the current crc -> call clrcrc(); ; GETCRC return the CRC -> crc = getcrc(); /* bit(16) */ ; ADDCRC Add a byte to the crc -> call addcrc(option); ; MEMCRC Add memory to the crc -> call memcrc(addr(mem),size); ; Written By Richard Holmes 09-12-84 ; Last update Richard Holmes 09-12-84 ;---------------------------------------------------------------- ; name 'crc' public getcrc,clrcrc,addcrc,memcrc extrn getp2,getp1 ; getcrc: lhld crc mov a,l ret clrcrc: lxi h,0 shld crc ; addcrc: call getp1 ; fetch the byte ; addit: ret ; memcrc: ; p1 -> memory, p2 = size call getp2 ; DE -> string mov c,m inx h mov b,m ; BC = size mov a,b ora c rz ; mem$loop: ldax d push b push d call addit pop d pop b ; save and restore all dcx b mov a,b ora c jnz mem$loop ret ; dseg crc: db 00,00 end