home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / vbcc / doc / vbcci386.doc < prev    next >
Encoding:
Text File  |  1997-01-31  |  4.3 KB  |  118 lines

  1. vbcc - C compiler (c) in 1995-97 by Volker Barthelmann
  2.  
  3.  
  4. INTRODUCTION
  5.  
  6.     vbcc is a free portable and retargetable ANSI C compiler.
  7.     It is clearly split into a target independant and a target dependant
  8.     part and supports emulating datatypes of the target machine on any
  9.     other machine so that it is possible to e.g. make a crosscompiler for
  10.     a 64bit machine on a 32bit machine.
  11.     This document only deals with the target dependant parts of the
  12.     i386 version.
  13.  
  14.     This code generator is in a very early stage and is expected to create
  15.     incorrect code. Also the generated code is still rather poor.
  16.  
  17.  
  18. LEGAL
  19.  
  20.     vbcc is (c) in 1995-97 by Volker Barthelmann. All code is written by me
  21.     and may be freely redistributed as long as no modifications are made
  22.     and nothing is charged for it.
  23.     Non-commercial usage of vbcc is allowed without any restrictions.
  24.     Commercial usage needs my written consent.
  25.  
  26.     Sending me money, gifts, postcards etc. would of course be very nice
  27.     and may encourage further development of vbcc, but is not legally or
  28.     morally necessary to use vbcc.
  29.  
  30.  
  31. ADDITIONAL OPTIONS FOR THIS VERSION
  32.  
  33.     -elf        Do not use a '_'-prefix in front of external identifiers.
  34.                 Use a '.'-prefix for label names.
  35.  
  36.     -merge-constants
  37.  
  38.                 Place identical floating point constants at the same
  39.                 memory location. This can reduce program size and increase
  40.                 compilation time.
  41.  
  42.     -const-in-data
  43.  
  44.                 By default constant data will be placed in the code
  45.                 section (and therefore is accessable with faster pc-relative
  46.                 addressing modes). Using this option it will be placed in the
  47.                 data section.
  48.                 Note that on operating systems with memory protection this
  49.                 option will disable write-protection of constant data.
  50.  
  51.     -no-delayed-popping
  52.  
  53.                 By default arguments of function calls are not always popped
  54.                 from the stack immediately after the call, so that the
  55.                 arguments of several calls may be popped at once.
  56.                 With this option vbcc can be forced to pop them after every
  57.                 function call.
  58.                 This may simplify debugging and very slightly reduce the
  59.                 stack size needed by the compiled program.
  60.  
  61.  
  62. SOME INTERNALS
  63.  
  64.     The current version generates assembly output for use with the GNU
  65.     assembler. The generated code should work on systems with Intel 80386
  66.     or higher CPUs with FPU.
  67.  
  68.     The register names are:
  69.  
  70.         %eax, %ebx, %ecx, %edx
  71.         %esi, %edi, %ebp, %esp
  72.  
  73.         (and %st(0)-%st(7) for the floating point stack but you must not
  74.          use it for register variables because it cannot be handled like
  75.          normal registers)
  76.  
  77.     The registers %eax, %ecx and %edx (as well as the floating point stack)
  78.     are used as scratch registers (i.e. they can be destroyed in function
  79.     calls), all other registers are preserved.
  80.  
  81.     All elementary types up to 4 bytes are returned in register %eax
  82.     Floating point values are returned in %st(0).
  83.     All other types are returned by passing the function the address
  84.     of the result as a hidden argument - so when you call such a function
  85.     without a proper declaration in scope you can expect a crash.
  86.  
  87.     vbcc uses %eax, %ebx, %ecx, %edx, %esi, %edi, %ebp and the floating point
  88.     stack for temporary results and register variables. Local variables
  89.     are created on the stack and addressed via %esp.
  90.  
  91.     The elementary data types are represented like:
  92.  
  93.     type        size in bits        alignment in bytes
  94.  
  95.     char                8                       1
  96.     short              16                       2
  97.     int                32                       2
  98.     long               32                       2
  99.     all pointers       32                       2
  100.     float(fpu)         32                       2
  101.     double(fpu)        64                       2
  102.  
  103.     Currently the i386 code generator at the moment only works on systems
  104.     that store floats and doubles in a similar way (IEEE) like the i386.
  105.     Floating point will especially not work on big-endian systems.
  106.  
  107.  
  108. KNOWN PROBLEMS
  109.  
  110.     Lots...
  111.  
  112.  
  113. Volker Barthelmann                                      volker@vb.franken.de
  114. Kennedy-Ring 39
  115. 91301 Forchheim
  116. Germany
  117.  
  118.