home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 488.lha / FDStub_v0.6a / FDStub.DOC < prev    next >
Text File  |  1991-02-08  |  5KB  |  213 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                  FDStub
  7.                  
  8.             The C to ASM interface generator
  9.              Written by Bruce Mackey
  10.                     (c) 1991
  11.                 All rights reserved.
  12.  
  13.  
  14.                   Version 0.6a
  15.  
  16.  
  17.  
  18.  
  19. DISCLAMER
  20.      Anyone  my  FREELY   distribute   this  progam  and  program
  21. documentation, providing that the  program, documention, and LZH
  22. file remain in there original state. You as the user or distributor
  23. may not charge any money apart from postage or material (eg. Disks).
  24. If you want to bundle this  program  (oh  sure) with some work of
  25. your own you MUST get permission from the author in writing (of course
  26. if it is for a commercial product the author would like some green
  27. backs...er CASH!).
  28.  
  29.  
  30. OVERVIEW
  31.     I started writing this program when I still used Lattice 3.03 
  32.     and had a greater need for it.
  33.     
  34.     I came across it and brushed off the dust, polished it up a 
  35.     little, and here you go.
  36.  
  37.     I use it when I'm writing individual assembler subroutines.
  38.     I'll use 'C' to write a quick and easy test routine and FDStub 
  39.     to create the stubs from the .FD file I keep as documentation.
  40.  
  41.     FDStub is of course useful for creating stub (link-time) 
  42.     libraries (like amiga.lib).
  43.     
  44. USAGE
  45.  
  46.     FDStub is used from the CLI:
  47.  
  48.    FDStub infile { outfile | outpath } [OPTIONS] [MULTI] [NOLVOS] [NOA6]
  49.     
  50.         
  51.         infile is the .FD filename and can include a path.
  52.  
  53.         outfile is the name of the file to receive the stubs.
  54.         outpath is used with the MUTLI keyword (see KEYWORDS below).
  55.             outpath can be  .  or  "" for current dir.
  56.  
  57. OPTIONS
  58.  
  59.     There are only TWO options:
  60.     
  61.         -Q    won't diplay line numbers AND does not
  62.             print the name header of the function     
  63.             in the outfile.
  64.         
  65.         -B    use Bias insted of function name.
  66.             for example:    
  67.  
  68.             w/o -B:        JSR    _LVOOpen(a6)
  69.  
  70.             with -B:    JSR     -30(a6)
  71.             
  72.             if the Bias is 30 FDStub converts it to
  73.             -30 and subtracts 6 for each function.
  74.             (see FD1.3 files for examples of bias)
  75.  
  76.         options can appear any place on the command line AFTER
  77.         infile, outfile | outpath. -QB and -Q -B both are ok.
  78.  
  79.         
  80. KEYWORDS
  81.     
  82.     MULTI    causes FDStub to create an INDIVIDUAL FILE FOR EACH
  83.         STUB THAT IT CREATES. This is the way I intended
  84.         FDStub to act but decided to make it a switch so 
  85.         the user (me) will think about what he (me) is about 
  86.         to do.
  87.         
  88.         This option takes longer when output is to a floppy.
  89.     
  90.         I suggest using this option with RAM: or a HD.
  91.  
  92.     NOLVOS    use this option when you are creating stubs for
  93.         routines that DO NOT START with _LVO and no
  94.         underscore. This is what FDStub does:
  95.         
  96.  
  97.             source:        SomeFunction()()
  98.  
  99.         STUB with _LVO:
  100.  
  101.             _SomeFunction:
  102.                 ......
  103.                 MOVE.L  librarybase,A6
  104.                 JSR    _LVOSomeFunction(A6)
  105.                 ......
  106.  
  107.         STUB with NOLVOS
  108.     
  109.             _SomeFunction:
  110.                 ......
  111.                 JSR    SomeFunction(A6)
  112.                 ......
  113.  
  114.         to remove the '(A6)' remove the ##base command
  115.         in the source file (see COMMANDS below) OR use
  116.         the NOA6 command line switch.
  117.  
  118.         KEYWORDS can appear any place on the command line AFTER
  119.         infile, outfile | outpath.
  120.  
  121.  
  122.  
  123.         NOA6    this keyword overriddes the ##base command (see COMMANDS)
  124.         ignoring all references to A6. FDStub acts as if ##base 
  125.         was not in the sourcefile.
  126.  
  127.  
  128. COMMANDS
  129.     The following commands are not being defined by me but 
  130.     this is a just a description of how I implemented them 
  131.     for FDStub. 
  132.  
  133.     to see examples of these commands see the FD1.3 files that 
  134.     are for use with the Basic on the Extras disk.(pre 2.0 ??)
  135.  
  136.     FDStub expects ## in front of each command.
  137.  
  138.     FDStub expects a double set of '()' one for the parameter names
  139.     and the second for the register list.(one or both sets can be empty)
  140.  
  141.     ##base    librarybase
  142.  
  143.         for making stubs for a resident library.
  144.  
  145.         if ##base is not in the file then FDStub
  146.         WILL NOT use A6 as an offset with JSR.
  147.         w/o ##base:    JSR    [_LVO]SomeFunction
  148.         
  149.         with ##base:    MOVE.L    librarybase,a6
  150.                 JSR    [_LVO]SomeFunction(A6)
  151.         
  152.         (see KEYWORD NOA6)
  153.         
  154.  
  155.     ##bias    offset
  156.  
  157.         for making stubs for a resident library.
  158.  
  159.         offset is a POSITIVE ascii string. FDStub makes 
  160.         offset a negative and will subtract 6 from offset 
  161.         each time it creates a stub or until another ##bias 
  162.         comes along.
  163.  
  164.  
  165.     ##private
  166.         turns off stub production until a matching ##public
  167.         or the end of the file is reached.
  168.  
  169.  
  170.     ##public
  171.         turns on stub production.
  172.  
  173.  
  174.     ##end
  175.         denotes the end of the source file, and shuts down FDStub.
  176.  
  177.              
  178.  
  179. DRAWBACKS
  180.  
  181.    1.    code geeneration could be better, BUT since I have written 
  182.     MANY stubs by hand, FDStub does (IMHO) a great job.
  183.  
  184.     SEMI-IMPORTANT NOTE:
  185.         IT MIGHT BE A GOOD IDEA TO TAKE A LOOK AT THE FILE
  186.                 CODE.GEN
  187.             
  188.  
  189.  
  190.  
  191.  
  192.  
  193. If you like this program and want something added.. (well what the hell) 
  194. let me know.
  195.  
  196. support for SAS/C's -rr option ?
  197.  
  198. -----------------------------------------------------------------------
  199.  
  200. see FDConvert by CBM's Carolyn Scheppner
  201. see FD-BMap by Bruce Mackey (assembly version of FDConvert)
  202.  
  203. Bruce Mackey
  204. 4040 Avoca Ave.
  205. Bethpage NY. 11714
  206. 516-935-2075
  207.  
  208. BIX:    bmackey
  209. CI$:    72567,2601
  210.  
  211. SAS/C is a trademark of SAS inc.
  212. LATTICE is a tradmark of Lattice inc.
  213.