Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Calculating che...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 10 Topic 4571 of 4646
Post > Topic >>

Calculating checksums...

by Alex Buell <spamtrap@[EMAIL PROTECTED] > Mar 14, 2008 at 07:33 PM

I have a snippet of FASM code:

; The last byte (512th) will be the patch_byte for the checksum
; patch_byte is calculated and automagically inserted below
PREV_CHKSUM = 0
repeat $
   load CHKSUM byte from %-1
   CHKSUM = (PREV_CHKSUM + CHKSUM) mod 0x100
   PREV_CHKSUM = CHKSUM
end repeat
store byte (0x100 - CHKSUM) at ($-1)  ; store the patch_byte

How would you suggest I could rewrite this in NASM?
-- 
http://www.munted.org.uk

Fearsome grindings.




 10 Posts in Topic:
Calculating checksums...
Alex Buell <spamtrap@  2008-03-14 19:33:12 
Re: Calculating checksums...
Tim Roberts <spamtrap  2008-03-15 03:18:56 
Re: Calculating checksums...
Robert Redelmeier <red  2008-03-15 13:40:22 
Re: Calculating checksums...
Tim Roberts <spamtrap  2008-03-16 21:13:23 
Re: Calculating checksums...
Frank Kotler <spamtra  2008-03-15 06:14:00 
Re: Calculating checksums...
Alex Buell <spamtrap@  2008-03-15 08:25:41 
Re: Calculating checksums...
Frank Kotler <spamtra  2008-03-15 20:11:34 
Re: Calculating checksums...
Alex Buell <spamtrap@  2008-03-15 08:20:33 
Re: Calculating checksums...
Mike Gonta <spamtrap@  2008-03-15 04:30:28 
Re: Calculating checksums...
Mike Gonta <spamtrap@  2008-03-15 06:32:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 16:27:33 CDT 2008.