From 997d62dbe600f90da66c41323f84061aef262bd2 Mon Sep 17 00:00:00 2001 From: tuz358 Date: Mon, 5 Mar 2018 16:56:15 +0900 Subject: [PATCH] jne_imm8: Bug fix due toeip addressing mistakes --- instructions.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/instructions.cpp b/instructions.cpp index f9b9bf1..10de040 100644 --- a/instructions.cpp +++ b/instructions.cpp @@ -161,11 +161,13 @@ void Instructions::dec_ecx(){ void Instructions::jne_imm8(){ printf("jne_imm8 called.\n"); - this->eip++; - uint8_t imm8 = memory.read_uint8(this->eip); + int8_t imm8 = memory.read_int8(this->eip); int zero_flag = this->get_flag(ZF); - if (!zero_flag) this->eip += imm8; + if (!zero_flag){ + this->eip += imm8; + } + this->eip++; } void Instructions::opcode_83(){