DES PIC-ification. Windows companion.

This commit is contained in:
Andy Polyakov 2002-12-14 17:54:30 +00:00
parent 4329db3726
commit 270fa8aeda
2 changed files with 11 additions and 5 deletions

View File

@ -92,6 +92,8 @@ sub get_mem
$addr="_$addr";
}
if ($addr =~ /^.+\-.+$/) { $addr="($addr)"; }
$reg1="$regs{$reg1}" if defined($regs{$reg1});
$reg2="$regs{$reg2}" if defined($regs{$reg2});
if (($addr ne "") && ($addr ne 0))
@ -111,6 +113,7 @@ sub get_mem
{
$ret.="[$reg1$post]"
}
$ret =~ s/\[\]//; # in case $addr was the only argument
return($ret);
}
@ -151,7 +154,7 @@ sub main'push { &out1("push",@_); $stack+=4; }
sub main'pop { &out1("pop",@_); $stack-=4; }
sub main'bswap { &out1("bswap",@_); &using486(); }
sub main'not { &out1("not",@_); }
sub main'call { &out1("call",'_'.$_[0]); }
sub main'call { &out1("call",($_[0]=~/^\$L/?'':'_').$_[0]); }
sub main'ret { &out0("ret"); }
sub main'nop { &out0("nop"); }
@ -338,7 +341,7 @@ sub main'set_label
{
if (!defined($label{$_[0]}))
{
$label{$_[0]}="${label}${_[0]}";
$label{$_[0]}="\$${label}${_[0]}";
$label++;
}
if((defined $_[2]) && ($_[2] == 1))

View File

@ -98,6 +98,8 @@ sub get_mem
$addr="_$addr";
}
if ($addr =~ /^.+\-.+$/) { $addr="($addr)"; }
$reg1="$regs{$reg1}" if defined($regs{$reg1});
$reg2="$regs{$reg2}" if defined($regs{$reg2});
if (($addr ne "") && ($addr ne 0))
@ -117,6 +119,7 @@ sub get_mem
{
$ret.="$reg1$post]"
}
$ret =~ s/\+\]/]/; # in case $addr was the only argument
return($ret);
}
@ -160,7 +163,7 @@ sub main'push { &out1("push",@_); $stack+=4; }
sub main'pop { &out1("pop",@_); $stack-=4; }
sub main'bswap { &out1("bswap",@_); &using486(); }
sub main'not { &out1("not",@_); }
sub main'call { &out1("call",'_'.$_[0]); }
sub main'call { &out1("call",($_[0]=~/^\.L/?'':'_').$_[0]); }
sub main'ret { &out0("ret"); }
sub main'nop { &out0("nop"); }
@ -312,7 +315,7 @@ sub main'label
{
if (!defined($label{$_[0]}))
{
$label{$_[0]}="\$${label}${_[0]}";
$label{$_[0]}=".${label}${_[0]}";
$label++;
}
return($label{$_[0]});
@ -322,7 +325,7 @@ sub main'set_label
{
if (!defined($label{$_[0]}))
{
$label{$_[0]}="${label}${_[0]}";
$label{$_[0]}=".${label}${_[0]}";
$label++;
}
push(@out,"$label{$_[0]}:\n");