Skip to content

Commit

Permalink
[INTERPRETER] Fixed 32bits ADCX/ADOX opcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Dec 28, 2024
1 parent 4aaa0b5 commit cace5f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/emu/x64run660f.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,14 +828,15 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
tmp64u2 = GD->q[0] + ED->q[0];
}
tmp64u = (tmp64u >> 32) + (GD->q[0] >> 32) + (ED->q[0] >> 32);
CONDITIONAL_SET_FLAG(tmp64u & 0x100000000L, F_CF);
CONDITIONAL_SET_FLAG(tmp64u & 0x100000000LL, F_CF);
GD->q[0] = tmp64u2;
} else {
if (ACCESS_FLAG(F_CF))
GD->q[0] = 1LL + GD->dword[0] + ED->dword[0];
else
GD->q[0] = (uint64_t)GD->dword[0] + ED->dword[0];
CONDITIONAL_SET_FLAG(GD->q[0] & 0x100000000LL, F_CF);
GD->dword[1] = 0;
}
break;
default:
Expand Down
8 changes: 4 additions & 4 deletions src/emu/x64runf30f.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,20 +190,20 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr)
if (ACCESS_FLAG(F_OF)) {
tmp64u = 1 + (GD->q[0] & 0xFFFFFFFF) + (ED->q[0] & 0xFFFFFFFF);
tmp64u2 = 1 + GD->q[0] + ED->q[0];
}
else {
} else {
tmp64u = (GD->q[0] & 0xFFFFFFFF) + (ED->q[0] & 0xFFFFFFFF);
tmp64u2 = GD->q[0] + ED->q[0];
}
}
tmp64u = (tmp64u >> 32) + (GD->q[0] >> 32) + (ED->q[0] >> 32);
CONDITIONAL_SET_FLAG(tmp64u & 0x100000000L, F_OF);
CONDITIONAL_SET_FLAG(tmp64u & 0x100000000LL, F_OF);
GD->q[0] = tmp64u2;
} else {
if (ACCESS_FLAG(F_OF))
GD->q[0] = 1LL + GD->dword[0] + ED->dword[0];
else
GD->q[0] = (uint64_t)GD->dword[0] + ED->dword[0];
CONDITIONAL_SET_FLAG(GD->q[0] & 0x100000000LL, F_OF);
GD->dword[1] = 0;
}
break;

Expand Down

0 comments on commit cace5f0

Please sign in to comment.