-- JaMExecDefs.mesa
-- Written by John Warnock, January, 1978.
-- Last changed by Doug Wyatt, September 29, 1980 11:50 AM
DIRECTORY
JaMMasterDefs: FROM "JaMMasterDefs" USING [Object];
JaMExecDefs: DEFINITIONS =
BEGIN OPEN JaMMasterDefs;
JaMExec: PROGRAM;
-- The following routines provide for the control of execution. It is
-- assumed that the current stack is the execution stack.
--"Execute" executes the undiscriminated object.
Execute: PUBLIC PROCEDURE;
--"If" is the implementation of the testing instruction.
--Two operands are required: an Object and a Boolean. If the
--Boolean is TRUE then the object is executed otherwise the
--object is popped.
If: PUBLIC PROCEDURE;
--"IfElse" is the implementation of the two way conditional execution
--instruction. Three operands are required: Object1,Object2, and a Boolean.
-- If the Boolean is TRUE then Object2 is executed otherwise Object1 is
--executed.
IfElse: PUBLIC PROCEDURE;
--"Rept" is the "loop for count" instruction. Two operands are required:
-- an IntegerType and an Object. The Object is executed for the number
-- of times indicated by the Integer. (0 for Negative).
Rept: PUBLIC PROCEDURE;
--"For" is based on the Algol "for i ← i step j until k do" instruction.
-- Four operands are required: three IntegerTypes and an Object.
-- The Object is executed for each iteration, with the current loop index on
-- the operand stack.
For: PUBLIC PROCEDURE;
--"Loop" is the "loop forever" instruction. One operand is required:
-- The Object is executed until an ".exit" command is executed.
Loop: PUBLIC PROCEDURE;
--"Exit" procedure pops the executionstack until the inner most loop is
--terminated. (until a mark is encountered).
Exit: PUBLIC PROCEDURE;
--"Stop" procedure pops the executionstack and checkpoints the VM.
Stop: PUBLIC PROCEDURE;
--"JaMError" is an error that is caught by execution control. The
-- restore parameter is used to indicate to execution control if it
-- is safe to restore the operand stack. execute is the StringType Object
-- that will be pushed onto the execution stack.
JaMError: PUBLIC ERROR [execute:StringType Object,restore:BOOLEAN];
SetWakeUp: PUBLIC PROCEDURE[BOOLEAN];
GetWakeUp: PUBLIC PROCEDURE RETURNS[BOOLEAN];
END.
DKW March 27, 1980 6:15 PM
added JaMExec: PROGRAM;
DKW September 29, 1980 11:49 AM
changed WakeUp to SetWakeUp, added GetWakeUp