#1392 Z-80 CP A,<xxx> assembly

closed-fixed
assembler (26)
5
2013-05-25
2007-11-10
Troy
No

as-z80 V01.75

Specifying register A with the compare instruction, when the operand is a global value, produces an incorrect operand value. Example:

.globl offset
cp a,#offset

yields FE 07 -- offset is 7 instead of 0.

.globl offset
cp #offset

yields FE 00 -- offset is 0, which is correct.

The same problem exists when using the (IY+d) and (IX+d) addressing mode. The displacement value is calculated incorrectly.

Discussion

  • Troy

    Troy - 2007-11-10

    Assembler list file

     
  • Troy

    Troy - 2007-11-10
    • priority: 5 --> 1
     
  • Philipp Klaus Krause

    • priority: 1 --> 5
     
  • Philipp Klaus Krause

    I can reproduce this in #5215.

    Philipp

     
  • Borut Ražem

    Borut Ražem - 2009-02-23

    I tested it with the original asxxxx V04.11 and the result is the same, which makes me suspicious: is this really a bug? Is it possible that nobody found it in the original asxxxx branch?

    Borut

     
  • Borut Ražem

    Borut Ražem - 2009-02-23

    This is actually only a cosmetic bug: the location is overwritten by the linker with the value of external defined global symbol.

    The bug is already fixed for mcs51 and hc08 targets.

    Fixed in svn revision #5387.

    Borut

     
  • Borut Ražem

    Borut Ražem - 2009-02-23
    • milestone: --> fixed
    • assigned_to: nobody --> borutr
    • labels: --> assembler
    • status: open --> closed-fixed
     
  • Maarten Brock

    Maarten Brock - 2009-02-24

    cp a,#offset

    is not the mnemonic for this instruction according to the Z80 user manual. It is without 'a,'.

    cp #offset

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks