diff options
author | James Patrick Conlon <cptjustice@gmail.com> | 2018-08-07 08:34:08 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2018-08-07 08:34:08 +0100 |
commit | 8f9ea98bebb629f0e6993be015f042bf45dcdd18 (patch) | |
tree | 69f1131acb02712504ee95d0cddb06d819716cc2 /gas/config | |
parent | 71f6efc44e1bc525313f62dc6e30b4706fc644d3 (diff) | |
download | binutils-8f9ea98bebb629f0e6993be015f042bf45dcdd18.zip binutils-8f9ea98bebb629f0e6993be015f042bf45dcdd18.tar.gz binutils-8f9ea98bebb629f0e6993be015f042bf45dcdd18.tar.bz2 |
Correct the parsing of derferred register addressing in the PDP11 assembler.
PR 23481
* config/tc-pdp11.c (parse_op_noreg): Check for deferred register
addressing before assuming non-deferred addressing.
* testsuite/gas/pdp11/pr23481.s: New test source file.
* testsuite/gas/pdp11/pr23481.d: New test driver file.
* testsuite/gas/pdp11/pdp11.exp: Run the new test.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-pdp11.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gas/config/tc-pdp11.c b/gas/config/tc-pdp11.c index e151b27..1ebd461 100644 --- a/gas/config/tc-pdp11.c +++ b/gas/config/tc-pdp11.c @@ -350,10 +350,7 @@ parse_reg (char *str, struct pdp11_code *operand) str += 2; } else - { - operand->error = _("Bad register name"); - return str; - } + operand->error = _("Bad register name"); return str; } @@ -594,10 +591,21 @@ parse_op_noreg (char *str, struct pdp11_code *operand) str = parse_op_no_deferred (str, operand); } else - str = parse_op_no_deferred (str + 1, operand); + { + /* @Rn == (Rn): Register deferred. */ + str = parse_reg (str + 1, operand); + + /* Not @Rn */ + if (operand->error) + { + operand->error = NULL; + str = parse_op_no_deferred (str, operand); + } + } if (operand->error) return str; + operand->code |= 010; } else |