ncatelli / spasm

An experimental multi-target assembler.
Apache License 2.0
4 stars 0 forks source link

Preparser constructs should not reach backends #92

Open ncatelli opened 3 years ago

ncatelli commented 3 years ago

The preparser passes reference objects to each corresponding backend to be parsed. Instead, the preparser should replace each reference with a corresponding constant allowing the backends to handle sizing or offset correctness.

The only exception to this will be Origin offset blocks which will be the smallest block passed to the assembler.

ncatelli commented 3 years ago

This will probably come with some preparser deref syntax. changes something like

.define byte test 0xff
.define word addr 0xaaaa

lda [test]
sta [addr]
ncatelli commented 3 years ago

Alternatively it might be better keeping with the style of the preparser and prefixing with a . for consistency. Though this is slighly uglier

.define byte test 0xff
.define word addr 0xaaaa

lda .ref test
sta .ref addr