aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-pdp11.c
diff options
context:
space:
mode:
authorJames Patrick Conlon <cptjustice@gmail.com>2018-08-01 15:14:46 +0100
committerNick Clifton <nickc@redhat.com>2018-08-01 15:14:46 +0100
commit3cf2b6691cef024f7cdb48aaec5fab5189e1cffa (patch)
tree92a415246683a7a95ff238c5bf1d21bb5db95503 /gas/config/tc-pdp11.c
parentc25179e71fee952ace322ce26b3fe6b722ec77f9 (diff)
downloadbinutils-3cf2b6691cef024f7cdb48aaec5fab5189e1cffa.zip
binutils-3cf2b6691cef024f7cdb48aaec5fab5189e1cffa.tar.gz
binutils-3cf2b6691cef024f7cdb48aaec5fab5189e1cffa.tar.bz2
Fix bug in PDP11 assembler when handling a JSr instruction with deferred auto increment.
PR 14480 * config/tc-pdp11.c (parse_op_noreg): Check for and handle auto increment deferred. * testsuite/gas/pdp11/pr14480.d: New test driver file. * testsuite/gas/pdp11/pr14480.s: New test source file file. * testsuite/gas/pdp11/pdp11.exp: Run the new test.
Diffstat (limited to 'gas/config/tc-pdp11.c')
-rw-r--r--gas/config/tc-pdp11.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gas/config/tc-pdp11.c b/gas/config/tc-pdp11.c
index 2ad6882..e151b27 100644
--- a/gas/config/tc-pdp11.c
+++ b/gas/config/tc-pdp11.c
@@ -581,7 +581,21 @@ parse_op_noreg (char *str, struct pdp11_code *operand)
if (*str == '@' || *str == '*')
{
- str = parse_op_no_deferred (str + 1, operand);
+ /* @(Rn) == @0(Rn): Mode 7, Indexed deferred.
+ Check for auto-increment deferred. */
+ if (str[1] == '('
+ && str[2] != 0
+ && str[3] != 0
+ && str[4] != 0
+ && str[5] != '+')
+ {
+ /* Change implied to explicit index deferred. */
+ *str = '0';
+ str = parse_op_no_deferred (str, operand);
+ }
+ else
+ str = parse_op_no_deferred (str + 1, operand);
+
if (operand->error)
return str;
operand->code |= 010;