From 2cf402d663ace8b31cb956fc4e9cd0bd1e565774 Mon Sep 17 00:00:00 2001 From: Arnold Metselaar Date: Sun, 14 Sep 2008 05:40:09 +0000 Subject: Fix Opcode generation of ld a,(bc) and ld a,(de) on target z80 --- gas/ChangeLog | 5 +++++ gas/config/tc-z80.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 284e4a8..82ffb6b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2008-09-14 Chris Smith + + * config/tc-z80.c: Opcode generation of ld a,(bc) and ld a,(de) was + broken, as the opcode of ld a,(de) was being emitted for both. + 2008-09-12 Sterling Augustine * config/tc-xtensa.c (init_op_placement_info_table): Allow number of diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c index 89a4603..825d920 100644 --- a/gas/config/tc-z80.c +++ b/gas/config/tc-z80.c @@ -1471,7 +1471,7 @@ emit_ldreg (int dest, expressionS * src) && (src->X_add_number == REG_BC || src->X_add_number == REG_DE)) { q = frag_more (1); - *q = 0x0A + ((dest & 1) << 4); + *q = 0x0A + ((src->X_add_number & 1) << 4); break; } -- cgit v1.1