Skip to content

Commit d35ea9c

Browse files
author
Joon-Mo Yang
committed
Implement execution for JMP
1 parent 125263a commit d35ea9c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

vm/src/executor.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ pub fn execute(
125125
Instruction::Nop => {}
126126
Instruction::Not => unimplemented!(),
127127
Instruction::Eq => unimplemented!(),
128-
Instruction::Jmp(..) => unimplemented!(),
128+
Instruction::Jmp(val) => {
129+
pc += *val as usize;
130+
}
129131
Instruction::Jnz(..) => unimplemented!(),
130132
Instruction::Jz(..) => unimplemented!(),
131133
Instruction::Push(val) => stack.push(Item(vec![*val]))?,

0 commit comments

Comments
 (0)