From 27123a09eaa745ac01d84cb887076e842ee8d265 Mon Sep 17 00:00:00 2001 From: Lawrence Kesteloot Date: Thu, 2 Aug 2018 15:16:48 -0700 Subject: [PATCH] Fix bytelength calculation in disassembler. --- dis6502.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dis6502.cpp b/dis6502.cpp index 7c5e183..5208149 100644 --- a/dis6502.cpp +++ b/dis6502.cpp @@ -68,7 +68,7 @@ tuple disassemble_6502(int address, const unsigned char* buffer) sprintf(p, "%04X %n", address, &stored); //Display current address at beginning of line p += stored; paramcount = opcode_props[currentbyte][0]; //Get instruction length - bytelength = 1 + paramcount; + bytelength = paramcount; opcode = instruction[opcode_props[currentbyte][1]]; //Get opcode name addrmode = opcode_props[currentbyte][2]; //Get info required to display addressing mode pre = modes[addrmode][0]; //Look up pre-operand formatting text