chore: use bitfield library

This commit is contained in:
2022-10-21 05:11:45 -03:00
parent f030889d6c
commit 7016fcdb79
3 changed files with 181 additions and 92 deletions

View File

@@ -40,10 +40,10 @@ pub fn comptimeDataProcessing(comptime I: bool, comptime S: bool, comptime instr
const didOverflow = @subWithOverflow(u32, op1_val, op2, &result);
cpu.cpsr.setV(v_ctx and (result >> 31 & 0x01 == 0x01));
cpu.cpsr.setC(didOverflow);
cpu.cpsr.setZ(result == 0x00);
cpu.cpsr.setN(result >> 31 & 0x01 == 0x01);
cpu.cpsr.v.write(v_ctx and (result >> 31 & 0x01 == 0x01));
cpu.cpsr.c.write(didOverflow);
cpu.cpsr.z.write(result == 0x00);
cpu.cpsr.n.write(result >> 31 & 0x01 == 0x01);
},
else => std.debug.panic("TODO: implement data processing type {}", .{instrKind}),
}