37

I never had a Commodore 64 but I've always been curious what the purpose and history of some of the special keys were. In particular:

  • C=
  • Run/Stop
  • Clr/Home
  • Restore

I'm mostly used to the standard ASCII keyboards from the era and whenever I had sat in front of a Commodore these keys didn't seem to do much. But to be fair, I believe the Run/Stop key would break listings and the C= + Shift key would possibly switch out the character set to allow for lowercase. But were there other uses? How come Run/Stop can break a program but not start it? What is the Restore key and why is it so big?

I think the same keyboard was used on the other Commodore machines, but memory isn't clear. Are the behaviors consistent?

3
  • To be fair, most software (all not written in BASIC, so "all") did remap the keyboard completely for its own purposes. So, which function was on a certain key depended on the program you were running.
    – Janka
    Jun 8, 2017 at 3:34
  • 1
    You CAN use the RUN feature of the RUN/STOP key to load from disc. Type four spaces, "*",8(,1) shift return, shift cursor up, shift RUN. This will launch the 1st program on disc and run it. Jun 5, 2019 at 14:04
  • Hmm... I never used that key for that purpose, but I think down, del, "*",8 shift+up shift+run would be fewer keystrokes.
    – supercat
    Mar 7, 2023 at 22:32

6 Answers 6

6

Background: The Original PET Keyboard and PETSCII

Most of these keys have their roots in the original Commodore PET 2001 keyboard:

PET 2001 Keyboard Layout

The scanning and conversion was complex and seems to have varied somewhat by ROM version, but eventually a PETSCII code would be produced from a keypress. For the original keyboard, typing a key with a printable character would produce that PETSCII character, and holding shift would produce the same character code but with the high bit set (128 added to it) to give the graphic symbol printed on the shifted portion of the key.

The other keys produced PETSCII control characters very similiar to ASCII control characters. As you can see from the table at line 551 of petdoc.txt, these were:

    Lower       Shifted     Code
    --------------------------------------------------
    RETURN                  ^M (CR or carriage return)
    RVS         RVS OFF     ^R
    STOP        RUN         ^C (CAN, cancel)
    HOME        CLR         ^S
    CRSR ↓      CRSR ↑      ^Q
    CRSR →      CRSR ←      ^]
    DEL         INST        ^T

Using shift with the above keys (excepting RETURN) would also set the high bit, just as with the other keys, giving a PETSCII code in the "high control" area.

STOP/RUN and HOME/CLR

The STOP/RUN and HOME/CLR keys, along with DEL/INST, CRSR↓/↑, CRSR→/←, do just what they did on the PET: they send the appropriate key codes which are then interpreted by the screen editor or, when embedded into a BASIC string and printed, perform their action. From BASIC you can also print the PETSCII code directly with, e.g. CHR$(19) or CHR$(128+19) to home the cursor or clear the screen, just as if you'd pressed or stored the HOME/CLR key.

The CTRL key on the Commodore 64 allows input of the same characters as all of the unshifted keys above; CTRL S will do the same thing as pressing HOME. However, CTRL SHIFT combinations don't work.

The one exception here is STOP/RUN. Neither its unshifted (CHR$(3)) nor shifted (CHR$(128+3)) code does anything when printed. Additionally, the shifted key does not embed when typing into a quoted BASIC string and will always type its LOAD followed by RUN sequence.

The Commodore C= Key

