projects
/
p5sagit/p5-mst-13.2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
B::Lint doesn't work
[p5sagit/p5-mst-13.2.git]
/
ext
/
B
/
B
/
disassemble
1
use B::Disassembler qw(disassemble_fh);
2
use FileHandle;
3
4
my $fh;
5
if (@ARGV == 0) {
6
$fh = \*STDIN;
7
} elsif (@ARGV == 1) {
8
$fh = new FileHandle "<$ARGV[0]";
9
} else {
10
die "Usage: disassemble [filename]\n";
11
}
12
13
sub print_insn {
14
my ($insn, $arg) = @_;
15
if (defined($arg)) {
16
printf "%s %s\n", $insn, $arg;
17
} else {
18
print $insn, "\n";
19
}
20
}
21
22
disassemble_fh($fh, \&print_insn);