Previous: 2.3.9. Opcode Mnemonics To the Table of Contents Next: 2.3.11. Operands
2.3.9. Opcode Mnemonics Table of Contents 2.3.11. Operands

- 2.3.10. -
Table of Contents
2. TMT Pascal Language Description
2.3. Built-in Assembler
2.3.10. Operand Expressions


2.3.10. Operand Expressions


Operand expressions are built from operands and operators. Operands are constants, registers, labels, and memory locations. Operators combine operands and alter their attributes. Each instruction allows only certain combinations of operands.

Operand expressions can be classified into three classes: Immediate operands
  PUSH  10
  MOV   AX, 10
  MOV   AX, offset Start
Here 10, and Start are immediate operands. The values of AX and 10 can be determined immediately; the value of offset Start is determined during linking.

Registers
TMT Pascal built-in assembler allows use of any 8, 16, or 32-bit 80386 registers.
  XOR  AH, AL
  LSL  EAX,EAX
  MOV  AX, FX
Memory and label operands
Memory operands refer to the data stored in memory locations. Usually, one uses the square brackets [..] or the type ptr operator to ensure that the argument is treated as a memory location. Label operands refer to locations in code.
  MOV      EBX,[0]
  POP      Word Ptr [88]
  POP      Word Ptr 88  // same as above
  JMP      @exit
  LOOP16   @loop
Memory and immediate operands can be either absolute or relocatable. An operand is absolute if its value or offset is entirely known during compilation. An operand is relocatable if its offset will become known only during linking.


Previous: 2.3.9. Opcode Mnemonics To the Table of Contents Next: 2.3.11. Operands
2.3.9. Opcode Mnemonics Table of Contents 2.3.11. Operands

- 2.3.10. -