The VIC-20 removed the numeric keypad that the PET keyboards had, combining the numeric and punctuation keys on the top row with the unshifted keystrokes giving numbers and the shifted keystrokes giving punctuation (!, ", etc.). They also added colour and assigned character codes to change the colour of the text. A good guess would be that this is the reason they added the C=: it's a second kind of shift that now allows three PETSCII codes to be produced from each key rather than just two. This allows all the original graphics codes still to be produced and adds enough extra keystroke inputs to cover the new colours as well. The same keyboard and decoding was used on the C64, with a few extra color codes added.

Thus, while SHIFT L produced PETSCII code 204 (lower left box) on both the PET and the C64, SHIFT 6 produced code 182 (right half-box) on the PET but an ampersand & on the C64, and to get that code 182 on the C64 you'd instead use C= L.

The RESTORE Key

As others have pointed out, the new RESTORE key added on the VIC-20 isn't actually connected to the keyboard matrix; it's connected to the CPU's non-maskable interrupt (NMI) line - this connection is routed through a VIA 6520 interface chip on the VIC-20, but it was turned into a direct connection through a minimal filtering circuit on the C-64. This allows you to send an interrupt that can't be blocked (like RESET) but makes it easier to have the running code do a "soft reset" when pressed, which is a reasonable enough idea. The standard ROMs intercept this and, if the STOP/RUN is held down while RESTORE is pressed, do a soft reset, returning you to a clear screen and BASIC prompt with memory left intact.

2
  • One small thing: a shift-Return is really different from a normal one. It moves the cursor to the next line, but does not complete an input operation. So in direct mode, it doesn't execute the command you enter. Nor when anwering a Basic INPUT statement. Mar 29, 2020 at 16:57
  • @Rhialto Interesting. I wonder what the point of that is.
    – cjs
    Mar 29, 2020 at 23:40
36

The Restore key triggered the NMI (non-maskable interrupt) line; to actually have an effect it had to be combined with Run/Stop - it would soft-reset the machine (via an indirect jump vector that could be overwritten to a custom routine if desired. This wouldn't reset memory, but would stop even misbehaving programs in most cases.)

Run/Stop was two keys; unshifted, it was Stop and would halt the current action (like listing a program or stop a running BASIC program). Pressing Shift + Run/Stop would be a shortcut for the LOAD command.

Clr/Home was similar. Unshifted, it moved the cursor to the upper-left corner of the screen. Shifted (Clr) it cleared the screen and moved the cursor to the upper-left. (If you were in an open quoted string, it would actually insert the control character for these things, so you could have a command in a program that would "print" the Clr character, and when you ran the program it would clear the screen.)

The C= key had a few uses. One, when combined with SHIFT would switch between uppercase/graphics and lower/uppercase characters. It was also an alternate SHIFT key to access additional characters on the keyboard. Lastly, C= plus the numbers 1-8 would allow choices of 8 additional text colors (Ctrl and 1-8 are the other 8 colors).

http://sta.c64.org/cbm64petkey.html

6
  • 3
    As an aside: I never used the Run part of Run/Stop on purpose.
    – Joe
    Jun 7, 2017 at 1:45
  • 6
    Shift + Run/Stop executes a LOAD before the RUN.
    – kolrabi
    Jun 7, 2017 at 11:21
  • 3
    @kolrabi RIGHT. But it was the tape-style LOAD without any drive specifier...
    – Joe
    Jun 7, 2017 at 11:55
  • 5
    The Restore key gave an NMI immediately on pressing it. It was the default NMI handling function which checked if Run/Stop was pressed also - and abadoned the request if not. But programs may change that handler and the Restore behaviour, too. It wasn't used much, though, because NMIs have even higher priority than the raster IRQ many programs used to control the screen more decently, and pressing Restore lead to glitches because of that.
    – Janka
    Jun 8, 2017 at 3:27
  • 7
    @Janka: Actually, VIC-20 and C64 Restore keys generated the NMI on release. The C128 seems to have changed the behavior, though.
    – supercat
    Feb 18, 2019 at 2:42
18

I just want to add to the existing answers that the Restore key was a weird key. It was on hardware side already completely independent of all the other keys. It was attached to the NMI line of the processor, only proxied by a small circuit which let only rising flanks pass. This circuit sometimes ignored a simple slow press and reacted much more reliably on a series of such flanks in quick succession. Users could create these when hitting the key quite hard and fast and so letting the key bounce (that usage was typically rather loud and could have inspired the term "hacker" — just kidding).

The Stop key (which was Run when used with Shift, hence it was often mis-called Run Stop, but in fact a simple press on Stop stopped a running program if that didn't take care to avoid this behavior) was a key of the normal keyboard matrix. So the NMI routine jumped to by the Restore key did a check first whether the Stop key was being held and just returned otherwise. Since this behavior could be changed, hacking on the Restore key alone could create some special reaction in some special cases (in some games, for instance).

12
  • 2
    The PET definitely did not have the RESTORE key or a Commodore key for that matter.
    – JeremyP
    Jun 8, 2017 at 8:51
  • 2
    I had a Vic20 (but not a C64) and I remember RunStop + Restore being a "reset" key combination behaving as described in these answers. So safe to say that Vic20 and C64 had the same behaviour. Jun 9, 2017 at 8:57
  • 3
    +1 for the first part about the Restore key. I used to have a C64 and I remember that weird behavior. It's nice to read an explanation for that after >30 years...
    – dr_
    Jun 29, 2017 at 15:22
  • 3
    There is a hack that disables Restore key. First you set up a timer that fires interrupt on NMI line in a few cycles, then you continue your program through NMI vector. The trick is not to acknowledge an interrupt to that timer so that NMI hangs at logic 0 forever and Restore is no more functional.
    – lvd
    Apr 22, 2019 at 16:49
  • 2
    I seem to remember the Restore key was frequently the first one to break, as people would hammer it in frustration trying to get it to 'take'.
    – Alan B
    Mar 31, 2020 at 8:30
15

I believe the C64 keys were carried over from the VIC-20. The VIC-20 keys (somewhat at least) have some history from the PET series too.

Taken from Wikipedia on the VIC 20:

When they returned to California from that meeting, Tomczyk wrote a 30-page memo detailing recommendations for the new computer, and presented it to Tramiel. Recommendations included programmable function keys (inspired by competing Japanese computers), full-size typewriter-style keys, and built-in RS-232.

The keys you mentioned are mostly self-explaining. RUN/STOP would run or halt an application and was programmable in software. The fact that "RUN" rarely (if at all) started an application wasn't a limit of the key.

The C= key could be said to exist as mere corporate branding such as the "Apple" keys on the Apple II series. Useful as a META key or "special" key to allow specific combinations in software.

I have to admit, I'm not sure of the history of the Restore key.

Also, keep in mind, that before the VIC-20 the biggest success Commodore had in computers was the PET. The PET originally had terrible calculator keys that was quickly replaced by a real, full-travel keyboard. Commodore seemed to learn their lesson in bad keyboards as many of their computers after the original PET actually had pretty good keyboards. Even their cheaper models like the C16. Of course, there are exceptions.

Finally, Tamiel was legendary in using parts he had on hand. Which is one reason why the C64 inherited the VIC-20 keyboard. So he wasn't going to design a completely new keyboard for the C64.

1
  • Last statement: Don't forget the C116.
    – Polluks
    Apr 1, 2020 at 10:03
3

In order not to trigger the NMI with every contact bounce when hitting the Restore Key, there is a simple RC filter. The timing constant is marginal for the purpose, though. This is why the key has to be tapped and not just pressed down like any other. Back in the day there were some tutorials on which parts to exchange to make it behave normally. As to why Commodore never changed the parts themselves, several stories made the rounds. Some of the people involved liked the behaviour, or others in the chain were too lazy to get the changes into production.

1
  • 1
    Welcome to Retrocomputing Stack Exchange! Please read the tour and How to Answer. It'd be good if you edited your answer to state that the Restore key triggered a NMI at the beginning, and explain what that is; that'd make it more complete. ☺
    – wizzwizz4
    Jul 28, 2019 at 19:10
3

There are very good answers describing the functions of C64's special keys. But nobody mentioned the modern counterparts.

C= is a modifer key. It is used to bring additional PETSCII characters and also to change text color. Obviously, it has branding function, too. Modern counterparts can be (Old Apple key) or Windows key.

run/stop Normal function of this key is to stop running program listings or basic programs. Modern counterpart is ESC. When used in combination with shift it loads the first program from datasette. There is no modern day counterpart of this function.

Clr/Home Home function is identical to modern keyboard Home button. ClR is same as CLS command in Dos console.

Restore button, also called as soft-reset, returns the computer into the initial opening state without clearing the memory. It is very useful debugging/or hacking tool. Not used much by the gamers as the key was mostly disabled by the game developers as the first step of copy protection efforts.

Hardware triggered soft-reset idea carried over to Amiga as CTRL+Left-Amiga+Right-Amiga. In some ways it can be seen as a variation of modern CTRL+ALT+DEL

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .