Talk About Network

Google


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 > Re: Calculating...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 10 Topic 4571 of 4729
Post > Topic >>

Re: Calculating checksums...

by Mike Gonta <spamtrap@[EMAIL PROTECTED] > Mar 15, 2008 at 04:30 AM

On Mar 14, 3:33 pm, Alex Buell wrote:

> 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?

That's easy, just replace the "N" with "F".

http://flatassembler.net/

Seriously though, NASM is an excellent assembler, however
the macro facilities of FASM directly interface the assembly
process and are not merely a preprocess. This example only
reveals the tip of the iceberg.


Mike Gonta
look and see - many look but few see

http://mikegonta.com
 




 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 Fri Jul 25 20:55:56 CDT 2008.