Reply to post: VDU 21

Beware the trainee with time on his hands and an Acorn manual on his desk


VDU 21

'Until the fateful day Drew discovered "an ASCII code that disabled output to the terminal."'

Ah, good old VDU 21. You could also use that to hide part or all of a BASIC program. What you did is use the ? operator (the equivalent of POKE on other systems) to insert that character into the BASIC program in a part that was ignored by the BASIC interpreter, such as the text after a REM command.

When the LIST command was typed to show the program listing, it would only output up to the where the ASCII 21 was inserted. You could re-enable output later on in the listing with the ASCII 6 character.

For example entering the following listing:

10 REM Hello Earth

20 PRINT "This is hidden code!"

30 REM Goodbye World!

Then typing:



PAGE is a system variable which holds the start of BASIC workspace. Typing this would cause the LIST command to output:

10 REM Hello World!

I just tried this on a BBC emulator :)

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon


Biting the hand that feeds IT © 1998–2020