4 # &asm_init("cpp","des-586.pl");
12 &asm_finish_cpp() if $cpp;
13 print &asm_get_output();
21 $elf=$cpp=$sol=$aout=$win32=$gaswin=$netware=0;
22 if ( ($type eq "elf"))
23 { $elf=1; require "x86unix.pl"; }
24 elsif ( ($type eq "a.out"))
25 { $aout=1; require "x86unix.pl"; }
26 elsif ( ($type eq "gaswin"))
27 { $gaswin=1; $aout=1; require "x86unix.pl"; }
28 elsif ( ($type eq "sol"))
29 { $sol=1; require "x86unix.pl"; }
30 elsif ( ($type eq "cpp"))
31 { $cpp=1; require "x86unix.pl"; }
32 elsif ( ($type eq "win32"))
33 { $win32=1; require "x86ms.pl"; }
34 elsif ( ($type eq "win32n"))
35 { $win32=1; require "x86nasm.pl"; }
36 elsif ( ($type eq "nw-nasm"))
37 { $netware=1; require "x86nasm_nw.pl"; }
38 elsif ( ($type eq "nw-mwasm"))
39 { $netware=1; require "x86mwasm_nw.pl"; }
43 Pick one target type from
44 elf - linux, FreeBSD etc
47 cpp - format so x86unix.cpp can be used
48 win32 - Windows 95/Windows NT
49 win32n - Windows 95/Windows NT NASM format
50 nw-nasm - NetWare NASM format
51 nw-mwasm- NetWare Metrowerks Assembler
57 for (@ARGV) { $pic=1 if (/\-[fK]PIC/i); }
61 &comment("Don't even think of reading this code");
62 &comment("It was automatically generated by $filename");
63 &comment("Which is a perl program used to generate the x86 assember for");
64 &comment("any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris");
65 &comment("eric <eay\@cryptsoft.com>");
68 $filename =~ s/\.pl$//;
77 foreach $i (&get_labels())
79 $tmp.="#define $i _$i\n";
82 /* Run the C pre-processor over this file with one of the following defined
83 * ELF - elf object files,
84 * OUT - a.out object files,
85 * BSDI - BSDI style a.out object files
86 * SOL - Solaris style elf
89 #define TYPE(a,b) .type a,b
90 #define SIZE(a,b) .size a,b
92 #if defined(OUT) || (defined(BSDI) && !defined(ELF))
99 #if defined(__CYGWIN__) || defined(__DJGPP__)
103 #define TYPE(a,b) .def a; .scl 2; .type 32; .endef
104 #endif /* __CYGWIN || __DJGPP */
107 #if defined(BSDI) && !defined(ELF)
116 #if defined(ELF) || defined(SOL)
122 You need to define one of
123 ELF - elf systems - linux-elf, NetBSD and DG-UX
124 OUT - a.out systems - linux-a.out and FreeBSD
125 SOL - solaris systems, which are elf with strange comment lines
126 BSDI - a.out with a very primative version of as.
129 /* Let the Assembler begin :-) */