NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: dalfonso01 on May 27, 2014, 11:41:30 AM

Title: Upfront decision about single file vs separate compilation and procedure design?
Post by: dalfonso01 on May 27, 2014, 11:41:30 AM
Hi,
I am seeing that also a simple move from a single file to a separate compilation to target a library for reuse  requires quite a lot of attention , significant more than in higher level languages.
The same occurs moving code from a block to multiple procedures.

Should I consider the splits better as an upfront decision to make, for any but toy size coding?

Thanks
Fabio D'Alfonso
Title: Re: Upfront decision about single file vs separate compilation?
Post by: Frank Kotler on May 27, 2014, 12:56:51 PM
Hi Fabio,

My naive thinking is that you've got two keywords here, one is "reuse" and the other is "upfront". If "reuse" is a goal, I would think that separate compilation of modules would almost certainly be better. As opposed to writing a big "monofile" first and then deciding to split it up into modules, or writing modules first and then deciding to combine them, I would think that "upfront" would be better - although you could do either without "too" much penalty. That's only halfway through my first cup of coffee...

Best,
Frank

Title: Re: Upfront decision about single file vs separate compilation and procedure design?
Post by: dalfonso01 on May 27, 2014, 01:17:21 PM
Hi,
the same occurs moving code from a block to multiple procedures, and probably my first think came from this more than the split in files.

Yes, nothing really hard, I was just seeing how the operations related to stack and registers' preservation make the task a little more error prone.

Thanks
Fabio D'Alfonso