NASM
From OSDev Wiki
The Netwide Assembler (NASM) is a popular assembler for the IA32 platform. NASM is open source software and is freely available from SourceForge. Those preferring it over GNU as (GAS) claim its easy syntax and powerful macro capabilities are a plus. On the other hand, other users claim gas is better integrated into the GNU Compiler Collection (GCC) and has more cross-platform capabilities. Similar to editor and browser discussions, this is likely to remain an unresolved debate.
NASM is available for many operating systems, including (but not limited to) Windows and GNU/Linux. Due to its availability in source format, NASM can be made to run on pretty much any operating system, and is a common choice for a first port to a hobby OS.
Contents |
Advice when using NASM
- Use "-w+orphan-labels". Often, labels without colons were not really intended to be labels, and are actually misspellings or typos. This flag will cause NASM to warn you if there are labels without colons.
- Explicitly define your sections. While NASM defaults to .text, it doesn't put labels declared as globals in .text correctly, unless the label is preceded by a section directive at some point.
