kosarev / z80

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

Fixed block IN decrementing B too early #47

Closed simonowen closed 2 years ago

simonowen commented 2 years ago

INI/IND/INIR/INDR all read from the port before decrementing B.

Visual Z80 remix also confirms that B is decremented after BC is put on the address bus.

simonowen commented 2 years ago

I noticed that B was decremented too late for OUT instructions in #8, but hadn't noticed that IN was also reversed too.