7 require Nasm
::insns
::Operands
;
8 require Nasm
::insns
::Flags
;
10 # Opcode prefixes which need their own opcode tables
11 # LONGER PREFIXES FIRST!
12 our @disasm_prefixes = qw(0F24 0F25 0F38 0F3A 0F7A 0FA6 0FA7 0F);
14 # This should match MAX_OPERANDS from nasm.h
15 our $MAX_OPERANDS = 5;
19 for( my $m = 0; $m < 32; $m++ ){
20 for( my $lp = 0; $lp < 8; $lp++ ){
21 push(@vexlist, sprintf("VEX%02X%01X", $m, $lp));
24 @disasm_prefixes = (@vexlist, @disasm_prefixes);
26 our @bytecode_count = (0) x
256;
29 my($class,$filename) = @_;
31 my $self = bless {}, $class;
34 $self->ProcessFile($filename);
41 my( $self, $filename ) = @_;
42 open( my $file, '<', $filename ) || die "unable to open $filename";
44 $self->{filename
} = $filename;
47 while( my $line = <$file> ){
51 # /^\s*(?:;\#)(.*)$/ # special lines
52 next if $line =~ /^\s*(?:;|$)/ ; # comments or blank lines
54 $self->ProcessLine($line,$line_number);
59 my( $self, $line, $line_number ) = @_;
75 my($name,$operands,$code_string,$flags) = ($1,$2,$3,$4);
77 my $op_obj = Nasm
::insns
::Operands
->new($operands);
78 my $flag_obj = Nasm
::insns
::Flags
->new($flags);
80 my $ref = $self->{ops
}{$name.':'.$op_obj->string} = {
83 codestring
=> $code_string