sub main'inc { &out1("incl",@_); }
sub main'push { &out1("pushl",@_); $stack+=4; }
sub main'pop { &out1("popl",@_); $stack-=4; }
+sub main'pushf { &out0("pushf"); $stack+=4; }
+sub main'popf { &out0("popf"); $stack-=4; }
sub main'not { &out1("notl",@_); }
sub main'call { &out1("call",$under.$_[0]); }
sub main'ret { &out0("ret"); }
popl %ebx
popl %ebp
ret
-$const
.${func}_end:
EOF
push(@out,$tmp);
- $const="";
if ($main'cpp)
{ push(@out,"\tSIZE($func,.${func}_end-$func)\n"); }
sub main'file_end
{
+ if ($const ne "")
+ {
+ push(@out,".section .rodata\n");
+ push(@out,$const);
+ $const="";
+ }
}
sub main'data_word
sub pushvars
{
+ &main'pushf();
&main'push("edx");
&main'push("ecx");
&main'push("eax");
&main'pop("eax");
&main'pop("ecx");
&main'pop("edx");
+ &main'popf();
}