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 7 of 10 Topic 4571 of 4729
Post > Topic >>

Re: Calculating checksums...

by Frank Kotler <spamtrap@[EMAIL PROTECTED] > Mar 15, 2008 at 08:11 PM

Alex Buell wrote:
> On Sat, 15 Mar 2008 06:14:00 GMT, I waved a wand and this message
> magically appears in front of Frank Kotler:
> 
> 
>>>How would you suggest I could rewrite this in NASM?
>>
>>Dunno. What's it do? If it emits code similar to what Tim posted,
>>maybe we could do something with it. It *looks* to me as if this
>>performs the calculation at assemble-time! IOW, it *doesn't* emit
>>anything but the checksum "patch_byte". If this is true, I don't
>>think it's possible with Nasm. I don't think Nasm knows anything
>>about any "previous bytes" at the time the macro-processor runs. If
>>this does what I think it does, Fasm must have a "post-processor".
>>I've been told that Fasm's macro facilities are more powerful than
>>Nasm's... perhaps it's true. The syntax is a whole lot "prettier"
>>than Nasm's (which looks like someone had a nice bowl of punctuation
>>salad, and vomited). I can't say that I find it any more
>>"readable"... what's "load CHKSUM byte from %-1" do? If it emits
>>"lodsb", or similar, maybe. If it does this at assemble-time... I
>>think you'd better stick to Fasm!
>>
>>Or maybe a more sophisticated Nasm macro user can help you. I'm
>>stumped.
> 
> 
> What that FASM script does is to calculate the checksum for the
> contents of the assembled file and inserts it at the end of the
> assembled file. Can anything like that be done in NASM?

I don't believe so. Hasn't got the "interpreter" in it (Thanks, Mike, 
for that link! - that's what I *thought* Fasm was doing...). In a batch 
file, maybe...

call nasm
call my_chksum.com

Someday when I'm real ambitious, maybe I'll look at the code and see how 
Tomasz did it. Good trick!

Best,
Frank
 




 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 Thu Jul 24 14:59:30 CDT 2008.