notes.txt 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. { $Id$ }
  2. Notes about MorphOS version of Free Pascal:
  3. Stack:
  4. ========================================================================
  5. Under MorphOS, the default stack is set to 256 kB. Stack size can be set
  6. directly by the programmer with the compiler switch (-Cs), or with the
  7. {$MEMORY} directive. The memory area for the stack is dynamically
  8. allocated on program startup, so if you set this value too high, in low
  9. memory situations your program may exit immediately on startup without
  10. any further notice.
  11. Syscalls:
  12. ========================================================================
  13. Free Pascal currently supports ABox-style calls for MorphOS. Using
  14. additional hand-written assembly is not needed to call any ABox library
  15. function. However, you must declare every function you're going to use
  16. by the following way:
  17. Var
  18. my_LibBase: Pointer;
  19. function my_LibCall(param1: longint location 'd0',
  20. param2: longint location 'd1'): LongInt;
  21. SysCall my_LibBase 1234;
  22. Where my_LibBase is the library base returned by exec's OpenLibrary()
  23. call, and 1234 is the call offset. Please note that offset values in
  24. Free Pascal must be specified as positive values, and not negative as
  25. shown in MorphOS SDK.
  26. The value after location can be any 68k registers from d0-d7/a0-a6. Note
  27. that a7 and sp cannot be used. Register names are not case sensitive.
  28. In SysCalls you must specify location for every arguments explicity.
  29. MOST IMPORTANT: You must open libraries explicitly _BEFORE_ using any
  30. functions from it, because the compiler will not do it for you. Don't
  31. forget to close libraries before you exit.
  32. Before declaring a SysCall function, please check the units provided
  33. with FPC, the function you want to use might already be declared in one
  34. of the units, and ready to use.
  35. Alignment:
  36. ========================================================================
  37. Record elements are aligned to DWORD (4 bytes) under MorphOS. Use
  38. {$PACKRECORDS 2} if you need word aligned structures. For byte
  39. aligned records, use packed record.
  40. Thanks:
  41. ========================================================================
  42. MorphOS port of Free Pascal Compiler was possible, because Genesi
  43. S.a.r.l. <www.genesi.lu> provided a free Pegasos II/G4 machine to do
  44. the developments on it.
  45. {
  46. $Log$
  47. Revision 1.1 2004-06-06 18:32:50 karoly
  48. * initial revision
  49. }