Attached patch makes sure you don't try and use register numbers over
31. That is, this patch allows registers I0-I31 and anything else gets
a: Error (foo.pasm:0): Register 32 out of range (should be 0-31) in 'set_i_ic'

Oh, there's also a comment at end of line patch that has snuck in 'cos
it's so darn useful.

Leon
-- 
Leon Brocard.............................http://www.astray.com/
Nanoware...............................http://www.nanoware.org/

... You seem a decent fellow, I hate to kill you
Index: assemble.pl
===================================================================
RCS file: /home/perlcvs/parrot/assemble.pl,v
retrieving revision 1.38
diff -u -u -r1.38 assemble.pl
--- assemble.pl 2001/09/22 16:18:48     1.38
+++ assemble.pl 2001/09/22 20:01:41
@@ -162,6 +162,7 @@
 
     1 while $code=~s/\"([^\\\"]*(?:\\.[^\\\"]*)*)\"/constantize($1)/eg;
     $code=~s/,/ /g;
+    $code =~ s/#.*$//; # Strip end-of-line comments
     my($opcode,@args)=split(/\s+/,$code);    
     if(exists($macros{$opcode})) {
        # found a macro
@@ -303,6 +304,7 @@
        if($rtype eq "I" || $rtype eq "N" || $rtype eq "P" || $rtype eq "S") {
            # its a register argument
            $args[$_]=~s/^[INPS](\d+)$/$1/i;
+           error("Register $1 out of range (should be 0-31) in 
+'$opcode'",$file,$line) if $1 < 0 or $1 > 31;
        } elsif($rtype eq "D") {
            # a destination
            if($args[$_]=~/^\$/) {

Reply via email to