diff --git a/docs/lang/assembly6809.md b/docs/lang/assembly6809.md index 6da6d449..61c02d8a 100644 --- a/docs/lang/assembly6809.md +++ b/docs/lang/assembly6809.md @@ -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. diff --git a/src/main/scala/millfork/parser/M6809Parser.scala b/src/main/scala/millfork/parser/M6809Parser.scala index c1df40f4..2f4ba303 100644 --- a/src/main/scala/millfork/parser/M6809Parser.scala +++ b/src/main/scala/millfork/parser/M6809Parser.scala @@ -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