diff --git a/machine.hpp b/machine.hpp index 90a8f93..3f50cbc 100644 --- a/machine.hpp +++ b/machine.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include namespace VariadicMachine { @@ -135,8 +136,13 @@ private: std::cout << std::bitset(memory[currentPosition]); return; + // Ugh hate this, I really should use C++23 case AsHex: - std::cout << std::hex << memory[currentPosition] << std::dec; + std::cout << "0x" << std::setfill('0') << std::setw(sizeof(int)) + << std::hex << memory[currentPosition]; + + // Stupid reset because cout is a dumb dumb thing + std::cout << std::dec << std::setfill(' ') << std::setw(0); return; default: