1 use B::Assembler qw(assemble_fh);
4 my ($filename, $fh, $out);
6 if ($ARGV[0] eq "-d") {
7 B::Assembler::debug(1);
16 } elsif (@ARGV == 1) {
18 $fh = new FileHandle "<$filename";
19 } elsif (@ARGV == 2) {
21 $fh = new FileHandle "<$filename";
22 $out = new FileHandle ">$ARGV[1]";
24 die "Usage: assemble [filename] [outfilename]\n";
28 $SIG{__WARN__} = sub { warn "$filename:@_" };
29 $SIG{__DIE__} = sub { die "$filename: @_" };
30 assemble_fh($fh, sub { print $out @_ });