wokwi / rp2040js

A Raspberry Pi Pico Emulator in JavaScript
MIT License
389 stars 40 forks source link

again SUBS wrong flags #56

Closed Turro75 closed 3 years ago

Turro75 commented 3 years ago

according to what did in CMP, I tested this case and it fails:

it('should execute a subs r5, r3, r2 instruction', async () => { await cpu.setPC(0x20000000); await cpu.writeUint16(0x20000000, opcodeSUBSreg(r5, r3, r2)); await cpu.setRegisters({ r3: 0 }); await cpu.setRegisters({ r2: 0x80000000 }); await cpu.singleStep(); const registers = await cpu.readRegisters(); expect(registers.r5).toEqual(0x80000000); expect(registers.N).toEqual(true); expect(registers.Z).toEqual(false); expect(registers.C).toEqual(false); expect(registers.V).toEqual(true); });

I'm sending a new PR to (hopefully) definitely close this bug

urish commented 3 years ago

Great, thank you!