Labels - MARIE-js/MARIE.js GitHub Wiki
Labels allow you to reference memory cells. They consist of an alphabet followed by a sequence of zero to many alphanumerical characters. For example, One
is a valid name for a label, whereas 6loop
is not a valid label. Labels are case-sensitive, so One
and ONE
are different labels.
There are three purposes for labels:
- Refer to a single value. For example,
One, DEC 1
andADD One
- Refer to instructions to jump to. For example
Loop, Load X
andJump Loop
- Refer to an array of values. This can be done by using
ADR <label>
. For example,StartOfArray, DEC 42
stores the first element of an array, andArrayPointer, ADR StartOfArray
allows you to store memory address of labelStartOfArray
inArrayPointer
.