Method mark
mark()
Returns a temporary absolute index of the current stack top from which subsequent instructions can index stack entries.
Declaration
public uint mark()
Returns
Type | Description |
---|---|
System.UInt32 | A System.UInt32 value that marks the current stack top. |
Remarks
The absolute indices are encoded as System.UInt32, which is different from the relative indices,
which are encoded as System.Int32.
Within functions it is often more easy to work with absolute indices as they do not change frequently.
Examples
var m = cpu.mark();
cpu.push(x); // at m + 0
cpu.push(y); // at m + 1
cpu.push(z); // at m + 2
cpu.add(m + 0, m + 1); // x + y
cpu.pop(4);