feat(v5te): stub THUMB BKPT

This commit is contained in:
Rekai Nyangadzayi Musuka 2023-09-19 23:15:04 -05:00
parent 3c5d4acc5f
commit 502647806c
2 changed files with 22 additions and 7 deletions

View File

@ -216,3 +216,13 @@ pub fn fmt13(comptime InstrFn: type, comptime S: bool) InstrFn {
}
}.inner;
}
pub fn bkpt(comptime InstrFn: type) InstrFn {
const Arm32 = @typeInfo(@typeInfo(@typeInfo(InstrFn).Pointer.child).Fn.params[0].type.?).Pointer.child;
return struct {
fn inner(cpu: *Arm32, _: u16) void {
cpu.panic("TODO: handle THUMB BKPT", .{});
}
}.inner;
}

View File

@ -212,14 +212,19 @@ pub const thumb = struct {
const rd = i >> 2 & 0x7;
break :blk processing.fmt12(InstrFn, isSP, rd);
},
0b011 => if (i >> 4 & 1 == 1) blk: {
0b011 => switch (@as(u2, @truncate(i >> 3 & 0x3))) {
0b10 => blk: {
// PUSH / POP
const L = i >> 5 & 1 == 1;
const R = i >> 2 & 1 == 1;
break :blk block_transfer.fmt14(InstrFn, L, R);
} else blk: {
},
0b11 => processing.bkpt(InstrFn),
else => blk: {
const S = i >> 1 & 1 == 1;
break :blk processing.fmt13(InstrFn, S);
},
},
0b100 => blk: {
const L = i >> 5 & 1 == 1;
const rb = i >> 2 & 0x7;