rgbasm: Allow variations of 'ld [$FF00+c],a'

The following mnemonics are now valid:

    - ld
    - ldh
    - ldio

The following are valid as operands:

    - [$ff00+c]
    - [$ff00 + c]
    - [c]

This is done for consistency with 'ld [$FF00+n],a' and variations of it.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2018-05-20 20:56:21 +01:00
parent 748943f6fc
commit f8b4cc52f6
2 changed files with 9 additions and 0 deletions

View File

@@ -1707,6 +1707,14 @@ z80_ldio : T_Z80_LDIO T_MODE_A comma op_mem_ind
$2.nVal &= 0xFF; $2.nVal &= 0xFF;
out_RelByte(&$2); out_RelByte(&$2);
} }
| T_Z80_LDIO T_MODE_A comma T_MODE_C_IND
{
out_AbsByte(0xF2);
}
| T_Z80_LDIO T_MODE_C_IND comma T_MODE_A
{
out_AbsByte(0xE2);
}
; ;
z80_ld : z80_ld_mem z80_ld : z80_ld_mem

View File

@@ -312,6 +312,7 @@ const struct sLexInitString lexer_strings[] = {
{"sp", T_MODE_SP}, {"sp", T_MODE_SP},
{"[c]", T_MODE_C_IND}, {"[c]", T_MODE_C_IND},
{"[$ff00+c]", T_MODE_C_IND}, {"[$ff00+c]", T_MODE_C_IND},
{"[$ff00 + c]", T_MODE_C_IND},
{"a", T_TOKEN_A}, {"a", T_TOKEN_A},
{"b", T_TOKEN_B}, {"b", T_TOKEN_B},