From 34c6df344d8b3d2e5815419dbf7f66b111336e61 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:11:53 -0300 Subject: [PATCH] feat(cpu): Implement ORR --- src/cpu/data_processing.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cpu/data_processing.zig b/src/cpu/data_processing.zig index 012bfbd..0624daf 100644 --- a/src/cpu/data_processing.zig +++ b/src/cpu/data_processing.zig @@ -64,6 +64,16 @@ pub fn dataProcessing(comptime I: bool, comptime S: bool, comptime instrKind: u4 cpu.cpsr.c.write(op2 <= cpu.r[op1]); cpu.cpsr.v.write(((op1 ^ result) & (~op2 ^ result)) >> 31 & 1 == 1); }, + 0xC => { + // ORR + const result = cpu.r[op1] | op2; + + if (S and rd != 0xF) { + cpu.cpsr.n.write(result >> 31 & 1 == 1); + cpu.cpsr.z.write(result == 0); + // C set by Barr0x15el Shifter, V is unnafected + } + }, else => std.debug.panic("[CPU] TODO: implement data processing type {}", .{instrKind}), } }