NASM Error Parsing, Instruction Expected

That assembly language is MASM, not NASM.

For starters, NASM segments are defined differently.

Instead of

Code    segment word public 'CODE'

we write

.section text

And that “ASSUME” declaration… You must have an ancient book. That is old, old MASM code. Brings back memories from the early 1980s for me!

There are many differences between NASM and MASM, and your code needs quite a bit of work to port. If you want to port that MASM code to NASM, see MASM/NASM Differences or the NASM documentation or google “NASM vs MASM”

TL;DR: you are writing MASM code, not NASM.

Leave a Comment