Wed Jul 15 19:11:34 CEST 2009
Assembler with addressing modes
PIC asm is quite simple due to lack of addressing modes. I need to
find a way to support addressing modes for supporting the 6809 and
First step: get inspiration for syntax: find an s-expression based
representation and write it as code modifiers.
Let's think about this a bit. What is an addressing mode? It is a
register list semantics modifier. It doesn't necessarily modify a
single register, but can also modify groups (i.e. relative
I don't have enough data points so this needs to be implemented using
a relaxation approach: just do it and see where it gets at..
There are two ways to look at it:
- how to represent it textually
- how the modes are encoded
Typically, encoding is a bit vector that expresses the type of the
arguments. I.e. for dsPIC.
The reason why I find this so difficult is because I currently have
assemblers modeled as _functions_ while this doesn't work for
addressing modes, unless you see an addressing mode as an opcode
modifier instead of an argument modifier.
In some sense, I need to undo some of the cleverness that's used in
the design of the assembler language.
Now in general there seems to not be so much structure so it looks
like a simple expansion step on top of the current implementation is
what is necessary.