Free Hero Mesh

Changes To Program instructions
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.

Initial version of "Program instructions"


















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
(Note: This may change as the program is being written and it is currently a draft.)

In some places in a <tt>.class</tt> file, program instructions can be used. This includes in any global message block, class message block, <tt>SUBS</tt> block, <tt>Goal</tt> block, or global function definition.

The heading includes the instruction name (if in parentheses, it takes other stuff inside of the same block with parentheses; there may be brackets afterward if some other name or number is a part of it), followed by the stack effect (given in a notation like Forth).

Some headings include <b>,</b> and/or <b>=</b> after the stack diagram if it supports those prefixes optionally. In this case, <b>,</b> means a variable of another object (taken on the stack below the value, if writing), while <b>=</b> means to write instead of read (the value to write is taken below another argument if any, but above the object if any).

You can also use numbers as instructions (that push their value to the stack), either in decimal or in hexadecimal (with <tt>0x</tt> at first), and an optional minus sign is allowed at first for negative decimal numbers.

<h2 name=xp0>%[] ( -- value ) =</h2>
Read a user variable of this object. All user variables are initialized to zero and can store any value. You do not need to declare them first.

<h2 name=xxbit0>bit[] ( -- n )</h2>
A constant with exactly one bit set; replace [] with a number 0 to 31.

<h2 name=yxbit>(bit) ( -- n)</h2>