Main Page   Class Hierarchy   Compound List   File List   Compound Members  

operations.h File Reference

Go to the source code of this file.


Detailed Description

Implements C-machine instructions Impments the list of C-machine instructions inside class CMa::Interpreter< Word, Int, Heap, FreeStore, Code > Class

Hidden assumptions:

Assumptions on parameter class Int: It must posess following methods:

Assumptions on parameter class Word: It must posess following methods: Visible (class) variables are: Heap and Code methods verifyXXX have following semantics: For efficiency reasons we always use newSP as value for new SP value because it has been already calculated. So it is CRUCIAL that We also assume that SP and newSP are valid stack addresses ie. If operation has two or more arguments in stack then the last argument is on top, ie. op(x,y) = op(heap[SP-1],heap[SP]).

For unification the first argument of every operation is newSP, even it does't need it.

Operation mark raises SP to SP+4 we assume that this is still smallereq. EP ie. EP is correctly calculated.

In operation alloc_memory we assume that Freestore method malloc is clever enough to release memory when needed. If allocation doesn't succeed we return NULL=(Word)0.

Operations load, store, loada, storea, loadr, storer will raise Error when address is NULL

Operation loadq is RENAMED to push.

Operation move starts coping from top to bottom and newer produces uncorrect result.

If the operation doesn't succeed the state of interpreter remains same as before executing operation.

List of all possible errors:


Generated on Tue Oct 12 03:30:45 1999 by doxygen1.2.18