Fix bug in hexadecimal output.

This commit is contained in:
Marcel Keller
2024-06-18 19:02:09 +10:00
parent e93190f3b7
commit adef788433
4 changed files with 23 additions and 3 deletions

View File

@@ -394,10 +394,14 @@ void Processor<T>::print_reg(int reg, int n, int size)
#ifdef DEBUG_VALUES
cout << "print_reg " << typeid(T).name() << " " << reg << " " << &C[reg] << endl;
#endif
bigint output;
out << "Reg[" << reg << "] = 0x" << hex << noshowbase;
for (int i = 0; i < size; i++)
output += bigint((unsigned long)C[reg + i].get()) << (T::default_length * i);
out << "Reg[" << reg << "] = " << hex << showbase << output << dec << " # ";
{
out.fill('0');
out.width(16);
out << (unsigned long)C[reg + size - 1 - i].get();
}
out << dec << " # ";
print_str(n);
out << endl << flush;
}