From 85dae5e1d75f30898ebee7fee5597aa9587f3cea Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Tue, 18 Jan 2022 14:27:07 -0400 Subject: [PATCH] feat(cpu): implement EOR --- src/cpu/arm/data_processing.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cpu/arm/data_processing.zig b/src/cpu/arm/data_processing.zig index 5c167d9..01e6d22 100644 --- a/src/cpu/arm/data_processing.zig +++ b/src/cpu/arm/data_processing.zig @@ -33,6 +33,17 @@ pub fn dataProcessing(comptime I: bool, comptime S: bool, comptime instrKind: u4 // C set by Barrel Shifter, V is unaffected } }, + 0x1 => { + // EOR + const result = op1 ^ op2; + cpu.r[rd] = result; + + if (S and rd != 0xF) { + cpu.cpsr.n.write(result >> 31 & 1 == 1); + cpu.cpsr.z.write(result == 0); + // C set by Barrel Shifter, V is unaffected + } + }, 0x2 => { // SUB const result = op1 -% op2;