x86asm.pl revision 9dc0df1bac950d6e491f9a7c7e4888f2b301cb15
# require 'x86asm.pl';
# &asm_init("cpp","des-586.pl");
# XXX
# XXX
# main'asm_finish
sub main'asm_finish
{
&file_end();
&asm_finish_cpp() if $cpp;
print &asm_get_output();
}
sub main'asm_init
{
if ( ($type eq "elf"))
elsif ( ($type eq "a.out"))
elsif ( ($type eq "cpp"))
elsif ( ($type eq "win32"))
elsif ( ($type eq "win32n"))
elsif ( ($type eq "nw-nasm"))
elsif ( ($type eq "nw-mwasm"))
else
{
print STDERR <<"EOF";
exit(1);
}
$pic=0;
&asm_init_output();
&comment("Don't even think of reading this code");
&comment("It was automatically generated by $filename");
&comment("Which is a perl program used to generate the x86 assember for");
&comment("any of ELF, a.out, COFF, Win32, ...");
&comment("eric <eay\@cryptsoft.com>");
&comment("");
}
sub asm_finish_cpp
{
return unless $cpp;
local($tmp,$i);
foreach $i (&get_labels())
{
$tmp.="#define $i _$i\n";
}
print <<"EOF";
*/
#define TYPE(a,b) .type a,b
#define SIZE(a,b) .size a,b
#if defined(OUT) || (defined(BSDI) && !defined(ELF))
$tmp
#endif
#ifdef OUT
#define OK 1
#define ALIGN 4
#if defined(__CYGWIN__) || defined(__DJGPP__)
#undef SIZE
#undef TYPE
#define SIZE(a,b)
#define TYPE(a,b) .def a; .scl 2; .type 32; .endef
#endif /* __CYGWIN || __DJGPP */
#endif
#if defined(BSDI) && !defined(ELF)
#define OK 1
#define ALIGN 4
#undef SIZE
#undef TYPE
#define SIZE(a,b)
#define TYPE(a,b)
#endif
#if defined(ELF) || defined(SOL)
#define OK 1
#define ALIGN 16
#endif
#ifndef OK
#endif
}
1;