Report illegal Z80 load instructions.

PR 27823
	* config/tc-z80.c (emit_ld_r_m): Report an illegal load
	instruction.
	* testsuite/gas/z80/ill_ops.s: New test source file.
	* testsuite/gas/z80/ill_ops.d: New test driver.
	* testsuite/gas/z80/ill_ops.l: New test error output.
This commit is contained in:
Sergey Belyashov
2021-05-11 10:57:04 +01:00
committed by Nick Clifton
parent f2f9554bf0
commit cfe7a19169
5 changed files with 95 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2021-05-11 Sergey Belyashov <sergey.belyashov@gmail.com>
PR 27823
* config/tc-z80.c (emit_ld_r_m): Report an illegal load
instruction.
* testsuite/gas/z80/ill_ops.s: New test source file.
* testsuite/gas/z80/ill_ops.d: New test driver.
* testsuite/gas/z80/ill_ops.l: New test error output.
2021-05-10 Sergey Belyashov <sergey.belyashov@gmail.com>
PR 27415

View File

@ -2391,6 +2391,8 @@ emit_ld_r_m (expressionS *dst, expressionS *src)
*q = (ins_ok & INS_GBZ80) ? 0xFA : 0x3A;
emit_word (src);
}
else
ill_op ();
}
}

View File

@ -0,0 +1,3 @@
#as:
#name: illegal operations
#error_output: ill_ops.l

View File

@ -0,0 +1,39 @@
[^:]*: Assembler messages:
[^:]*:2: Error: illegal operand
[^:]*:3: Error: illegal operand
[^:]*:4: Error: illegal operand
[^:]*:5: Error: illegal operand
[^:]*:6: Error: illegal operand
[^:]*:7: Error: illegal operand
[^:]*:8: Error: illegal operand
[^:]*:9: Error: illegal operand
[^:]*:10: Error: illegal operand
[^:]*:11: Error: illegal operand
[^:]*:12: Error: illegal operand
[^:]*:13: Error: illegal operand
[^:]*:14: Error: illegal operand
[^:]*:15: Error: illegal operand
[^:]*:16: Error: illegal operand
[^:]*:17: Error: illegal operand
[^:]*:18: Error: illegal operand
[^:]*:19: Error: illegal operand
[^:]*:20: Error: illegal operand
[^:]*:21: Error: illegal operand
[^:]*:22: Error: illegal operand
[^:]*:23: Error: illegal operand
[^:]*:24: Error: illegal operand
[^:]*:25: Error: illegal operand
[^:]*:26: Error: illegal operand
[^:]*:27: Error: illegal operand
[^:]*:28: Error: illegal operand
[^:]*:29: Error: illegal operand
[^:]*:30: Error: illegal operand
[^:]*:31: Error: illegal operand
[^:]*:32: Error: illegal operand
[^:]*:33: Error: illegal operand
[^:]*:34: Error: illegal operand
[^:]*:35: Error: illegal operand
[^:]*:36: Error: illegal operand
[^:]*:37: Error: illegal operand
[^:]*:38: Error: illegal operand
[^:]*:39: Error: illegal operand

View File

@ -0,0 +1,42 @@
.text
ld b,(var)
ld c,(var)
ld d,(var)
ld e,(var)
ld h,(var)
ld l,(var)
ld (var),(var)
ld (var),b
ld (var),c
ld (var),d
ld (var),h
ld (var),l
ld (var),10
ld 10,(var)
ld b,(bc)
ld c,(bc)
ld d,(bc)
ld e,(bc)
ld h,(bc)
ld l,(bc)
ld (bc),b
ld (bc),c
ld (bc),d
ld (bc),e
ld (bc),h
ld (bc),l
ld b,(de)
ld c,(de)
ld d,(de)
ld e,(de)
ld h,(de)
ld l,(de)
ld (de),b
ld (de),c
ld (de),d
ld (de),e
ld (de),h
ld (de),l
.bss
var:
.db 10