Tips for Programming in In-line Assembler
- A common error message is "operand size mismatch". Process a byte in AL, a shortint in AX and an integer in EAX.
- If a variable does not work as an operand, try using an appropriate register as an operand.
- The order of terms within brackets matters. If a register is combined with a variable, put the register first.
- 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.