ZINC Abstract Machine
Registers
- accum - accumulator register
Instruction Set
- const8(int8) - Put int8 constant into the accumulator
- const16(int16) - Put int16 constant into the accumulator
- const32(int32) - Put int32 constant into the accumulator
- const64(int64) - Put int64 constant into the accumulator
- atom(n) - Pointer to a 0 sized block tagged n in the accumulator
- get_global(int32) - Load global into the accumulator
- set_global(int32) - Save the accumulator to the designated global
Function Handling
- push, pushmark - Push the accumulator (resp. a mark) on the argument stack
- apply, appterm - Call (resp. jump to) the closure contained in the accumulator
- return - If there is a mark on top of the argument stack, pop it and return to the caller; otherwise, jump to the closure contained in the accumulator
- grab - Popone value on the argument stack and put it in the environment; if the top of stack is a mark, build a closure and return it to the caller
- cur(ofs) - Build the closure of ofs with the current environment, and put it in the accumulator
Environment Handling
- access(ofs) - Fetch the nth slot in the environment, and put it in the accumulator
- let - Put the value of the accumulator in front of the environment
- endlet(n) - Throw away the first n local variables from the environment
- dummies(n) - Put n dummy closures in front of the environment
- update(n) - Physically update the nth slot of the environment with the value of the accumulator
- letrec1(ofs) - Same as Dummies(1); Closure(ofs); Update(0) (A very frequent sequence, corresponding to
let rec f = function ... in ...
Building and Destructuring Blocks
Integers
Floating Point Numbers
Strings
Predicates
Branches and Conditional Branches
References