I'm starting to learn the Assembly language. I'm familiar with it in the basic level. I wonder, how big application in the Assembly are organized, that is, how can I split them into modules/packages and include them into other modules? I'm talking about NASM in particular.
You can either:
Use %include
To include an external file into the current one.
This can be further controlled with the -i command line switch.
You can also force NASM to pre-include a file using the -p switch.
Assemble multiple files
Since NASM is not a linker, you can take advantage of the linkers' ability to... well, link files together.
Use the GLOBAL directive to make a set of symbols visible to other modules.
Use the EXTERN directive to import a set of symbols from other modules.
You can pass all the object files to the linker.
NASM (as today) can only assemble one file at a time, so a build script is needed.
The two above are not mutually exclusive but you have to basically understand the NASM output file formats to see when the latter is applicable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With