diff options
author | Jens Remus <jremus@linux.ibm.com> | 2024-03-01 12:45:14 +0100 |
---|---|---|
committer | Jens Remus <jremus@linux.ibm.com> | 2024-03-01 12:45:14 +0100 |
commit | bd0ee1ee4105579b5a1ade934b8deb1dfe8461da (patch) | |
tree | 518396a8bf1a9baa6bcfe1724a44c3b87270e3fc /opcodes | |
parent | a0af167da214b166dc2b7a17f688aa001687e999 (diff) | |
download | binutils-bd0ee1ee4105579b5a1ade934b8deb1dfe8461da.zip binutils-bd0ee1ee4105579b5a1ade934b8deb1dfe8461da.tar.gz binutils-bd0ee1ee4105579b5a1ade934b8deb1dfe8461da.tar.bz2 |
s390: Add test cases for base/index register 0
While at it add comments to logic to omit base and/or index register 0
in s390 disassembly.
opcodes/
* s390-dis.c: Add comments related to omitting base and/or index
register 0 in disassembly.
gas/
* testsuite/gas/s390/s390.exp: Add test cases for base and/or
index register 0.
* testsuite/gas/s390/zarch-base-index-0.s: Add test cases for
base and/or index register 0.
* testsuite/gas/s390/zarch-base-index-0.d: Likewise.
* testsuite/gas/s390/zarch-base-index-0-err.s: Add error test
cases for base and/or index register 0.
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/s390-dis.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/opcodes/s390-dis.c b/opcodes/s390-dis.c index 0db4158..a4cba77 100644 --- a/opcodes/s390-dis.c +++ b/opcodes/s390-dis.c @@ -204,10 +204,11 @@ s390_print_insn_with_opcode (bfd_vma memaddr, union operand_value val = s390_extract_operand (buffer, operand); unsigned long flags = operand->flags; + /* Omit index register 0. */ if ((flags & S390_OPERAND_INDEX) && val.u == 0) continue; - if ((flags & S390_OPERAND_BASE) && - val.u == 0 && separator == '(') + /* Omit base register 0, if no or omitted index register 0. */ + if ((flags & S390_OPERAND_BASE) && val.u == 0 && separator == '(') { separator = ','; continue; |