kosarev / z80

Fast and flexible Z80/i8080 emulator with C++ and Python APIs
MIT License
63 stars 10 forks source link

Wrong mnemonics for 0xed 0x50 (python) #59

Closed mortenjc closed 1 month ago

mortenjc commented 1 month ago

Hi, The sequence 0xed, 0x50 is decoded (for z80) as

176a 10 fb       ; djnz 0x1767        
176c ed           ; db 0xed            
176d 50           ; ld d, b            
176e 82           ; add a, d

Which is misleading. I believe

176c ed 50 ; in d, (c)

is correct.

Best regards Morten

mortenjc commented 1 month ago

I'm using this reference: https://clrhome.org/table/#ed

kosarev commented 1 month ago

Fixed in 33350abacfcf608c9a2ab89ac27b5b351e8a2db6.

>>> import z80
>>> i = z80._Z80InstrBuilder().build_instr(0, b'\xed\x50')
>>> i
IN(D, At(C))
>>> str(i)
'in d, (c)'
mortenjc commented 1 month ago

Verified, thanks!