home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / biblioteki / c_library / easylibs / fd2pragma.readme < prev    next >
Text File  |  1977-12-31  |  3KB  |  84 lines

  1. Short: Pragmas, LVOs for Aztec, Dice, SAS, Maxon
  2. Type: dev/misc
  3. Author: wiedmann@zdv.uni-tuebingen.de
  4. Uploader: wiedmann@zdv.uni-tuebingen.de
  5.  
  6.  
  7. fd2pragma is a utility which creates so-called pragma and LVO files
  8. for using shared libraries. Of course you need FD files that describe
  9. how to call the library. (The best way to get the system FD files is
  10. to buy the NDU. See the AmigaFAQ for details.)
  11.  
  12. fd2pragma is nothing special. Most compilers have such a utility. But
  13. my version has some advantages:
  14.  
  15. - Different pragma formats available; supported formats are:
  16.  
  17.     Program    Filename (example)  pragma format (example)
  18.  
  19.     Aztec-C    xxx_lib.h        #pragma amicall(xBase,0x1e,xfuncA(a0,d1))
  20.     Maxon    xxx_pragmas.h        #pragma amicall(xBase,0x1e,xfuncA(a0,d1))
  21.     Dice    xxx_pragmas.h        #pragma libcall xBase xfuncA 1e 1802
  22.     SAS-C    xxx_pragmas.h        #pragma libcall xBase xfuncA 1e 1802
  23.  
  24. - Possibility to create LVO files for assembler. (Aztec-As format, but
  25.   this most assemblers should understand this. SAS-asm does.) LVO
  26.   definitions look like this:
  27.  
  28.     Program    Filename (example)  LVO format (example)
  29.  
  30.     Aztec-As    xxx_lib.asm            xdef    _LVOxfunc
  31.                     _LVOxfunc    equ    -30
  32.  
  33. - Possibility to create tagcall pragmas that SAS-C understands. This
  34.   replace the old stub routines when using tag functions with arguments
  35.   on the stack. This is enabled by using certain comments. To create a
  36.   a tagcall pragma for the above function you would put the comment
  37.  
  38.     *tagcall
  39.  
  40.   behind the respective line in the FD file. In SAS mode fd2pragma would
  41.   produce this:
  42.  
  43.     #ifdef __SASC_60
  44.     #pragma tagcall xBase xfunc 1e 1802
  45.     #endif
  46.  
  47.   In the above example we got the name of the tagcall function by removing
  48.   the character 'A' from the original name. This is the usual behaviour
  49.   of Commodore for now, as far as I know and hence this is the default.
  50.   But how to produce a tagcall SystemTags from System? We would say
  51.  
  52.     *tagcalltags
  53.  
  54.   fd2pragma would put the word tags behind the original word System by
  55.   uppercasing the first character. (This is like in MUIMaster_lib.fd.)
  56.   Finally you have the possibility to use something like
  57.  
  58.     *tagcall =SystemTags
  59.  
  60.   This would tell fd2pragma the exact name of the tagcall function. (The
  61.   above possibilities are for compatibility with MUIMaster_lib.fd, which
  62.   gave me the idea.)
  63.  
  64.   Note, that the original FD files from Commodore don't have these
  65.   comments!
  66.  
  67. - Possibility to create stub routines for other compilers. (Don't look
  68.   at these stubs: They look BCPL-like, horrible! But I hope, they'll
  69.   work. ;-)
  70.  
  71.  
  72.  
  73. The command template pf fd2pragma is
  74.  
  75.     fd2pragma FDFILE/A,AZTEC/K,AS/K,DICE/K,SAS/K,MAXON/K,TAGDIR/K
  76.  
  77. where "FDFILE" is the file to convert. The arguments AZTEC, AS (Aztec-As),
  78. DICE, SAS and MAXON are the pragma or LVO files that should be created.
  79. The TAGDIR argument is the name of a directory where to place stub routines.
  80.  
  81.  
  82. This program is in the public domain. Use it as you want, but WITHOUT ANY
  83. WARRANTY!
  84.