Split register-indirect tokens

This allows whitespace between the brackets and the register.
This also fixes #531

Note that `$ff00 + c` is still treated as a single token, because trying to
use an expression on the left side causes a shift/reduce conflict.
This isn't great, but most people seem to be either used to it as-is, or
using the new `ldh a, [c]` syntax.
If this causes problems with a lexer rewrite, it'll be deprecated; but for
now, keep it around, as the support is clunky but bearable.
This commit is contained in:
ISSOtm
2020-07-22 14:59:43 +02:00
parent fcd37b52b6
commit ca6fa6d1d7
4 changed files with 41 additions and 27 deletions

View File

@@ -155,6 +155,8 @@ ENDM
ld [$ABCD],a
ldh [$ff00+$DB],a
ld [$ff00+c],a
ld [$ff00 + c],a
ldh [c],a
ld a,[bc]
ld a,[de]
@@ -162,11 +164,17 @@ ENDM
ld a,[$ABCD]
ldh a,[$ff00+$DB]
ld a,[$ff00+c]
ld a,[$ff00 + c]
ldh a,[c]
ld [hl+],a
ld [hli],a
ld [hl-],a
ld [hld],a
ld a,[hl+]
ld a,[hli]
ld a,[hl-]
ld a,[hld]
; Jumps and Subroutines