How important are section/segment directives? I've noticed that they are usually optional. Also, I've noticed that the output size changes when you do or do not include them.
I'm using NASM, if that helps.
How important are section/segment directives? I've noticed that they are usually optional. Also, I've noticed that the output size changes when you do or do not include them.
I'm using NASM, if that helps.
These are mostly hints to the linker. For the newer architectures you can pretty much ignore them, unless you have very specific memory management requirements. For older 16-bit code they are very essential.
They are very important because if you save your strings in the Code segment the program could execute much slower and the Strings blow up the data in the Instruction cache.
If you create a Library(.lib or something like that) it is also important because you don't wan't data (strings) to lay directly behind your executable instructions because of the reasons above.