t3x.org / t3x / t3x-manual / 45.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
4.4 Tcode Instruction Format
TOC | Index | Back Next:
4.6 Startup Conditions

4.5 Instruction Cycles

A cycle is the set of operations which is required to execute one single Tcode instruction. Each cycle consists of the following steps:

  1. Load the byte pointed to by IP into the internal variable OP. Increment IP by 1.
  2. If OP has the argument flag (ARFLAG) set,
  3. If NA > 0,
  4. If NA > 1,
  5. If OP contains a valid opcode, execute its instructions, otherwise signal an error and halt the machine.

These steps are repeated until the Tcode machine is halted by executing HALT.

If an instruction modifies stack elements, first all of its operands are removed from the stack, then the operation denoted by the instruction is performed, and finally the result is placed back on the stack.

The string flag SF is normally not check at run time, since instructions involving strings are typically removed during a pre-processing step.

Previous:
4.4 Tcode Instruction Format
TOC | Index | Back Next:
4.6 Startup Conditions