cvsuser 02/06/10 16:56:33
Modified: . assemble.pl
Log:
Adding the key register type to the assembler. Syntax matches PDD 08, namely
'P3[k:I21]' et al. It does actually support 'P5[k:I5:S30:N0]' as well, but there
won't be back-end assembly support for that for some time, I'd guess.
I'll shortly modify core.ops to add the appropriate raw keyed ops so that we can
do keyed access properly.
Revision Changes Path
1.67 +14 -0 parrot/assemble.pl
Index: assemble.pl
===================================================================
RCS file: /cvs/public/parrot/assemble.pl,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -w -r1.66 -r1.67
--- assemble.pl 10 Jun 2002 05:40:06 -0000 1.66
+++ assemble.pl 10 Jun 2002 23:56:33 -0000 1.67
@@ -707,6 +707,20 @@
$suffixes .= "_".lc(substr($1,0,1));
push @{$_->[0]}, [lc(substr($1,0,1)),$1];
}
+ #
+ # XXX '[k]' should be the result of one or more chained '[k:I3]' type
+ # XXX arguments. '[k:I3:N0]' gets transformed to '[k:N0]', then just '[k]'
+ #
+ elsif($temp=~s/^\[k\]//) {
+ }
+ #
+ # XXX Nip off the first keyed register and replace the '[k' at the start
+ # XXX of the string, so we can nip off another argument.
+ #
+ elsif($temp=~s/^\[k:($reg_re)/\[k/) {
+ $suffixes .= "_r";
+ push @{$_->[0]}, ['r',$1];
+ }
elsif($temp=~s/^\[(S\d+)\]//) { # The only key register should be Sn
$suffixes .= "_s";
push @{$_->[0]}, ['s',$1];