NASM Forum > Example Code

phase error detected at end of assembly


Why do i recive thise error:phase error detected at end of assembly ??Here is the code that generates this error:

Frank Kotler:
Good question. It assembles without a whimper for me. What command line are you feeding Nasm?

The "phase error" message is intended to be generated if you give too small a number to the "-O" switch, and Nasm can't complete optimization in the specified maximum number of passes. At one time, "-O2" gave five passes, and -"O3" gave ten passes (or 10 and 15, maybe...), but the "special case" code has been removed, and now "-O2" (and greater) give just the specified number of passes. 2 or 3 are *not* enough for any but the simplest code - use a good big number - I like "-O999" - this is the *maximum* number of passes Nasm will make, so you won't slow things down by using too big a number. Too small will fail with that error message.

That message is *also* generated as a "bonus error message" if there's an undefined symbol... perhaps other errors would cause it... This isn't really intended...

Neither of these seem to be the case with your code. Even "-O2" is enough to assemble this code, and there don't seem to be any undefined symbols... I haven't actually tested it (not in dos at the moment), but it assembles fine for me, and looks correct. So... what command line? Any other error messages besides "phase error"?


I can't reproduce your problem when I assemble
this with NASM 0.98.38. I have tried BIN, and
various levels of -O. Which version do you use
and which arguments to you feed it?


[0] Message Index

Go to full version