Emu8086 Compile Errors: Undefined Symbol, Operand Types Do Not Match, Jump Out of Range

Back to Emu8086 home or the install guide. If the problem turns out to be in your code rather than in the program itself, the 8086 instruction set and opcode reference may help you check the instruction you are using.

Compile errors stop your program before it runs, but they are usually the most fixable kind of problem: the assembler is telling you exactly which line it could not understand. Read the message, go to that line, and check one thing at a time.

Undefined symbol

This usually means the assembler met a name it does not recognise — a label, variable, or procedure name that is misspelled, or used before it is defined. Try checking the spelling of the name at the error line against the spelling where it is defined, and check that the definition is actually in the same file and before the point of use, or declared in a way the assembler can see. A single-letter typo is a common cause, so compare the two spellings character by character.

Operand types do not match

This usually means the two sides of an instruction do not go together — for example, mixing sizes, or using a memory operand where a register is expected. Try checking the instruction against the 8086 instruction set and opcode reference to confirm what operand forms that instruction accepts, and make the sizes on both sides agree. If you are moving a value into memory, check whether you need to state the size explicitly.

Jump out of range

This usually means a short jump is trying to reach a label that is too far away for that jump form. Try restructuring the code so the target is closer — for example, by jumping over a short section to a nearby label, or by reversing the jump condition — or by using a jump form that can reach further, if the instruction set allows it for that case. Check the reference for which jump forms are short-range and which are not.

General steps to try for any compile error

  1. Fix one error at a time, starting with the first error reported. Later errors are often side effects of the first one.
  2. Recompile after each fix, so you can tell whether the fix worked or created a new message.
  3. If the error line looks correct, check the lines just above it — a missing comma, bracket, or end of a definition can make the assembler report the next line instead.
  4. Try compiling a tiny example that uses the same instruction. If the example works, compare it with your code line by line.

What to check next if it still does not work

If the program compiles but then crashes or behaves unexpectedly, that is a runtime problem, not a compile problem — see silent crashes and runtime and permission errors. If the error only appears for a file in a particular folder, check folder permissions first.

Once it runs, see the tutorials linked from the home page to continue.

Similar Posts