home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / ST_USER / 1992 / USERMR92.MSA / DSK_DATAKIT.DOC < prev    next >
Text File  |  1991-11-27  |  5KB  |  118 lines

  1. **************************************************************************
  2. *                       Data Statement Kit v0.2                          *
  3. **************************************************************************
  4.  
  5.                              1. Introduction
  6.                             ----------------- 
  7.  Data Statement Kit is a handy tool for programmers of Devpac 1 and most
  8.  types of Basic.  How many times have you wished that you could have an
  9.  'INCBIN' directive in Devpac 1 ?  How many times have you been using GFA
  10.  Basic and wished you could put all your Machine Code Routines at the end
  11.  of your program as 'DATA' statements ?  You could even put your Sprite
  12.  Files at the end of your basic program as 'DATA' statements.  This saves
  13.  all the hassle of 'BLOADING' files in from disk or in Assembler having
  14.  to use GEMDOS to read in data files.  What this utility does is takes a
  15.  file in and creates a new file.  The new file is constructed totally of
  16.  ASCII so that you can use the 'Merge' option to include this output in
  17.  your programs.  Most of you Programmers out there will know that being
  18.  able to include any file in an Assembler listing or Basic Listing saves
  19.  time and makes things easy for the programmer.  
  20.  
  21.                               2. Features
  22.                 ---------------
  23.  Data Statement Kit allows the Programmer to do the following things:
  24.  
  25.               1.  Take ANY File less than 40 K and convert it
  26.           to mergable DATA statements that are compatible
  27.           with GFA BASIC.
  28.  
  29.           2.  Take ANY File less than 40K and convert it
  30.           to mergable DATA statements with line numbers
  31.           (some basics only use line numbers).
  32.  
  33.           3.  Take ANY File less than 40K and convert it
  34.           to mergable DC.L statements that can be used
  35.           in ANY good Assembler.
  36.  
  37.            3. Merging routines into GFA Basic
  38.         ---------------------------------------
  39.  
  40.  Lets say for example you have coded a sprite routine and you want to
  41.  use it from a GFA-Basic Program, follow the following steps:
  42.  
  43.           1.  Compile the Sprite Routine in your Assembler
  44.           2.  Load up DSK.PRG
  45.           3.  Select Option 1 
  46.           4.  Select your compiled file as the input file
  47.           5.  Wait a few seconds for the new file to be created
  48.           6.  Select an Output Filename making sure it ends
  49.           with .LST so that you can merge it with GFA.
  50.           7.  Boot up GFA Basic and press F2 (Merge)
  51.           8.  Insert the disk containing the new file
  52.           9.  Select the file and that's it.
  53.           10. Lots of Longword sized DATA statements will
  54.            appear in the GFA editor window.
  55.  
  56.  The following GFA Basic statements show how to use the DATA from your
  57.  program:
  58.  
  59.         dim code%(1000/4)         ! Make a buffer for the Code
  60.         restore                   ! Reset Data Statement Pointer
  61.         codeaddr=varptr(code%(0)) ! Get addr of buffer
  62.         backup=codeaddr
  63.         repeat
  64.           read    a          ! read a longword of DATA
  65.           lpoke  backup,a          ! Poke it to the Buffer
  66.           backup=backup+4          ! Increment Buffer addr
  67.         until    a=-1          ! Repeat until data ends
  68.         call    codeaddr      ! Call the code 
  69.  
  70.           4. Merging DATA into other basics 
  71.                 -------------------------------------
  72.  Some basics require line numbers so you may have to use option 2 from
  73.  the main menu.  This option is no different from the above option
  74.  except that it adds line numbers.  The Program will ask you for the
  75.  line starting number and this number must not be more than 30,000 for
  76.  overflow reasons.  If an overflow occurs by some chance, the program
  77.  will insert (NUMBER OVER) in place of the line numbers and if this
  78.  happens try lower line number and you should be okay.
  79.  
  80.          5. Creating Define Constants for Assemblers  
  81.        -----------------------------------------------
  82.  
  83.  Hands up who owns DEVPAC 1 like me, and wish they had an INCBIN
  84.  directive for merging files into one program ?  Well you to can now
  85.  merge files into one program!  Just following the same procedure
  86.  that is used for option 1 (GFA Basic) and load up DEVPAC 1.  Now
  87.  simply use the INSERT FILE feature that it has and bobs your uncle
  88.  your in business, the file ends up in one program, but as Constants
  89.  in your source code.
  90.  
  91.                 6.  Speed, Compatibility and Bug Reports    
  92.           --------------------------------------------
  93.  You may notice that the conversion process is turbo fast,  depending
  94.  on the size of the input file it may take a split second to 2 seconds
  95.  at most!  Data Statement Kit has been tested for STE Compatibility and
  96.  it seems to work well on all ST's.  A word of warning to 520 Owners is
  97.  that if you have alot of Desk acc's installed when running the program,
  98.  you may get the message (Remove Acc's and Memory Resident Programs).
  99.  This is becuase the Program requires a buffer of 200K at least to 
  100.  work!  Last but not least if you happen to stumble across any bugs then
  101.  don't hesitate to get in contact with me about it and remember to state
  102.  your TOS Version, RAM Size and Atari Model (STM,STFM,STE,TT).
  103.  
  104.  Anyway I hope that coders, developers find this program handy.
  105.  
  106. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  107.  
  108.  
  109.  
  110.  Craig Smith
  111.  84 Lomond Place
  112.  Castlepark
  113.  Irvine
  114.  AYRSHIRE
  115.  KA12 9PG.
  116.  
  117.  
  118.