summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2019-11-18 03:02:14 +0300
committerOxore <oxore@protonmail.com>2019-11-18 03:02:14 +0300
commit4a0a8437263bfb8ac5ead4b1d38c174f8a006e14 (patch)
treeb87074490a23d4f20cfc6eed35121583a81d6477 /src
parentd5ad463a3c1b43d508fb28b23509e7fe2539d334 (diff)
Fix SJMP opcode
Diffstat (limited to 'src')
-rw-r--r--src/core.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core.rs b/src/core.rs
index 415afa0..10bb05b 100644
--- a/src/core.rs
+++ b/src/core.rs
@@ -59,6 +59,7 @@ const RAM_OFFSET_R7: u8 = 0x07;
const OPCODE_NOP: u8 = 0x00;
const OPCODE_MOV_A_DATA: u8 = 0x74;
const OPCODE_MOV_DIRECT_DATA: u8 = 0x75;
+const OPCODE_SJMP: u8 = 0x80;
const OPCODE_MOV_A_DIRECT: u8 = 0xE5;
const OPCODE_MOV_A_INDIRECT_R0: u8 = 0xE6;
const OPCODE_MOV_A_INDIRECT_R1: u8 = 0xE7;
@@ -72,7 +73,6 @@ const OPCODE_MOV_A_R6: u8 = 0xEE;
const OPCODE_MOV_A_R7: u8 = 0xEF;
const OPCODE_PUSH: u8 = 0xC0;
const OPCODE_POP: u8 = 0xD0;
-const OPCODE_SJMP: u8 = 0xD2;
const OP_LUT: [Isa8051Op; u8::max_value() as usize + 1] = {
let mut lut = [Isa8051Op {
@@ -99,6 +99,12 @@ const OP_LUT: [Isa8051Op; u8::max_value() as usize + 1] = {
operand1: Some(Isa8051Operand::Direct),
operand2: Some(Isa8051Operand::Data),
};
+ lut[OPCODE_SJMP as usize] = Isa8051Op {
+ opcode: Isa8051Opcode::Sjmp,
+ size: 2,
+ operand1: Some(Isa8051Operand::Reladdr),
+ operand2: None,
+ };
lut[OPCODE_MOV_A_DIRECT as usize] = Isa8051Op {
opcode: Isa8051Opcode::Mov,
size: 2,
@@ -177,12 +183,6 @@ const OP_LUT: [Isa8051Op; u8::max_value() as usize + 1] = {
operand1: Some(Isa8051Operand::Direct),
operand2: None,
};
- lut[OPCODE_SJMP as usize] = Isa8051Op {
- opcode: Isa8051Opcode::Sjmp,
- size: 2,
- operand1: Some(Isa8051Operand::Reladdr),
- operand2: None,
- };
lut
};