Section "built-in"

The only built-ins currently supported by the π-WAM are the channel send send/2 and channel receive recv/2 primitives. Their compilation is reflected in special mode values. Otherwise, the mode values compile into load with function application, store and jumps.

Currently RAM addresses are never loaded into the accumulator, only the content that is found at an explicitly given RAM address is either accessed or modified. In as far our Hack VM is currently more restricted than the Nisan & Schocken machine.

Name    Value   Usage
cst     0       Fun A, Operand
get     1       Fun A, [Operand]
ext     2       Fun A, Operand1
out     3       Fun A, out(Operand)
in      4       Fun A, in(Operand)
set     5       mov [Operand], A
bra     6       jmz 0, Operand
brz     7       jmz A, Operand
jma     8       jmz 0, [Operand]
jmz     9       jmz A, [Operand]

Direct jumps an occasion where a ROM address is seen in the code. Since jumps do always link, they are also an occasion, where a ROM address is loaded into the accumulator. There is no guarantee that the indirect jumps use a ROM address obtained on this route.