home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 19 / 019.d81 / t.bload.s < prev    next >
Text File  |  2022-08-26  |  3KB  |  172 lines

  1.  
  2.            ** BLOAD **
  3.    (Better known as Binary Load)
  4.  
  5.  
  6. Written by:  Alan Gardner
  7.  
  8.  
  9.   If you've ever tried to LOAD a file
  10.  
  11. from within a BASIC program, then you
  12.  
  13. know how much of a problem this can
  14.  
  15. be.  Loading one file is bad enough,
  16.  
  17. but when you have to load three, four,
  18.  
  19. or more, you could get yourself into
  20.  
  21. so much red tape that the IRS would
  22.  
  23. be embarrassed!  Why in the world
  24.  
  25. Commodore designed the LOAD command to
  26.  
  27. GOTO the first line in your program
  28.  
  29. after loading is beyond me!  All I
  30.  
  31. know is that it is a pain in the royal
  32.  
  33. behind!
  34.  
  35.   Wouldn't it be nice to just say
  36.  
  37. LOAD a file and it would load and NOT
  38.  
  39. GOTO the first line in your program?
  40.  
  41. Do you know what I'm leading up to
  42.  
  43. now?  Well, it just so happens that I
  44.  
  45. got so fed up with designing the logic
  46.  
  47. structures so that all my files would
  48.  
  49. load at the right time in the program
  50.  
  51. (plus I wanted to LOAD a file anywhere
  52.  
  53. I needed it, but more on this later),
  54.  
  55. that I wrote BLOAD.
  56.  
  57.   With the BLOAD utility installed,
  58.  
  59. all you need is one simple SYS to LOAD
  60.  
  61. a file.  And guess what!?  That's
  62.  
  63. right, the program does NOT GOTO the
  64.  
  65. first line of your program.  You know
  66.  
  67. what else you can do with this happy
  68.  
  69. little utility?  Remember I said I
  70.  
  71. wanted to LOAD a file anywhere I
  72.  
  73. needed it?  Well, with BLOAD I can
  74.  
  75. specify the address the file will
  76.  
  77. begin to LOAD into.  For example,
  78.  
  79. if I had a great piece of ML music
  80.  
  81. whose load address was right where I
  82.  
  83. wanted to put some sprites, then I
  84.  
  85. could simply LOAD the music somewhere
  86.  
  87. else in memory by specifying a new
  88.  
  89. load address.  By the way, here is the
  90.  
  91. syntax of the BLOAD utility:
  92.  
  93.  
  94.  SYS 828,load address,filename
  95.  
  96. Since BLOAD resides at 828, it
  97.  
  98. would not be a good idea to BLOAD a
  99.  
  100. file into there!  The load address can
  101.  
  102. be any addressable space in memory (0-
  103.  
  104. 65535).  The filename can be a
  105.  
  106. constant (enclosed in quotes), or
  107.  
  108. an evaluated expression.  Here are
  109.  
  110. some examples:
  111.  
  112.  
  113.  SYS 828,49152,"TOCATTA"
  114. -- This will load the file TOCATTA
  115.     starting at 49152
  116.  
  117.  SYS 828,16384+J,F$(K)
  118. -- This will load the file specified
  119.     by F$(K) (whatever that might be)
  120.     and begin loading it at memory
  121.     location 16384 plus the current
  122.     value of J.
  123.  
  124.  SYS 828,32768,LEFT$(L$,3)
  125. -- This will load the file specified
  126.     by LEFT$(L$,3) begining at memory
  127.     location 32768.
  128.  
  129.  
  130.   Oh, to get the BLOAD working you
  131.  
  132. have to use the old fashioned way of
  133.  
  134. LOADing a file.  If you're not sure
  135.  
  136. how, this line will get the job done:
  137.  
  138.  
  139. 5 IF X=0 THEN X=1:LOAD"BLOAD",8,1
  140.  
  141. After this, any SYSes to 828 will be
  142.  
  143. directed at BLOAD.
  144.  
  145.   Just to show you that we here at
  146.  
  147. LOADSTAR really use what we write,
  148.  
  149. take a look at this month's program
  150.  
  151. on Halley's Comet.  It actually uses
  152.  
  153. BLOAD!  So see, we really do use what
  154.  
  155. we write.
  156.  
  157.   BLOAD was written with the MERLIN
  158.  
  159. Assembler.
  160.  
  161.  
  162. *** NOTE ***
  163.   Because of the nature of BLOAD, you
  164. cannot RUN it from the LOADSTAR
  165. environment.
  166.  
  167.  
  168. >Files used:  BLOAD.S __ source file
  169.               BLOAD.O __ object file
  170.  
  171. --------< end of article >------------
  172.