diff --git a/src/xenia/cpu/backend/x64/x64_sequences.cc b/src/xenia/cpu/backend/x64/x64_sequences.cc index 0bd483caf..03a609ccb 100644 --- a/src/xenia/cpu/backend/x64/x64_sequences.cc +++ b/src/xenia/cpu/backend/x64/x64_sequences.cc @@ -2139,8 +2139,13 @@ RegExp ComputeMemoryAddress(X64Emitter& e, const T& guest) { // TODO(benvanik): figure out how to do this without a temp. // Since the constant is often 0x8... if we tried to use that as a // displacement it would be sign extended and mess things up. - e.mov(e.eax, static_cast(guest.constant())); - return e.GetMembaseReg() + e.rax; + uint32_t address = static_cast(guest.constant()); + if (address < 0x80000000) { + return e.GetMembaseReg() + address; + } else { + e.mov(e.eax, address); + return e.GetMembaseReg() + e.rax; + } } else { // Clear the top 32 bits, as they are likely garbage. // TODO(benvanik): find a way to avoid doing this.