mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-17 20:44:37 +03:00
Fixed Issue #22
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
// This file is used to test opcodes generated by AsmJit. Output can be
|
||||
// disassembled in your IDE or by your favourite disassembler. Instructions
|
||||
// are sorted alphabetically.
|
||||
// are grouped by category and then sorted alphabetically.
|
||||
|
||||
// [Dependencies - AsmJit]
|
||||
#include <asmjit/asmjit.h>
|
||||
|
||||
@@ -3180,13 +3180,15 @@ _EmitX86M:
|
||||
mIndex = rmMem->getIndex();
|
||||
|
||||
// Size override prefix.
|
||||
if (Arch == kArchX86) {
|
||||
if (rmMem->getMemType() != kMemTypeLabel && !rmMem->hasGpdBase())
|
||||
EMIT_BYTE(0x67);
|
||||
}
|
||||
else {
|
||||
if (rmMem->getMemType() != kMemTypeLabel && rmMem->hasGpdBase())
|
||||
EMIT_BYTE(0x67);
|
||||
if (rmMem->hasBaseOrIndex()) {
|
||||
if (Arch == kArchX86) {
|
||||
if (!rmMem->hasGpdBase())
|
||||
EMIT_BYTE(0x67);
|
||||
}
|
||||
else {
|
||||
if (rmMem->hasGpdBase())
|
||||
EMIT_BYTE(0x67);
|
||||
}
|
||||
}
|
||||
|
||||
// Segment override prefix.
|
||||
|
||||
@@ -2685,12 +2685,14 @@ struct Mem : public BaseMem {
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
//! @brief Get whether the memory operand has base register.
|
||||
ASMJIT_INLINE bool hasBase() const
|
||||
{ return _vmem.base != kInvalidValue; }
|
||||
ASMJIT_INLINE bool hasBase() const {
|
||||
return _vmem.base != kInvalidValue;
|
||||
}
|
||||
|
||||
//! @brief Get memory operand base register code, variable id, or @ref kInvalidValue.
|
||||
ASMJIT_INLINE uint32_t getBase() const
|
||||
{ return _vmem.base; }
|
||||
ASMJIT_INLINE uint32_t getBase() const {
|
||||
return _vmem.base;
|
||||
}
|
||||
|
||||
//! @brief Set memory operand base register code, variable id, or @ref kInvalidValue.
|
||||
ASMJIT_INLINE Mem& setBase(uint32_t base) {
|
||||
@@ -2796,6 +2798,20 @@ struct Mem : public BaseMem {
|
||||
return _setVSib(kMemVSibGpz);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// [Misc]
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
//! @brief Get whether the memory operand has base and index register.
|
||||
ASMJIT_INLINE bool hasBaseOrIndex() const {
|
||||
return _vmem.base != kInvalidValue || _vmem.index != kInvalidValue;
|
||||
}
|
||||
|
||||
//! @brief Get whether the memory operand has base and index register.
|
||||
ASMJIT_INLINE bool hasBaseAndIndex() const {
|
||||
return _vmem.base != kInvalidValue && _vmem.index != kInvalidValue;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// [Shift]
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user