summaryrefslogtreecommitdiff
path: root/src/core.rs
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2019-10-01 00:07:36 +0300
committerOxore <oxore@protonmail.com>2019-10-01 00:07:36 +0300
commit6195de98c48a43f1c9d7838e8d2d9d11a1ae3571 (patch)
tree51485977426e72c7597adb7566ef38c3f8ed4ca8 /src/core.rs
parent0832a0dddad7782b8ac7a06c76d3e58ab2a56864 (diff)
Fix hex parsing using radix 16 instead of 10
Diffstat (limited to 'src/core.rs')
-rw-r--r--src/core.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core.rs b/src/core.rs
index 35ef2a6..a4c0ce8 100644
--- a/src/core.rs
+++ b/src/core.rs
@@ -91,7 +91,7 @@ impl Core {
Opcode::Illegal => (),
Opcode::Push => (),
Opcode::Pop => (),
- Opcode::Sjmp => self.sjmp(op.operand1.expect("JSMP has no operand") as i8),
+ Opcode::Sjmp => self.sjmp(op.operand1.expect("SJMP has no operand given") as i8),
}
}
@@ -113,8 +113,8 @@ impl Isa8051 for u8 {
fn op(&self) -> (Opcode, usize, Option<Register>) {
match *self {
OPCODE_NOP => (Opcode::Nop, 1, None),
- OPCODE_MOV_A_DATA => (Opcode::Mov, 1, None),
- OPCODE_MOV_DIR_DATA => (Opcode::Mov, 1, None),
+ OPCODE_MOV_A_DATA => (Opcode::Mov, 2, None),
+ OPCODE_MOV_DIR_DATA => (Opcode::Mov, 3, None),
OPCODE_PUSH => (Opcode::Push, 2, None),
OPCODE_POP => (Opcode::Pop, 2, None),
OPCODE_SJMP => (Opcode::Sjmp, 2, None),