The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: 0x401000 on December 02, 2009, 06:32:05 PM

Title: CyclicCode
Post by: 0x401000 on December 02, 2009, 06:32:05 PM
Someone can give me an example of code that can be called as a Cyclic Code ??? http://en.wikipedia.org/wiki/Cyclic_code
very interested in the code interpreter based on Cyclic CodeĀ  ::) Thanks
Title: Re: CyclicCode
Post by: dedndave on December 02, 2009, 07:16:26 PM
this is as simple as it gets - lol

        mov     esi,offset DataArray
        mov     edx,0DABEh
        mov     ecx,ByteCount

HashIt: mov     al,[esi]
        xor     al,dl
        ror     dl,1
        mov     [esi],al
        not     dl
        inc     esi
        dec     ecx
        jnz     HashIt

the new value is dependant on the last one - the pattern repeats every 32 bytes
a little more complicated but very common example...
http://en.wikipedia.org/wiki/Cyclic_redundancy_check
Title: Re: CyclicCode
Post by: 0x401000 on December 02, 2009, 07:34:14 PM
Thank you. Indeed examples are extremely simple, then probably worthwhile to rephrase. What methods of Cyclic Code exist in programming interpreters?  Thanks
Title: Re: CyclicCode
Post by: dedndave on December 03, 2009, 12:39:47 PM
i am trying to figure out what you are after - lol
i suppose the parser might be considered cyclic
Title: Re: CyclicCode
Post by: 0x401000 on December 03, 2009, 06:04:54 PM
Yes exactly  :red