flat assembler
Message board for the users of flat assembler.
Index
> Windows > CRC32 Calculation ( Sorry for posting so many threads) |
Author |
|
bogdanontanu 19 Nov 2004, 01:20
Heh, for somebody with "crc32" name ... is this ironical or what?
|
|||
19 Nov 2004, 01:20 |
|
Matrix 19 Nov 2004, 01:29
hy,
i see you're serious about the problem , but could you describe your problem? why is it good for you to post similar in many posts? you won't get more help that way. if your problem is manual calculation, then it fully depends on you if you can do it without a computer. ps.: anyway crc i guess is not os dependent, so it could fit easily in main |
|||
19 Nov 2004, 01:29 |
|
crc32 19 Nov 2004, 02:07
Hi there,
The problem is manually calculation CRC values... I can get the crc values from code with ease... but I need to understand how to do it manually, so that I can work with NON-STANDARD POLY. The reason for putting in different threads = they are all different problems, but all related to CRC. I figured if I put them all in one thread, I will confuse more people. I don't have a problem calculating with computer, but I do have a problem doing Long-Hand calculation. If you know how to do it for CRC32, then please advice. thanks for your time reading. regards Jim Matrix wrote: hy, _________________ CRC32 Manual Calculation: HELP>>>> I am stuck |
|||
19 Nov 2004, 02:07 |
|
Matrix 19 Nov 2004, 02:34
Code: PROGRAM CRCTable; {CRCTable generates the table of constants needed for byte-wise CRC-16 calculations. The constants are formatted for inclusion in the CRC UNIT. (C) Copyright 1989, Earl F. Glynn, Overland Park, KS. Compuserve 73257,3527. All Rights Reserved. This Turbo Pascal 5.5 PROGRAM may be freely distributed for non-commercial use. This program was derived from the CRCV FORTRAN 77 program given in "Byte-wise CRC Calculations" by Aram Perez in IEEE Micro, June 1983, pp. 40-50. The constants here are for the CRC-16 generator polynomial X^16 + X^15 + X^2 + 1. Other generator polynomials could be used but a new derivation would be needed to calculate the 'v' variables below.} CONST hexdigit: ARRAY[0..15] OF CHAR = '0123456789ABCDEF'; v : ARRAY[1..16] OF 0..1 = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); VAR count: 0..256; i,j : 1..4; k,sum: 0..16; x,x1,x2,x3,x4,x5,x6,x7,x8: 0..1; BEGIN count := 0; FOR x8 := 0 TO 1 DO FOR x7 := 0 TO 1 DO FOR x6 := 0 TO 1 DO FOR x5 := 0 TO 1 DO FOR x4 := 0 TO 1 DO FOR x3 := 0 TO 1 DO FOR x2 := 0 TO 1 DO FOR x1 := 0 TO 1 DO BEGIN x := x7 XOR x6 XOR x5 XOR x4 XOR x3 XOR x2 XOR x1; v[16] := x8 XOR x; v[15] := x; v[14] := x8 XOR x7; v[13] := x7 XOR x6; v[12] := x6 XOR x5; v[11] := x5 XOR x4; v[10] := x4 XOR x3; v[ 9] := x3 XOR x2; v[ 8] := x2 XOR x1; v[ 7] := x1; v[ 1] := x8 XOR x; k := 16; WRITE ('$'); FOR i := 1 TO 4 DO BEGIN FOR j := 1 TO 4 DO BEGIN IF j = 1 THEN sum := v[k] ELSE sum := 2*sum + v[k]; DEC (k) END; WRITE (hexdigit[sum]) END; WRITE (','); INC (count); IF count MOD 11 = 0 THEN WRITELN END END {CRCTable}. this helps? you can find more here and a google search here |
|||
19 Nov 2004, 02:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.