From: Hugo Villeneuve Date: Mon, 25 Nov 2013 01:39:30 +0000 (-0500) Subject: Remove superfluous bytes in program disassembly X-Git-Tag: v2.0.0~58 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=359b0be02becb952016f0f79f6e608c7737378e7;p=emu8051.git 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. --- 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); }