diff --git a/Machines/PCCompatible/PCCompatible.cpp b/Machines/PCCompatible/PCCompatible.cpp index 5de8359b0..b1308143a 100644 --- a/Machines/PCCompatible/PCCompatible.cpp +++ b/Machines/PCCompatible/PCCompatible.cpp @@ -369,7 +369,7 @@ public: template IntT in(const uint16_t port) { if constexpr (std::is_same_v) { - return in(port) | (in(port + 1) << 8); + return uint16_t(in(port) | (in(port + 1) << 8)); } else { static_assert(std::is_same_v); diff --git a/Machines/PCCompatible/SegmentedMemory.hpp b/Machines/PCCompatible/SegmentedMemory.hpp index afaae8c12..a1da4d82d 100644 --- a/Machines/PCCompatible/SegmentedMemory.hpp +++ b/Machines/PCCompatible/SegmentedMemory.hpp @@ -40,7 +40,7 @@ template struct ProgramFetcher { LinearMemory &linear_memory ) const { const auto &descriptor = segments.descriptors[InstructionSet::x86::Source::CS]; - const auto base = descriptor.base() & (linear_memory.MaxAddress - 1); + const auto base = uint32_t(descriptor.base() & (linear_memory.MaxAddress - 1)); return std::make_pair( linear_memory.at(base), std::min(0x1'0000, 1 + descriptor.bounds().end - base)