The unified diff between revisions [266fa6a6..] and [d7f56ff4..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'disassem.pl'
# # old_revision [266fa6a67e73f67581c4c8844d4ec9b62b10da46] # new_revision [d7f56ff4d45c3b7b9afeafe4288a9b4d65c37101] # # patch "disassem.pl" # from [547116c9df493de3ef5ba8b453f4070068afb1be] # to [5d879747c483bd6cff52dadb8415f8d01f60017a] # ============================================================ --- disassem.pl 547116c9df493de3ef5ba8b453f4070068afb1be +++ disassem.pl 5d879747c483bd6cff52dadb8415f8d01f60017a @@ -1,4 +1,4 @@ -#!/usr/pkg/bin/perl +#!/usr/bin/env perl open FILE, "input.bin" or die $!; @@ -63,7 +63,7 @@ if (open LABELS, "<input.labels") { $addr = hex $addr; $labels{$addr} = $name; if ($name =~ /^L(\d+)$/) { - $labelnum = $1 + 1 if ($labelnum >= $1); + $labelnum = $1 + 1 if ($1 >= $labelnum); } } } @@ -158,9 +158,9 @@ $output = 0; 0xB9 => "ICR09", 0xBA => "ICR10", 0xBB => "ICR11", - 0xBC => "ICR22", - 0xBD => "ICR33", - 0xBE => "ICR44", + 0xBC => "ICR12", + 0xBD => "ICR13", + 0xBE => "ICR14", 0xBF => "ICR15", # Specific to LC2412 0xC0 => "KEY0", @@ -210,7 +210,7 @@ foreach my $addr (sort keys %labels) { open LABELS, ">input.labels" or die $!; foreach my $addr (sort keys %labels) { - printf LABELS "%s: %.6x\n", $labels{$addr}, $addr + printf LABELS "%s: %06x\n", $labels{$addr}, $addr if defined($labels{$addr}); } @@ -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!!!