# New Ticket Created by Simon Glover
# Please include the string: [netlabs #649]
# in the subject line of all future correspondence about this issue.
# <URL: http://bugs6.perl.org/rt2/Ticket/Display.html?id=649 >
The new assembler allows one to use string constants and string registers
interchangably as keys, but doesn't let you do the same for INTs or
FLOATs. Patch below fixes.
Simon
--- assemble.pl.old Sat Jun 1 15:45:14 2002
+++ assemble.pl Sat Jun 1 15:49:21 2002
@@ -684,6 +684,14 @@
$_->[0][0] .= "_nc";
push @{$_->[0]}, $self->_numeric_constant($1);
}
+ elsif($temp=~s/^\[($flt_re)\]//) {
+ $_->[0][0] .= "_nc";
+ push @{$_->[0]}, $self->_numeric_constant($1);
+ }
+ elsif($temp=~s/^($str_re)//) {
+ $_->[0][0] .= "_sc";
+ push @{$_->[0]}, $self->_string_constant($1);
+ }
elsif($temp=~s/^\[($str_re)\]//) {
$_->[0][0] .= "_sc";
push @{$_->[0]}, $self->_string_constant($1);
@@ -693,17 +701,26 @@
$_->[0][0] .= "_ic";
push @{$_->[0]}, ['ic',(strtol($val,2))[0]];
}
+ elsif($temp=~s/^\[($bin_re)\]//) {
+ my $val = $1;$val=~s/0b//;
+ $_->[0][0] .= "_ic";
+ push @{$_->[0]}, ['ic',(strtol($val,2))[0]];
+ }
elsif($temp=~s/^($hex_re)//) {
$_->[0][0] .= "_ic";
push @{$_->[0]}, ['ic',(strtol($1,16))[0]];
}
+ elsif($temp=~s/^\[($hex_re)\]//) {
+ $_->[0][0] .= "_ic";
+ push @{$_->[0]}, ['ic',(strtol($1,16))[0]];
+ }
elsif($temp=~s/^($dec_re)//) {
$_->[0][0] .= "_ic";
push @{$_->[0]}, ['ic',0+$1];
}
- elsif($temp=~s/^($str_re)//) {
- $_->[0][0] .= "_sc";
- push @{$_->[0]}, $self->_string_constant($1);
+ elsif($temp=~s/^\[($dec_re)\]//) {
+ $_->[0][0] .= "_ic";
+ push @{$_->[0]}, ['ic',0+$1];
}
elsif($temp=~s/^($label_re)//) {
unless(defined $self->{global_labels}{$1}) {