BASIC keyword abbreviation

From C64-Wiki

Jump to: navigation, search

Commodore BASIC offers a "shortcut" for entering keywords: Generally, a BASIC keyword may be entered as merely the first letter of the keyword in "lowercase", followed by the second one in "uppercase" (i.e. using one of the SHIFT keys). For instance:

  • The keyword SAVE can be entered as sA (a lowercase "S" and an uppercase "A")
  • The keyword VERIFY can be entered as vE (a lowercase "V" and an uppercase "E")

In some cases, two keywords begin with the same two letters; in these cases one takes "precedence", so the abbreviation for the consists of the first two letters in "lowercase", followed by the third in "uppercase":

  • The keyword GOTO can be entered as gO
  • The keyword GOSUB is abbreviated to goS

Because of the way these shortcuts are implemented in the code in BASIC ROM, there are several "shortcuts" for each keyword: GOSUB may be entered not only as "goS" (G, O, Shift+S), but also as "gosU" (G, O, S, Shift+U). But entering the whole word with the last letter capitalized: "gosuB" (G, O, S, U, Shift+B) fails, yielding some other, "random" BASIC keyword which will most likely yield a ?SYNTAX  ERROR.

One exception to the rule is PRINT, which is abbreviated to a question mark, so that

? "Hello world!"

is a valid PRINT statement . ("pR", or P, Shift+R is the abbreviation for PRINT#). A few BASIC keywords, such as NEW and INT do not have abbreviations at all.

[edit] Overview of BASIC abbreviations

The following table gives the shortest possible abbreviation for all keywords in the Commodore BASIC V2 found in the C-64:

ABSaB (A, Shift+B)
ANDaN (A, Shift+N)
ASCaS (A, Shift+S)
ATNaT (A, Shift+T)
CHR$cH (C, Shift+H)
CLOSEclO (C, L, Shift+O)
CLRcL (C, Shift+L)
CMDcM (C, Shift+M)
CONTcO (C, Shift+O)
COS(No abbreviation)
DATAdA (C, Shift+A)
DEFdE (D, Shift+E)
DIMdI (D, Shift+I)
ENDeN (E, Shift+N)
EXPeX (E, Shift+X)
FN(No abbreviation)
FORfO (F, Shift+O)
FREfR (F, Shift+R)
GETgE (G, Shift+E)
GET#(No abbreviation)
GOSUBgoS (G, O, Shift+S)
GOTOgO (G, Shift+O)
IF(No abbreviation)
INPUT(No abbreviation)
INPUT#iN (I, Shift+N)
INT(No abbreviation)
LEFT$leF (L, E, Shift+F)
LEN(No abbreviation)
LETlE (L, Shift+E)
LISTlI (L, Shift+I)
LOADlO (L, Shift+O)
LOG(No abbreviation)
MID$mI (M, Shift+I)
NEW(No abbreviation)
NEXTnE (N, Shift+E)
NOTnO (N, Shift+O)
ON(No abbreviation)
OPENoP (O, Shift+P)
OR(No abbreviation)
PEEKpE (P, Shift+E)
POKEpO (P, Shift+O)
POS(No abbreviation)
PRINT#pR (P, Shift+R)
READrE (R, Shift+E)
REM(No abbreviation)
RESTOREreS (R, E, Shift+S)
RETURNreT (R, E, Shift+T)
RIGHT$rI (R, Shift+I)
RNDrN (R, Shift+N)
RUNrU (R, Shift+U)
SAVEsA (S, Shift+A)
SGNsG (S, Shift+G)
SINsI (S, Shift+I)
SPC(sP (S, Shift+P)
SQRsQ (S, Shift+Q)
STATUS(No abbreviation)
STEPstE (S, T, Shift+E)
STOPsT (S, Shift+T)
STR$stR (S, T, Shift+R)
SYSsY (S, Shift+Y)
TAB(tA (T, Shift+A)
TAN(No abbreviation)
THENtH (T, Shift+H)
USRuS (U, Shift+S)
VALvA (V, Shift+A)
VERIFYvE (V, Shift+E)
WAITwA (W, Shift+A)
Personal tools
Help and Feedback