blob: 61ecd1c1948cf7eb5c322e10db826df17c44fd3d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
namespace core;
include rt;
// calls the host gate with an operation and three machine-word arguments.
// returns the host result; negative values indicate a failed operation.
int syscall(int operation, word a, word b, word c) {
return rt.syscall(operation, a, b, c);
}
// the current operand-stack pointer, expressed as a word address.
word dsp() { return rt.dsp(); }
// converts a vm word address to its byte address.
word addr_b(word address) { return rt.addr_b(address); }
// loads one unsigned byte from a byte address.
int ld8(word address) { return rt.ld8(address); }
// stores the low byte of value at a byte address.
int st8(word address, int value) { return rt.st8(address, value); }
// stops execution of the current vm program.
int halt() { return rt.halt(); }
|