From d3ce23424e7cdbd5cf308d96ff6c5da1f4b0a4c8 Mon Sep 17 00:00:00 2001 From: Gavan Fantom Date: Sun, 13 Feb 2011 15:29:15 +0000 Subject: [PATCH] Track branches with 24 bit absolute addresses too. Also, fix bug in generating duplicate labels after reading in labels file --- disassem.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/disassem.pl b/disassem.pl index 65db26f..42b028b 100755 --- a/disassem.pl +++ b/disassem.pl @@ -63,7 +63,7 @@ if (open LABELS, "= $1); + $labelnum = $1 + 1 if ($1 >= $labelnum); } } } @@ -1550,7 +1550,12 @@ sub read_operand_addr24 my $addr = $byte1; $addr += $byte2 << 8; $addr += $byte3 << 16; - set_operand(sprintf("0x%.6x", $addr)); + if ($branch) { + set_operand(sprintf("%s", get_label($addr))); + add_comment(sprintf("0x%.6x", $addr)); + } else { + set_operand(sprintf("0x%.6x", $addr)); + } } ## ASSUMPTION: This is always the last operand!!!