Constants:

’T
1Push "T" onto stack
’NIL
1Push "NIL" onto stack
’0
1Push "0" onto stack
’1
1Push "1" onto stack
’UNBOUND
1Push "Unbound" onto stack
SIC
3Push 2 byte positive integer onto stack
SNIC
3Push 2 byte negative integer onto stack
PCONST
5Push 4 byte pointer onto stack
FCONST
5Push 4 byte floating onto stack
ICONST
5Push 4 byte integer onto stack
ATOMNBR
3?Push atom onto stack
(The format of atoms needs to be defined.)

Vars access:

VAR0-15
1Push Var i onto stack
VARX
2Push Var X onto stack
VARX←
2Set Var X from stack
VARX←↑
2Set Var X from stack, pop stack
VVARX
2Push Var i onto stack, don’t follow indirect
VVARX←
2Set Var X from stack, don’t follow indirect
FVARX
2Push Var i onto stack, UFN if unbound
FVARX←
2Set Var i from stack, UFN if unbound
GVARX
3?Push GVar onto stack
GVARX←
3?Set GVar from stack, do ref counts
(The format of atoms needs to be defined.)
BINDNIL.n.k
3Bind Var k to k+n to "NIL"
BINDUNB.n.k
3Bind Var k to k+n to "UNBOUND"
VAR0-7←NIL
1Set Var i to NIL

Jumps:

JUMPk
1
JUMPX
2
JUMPXX
3
FJUMPk
1
FJUMPX
2
TJUMPk
1
TJUMPX
2
NFJUMPX
2
NTJUMPX
2

-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-6
5Call function with k arguments
FNL
5Call function with list of arguments
APPLYFN
1Call function (name on stack)
TAPPLYFN
1Tail recursive call function (name on stack)
CAPPLYFN
1Closure call function (name, frame ptr on stack)
RETURN
1Return
CONTEXTSWITC
1Context Switch - ***TBD***

STKSCAN
-1---
EVAL
-1---
MYALINK
-1---


Memory Access:

GETBASE
getbase3’intDBse-
GETFIELD
getfield4’intDBseSB
PUTBASE
putbase3’intDBse-
PUTFIELD
putfield4’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:

PLUS
binarith1--’0
DIFFER
binarith1--’1
LOGAND
binarith1--’5
LOGOR
binarith1--’6
LOGXOR
binarith1--’7
TIMES
binarith1--’2
QUOTIENT
binarith1--’3
REMAINDER
binarith1--’4

GREATERP
binarith1--’10

LLSH1
monarith1--’0
LRSH1
monarith1--’1
LLSH8
monarith1--’2
LRSH8
monarith1--’3

COPY
1
POP
1
EQ
1
SWAP
1
NOP
1
SETTOS
2
SETTOSPOP
2


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