Compare commits

..

6 Commits

Author SHA1 Message Date
Rekai Nyangadzayi Musuka 704c029fd3 feat: respond to API changes for software bkpts 2023-01-29 08:59:05 -06:00
Rekai Nyangadzayi Musuka 424142d01c feat: allow gdb writes to certain mem regions 2023-01-29 08:59:05 -06:00
Rekai Nyangadzayi Musuka 8a3ac9befd chore: update gdbstub lib 2023-01-29 08:59:05 -06:00
Rekai Nyangadzayi Musuka f97f2e028c feat: add gdb support to zba 2023-01-29 08:59:05 -06:00
Rekai Nyangadzayi Musuka 9e69765135 feat: add gdbstub library 2023-01-29 08:59:05 -06:00
Rekai Nyangadzayi Musuka c0e583d20d fix: resolve off-by-one error in `str` addr when r15 is involved
I seem to have made up this rule (I was thinking about when r15 was
a source register). `rn` is the destination register.... whoops
2023-01-29 08:58:41 -06:00
1 changed files with 1 additions and 3 deletions

View File

@ -11,9 +11,7 @@ pub fn singleDataTransfer(comptime I: bool, comptime P: bool, comptime U: bool,
const rn = opcode >> 16 & 0xF; const rn = opcode >> 16 & 0xF;
const rd = opcode >> 12 & 0xF; const rd = opcode >> 12 & 0xF;
// rn is r15 and L is not set, the PC is 12 ahead const base = cpu.r[rn];
const base = cpu.r[rn] + if (!L and rn == 0xF) 4 else @as(u32, 0);
const offset = if (I) shifter.immediate(false, cpu, opcode) else opcode & 0xFFF; const offset = if (I) shifter.immediate(false, cpu, opcode) else opcode & 0xFFF;
const modified_base = if (U) base +% offset else base -% offset; const modified_base = if (U) base +% offset else base -% offset;