Skip to content

Commit

Permalink
Small bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
erhanbaris committed Aug 19, 2024
1 parent 98e2e13 commit 1283b75
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/code_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -160,9 +160,6 @@ impl CodeGenerator {
}
}

println!("modes: {:?}", &modes);
println!("target: {:?}", &target);

if !found {
return Err(CodeGeneratorError::IllegalOpcode)
}
Expand Down

0 comments on commit 1283b75

Please sign in to comment.