From cace5f0ccbebc86614ca4bf43d8307a57f37fd41 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 28 Dec 2024 13:50:32 +0100 Subject: [INTERPRETER] Fixed 32bits ADCX/ADOX opcodes --- src/emu/x64run660f.c | 3 ++- src/emu/x64runf30f.c | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/emu/x64run660f.c b/src/emu/x64run660f.c index 295a76be..291a3513 100644 --- a/src/emu/x64run660f.c +++ b/src/emu/x64run660f.c @@ -828,7 +828,7 @@ 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)) @@ -836,6 +836,7 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) 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: diff --git a/src/emu/x64runf30f.c b/src/emu/x64runf30f.c index 53ec686d..ce69411d 100644 --- a/src/emu/x64runf30f.c +++ b/src/emu/x64runf30f.c @@ -190,13 +190,12 @@ 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)) @@ -204,6 +203,7 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) 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; -- cgit 1.4.1