#!/usr/bin/perl
use strict;

print "Enter x86 assembly\n";

my $asmfile = '/tmp/nasm.asm';
my $outfile = '/tmp/nasm';

while( <> )
{
	open ASMFILE, ">$asmfile";
	print ASMFILE "BITS 32\n";
	print ASMFILE $_;
	close ASMFILE;

	system('/usr/bin/nasm', $asmfile);

	system('/usr/bin/hexdump', '-v', '-e', '1/1 "%02X "', $outfile);
	print "\n";
}

