feat(cpu): implement TEQ

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-10-21 05:11:53 -03:00
parent 34c6df344d
commit 780c717409
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 // Barrel Shifter should always calc CPSR C in TST
if (!S) _ = BarrelShifter.exec(true, cpu, opcode); 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 => { 0xD => {
// MOV // MOV
cpu.r[rd] = op2; cpu.r[rd] = op2;