Constants:
’T1Push "T" onto stack
’NIL1Push "NIL" onto stack
’01Push "0" onto stack
’11Push "1" onto stack
’UNBOUND1Push "Unbound" onto stack
SIC3Push 2 byte positive integer onto stack
SNIC3Push 2 byte negative integer onto stack
PCONST5Push 4 byte pointer onto stack
FCONST5Push 4 byte floating onto stack
ICONST5Push 4 byte integer onto stack
ATOMNBR3?Push atom onto stack
(The format of atoms needs to be defined.)
Vars access:
VAR0-151Push Var i onto stack
VARX2Push Var X onto stack
VARX←2Set Var X from stack
VARX←↑2Set Var X from stack, pop stack
VVARX2Push Var i onto stack, don’t follow indirect
VVARX←2Set Var X from stack, don’t follow indirect
FVARX2Push Var i onto stack, UFN if unbound
FVARX←2Set Var i from stack, UFN if unbound
GVARX3?Push GVar onto stack
GVARX←3?Set GVar from stack, do ref counts
(The format of atoms needs to be defined.)
BINDNIL.n.k3Bind Var k to k+n to "NIL"
BINDUNB.n.k3Bind Var k to k+n to "UNBOUND"
VAR0-7←NIL1Set Var i to NIL
Jumps:
JUMPk1
JUMPX2
JUMPXX3
FJUMPk1
FJUMPX2
TJUMPk1
TJUMPX2
NFJUMPX2
NTJUMPX2
-No real changes. May want to separate forward and
-backward jumping opcodes. May want to add some
-short jumps that don’t refill ibuf. Could add opcodes
-that conditionally pop stack.
Function Calls:
FN0-65Call function with k arguments
FNL5Call function with list of arguments
APPLYFN1Call function (name on stack)
TAPPLYFN1Tail recursive call function (name on stack)
CAPPLYFN1Closure call function (name, frame ptr on stack)
RETURN1Return
CONTEXTSWITC1Context Switch - ***TBD***
STKSCAN-1---
EVAL-1---
MYALINK-1---
Memory Access:
GETBASEgetbase3’intDBse-
GETFIELDgetfield4’intDBseSB
PUTBASEputbase3’intDBse-
PUTFIELDputfield4’intDBseSB
RPLPTR.n
GETBASEBYTE
PUTBASEBYTE
ADDBASE
-GetBase and GetBasePtr can be combined. Both will
-work on full pointers. Same with Putbase and PutbasePtr
-GetField and PutField will have to be 4 opcodes to
-handle a 32 bit word size. Probably want an immeadiate
-field extract opcode(s) that takes argument on stack.
-The field descriptor can remain in the opcode(s).
Binary Ops:
PLUSbinarith1--’0
DIFFERbinarith1--’1
LOGANDbinarith1--’5
LOGORbinarith1--’6
LOGXORbinarith1--’7
TIMESbinarith1--’2
QUOTIENTbinarith1--’3
REMAINDERbinarith1--’4
GREATERPbinarith1--’10
LLSH1monarith1--’0
LRSH1monarith1--’1
LLSH8monarith1--’2
LRSH8monarith1--’3
COPY1
POP1
EQ1
SWAP1
NOP1
SETTOS2
SETTOSPOP2
DTEST?3
LISTP
NTYPEX
TYPEP
- May want to add some more here.
CONS
RPLCONS
CAR
CDR
RPLACA
RPLACD***
-These depend on cdr-coding mechanism.
GCREF
CREATECELL
RECLAIMCELL
GCSCAN1
GCSCAN2
-These depend on GC technique.
BIN
BLT
BITBLT
end