From 1283b7592d558343eb341ddd2c74dbdf72e8d633 Mon Sep 17 00:00:00 2001 From: Erhan BARIS Date: Mon, 19 Aug 2024 21:42:18 +0200 Subject: [PATCH] Small bug fix --- src/code_gen.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/code_gen.rs b/src/code_gen.rs index eda3771..2452702 100644 --- a/src/code_gen.rs +++ b/src/code_gen.rs @@ -107,7 +107,7 @@ impl CodeGenerator { InstrValue::Word(word) => (*word, ModeType::Absolute), InstrValue::Reference(reference) => match self.branches.get(reference) { Some(branch_position) => { - let distance_position = *branch_position as i8 - (target.len() + 2) as i8; + let distance_position = *branch_position as i8; (distance_position as u16, ModeType::Absolute) }, None => { @@ -160,9 +160,6 @@ impl CodeGenerator { } } - println!("modes: {:?}", &modes); - println!("target: {:?}", &target); - if !found { return Err(CodeGeneratorError::IllegalOpcode) }