source:
for-distributions/trunk/bin/windows/perl/lib/B/disassemble@
14489
Last change on this file since 14489 was 14489, checked in by , 17 years ago | |
---|---|
File size: 396 bytes |
Line | |
---|---|
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); |
Note:
See TracBrowser
for help on using the repository browser.