Skip to content

Commit

Permalink
Add jle
Browse files Browse the repository at this point in the history
  • Loading branch information
takatori committed Feb 14, 2017
1 parent 41cfbc6 commit dd704de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,12 @@ define_jx!(o, is_overflow);


pub fn jl(emu: &mut Emulator) {

let diff: i8 = if is_sign(emu) != is_overflow(emu) { emu.get_sign_code8(1) } else { 0 };
emu.eip += (diff + 2);
}


pub fn jle(emu: &mut Emulator) {
let diff: i8 = if is_zero(emu) || is_sign(emu) != is_overflow(emu) { emu.get_sign_code8(1) } else {0};
emu.eip += (diff + 2);
}

0 comments on commit dd704de

Please sign in to comment.