home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 20 / 020.d81 / t.datastater < prev    next >
Text File  |  2022-08-26  |  5KB  |  292 lines

  1.  
  2.              DATASTATER
  3.        A Utility for the C-128
  4.  
  5.  
  6.  
  7. Written by: Louis F. Sander
  8.  
  9.  
  10.  
  11.   Datastater is full-featured program
  12.  
  13. for converting machine language,
  14.  
  15. sprites, or other sections of memory,
  16.  
  17. to BASIC data statements. The program
  18.  
  19. takes advantage of several features of
  20.  
  21. the machine: the built-in machine-
  22.  
  23. language monitor, the escape sequences
  24.  
  25. used in screen editing, and the
  26.  
  27. hexidecimal-to-decimal conversion
  28.  
  29. function. For ease of typing and
  30.  
  31. improved understanding, the data
  32.  
  33. statements produced are in hexidecimal
  34.  
  35. notation.
  36.  
  37.   Running Datastater is simple, and
  38.  
  39. the program even includes brief
  40.  
  41. instructions.  However, you should be
  42.  
  43. familiar with using the MONITOR
  44.  
  45. command to call up your machine-
  46.  
  47. language monitor, and with using that
  48.  
  49. monitor's 'M' command to dump memory
  50.  
  51. to the screen.
  52.  
  53.   Your first step is to decide what
  54.  
  55. area in memory you want to convert to
  56.  
  57. data statements. Get into the monitor
  58.  
  59. by typing MONITOR<RETURN>, then use
  60.  
  61. the "M" command to display the
  62.  
  63. desired memory range. Since
  64.  
  65. Datastater manipulates the screen
  66.  
  67. display, it will convert a maximum of
  68.  
  69. 16 monitor lines at a time, which is
  70.  
  71. equivalent to 128 bytes of ML ($80
  72.  
  73. bytes in hex). If you need to convert
  74.  
  75. more, just break the project into
  76.  
  77. manageable parts.
  78.  
  79.   When the desired memory range is
  80.  
  81. displayed on the screen, use the
  82.  
  83. monitor's "X" command to exit back
  84.  
  85. to BASIC. The memory dump display, of
  86.  
  87. course, will remain on the screen.
  88.  
  89. Using your cursor-down key, scroll
  90.  
  91. that display upward until its first
  92.  
  93. line is on the top line of the
  94.  
  95. screen.
  96.  
  97.   Then move your cursor until it's on
  98.  
  99. the line just below the last monitor
  100.  
  101. line you want to convert to data, in
  102.  
  103. the leftmost screen position. It
  104.  
  105. doesn't matter if that line is blank
  106.  
  107. or not, as long as the cursor is at
  108.  
  109. the left margin.
  110.  
  111.   To initiate a conversion, just type
  112.  
  113. the word RUN, plus a colon, and then
  114.  
  115. press RETURN. (The colon is there in
  116.  
  117. case the cursor is not on a blank
  118.  
  119. line). By the way, when you run
  120.  
  121. Datastater, it checks to see that a
  122.  
  123. monitor dump is actually on the top
  124.  
  125. screen line; if it isn't, you're
  126.  
  127. shown a series of instructions.
  128.  
  129.   In a normal run, you'll be
  130.  
  131. prompted for a First Line#, and you
  132.  
  133. should respond with the number you
  134.  
  135. want to assign to your first data
  136.  
  137. line. If you respond by pressing
  138.  
  139. RETURN without entering a number,
  140.  
  141. Datastater will choose a line number
  142.  
  143. equal to the decimal value of the
  144.  
  145. ML's starting address, since that's
  146.  
  147. the most logical number to use.
  148.  
  149.   After choosing a starting line
  150.  
  151. number, you'll be prompted for a line
  152.  
  153. number interval. If you enter
  154.  
  155. nothing and hit RETURN, the interval
  156.  
  157. defaults to eight, which retains the
  158.  
  159. correspondence between the line
  160.  
  161. number and the address of the first
  162.  
  163. data item in the line.
  164.  
  165.   As soon as you choose an interval,
  166.  
  167. you'll see the monitor lines turn
  168.  
  169. into BASIC lines. After a short wait,
  170.  
  171. some other BASIC lines will appear
  172.  
  173. on the screen.
  174.  
  175.   The first one is a loop that
  176.  
  177. computes the checksum of the bytes
  178.  
  179. you have converted. (A checksum is
  180.  
  181. simply the numerical total of all the
  182.  
  183. bytes.) If your data statements are
  184.  
  185. ever typed from a listing, the typist
  186.  
  187. will appreciate having this line,
  188.  
  189. since it can be used to eliminate
  190.  
  191. errors.
  192.  
  193.   The next line is a FOR-NEXT loop
  194.  
  195. that will poke your ML into memory.
  196.  
  197. Datastater determines the start and
  198.  
  199. end of the loop, which saves effort
  200.  
  201. on your part, and reduces the chance
  202.  
  203. of error. Notice that while your ML
  204.  
  205. data is in hex, the loop is in
  206.  
  207. decimal. Smart people, these
  208.  
  209. computers.
  210.  
  211.   Finally, there are two REM lines
  212.  
  213. showing the number of data items, the
  214.  
  215. checksum, and the memory range of the
  216.  
  217. ML, in decimal as well as hex. This
  218.  
  219. information can be useful to you
  220.  
  221. later, so Datastater gives it to you
  222.  
  223. now, in a form that easily preserved.
  224.  
  225.   After all the lines have been
  226.  
  227. printed, Datastater terminates with
  228.  
  229. the cursor flashing in the "home"
  230.  
  231. position. Your BASIC lines have been
  232.  
  233. printed on the screen, but have not
  234.  
  235. yet been added to the program in
  236.  
  237. memory. You do that yourself, by
  238.  
  239. pressing the RETURN key over each
  240.  
  241. program line. If you don't want the
  242.  
  243. extra lines, use your cursor keys to
  244.  
  245. skip over them. When you're finished
  246.  
  247. with the RETURN key, your data lines,
  248.  
  249. plus the checksum, poker, and REM
  250.  
  251. lines, are in memory along with
  252.  
  253. Datastater. You can use the DELETE
  254.  
  255. command to get rid of Datastater
  256.  
  257. itself,  which will leave you with
  258.  
  259. the lines from Datastater's output.
  260.  
  261. You can save them to disk or printer,
  262.  
  263. where they can readily be added to
  264.  
  265. the balance of your BASIC program.
  266.  
  267.  
  268.               ------
  269.  
  270.    This program is copyrighted by
  271.  
  272.  Commodore Microcomputers magazine.
  273.  
  274.    All rights to it are reserved.
  275.  
  276.  LOADSTAR has relieved you from the
  277.  
  278.   burden of keying in this program.
  279.  
  280.  For more complete information about
  281.  
  282.  this program, refer to the February
  283.  
  284.        1986 issue of Commodore
  285.  
  286.             Microcomputers.
  287.  
  288.  
  289. >Files used: DATASTATER.128
  290.  
  291. --------< end of article >------------
  292.