cvsuser 01/09/19 12:04:20
Modified: . assemble.pl
Log:
Modifications to run on 64 bit platforms. To run on a 64 bit platform manually
change the setting for 'i' from 'l' to 'q'. This should be automatically done by a
Configure setting in the near future.
Revision Changes Path
1.27 +7 -7 parrot/assemble.pl
Index: assemble.pl
===================================================================
RCS file: /home/perlcvs/parrot/assemble.pl,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -w -r1.26 -r1.27
--- assemble.pl 2001/09/18 00:32:15 1.26
+++ assemble.pl 2001/09/19 19:04:20 1.27
@@ -17,7 +17,7 @@
'listing=s'));
if($options{'version'}) {
- print $0,'Version $Id: assemble.pl,v 1.26 2001/09/18 00:32:15 mon Exp $ ',"\n";
+ print $0,'Version $Id: assemble.pl,v 1.27 2001/09/19 19:04:20 thgibbs Exp $
',"\n";
exit;
}
@@ -75,7 +75,7 @@
my $line=0;
my %equate=('*'=>sub { return $pc },
'__DATE__'=>'"'.scalar(localtime).'"',
- '__VERSION__'=>'" $Revision: 1.26 $ "',
+ '__VERSION__'=>'" $Revision: 1.27 $ "',
'__LINE__' => sub { return $line });
while(<>) {
$line++;
@@ -103,7 +103,7 @@
while(scalar(@{$local_fixup{$label}})) {
my $op_pc=shift(@{$local_fixup{$label}});
my $offset=shift(@{$local_fixup{$label}});
- substr($bytecode,$offset,4)=pack('l',($pc-$op_pc)/4);
+
substr($bytecode,$offset,$sizeof{'i'})=pack('l',($pc-$op_pc)/$sizeof{'i'});
}
delete($local_fixup{$label});
}
@@ -118,7 +118,7 @@
while(scalar(@{$fixup{$label}})) {
my $op_pc=shift(@{$fixup{$label}});
my $offset=shift(@{$fixup{$label}});
- substr($bytecode,$offset,4)=pack('l',($pc-$op_pc)/4);
+
substr($bytecode,$offset,$sizeof{'i'})=pack('l',($pc-$op_pc)/$sizeof{'i'});
}
delete($fixup{$label});
}
@@ -213,7 +213,7 @@
}
$bytecode .= pack "l", $opcodes{$opcode}{CODE};
$op_pc=$pc;
- $pc+=4;
+ $pc+=$sizeof{'i'};
foreach (0..$#args) {
my($rtype)=$opcodes{$opcode}{TYPES}[$_];
@@ -231,7 +231,7 @@
push(@{$local_fixup{$args[$_]}},$op_pc,$pc);
$args[$_]=0xffffffff;
} else {
- $args[$_]=($local_label{$args[$_]}-$op_pc)/4;
+ $args[$_]=($local_label{$args[$_]}-$op_pc)/$sizeof{'i'};
}
} else {
if(!exists($label{$args[$_]})) {
@@ -239,7 +239,7 @@
push(@{$fixup{$args[$_]}},$op_pc,$pc);
$args[$_]=0xffffffff;
} else {
- $args[$_]=($label{$args[$_]}-$op_pc)/4;
+ $args[$_]=($label{$args[$_]}-$op_pc)/$sizeof{'i'};
}
}
$pc+=$sizeof{$rtype};