t3x.org / t3x / t3x-manual / 4E.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
4.13 Load and Store Instructions
TOC | Index | Back Next:
4.15 External Linkage

4.14 Flow Control

0xA042   BRF   A   -   BRanch on False

Remove the element S0 and load IP with A, if S0 is false.

0xA043   BRT   A   -   BRanch on True

Remove the element S0 and load IP with A, if S0 is true.

0xA04A   CALL   A   -   CALL procedure

Push the current value of IP and then load IP with A.

0x004B   CALR   -   CALl through Register

Push the current value of IP and then load IP with S0. The destination of CALR is implicitly located in the code array of the program. Branches to the data array cannot be done.

0xA048   DNEXT   A   -   Downward NEXT

Remove two elements S0 and S1 and load IP with A, if S1 <= S0. (*)

0xA053   ICALL   N   -   Interface CALL

Call the interface procedure located at slot N. Slot values are dynamically generated using IPROC, IREF, and ICALX. The interface procedure may return a machine word size return value in RR. The stack must me cleaned up using CLEAN after calling an interface procedure. Interface procedures are normally implemented in languages other than T3X (such as C or assembly language). They are used to extend the T3X runtime environment. The exact semantics of ICALL depend on the called procedure.

0xA049   HALT   N   -   HALT

Halt the Tcode machine. The least significant eight bits of N will be delivered to the invoking process as a return code.

0xA046   JUMP   A   -   JUMP

Load IP with A.

0xA044   NBRF   A   -   Nondestructive BRanch on False

Load IP with A, if S0 is false. Do not remove S0.

0xA045   NBRT   A   -   Nondestructive BRanch on True

Load IP with A, if S0 is true. Do not remove S0.

0xA047   UNEXT   A   -   Upward NEXT

Remove two elements S0 and S1 and load IP with A, if S1 >= S0. (*)

(*) The UNEXT and DNEXT instructions have been designed for use in counting loops (FOR-NEXT loops in BASIC). The idea is as follows: At the end of the loop, the current loop index and the loop limit are both pushed onto the stack. UNEXT compares the values and branches out of the loop, if index>=limit. DNEXT branches, if index<=limit. Therefore, UNEXT is used in upward counting loops and DNEXT is used in countdown loops.

Previous:
4.13 Load and Store Instructions
TOC | Index | Back Next:
4.15 External Linkage