feat(cpu): implement TEQ

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-01-10 08:09:02 -04:00
parent e9c1c94cae
commit ed3bdd90fb
1 changed files with 9 additions and 0 deletions

View File

@ -45,6 +45,15 @@ pub fn dataProcessing(comptime I: bool, comptime S: bool, comptime instrKind: u4
// Barrel Shifter should always calc CPSR C in TST
if (!S) _ = BarrelShifter.exec(true, cpu, opcode);
},
0x9 => {
// TEQ
const result = cpu.r[op1] ^ op2;
cpu.cpsr.n.write(result >> 31 & 1 == 1);
cpu.cpsr.z.write(result == 0);
// Barrel Shifter should always calc CPSR C in TEQ
if (!S) _ = BarrelShifter.exec(true, cpu, opcode);
},
0xD => {
// MOV
cpu.r[rd] = op2;