From 359b0be02becb952016f0f79f6e608c7737378e7 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sun, 24 Nov 2013 20:39:30 -0500 Subject: [PATCH] Remove superfluous bytes in program disassembly Sometimes, B1 and B2 were showing old values from previous disassembly. Now explicitly remove them for each disassembly line. --- src/pgmwin.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/pgmwin.c b/src/pgmwin.c index 09a6e83..0e8961b 100644 --- a/src/pgmwin.c +++ b/src/pgmwin.c @@ -273,9 +273,14 @@ pgmwin_refresh(void) InstSize = cpu8051_get_instruction_size(OpCode); /* Display instruction hex bytes. */ - for (k = 0, col_id = COL_B0; k < InstSize; k++, col_id++) { - int2asciihex(memory_read8(PGM_MEM_ID, Address + k), - str, 2); + for (k = 0, col_id = COL_B0; k < 3; k++, col_id++) { + if (k < InstSize) + int2asciihex(memory_read8(PGM_MEM_ID, + Address + k), + str, 2); + else + str[0] = '\0'; + gtk_list_store_set(store, &iter, col_id, str, -1); } -- 2.20.1