aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cpu/instruction.spec.ts4
-rw-r--r--src/cpu/instruction.ts12
2 files changed, 8 insertions, 8 deletions
diff --git a/src/cpu/instruction.spec.ts b/src/cpu/instruction.spec.ts
index 0665fe8..18ff76b 100644
--- a/src/cpu/instruction.spec.ts
+++ b/src/cpu/instruction.spec.ts
@@ -26,8 +26,8 @@ const r31 = 31;
const X = 26;
const Y = 28;
const Z = 30;
-const RAMPZ = 59;
-const EIND = 60;
+const RAMPZ = 0x5b;
+const EIND = 0x5c;
const SP = 93;
const SPH = 94;
const SREG = 95;
diff --git a/src/cpu/instruction.ts b/src/cpu/instruction.ts
index e82b811..bd9d2a2 100644
--- a/src/cpu/instruction.ts
+++ b/src/cpu/instruction.ts
@@ -221,7 +221,7 @@ export function avrInstruction(cpu: ICPU) {
/* EICALL, 1001 0101 0001 1001 */
const retAddr = cpu.pc + 1;
const sp = cpu.dataView.getUint16(93, true);
- const eind = cpu.data[0x3c];
+ const eind = cpu.data[0x5c];
cpu.data[sp] = retAddr & 255;
cpu.data[sp - 1] = (retAddr >> 8) & 255;
cpu.data[sp - 2] = (retAddr >> 16) & 255;
@@ -230,28 +230,28 @@ export function avrInstruction(cpu: ICPU) {
cpu.cycles += 3;
} else if (opcode === 0x9419) {
/* EIJMP, 1001 0100 0001 1001 */
- const eind = cpu.data[0x3c];
+ const eind = cpu.data[0x5c];
cpu.pc = ((eind << 16) | cpu.dataView.getUint16(30, true)) - 1;
cpu.cycles++;
} else if (opcode === 0x95d8) {
/* ELPM, 1001 0101 1101 1000 */
- const rampz = cpu.data[0x3b];
+ const rampz = cpu.data[0x5b];
cpu.data[0] = cpu.progBytes[(rampz << 16) | cpu.dataView.getUint16(30, true)];
cpu.cycles += 2;
} else if ((opcode & 0xfe0f) === 0x9006) {
/* ELPM(REG), 1001 000d dddd 0110 */
- const rampz = cpu.data[0x3b];
+ const rampz = cpu.data[0x5b];
cpu.data[(opcode & 0x1f0) >> 4] =
cpu.progBytes[(rampz << 16) | cpu.dataView.getUint16(30, true)];
cpu.cycles += 2;
} else if ((opcode & 0xfe0f) === 0x9007) {
/* ELPM(INC), 1001 000d dddd 0111 */
- const rampz = cpu.data[0x3b];
+ const rampz = cpu.data[0x5b];
const i = cpu.dataView.getUint16(30, true);
cpu.data[(opcode & 0x1f0) >> 4] = cpu.progBytes[(rampz << 16) | i];
cpu.dataView.setUint16(30, i + 1, true);
if (i === 0xffff) {
- cpu.data[0x3b] = (rampz + 1) % (cpu.progBytes.length >> 16);
+ cpu.data[0x5b] = (rampz + 1) % (cpu.progBytes.length >> 16);
}
cpu.cycles += 2;
} else if ((opcode & 0xfc00) === 0x2400) {
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.