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


|