x86 perlasm: add support for 16-bit values.

This commit is contained in:
Andy Polyakov 2010-06-04 13:13:18 +00:00
parent e8107c35b1
commit d08eae1bda
3 changed files with 10 additions and 2 deletions

View File

@ -91,6 +91,7 @@ sub ::DWP
}
sub ::QWP { &::DWP(@_); }
sub ::BP { &::DWP(@_); }
sub ::WP { &::DWP(@_); }
sub ::BC { @_; }
sub ::DWC { @_; }
@ -165,6 +166,7 @@ sub ::file_end
}
sub ::data_byte { push(@out,".byte\t".join(',',@_)."\n"); }
sub ::data_short{ push(@out,".word\t".join(',',@_)."\n"); }
sub ::data_word { push(@out,".long\t".join(',',@_)."\n"); }
sub ::align

View File

@ -14,7 +14,7 @@ sub ::generic
{ my ($opcode,@arg)=@_;
# fix hexadecimal constants
for (@arg) { s/0x([0-9a-f]+)/0$1h/oi; }
for (@arg) { s/(?<![\w\$\.])0x([0-9a-f]+)/0$1h/oi; }
if ($opcode !~ /movq/)
{ # fix xmm references
@ -65,6 +65,7 @@ sub get_mem
$ret;
}
sub ::BP { &get_mem("BYTE",@_); }
sub ::WP { &get_mem("WORD",@_); }
sub ::DWP { &get_mem("DWORD",@_); }
sub ::QWP { &get_mem("QWORD",@_); }
sub ::BC { "@_"; }
@ -156,6 +157,9 @@ sub ::public_label
sub ::data_byte
{ push(@out,("DB\t").join(',',@_)."\n"); }
sub ::data_short
{ push(@out,("DW\t").join(',',@_)."\n"); }
sub ::data_word
{ push(@out,("DD\t").join(',',@_)."\n"); }

View File

@ -67,6 +67,7 @@ sub get_mem
}
sub ::BP { &get_mem("BYTE",@_); }
sub ::DWP { &get_mem("DWORD",@_); }
sub ::WP { &get_mem("WORD",@_); }
sub ::QWP { &get_mem("",@_); }
sub ::BC { (($::mwerks)?"":"BYTE ")."@_"; }
sub ::DWC { (($::mwerks)?"":"DWORD ")."@_"; }
@ -135,7 +136,8 @@ sub ::public_label
sub ::data_byte
{ push(@out,(($::mwerks)?".byte\t":"db\t").join(',',@_)."\n"); }
sub ::data_short
{ push(@out,(($::mwerks)?".word\t":"dw\t").join(',',@_)."\n"); }
sub ::data_word
{ push(@out,(($::mwerks)?".long\t":"dd\t").join(',',@_)."\n"); }