Compare commits
5 Commits
704c029fd3
...
0016e28205
Author | SHA1 | Date |
---|---|---|
Rekai Nyangadzayi Musuka | 0016e28205 | |
Rekai Nyangadzayi Musuka | 2bce76f2e9 | |
Rekai Nyangadzayi Musuka | 6e6a4e32c2 | |
Rekai Nyangadzayi Musuka | 6decfb64ed | |
Rekai Nyangadzayi Musuka | 63a41a44a6 |
|
@ -11,7 +11,9 @@ pub fn singleDataTransfer(comptime I: bool, comptime P: bool, comptime U: bool,
|
|||
const rn = opcode >> 16 & 0xF;
|
||||
const rd = opcode >> 12 & 0xF;
|
||||
|
||||
const base = cpu.r[rn];
|
||||
// rn is r15 and L is not set, the PC is 12 ahead
|
||||
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 modified_base = if (U) base +% offset else base -% offset;
|
||||
|
|
Loading…
Reference in New Issue