wokwi/rp2040js

again SUBS wrong flags

Turro75 opened this issue · 1 comments

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

Great, thank you!