home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / alt / hackers / 1357 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  3.5 KB

  1. Xref: sparky alt.hackers:1357 alt.folklore.computers:13526
  2. Newsgroups: alt.hackers,alt.folklore.computers
  3. Path: sparky!uunet!mcsun!sunic!lth.se!pollux.lu.se!magnus
  4. From: magnus@thep.lu.se (Magnus Olsson)
  5. Subject: Unlistable BASIC (was: YAFP: TRS-80 Super Graphics)
  6. Message-ID: <1992Sep3.120011.5952@pollux.lu.se>
  7. Followup-To: alt.folklore.computers
  8. Sender: news@pollux.lu.se (Owner of news files)
  9. Nntp-Posting-Host: dirac.thep.lu.se
  10. Organization: Theoretical Physics, Lund University, Sweden
  11. References: <YAMAUCHI.92Aug29141341@fox.ces.cwru.edu> <1992Aug29.213737.19225@umbc3.umbc.edu> <1992Sep1.183035.20969@utdallas.edu> <1992Sep03.023833.4079@eng.umd.edu>
  12. Date: Thu, 3 Sep 1992 12:00:11 GMT
  13. Approved: We don't need no steenking approval!
  14. Lines: 61
  15.  
  16. In article <1992Sep03.023833.4079@eng.umd.edu> russotto@eng.umd.edu (Matthew T. Russotto) writes:
  17. >In article <1992Sep1.183035.20969@utdallas.edu> shane@utdallas.edu writes:
  18. >>
  19. >>On the Apple, I'm pretty sure you could POKE a begin- or end-of-BASIC-program
  20. >>address somewhere in zero page which would result in abridged output from
  21. >>LIST. You could also make "unmodifyable" code, even if LIST displayed it, by
  22. >>replacing line numbers with numbers >63999. Applesoft called a line number
  23. >>higher than 63999 a syntax error, so by POKEing 65535 or whatever into the
  24. >>line number, it became immune to standard BASIC editing.
  25. >
  26. >Other neat Applesoft hacks-- there was another POKE which would cause
  27. >LIST to display only the first statement on a line, so by starting all
  28. >lines with a colon, you had invisible code.  Changing address $D6 (I
  29. >think) to a nonzero value caused Applesoft to execute "RUN" no matter
  30. >what you typed-- more primitive copy-protection.  
  31.  
  32. On the Swedish ABC 80 (Z80-based, 16 K RAM, rather Microsoft-like
  33. BASIC), the BASIC interpreter had a bug that could be rather useful
  34. for making unlistable programs.
  35.  
  36. Like MS BASIC, ABC 80 BASIC allocated strings dynamically - the first
  37. time you used a string variable, 80 bytes were allocated, and if it
  38. grew to more than that size, a new chunk of memory was allocated (the
  39. garbage collector needed to take care of old forgotten strings had a
  40. rather interesting misfeature which could lock up the machine for 20
  41. minutes or so, but that's another story). You could override this by
  42. e.g. 
  43.  
  44. 10 DIM A$=10
  45.  
  46. which would only allocate 10 bytes. You could of course also use DIM
  47. to create arrays of strings:
  48.  
  49. 20 DIM B$(10,10), C$(100)=4
  50.  
  51. However, if you wrote just, say,
  52.  
  53. 30 DIM X$
  54.  
  55. this statement would excute just fine (I never found out exactly what
  56. it did, though - maybe some ABC 80 guru who reads this could help?),
  57. but, if you tried to LIST this statement, the computer would crash
  58. spectacularly (flashing graphical characters all over the screen,
  59. weird sounds from the speaker, and no way out except a hardware
  60. reset). Of course, one could still list the program as long as one
  61. knew the line number of the rogue statement - in the above case, 
  62. "LIST 40-" would work just great.
  63.  
  64.  
  65. ObHack: Connecting my old Acorn Atom to the parallel printer port on
  66. my PClone to transfer programs to disk and list them (nostalgia
  67. time!). Next step: making the connection bidirectional so I can make
  68. the Atom retrieve programs from the PC's disk. More about this when I
  69. get the hardware working... 
  70.  
  71.  
  72. Magnus Olsson                   | \e+      /_
  73. Dept. of Theoretical Physics    |  \  Z   / q
  74. University of Lund, Sweden      |   >----<           
  75. Internet: magnus@thep.lu.se     |  /      \===== g
  76. Bitnet: THEPMO@SELDC52          | /e-      \q
  77.