my $flavour = $output;
my %GLOBALS;
-my $dotinlocallabels=0;
+my $dotinlocallabels=($flavour=~/linux/)?1:0;
################################################################
# directives which need special treatment on different platforms
};
/linux.*32/ && do { $ret .= ".globl $name\n";
$ret .= ".type $name,\@function";
- $dotinlocallabels = 1;
last;
};
/linux.*64/ && do { $ret .= ".globl .$name\n";
$ret .= ".previous\n";
$name = ".$name";
- $dotinlocallabels = 1;
last;
};
}
}
".machine $arch";
};
+my $asciz = sub {
+ shift;
+ my $line = join(",",@_);
+ if ($line =~ /^"(.*)"$/)
+ { ".byte " . join(",",unpack("C*",$1),0) . "\n.align 2"; }
+ else
+ { ""; }
+};
################################################################
# simplified mnemonics not handled by at least one assembler
my $mnemonic = $2;
my $f = $3;
my $opcode = eval("\$$mnemonic");
- $line =~ s|\br([0-9]+)\b|$1|g if ($c ne "." and $flavour !~ /osx/);
+ $line =~ s|\bc?r([0-9]+)\b|$1|g if ($c ne "." and $flavour !~ /osx/);
if (ref($opcode) eq 'CODE') { $line = &$opcode($f,split(',',$line)); }
elsif ($mnemonic) { $line = $c.$mnemonic.$f."\t".$line; }
}