Menu

#3931 uCsim cp a, d(ix) disassembly

closed-fixed
None
Simulator
5
2 days ago
3 days ago
No

When disassembling, uCsim omits the left operand for cp, but not for otherwise similar sbc:

Stop at 0x001b51: (104) Breakpoint
A= 0x01   1 .  F= 00000000 0x00   0 .  Mode:10
                  SZxxxVxC
XPC= 0x000 IP= 0xff IIR= 0x02 EIR= 0x01
BC= 0x0001 80 d3 32 20 04 3e 02 ed ..2 .>..
DE= 0x0010 32 16 00 3e a8 d3 32 13 2..>..2.
HL= 0x0010 32 16 00 3e a8 d3 32 13 2..>..2.
IX= 0xdff6 00 00 ff 1e 04 00 bc 04 ........
IY= 0x0000 3e 80 d3 32 20 04 3e 02 >..2 .>.
JK= 0x0000 3e 80 d3 32 20 04 3e 02 >..2 .>.
SP= 0xdfca 10 00 10 00 10 00 08 00 ........
aAF= 0x00-00  aBC= 0x00-00  aDE= 0x00-00  aHL= 0x00-00  aJK= 0x00-00  
 PW= 0x0000-0000   PX= 0x0000-0000   PY= 0x0000-0000   PZ= 0x0000-0000  
aPW= 0x0000-0000  aPX= 0x0000-0000  aPY= 0x0000-0000  aPZ= 0x0000-0000  
0x1b51 F? dd be fe          CP     (IX-2)
F 0x001b51
Simulated 222306 ticks (2.223e-01 sec)
Host usage: 0.005333 sec, rate=41.685396
0> step

Stop at 0x001b54: (109) stepped 11 ticks
A= 0x01   1 .  F= 10000001 0x81 129 .  Mode:10
                  SZxxxVxC
XPC= 0x000 IP= 0xff IIR= 0x02 EIR= 0x01
BC= 0x0001 80 d3 32 20 04 3e 02 ed ..2 .>..
DE= 0x0010 32 16 00 3e a8 d3 32 13 2..>..2.
HL= 0x0010 32 16 00 3e a8 d3 32 13 2..>..2.
IX= 0xdff6 00 00 ff 1e 04 00 bc 04 ........
IY= 0x0000 3e 80 d3 32 20 04 3e 02 >..2 .>.
JK= 0x0000 3e 80 d3 32 20 04 3e 02 >..2 .>.
SP= 0xdfca 10 00 10 00 10 00 08 00 ........
aAF= 0x00-00  aBC= 0x00-00  aDE= 0x00-00  aHL= 0x00-00  aJK= 0x00-00  
 PW= 0x0000-0000   PX= 0x0000-0000   PY= 0x0000-0000   PZ= 0x0000-0000  
aPW= 0x0000-0000  aPX= 0x0000-0000  aPY= 0x0000-0000  aPZ= 0x0000-0000  
0x1b54  ? 3e 00             LD     A,0x00
F 0x001b54
0> 

Stop at 0x001b56: (109) stepped 4 ticks
A= 0x00   0 .  F= 10000001 0x81 129 .  Mode:10
                  SZxxxVxC
XPC= 0x000 IP= 0xff IIR= 0x02 EIR= 0x01
BC= 0x0001 80 d3 32 20 04 3e 02 ed ..2 .>..
DE= 0x0010 32 16 00 3e a8 d3 32 13 2..>..2.
HL= 0x0010 32 16 00 3e a8 d3 32 13 2..>..2.
IX= 0xdff6 00 00 ff 1e 04 00 bc 04 ........
IY= 0x0000 3e 80 d3 32 20 04 3e 02 >..2 .>.
JK= 0x0000 3e 80 d3 32 20 04 3e 02 >..2 .>.
SP= 0xdfca 10 00 10 00 10 00 08 00 ........
aAF= 0x00-00  aBC= 0x00-00  aDE= 0x00-00  aHL= 0x00-00  aJK= 0x00-00  
 PW= 0x0000-0000   PX= 0x0000-0000   PY= 0x0000-0000   PZ= 0x0000-0000  
aPW= 0x0000-0000  aPX= 0x0000-0000  aPY= 0x0000-0000  aPZ= 0x0000-0000  
0x1b56  ? dd 9e ff          SBC    A,(IX-1)

Here we have CP (IX-2), but SBC A,(IX-1), which looks inconsistent to me. I suggest to always print the left operand A. Inoticed the issue when using the R4K simulator, and didn't check if the simulators for other Z80-related targets are affected.

Discussion

  • Daniel Drotos

    Daniel Drotos - 2 days ago
    • status: open --> closed-fixed
    • assigned_to: Daniel Drotos
     
  • Daniel Drotos

    Daniel Drotos - 2 days ago
     

    Related

    Commit: [r16210]


Log in to post a comment.