diff --git a/InstructionSets/x86/AccessType.hpp b/InstructionSets/x86/AccessType.hpp index bba27e948..14ad92891 100644 --- a/InstructionSets/x86/AccessType.hpp +++ b/InstructionSets/x86/AccessType.hpp @@ -46,12 +46,11 @@ template class Writeable { public: Writeable(IntT &target) : target_(target) {} - void operator=(IntT value) { target_ = value; } + IntT operator=(IntT value) { return target_ = value; } private: IntT &target_; }; -//template struct Accessor { using type = Writeable; }; -template struct Accessor { using type = IntT &; }; +template struct Accessor { using type = Writeable; }; // Read-modify-writes: return a reference. template struct Accessor { using type = IntT &; }; diff --git a/InstructionSets/x86/Implementation/PerformImplementation.hpp b/InstructionSets/x86/Implementation/PerformImplementation.hpp index 713ca3141..e9d2900da 100644 --- a/InstructionSets/x86/Implementation/PerformImplementation.hpp +++ b/InstructionSets/x86/Implementation/PerformImplementation.hpp @@ -1013,9 +1013,9 @@ void setmo( write_t destination, ContextT &context ) { - destination = ~0; + const auto result = destination = ~0; context.flags.template set_from(0); - context.flags.template set_from(destination); + context.flags.template set_from(result); } template diff --git a/InstructionSets/x86/Implementation/Resolver.hpp b/InstructionSets/x86/Implementation/Resolver.hpp index 9f9c9d9e1..0f84eb825 100644 --- a/InstructionSets/x86/Implementation/Resolver.hpp +++ b/InstructionSets/x86/Implementation/Resolver.hpp @@ -44,7 +44,7 @@ uint32_t address( uint32_t address; uint16_t zero = 0; - address = resolve(instruction, pointer.index(), pointer, context, &zero); + address = resolve(instruction, pointer.index(), pointer, context, &zero); if constexpr (is_32bit(ContextT::model)) { address <<= pointer.scale(); } @@ -53,7 +53,7 @@ uint32_t address( if constexpr (source == Source::IndirectNoBase) { return address; } - return address + resolve(instruction, pointer.base(), pointer, context); + return address + resolve(instruction, pointer.base(), pointer, context); } /// @returns a pointer to the contents of the register identified by the combination of @c IntT and @c Source if any;