F5F Stay Refreshed Software General Software How to compile a binary using NASM?

How to compile a binary using NASM?

How to compile a binary using NASM?

P
PisulasRule
Senior Member
676
03-18-2023, 10:47 PM
#1
Hello! I'm working on converting a .asm file to a .o file (binary).
I've downloaded nasm and opened the NASM shell:
Code: ...\AppData\Local\bin\NASM>nasm -f elf32 kernel.asm -o kasm.o
kernel.asm:5: error: parser: instruction expected
...\AppData\Local\bin\NASM>nasm -f elf32 kernel.asm
kernel.asm:5: error: parser: instruction expected
...\AppData\Local\bin\NASM>nasm kernel.asm
kernel.asm:5: error: parser: instruction expected
I copied the file into the bin folder, but it keeps showing this message.
I tried typing "help" to check available instructions, but nasm isn't listed.
P
PisulasRule
03-18-2023, 10:47 PM #1

Hello! I'm working on converting a .asm file to a .o file (binary).
I've downloaded nasm and opened the NASM shell:
Code: ...\AppData\Local\bin\NASM>nasm -f elf32 kernel.asm -o kasm.o
kernel.asm:5: error: parser: instruction expected
...\AppData\Local\bin\NASM>nasm -f elf32 kernel.asm
kernel.asm:5: error: parser: instruction expected
...\AppData\Local\bin\NASM>nasm kernel.asm
kernel.asm:5: error: parser: instruction expected
I copied the file into the bin folder, but it keeps showing this message.
I tried typing "help" to check available instructions, but nasm isn't listed.

A
AyoItsAmyyx
Member
72
03-19-2023, 07:03 AM
#2
What steps have you taken to resolve this?
The issue appears in the initial five lines of "kernel.asm". It's probable the file isn't fully compatible with NASM, so you may need a different assembler (such as MASM) or adjust the source code accordingly.
A
AyoItsAmyyx
03-19-2023, 07:03 AM #2

What steps have you taken to resolve this?
The issue appears in the initial five lines of "kernel.asm". It's probable the file isn't fully compatible with NASM, so you may need a different assembler (such as MASM) or adjust the source code accordingly.