🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.folklore.computers
Article #896

Re: Commodore PET BASIC (was: BBC micro)

#896
From: h... Howard Chu
Date: Wed, 17 Jan 1990 00:01
37 lines
2964 bytes
In article <16...@cc.usu.edu> SL...@cc.usu.edu (Roger Ivie) writes:
>I used to have fun poking a Commodore PET basic program so that the
>only lines that LISTed were ones that were not the target of a GOTO.
>These had to be contained in the linked list because the interpreter had
>to be able to search for them; but sequentially executed statements could
>be left out of the list because it just kept going and didn't search for
>the next line.
>
>Unfortunately, I soon discovered that you couldn't SAVE a program this way.
>When you LOADed it back, the links were restored. :(

I did this with Data General DG BASIC on an Eclipse running AOS 4.xx.
Funstuff. The trick then was that it used 16 bits to represent the line number,
but only let you enter numbers up to 9999. I sat up one night figuring
out the tokenization method, and wrote a program that would read a
saved BASIC file, alter all the line numbers, (GOTOs and GOSUBs as well,
of course) and voom - the lines vanished. Unfortunately, a simple
RENUMBER command would correct the situation. But, there was a way around
that as well - made one of the first of the illegally numbered lines a
GOTO xxxx where xxxx didn't exist. Then renumber would just choke and give
up. I guess I'd just heard of synthetic programming on the HP-41 back
then, so I played with everything available, in great detail. The same
trick in Applesoft would give you lines that could be listed but couldn't
be deleted. Great for copyright notices.

I was pretty fond of the DG BASIC trick, tho. Wrote an entire Adventure
game, using overlays & all kinds of tricks to fit into 32K core. The
listing only had 10 lines of REMs, the code was nowhere to be seen. I
was well pleased with myself.  }-)  One of the other neat tricks was to
set the length of a line to be zero, then the interpreter's program counter
never advanced, and you'd get an infinite loop. You could set the
high bit too, getting negative offsets. Really wonderfully fast GOTOs,
but you had to count bytes pretty carefully, and it made your listings
pretty Strange and Wonderful. (Keep a hand on the Escape key...)
--
 -=- PrayerMail: Send 100Mbits to holyghost@father.son[127.0.0.1]
 and You Too can have a Personal Electronic Relationship with God!
Technical Details
Message-ID: <10673@stag.math.lsa.umich.edu>
Path: mbox-mo1.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!math.lsa.umich.edu!hyc
References: <wZfVc0200WB68G8m1a@andrew.cmu.edu> <16669@cc.usu.edu>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!math.lsa.umich.edu!hyc
From: h...@math.lsa.umich.edu (Howard Chu)
Newsgroups: alt.folklore.computers
Subject: Re: Commodore PET BASIC (was: BBC micro)
Message-ID: <10673@stag.math.lsa.umich.edu>
Date: 17 Jan 90 00:01:03 GMT
References: <wZfVc0200WB68G8m1a@andrew.cmu.edu> <16669@cc.usu.edu>
Sender: ne...@math.lsa.umich.edu
Reply-To: h...@math.lsa.umich.edu (Howard Chu)
Organization: University of Michigan Math Dept., Ann Arbor
Lines: 37
UUCP-Path: {mailrus,umix}!um-math!hyc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit