cavnex / mc6809

Cycle-Accurate MC6809/E implementation, Verilog
91 stars 19 forks source link

Set N and Z flags for SEX instruction. #2

Closed devsaurus closed 3 years ago

devsaurus commented 3 years ago

The SEX instruction misses to set N and Z flags. This PR adds respective logic to update N and Z according to B's content.

Update: Clear the V flag unconditionally, courtesy of Jotego.

gyurco commented 3 years ago

I confirm it also fixes Time Pilot 84's scrolling playfield.

cavnex commented 3 years ago

I agree with the N and Z flags; I clearly missed them. V is listed on the datasheet as being zeroed, but the programmer's manual lists it as "Not Affected". Since others seem confident, I'll take their word rather than setting up a hard 6809 and going off to check myself. :)

gyurco commented 2 years ago

@cavnex Excuse me, but you closed this PR without merging.

thorpej commented 2 years ago

For what it's worth, I confirmed on a hard 6809 (a CoCo2) that the V flag is unaffected by SEX.