Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/root/sys/src/cmd/perl/lib/B/disassemble

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


use B::Disassembler qw(disassemble_fh);
use FileHandle;

my $fh;
if (@ARGV == 0) {
    $fh = \*STDIN;
} elsif (@ARGV == 1) {
    $fh = new FileHandle "<$ARGV[0]";
} else {
    die "Usage: disassemble [filename]\n";
}

sub print_insn {
    my ($insn, $arg) = @_;
    if (defined($arg)) {
	printf "%s %s\n", $insn, $arg;
    } else {
	print $insn, "\n";
    }
}

disassemble_fh($fh, \&print_insn);

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.