please dont rip this site

SX Specific Cyclic Redundancy Check

16 and 32 Bit

By Dr. Imre Bartfai

;By Dr. Imre Bartfai
; What you need is to define the polynomial. E. g. for the CCITT one:

poly0	equ	$21
poly1	equ	$10

; Do not forget to initialize <crcval> = <crch:crcl> before the 1st call
; e. g. with 0xFF or with zeroes, as the particular CRC algorithm
; requires.

;This subroutine calculates a 16-bit CRC
;--------
; CrcUpd: update <crcval> using <W>
;
;
crch	DS 1
crcl	DS 1
saved	DS 1
oldcch	DS 1
i	DS 1

CrcUpd	mov	saved, W	; j = W
	mov	W, #8		; W = 8
	mov	i, W		; i = W
_loop	mov	W, crch
	mov	oldcch, W	; temporary save
	clrb	C		; clear carry for rlf
	rl	crcl		; crc << 1
	rl	crch
	mov	W, saved	; the char read
	xor	oldcch, W	; test with old high
	sb	oldcch.7	; if bit set, apply mask
        jmp     _notset         ; otherwise skip
	mov	W, #poly0
	xor	crcl, W
	mov	W, #poly1
	xor	crch, W
_notset	clrb	C		; for rl
	rl	saved		; next bit of saved
	decsz	i
        jmp     _loop
	ret
;
; End CrcUpd

file: /Techref/scenix/lib/io/osi2/crc_sx.htm, 1KB, , updated: 2001/5/19 19:49, local time: 2024/11/22 01:27,
TOP NEW HELP FIND: 
3.15.14.245:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://massmind.org/Techref/scenix/lib/io/osi2/crc_sx.htm"> SX Specific Cyclic Redundancy Check 16 and 32 Bit </A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .