home *** CD-ROM | disk | FTP | other *** search
/ Generous Efforts of Many / gemcd.zip / GEM.CD.A.po / FEATURES:BEAGLE / UTIL.CITY.DOC / T.UTILITY.CITY
Text File  |  1990-02-15  |  11KB  |  291 lines

  1. UTILITY CITY INSTRUCTIONS
  2. -------------------------
  3.  
  4. AN OVERVIEW
  5. -----------
  6. Welcome to Utility City! What you have here is a large
  7. collection of utilities that I'm sure you will find useful.
  8. I hop you can and will use them for their intended purposes,
  9. AND to learn something about what makes your Apple tick.
  10.  
  11. THE CATALOG
  12. -----------
  13. As you will see in the catalog, many of the U-City programs
  14. (the ones that do something TO one of YOUR programs) consist
  15. of two or more files, usually a Text file and an Applesoft
  16. file. See the instructions for DOUBLE LOADER for an
  17. explanation of what's happening here. The file names that
  18. end in ".A" are the Applesoft programs that run AFTER you
  19. load one of your own programs and EXEC the text file
  20. (without the ".A"). If this sounds confusing, forget it.
  21. Just read the instructions for each program you use, and ...
  22.  
  23. DO NOT RUN THE PROGRAMS THAT END IN ".A"
  24. ----------------------------------------
  25. You may LOAD them, LIST (most of) them, and change (most of)
  26. them, but RUNning them with no other in memory will possibly
  27. foul up a pointer or two and crash around inside of your
  28. Apple (nothing serious).
  29.  
  30. TRANSFERRING PROGRAMS TO OTHER DISKS
  31. ------------------------------------
  32. Use the FID program on your System Master to transfer
  33. programs. Remember to transfer both the Text file AND the
  34. Applesoft file (with the ".A") when both exist. For example,
  35. to transfer the BFIND FID, and enter "BFIND=" as the file
  36. name. Now, both BFIND and BFIND.A will be copied for you.
  37. See your DOS Manual for more FID details.
  38.  
  39. "WRITE" PROGRAMS
  40. ----------------
  41. The Applesoft files that end in ".WRITE" can be LOADed and
  42. then RUN to write a Text file to your disk.
  43.  
  44. APPLESOFT ONLY, PLEASE
  45. ----------------------
  46. Integer programs will not function with most of the files on
  47. this disk (except INT CONVERT, which is an Integer program
  48. itself).
  49.  
  50. LIMITATIONS
  51. -----------
  52. I have tried to think of everything each program CANNOT do,
  53. as well as what it can do.
  54.  
  55. BUGLIST
  56. -------
  57. Run the Buglist program on the U-City disk to see a list of
  58. the any changes, additions, or revelations we have
  59. encountered since this book was printed.
  60.  
  61. Have some fun!
  62.  
  63. FILENAME ZAP
  64. ------------
  65. WHAT IT DOES: Allows you to rename any file with an
  66. invisible file name OR with a trick file name made of any
  67. combination of inverse, flash & normal characters.
  68.  
  69. HOW TO USE IT: <1> SAVE your program on disk with an
  70. ordinary file name (no control characters please). <2>
  71. UNLOCK the file (or leave it unlocked). <3> RUN FILENAME
  72. ZAP. <4> Select from the options shown, and follow the
  73. instructions on the screen.
  74.  
  75. LIMITATIONS: <1> You can't have inverse or flashing
  76. characters in a file name that backspaces over itself
  77. (erases characters). <2> The only way you can load or run a
  78. file name with inverse or flash characters is from the
  79. immediate mode--Catalog and type LOAD or RUN, then trace
  80. over the file name in the catalog. <3> The only way you can
  81. load or run an invisible file name is under program control.
  82. Your invisible file name's visible name (with CHR$(8)'s)
  83. will be displayed on the screen after the conversion is
  84. made. WRITE THIS NAME DOWN or remember it, or you might have
  85. end up with an inaccessible file. You can temporarily expose
  86. the ctrl-H's (backspaces) by running the CTRL-FIND program
  87. on the U-City disk.
  88.  
  89. SUGGESTED USES: <1> Use inverse or flashing file names as
  90. decorative touches or accents to your catalogs. Don't overdo
  91. the flashing, o.k.? <2> Use invisible file names to disguise
  92. what's really on your disk. Some file, like binary files,
  93. need not be seen by the user, so why show them in the
  94. catalog?
  95.  
  96. HOW IT WORKS? <1> Inverse and flashing file name characters
  97. are recognized by DOS when you trace over them with the
  98. cursor. The program simply puts the names you want on the
  99. screen so you can trace over them to rename a file. <2> File
  100. names are made to erase themselves and/or file codes by
  101. inserting backspaces (ctrl-H's or CHR&(8)'s) into the name.
  102. Since DOS adds spaces after every file name to make it 30
  103. characters long, these spaces follow your backspaces and
  104. ERASE whatever was on the screen. If you've got good
  105. opticals and watch carefully, you can see it happen!
  106.  
  107. COMMAND ZAP
  108. -----------
  109. WHAT IT DOES: Allows you to put invisible commands or rem
  110. statements in your programs.
  111.  
  112. HOW TO USE IT: The best way is to type NEW, and try this
  113. test-- Type in a Line 100:
  114.  
  115.      100  PRINT "GOTCHA!": REM^
  116.  
  117. Type the "^" immediately following the word REM, as shown
  118. above. When you LIST 100, a space will be added before the
  119. ^. This is important. When you LIST, you have--
  120.  
  121.      100 PRINT "GOTCHA!": REM^^^^^^^
  122.      ^^^^^^^^^^^^^^IF X = 256 THE N GOSUB 12345
  123.  
  124. Now EXEC COMMAND ZAP. When asked "Which Line?", enter 100.
  125. When asked "Another Line?", answer N. Now LIST 100,  and you
  126. should see--
  127.  
  128.      100 IF X = 256 THEN GOSUB 12345
  129.  
  130. RUN the program, and it will print-- GOTCHA!
  131.  
  132. Your command executes, even though it has been hidden in the
  133. listing by fake command. The fake command you see in the
  134. listing could be a rem statement or any thing long enough to
  135. hide your command (the fake statement can't function since
  136. it follows a rem). Make the fake command spaced the same way
  137. Applesoft would do it (notice the two spaces between "THEN"
  138. and "GOSUB") so everything looks authentic. Now type--
  139.  
  140. SPEED=99: LIST
  141.  
  142. The listing is slowed down so you can see your trickery in
  143. action!  "SPEED=225" sets the speed to normal after the
  144. LIST. You can hide the LINE NUMBER too if you want. Just add
  145. five more ^'s to make 26. Maybe try typing--
  146.  
  147.      100 PRINT "GOTCHA!": REM ^^^^^^^^^^^^^^^^^^^^^^^^^^
  148. THIS IS A NICE TITLE, ISN'T IT?
  149.  
  150. EXEC COMMAND ZAP again. Then LIST. The command as well as
  151. the line number is now hidden! Longer line numbers will
  152. require more ^'s, so count carefully.
  153.  
  154. SUGGESTED USES: <1> Hide your name in your programs to
  155. identify illegal copies. <2> Hide commands that will bomb a
  156. program if any tampering is done. <3> Make rem statements
  157. that are more predominant and easier to read because they
  158. are flush left hiding the line number and the word "rem".
  159.  
  160. LIMITATIONS: You cannot hide a command longer than two or
  161. three words (it must be shorter than one line). CALLs,
  162. GOSUBs and GOTOs work just fine.
  163.  
  164. HOW IT WORKS: The program looks for ^s (token #94) in the
  165. selected line number, and pokes backspaces (ctrl-H's or
  166. token #8) in their place. Applesoft's LIST feature takes the
  167. backspaces literally and backs up. Your rem statement then
  168. overprints the real statement.
  169.  
  170. LINE SEARCH
  171. -----------
  172. WHAT IT DOES: Allows you to locate Applesoft program lines
  173. in memory.
  174.  
  175. HOW TO USE IT: <1> LOAD your program and write down the line
  176. numbers you wish to find. <2> EXEC LINE SEARCH. <3> Follow
  177. the instructions on the screen.
  178.  
  179. SUGGESTED USE: Repair garbaged program lines, or make
  180. "illegal" changes to Applesoft programs (see "Token Tricks"
  181. in this book).
  182.  
  183. LIMITATIONS: Line Search will not work on Integer BASIC
  184. programs, since the language structure is entirely different
  185. from Applesoft.
  186.  
  187. HOW IT WORKS: Let's take a look at a very small program.
  188. Type this in and follow along-
  189.  
  190.      1 REM COUNT
  191.      2 FOR I = 1 TO 10
  192.      100 PRINT I: NEXT I
  193.      1000 PRINT "END": END
  194.  
  195. Line Search first finds the start of your programs by
  196. PEEKing at locations 103 & 104. Try it yourself--
  197.  
  198.      PRINT PEEK(103) + PEEK(104) *256
  199.  
  200. This will usually give you a 2049 or hex $801. Now find the
  201. END OF PROGRAM with--
  202.  
  203.      PRINT PEEK(175) + PEEK(176) *256
  204.  
  205. The longer your program, the higher this number will be. In
  206. this case, we get 2097 or hex $831. Now, let's look at the
  207. entire program in the monitor, by listing just before and
  208. just after the start and end points--
  209.  
  210.      CALL -151
  211.      *800.832
  212.  
  213. You will now see something like--
  214.  
  215.      800- 00 0C 08 01 00 B2 43 4F
  216.      808- 55 4E 54 00 18 08 02 00
  217.      810- 81 49 D0 31 C1 31 30 00
  218.      820- 00 2E 08 E8 03 BA 22 45
  219.      828- 4E 44 22 3A 80 00 00 00
  220.      830- 0A 4E 44
  221.  
  222. Each two digit hex number above represents part of your
  223. program; a line number, character or command toke. Let's
  224. take a look at each one--
  225.  
  226. Location Value
  227.  
  228. 800      00          There is always a zero before the
  229.                      start of a program.
  230. 801-802  0C  08      These two numbers tell us that the
  231.                      NEXT program line starts at location
  232.                      $080C (Apple's two byte hex numbers
  233.                      are always backwards in this strange
  234.                      form).
  235. 803-804  01  00      This is the first Line Number, 1
  236.                      (00001).
  237.  
  238. 805      B2          This is the symbol or TOKEN for the
  239.                      word "REM". Each word Applesoft knows
  240.                      has a token number.
  241. 806-80A  43  4F  55  These five numbers ar the ASCII values
  242.             4E 54    for the characters C-O-U-N-T.
  243. 80B      00          A zero token means end of line, so Line
  244.                      1 is finished.
  245. 80C-80D  18  08      This is the start of the next program
  246.                      line, the location that was referred
  247.                      to up in 801. The values 18 & 08 tell
  248.                      us that the NEXT program line starts at
  249.                      $818.
  250. 80E-80F  02  00      Line number 2 ($0002).
  251. 810          81      Token for FOR.
  252. 811          49      Character "I".
  253. 812          D0      Token for "=".
  254. 813          31      Character for "1".
  255. 814          C1      Token for TO.
  256. 815-816      31  30  Characters "1" & "0". Applesoft handles
  257.                      numbers in a program as words, spelling
  258.                      them out digit by digit.
  259. 817          00      End of line.
  260. 818-819      21  08  Next line starts at $821.
  261. 81A-81B      64  00  Line number 100 ($0064).
  262. 81C          BA      Token for PRINT.
  263. 81D          49      Character "I".
  264. 81E          30      Character ":".
  265. 81F          82      Token for NEXT.
  266. 820          00      End of line.
  267. 821-822      2E  08  Next line starts at $82E.
  268. 823-824      EB  03  Line number for 1000 ($3E8).
  269. 825          BA      Token for PRINT.
  270. 826          22      Quote mark.
  271. 827-829  45  4E  44  Characters "E", "N", & "D".
  272. 82A          22      Quote mark.
  273. 82B          3A      Character ":".
  274. 82C          80      Token for END.
  275. 82D          00      End of line.
  276. 82E-82F      00  00  Two zeros as at this point mean
  277.                      end of program.
  278. 830-832  ??  ??  ??  Could be part of an old program.
  279.  
  280. TAKING OUT THE GARBAGE
  281. ----------------------
  282. Occasionally, a program will be zapped by mysterious forces
  283. and become inoperable. In the listing, you will find illegal
  284. line numbers or nonsense statements, like "COLOR= GOSUB
  285. HPLOT". What has probably happened is that ONE BYTE has been
  286. changed in a line number or LINE LOCATION NUMBER. If the
  287. latter is true, your program will jump to where it's told
  288. which is now some random place in memory. The numbers it
  289. finds there are interpreted as tokens, and thus the garbage.
  290. Use line and/or the last good line in the program.
  291.