Skip to content

Commit

Permalink
fix error in instruction setcc
Browse files Browse the repository at this point in the history
  • Loading branch information
szwathub committed Dec 1, 2015
1 parent 093a613 commit 8ddf7ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nemu/src/cpu/exec/logic/setcc-template.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ make_instr_helper(rm)

#define instr setg
static void do_execute() {
if(cpu.ZF == 0 || cpu.SF == cpu.OF) {
if(cpu.ZF == 0 && cpu.SF == cpu.OF) {
OPERAND_W(op_src, 1);
}
else {
Expand Down Expand Up @@ -106,7 +106,7 @@ make_instr_helper(rm)

#define instr setle
static void do_execute() {
if(cpu.ZF == 1 && cpu.SF != cpu.OF) {
if(cpu.ZF == 1 || cpu.SF != cpu.OF) {
OPERAND_W(op_src, 1);
}
else {
Expand Down

0 comments on commit 8ddf7ce

Please sign in to comment.