1
0
mirror of https://github.com/KarolS/millfork.git synced 2025-02-03 11:33:33 +00:00

6809: Allow explicit absolute addressing mode

This commit is contained in:
Karol Stasiak 2020-07-31 13:26:08 +02:00
parent 33d67ec932
commit ed55e2f081
2 changed files with 4 additions and 0 deletions

View File

@ -48,6 +48,9 @@ To use the direct addressing mode, prepend the argument with `<`:
CLR <$6f // clears the byte $6f in the direct page
CLR $6f // clears the byte $006f (absolute address!)
You can use `>` do signify the absolute addressing mode, but it is never necessary.
This option exists only for compatibility with other assemblers.
Any assembly opcode can be prefixed with `?`, which allows the optimizer change it or elide it if needed.
Opcodes without that prefix will be always compiled as written.

View File

@ -100,6 +100,7 @@ case class M6809Parser(filename: String,
pos <- position()
(a, e) <-
("#" ~/ HWS ~/ asmExpression).map(Immediate -> _) |
(">" ~/ HWS ~/ asmExpression).map(Absolute(false) -> _) |
("<" ~/ HWS ~/ asmExpression).map(DirectPage -> _) |
("[" ~/ AWS ~/ asmParameterNoIndirectOrImmediate ~/ AWS ~/ "]").map { case (a, e) => a.makeIndirect(pos) -> e } |
asmParameterNoIndirectOrImmediate