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