MARIE relies heavily on (global) pointers in data: its only indirection capability is to deference a memory location, via AddI, JumpI, LoadI, and StoreI.
Common sequence for example, is to LoadI pointer
for dereference, then Load pointer; Add One; Store pointer
to advance the pointer for its next usage.
But it does not have a direct mechanism to initialize a pointer variable to refer to a memory location by an assembler label. So, many either assemble twice, first time to figure the hex address of some data (then adjust source code), or, place data close to the beginning (where it is easy to pre-compute its address) and jump around the data at start.
Is there a way to initialize a pointer using a label? For example, I'd like the data location with label pointer
to be initialized to hold/refer-to the address of array
:
pointer, DEC array
/ ...
array, DEC 1000
DEC 1001
DEC 1002
However, this is a syntax error in MARIE assembly.
Can it be done: initializing a data word to refer to a label?
FYI, I'm using https://marie.js.org/ for simulation.