Fix Opcode generation of ld a,(bc) and ld a,(de) on target z80
[binutils-gdb.git] / gas / config / tc-z80.c
index 73b3fc831507bc439d69b62e30e89486c6b2ce89..825d9203d69902505d4dc6aa6af603ab01b31bc9 100644 (file)
@@ -1,12 +1,12 @@
 /* tc-z80.c -- Assemble code for the Zilog Z80 and ASCII R800
-   Copyright 2005, 2006 Free Software Foundation, Inc.
+   Copyright 2005, 2006, 2007 Free Software Foundation, Inc.
    Contributed by Arnold Metselaar <arnold_m@operamail.com>
 
    This file is part of GAS, the GNU Assembler.
 
    GAS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    GAS is distributed in the hope that it will be useful,
@@ -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;
        }