Why doesn’t NASM compile to an object file with the org directive?
org 0x7C00
nop
mov ax, ax
nop
If I compile this with:
nasm -O0 -fobj temp.asm
NASM gives me an error for whatever reason:
temp.asm:1: error: parser: instruction expected
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In this case instead of
orgyou should useresb:This is how you can compile different parts of a .COM program into separate object files. If you use TLINK as the linker, the next step would be:
Note that if you omit the comma and the following name of the resultant binary (nasmOrg.bin) or if you specify a name with the .COM extension (e.g. nasmOrg.com), TLINK will refuse to link, it will say something like:
And you’ll have to change 0x7C00 to 0x0100 to make a .COM program.