From d9562521caf4a189d4243c87bad0e55ee11d1998 Mon Sep 17 00:00:00 2001 From: sBubshait Date: Mon, 3 Jun 2024 22:13:46 +0100 Subject: [PATCH] Fix print format bug, it used to only print lower 32 bits, w/ T --- src/print.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/print.c b/src/print.c index 430f594..e0b8eb4 100644 --- a/src/print.c +++ b/src/print.c @@ -17,9 +17,9 @@ void printState(Machine *state, FILE *stream) { void printRegisters(Machine *state, FILE *stream) { fprintf(stream, "Registers:\n"); for (int i = 0; i < REGISTER_COUNT; i++) { - fprintf(stream, "X%02d\t= %016x\n", i, (unsigned int)state->registers[i]); + fprintf(stream, "X%02d\t= %016llx\n", i, state->registers[i]); } - fprintf(stream, "PC\t= %016x\n", (unsigned int)state->pc); + fprintf(stream, "PC\t= %016llx\n", state->pc); fprintf(stream, "PSTATE\t: %c%c%c%c", state->conditionCodes.Negative ? 'N' : UNSET_CONDITION_CODE_CHAR, state->conditionCodes.Zero ? 'Z' : UNSET_CONDITION_CODE_CHAR, state->conditionCodes.Carry ? 'C' : UNSET_CONDITION_CODE_CHAR, @@ -52,7 +52,7 @@ void printMemory(Machine *state, FILE *stream) { for (int addr = 0; addr < MEMORY_SIZE; addr+= 4) { word data = readWord(state->memory, addr); if (data != 0) { - fprintf(stream, "0x%08x: 0x%08x\n", addr, data); + fprintf(stream, "0x%08x: %08x\n", addr, data); } } }