Tips for Programming in In-line Assembler

  1. A common error message is "operand size mismatch". Process a byte in AL, a shortint in AX and an integer in EAX.
  2. If a variable does not work as an operand, try using an appropriate register as an operand.
  3. The order of terms within brackets matters. If a register is combined with a variable, put the register first.
  4. As a last resort, write high-level code for what you intend to achieve in assembler. Use the CPU window (Delphi) or assembler window (Lazarus) to see the assembler code corresponding to your compiled Pascal code. This provides you with valid syntax.
Programming - a skill for life!

Registers, addressing modes and flags