Updates:
- 2022-09-19 – John K pointed out a typo in the program listing, which has been corrected.
This one comes from Carl England. We met him at the 1990 Atlanta CoCoFest. That was the first time Sub-Etha Software appeared anywhere, and we couldn’t afford a full booth so we split on with Carl. He will always be the SuperBoot guy to me (my all time favorite utility), but most may know him as the programmer being The Defeater – a disk copy tool that could make clones of copy protected disk. (Download some of his items here.)
Carl popped up in some Facebook comments recently with this odd bit of code.
10 PRINT"THIS LINE IS INVISIBLE":'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 FORI=PEEK(25)*256+PEEK(26)TOPEEK(27)*256+PEEK(28) 30 IFPEEK(I)=37THENPOKEI,8 40 NEXT
Line 10 is a PRINT statement, followed by a comment and a bunch of percent symbols.
Line 20 is a loop that goes from the Start of BASIC to the End of BASIC.
Line 30 uses PEEK to look for a 37, which is the ASCII code for a percent sign. If it finds one, it POKEs it to 8 — a backspace.
Line 40 is just the NEXT for the loop.
If you run this program, it will modify line to and replace all those %’s with backspace characters. Then, if you LIST it, BASIC displays the line then immediately backspaces over it, too quick to see, making it look like there is no line there.
You could RUN this to modify the program, then DELete lines 20-40, and save it to tape or disk. You could then have a program you could load and run that would print a message, but LISTing it would appear as if nothing was there.
Carl said he used this to hide lines in some of his programs, but mentioned you could still see the code if you sent it to a printer using LLIST. Also, if you knew there was a line 10, you could EDIT 10 and SPACE through the line, revealing the code. I suppose you could SPACE until you got to the colon and then Hack the rest of the line, removing those backspace.
Fun.
Until next time…
Just testing using tags to embed code in a response:
10 IF A > 100 THEN 10
20 IF B < 100 THEN 20
Interesting trick
It reminds me of the embedded assembly language in strings that Robert Gault noticed in the Radio Shack “War” card game. I wonder how many “BASIC” programs I ran in the day that were doing off things like this for reasons.
Could it be that in line 20 the stars (*) after PEEK(25) and and PEEK(27) are missing?
Good catch. It looks like putting an asterisk around words will make them italics in the editor. I must have pasted that in and THEN converted it to a code block. My bad. Corrected.