zdebel

zdebel / BASIC.md

Last active 4 hours ago

Like 0

Revision 92e283baa4d7cbc1184563a727e24cae85674377

BASIC.md Raw

P65 BASIC

The P65 comes with a BASIC in ROM, in the style of Applesoft: Microsoft BASIC with floating point numbers (9 digits), strings, arrays, and a set of extra commands for the P65's graphics chip (TMS9918), the flash storage and the machine itself. It descends from mist64/msbasic with Applesoft-compatible commands added (see the notes at the top of rom/fpp65.a65).

This document describes every command and function. All examples with a result below them were run on the real ROM in the emulator, and are checked again by python tools/basic_doc.py (tests/test_basic_doc.py).

Notation: UPPER CASE is typed as it is, <name> is something you supply, [ ... ] is optional, ... can repeat.

Contents

  1. Using BASIC
  2. Numbers, strings, variables and operators
  3. Program control
  4. Flow of control
  5. Variables and data
  6. Text output and input
  7. Functions
  8. Graphics
  9. Sprites
  10. Flash storage
  11. The machine: memory, I/O, machine code
  12. Errors
  13. Not implemented

1. Using BASIC

After a reset the screen shows the banner and the prompt Ok. You type a line and press Return.

  • A line with a number is stored in the program. Typing a number alone deletes that line.
  • A line without a number is executed at once (immediate mode).
  • Several statements go on one line, separated by a colon :.
  • Keywords can be typed in lower case, they are stored in upper case.
  • Ctrl-C stops a running program: Break in <line>. CONT continues it.
  • The screen is 40 columns by 24 rows. A long line wraps to the next row.
PRINT "HELLO"
HELLO

A program is a list of numbered lines. RUN starts it at the lowest line number:

10 PRINT "HELLO"
20 PRINT "WORLD"
RUN
HELLO
WORLD

Output is shown as it appears on the screen. A number is printed with a space in front of it (or a minus sign) and a space behind it. Each command ends with the prompt Ok, which is left out of the results in this document.

PRINT 1,2,3
PRINT -1;-2;-3
 1               2               3
-1 -2 -3

2. Numbers, strings, variables and operators

Numbers

Numbers are floating point with about 9 significant digits, from about 1E-38 to 1.7E38. Decimal numbers can have an exponent (1.5E3). Hexadecimal constants start with $.

PRINT 1E10;1E-5;123456789;0.1+0.2
PRINT $FF;$100;$FF+1
 1E+10  1E-05  123456789  .3
 255  256  256

Commands that need a whole number (POKE, PEEK, addresses, HPLOT coordinates) take the whole part of the value and complain with Illegal quantity when it is out of range.

Variables

A variable name is a letter followed by letters and digits. Only the first two characters count (AB1 and AB2 are the same variable). The last character can be a type marker:

name holds
A real number
A% integer (-32767 to 32767)
A$ string (up to 255 characters)

A and A$ and A% are three different variables. A variable that was not set is 0 (or the empty string). Arrays have their own names too: A(1) is not A.

AB1=5:AB2=6
PRINT AB1;AB2
 6  6
A=1:A$="STRING":A%=7
PRINT A;A$;A%
 1 STRING 7

An integer variable holds the number rounded down (as INT does):

A%=3.9
PRINT A%
A%=-3.9
PRINT A%
 3
-4

Operators

From the highest to the lowest priority:

operator meaning
( ) parentheses
^ power
- (unary), NOT negation (also logical NOT)
* / multiply, divide
+ - add, subtract (+ also joins strings)
= < > <= >= <> comparison: gives -1 (true) or 0 (false)
AND logical and (bit by bit on 16 bits)
OR logical or
PRINT 2^10;10/4;3*4-1
PRINT 5>3;5<3;5=5
PRINT 7 AND 3;7 OR 8;NOT 0
PRINT "A"<"B";"HELLO"="HELLO"
 1024  2.5  11
-1  0 -1
 3  15 -1
-1 -1

Strings are joined with + and compared character by character:

A$="X":B$=A$+"Y"
PRINT B$;LEN(B$)
XY 2

3. Program control

NEW

Deletes the program and clears all variables.

10 PRINT "A"
NEW
LIST

RUN

RUN starts the program at its first line, RUN <line> at the given line. It clears the variables first.

10 PRINT "A"
20 PRINT "B"
RUN 20
B

LIST

LIST lists the whole program. LIST <line> lists one line, LIST <first>,<last> a range. Keywords are listed in upper case and spaced out.

10 A=1:PRINT A
20 FOR I=1 TO 2:NEXT
LIST
 10 A = 1: PRINT A
 20  FOR I = 1 TO 2: NEXT
10 PRINT "A"
20 PRINT "B"
30 PRINT "C"
LIST 20,30
 20  PRINT "B"
 30  PRINT "C"

DEL

DEL <first>,<last> deletes the lines from first to last (both included).

10 PRINT "A"
20 PRINT "B"
30 PRINT "C"
DEL 20,20
LIST
 10  PRINT "A"
 30  PRINT "C"

END, STOP, CONT

END stops the program quietly. STOP stops it with the message Break in <line> and CONT carries on with the next statement (it also works after Ctrl-C). In this example the program stops after printing 1 and 2, and CONT prints the 3:

10 FOR I=1 TO 3
20 PRINT I;
30 IF I=2 THEN STOP
40 NEXT
RUN
CONT
 1  2
Break in 30
 3

CLEAR

Sets all variables to 0 or the empty string and forgets arrays, FOR loops and GOSUB returns. The program stays.

A=5
CLEAR
PRINT A
 0

REM

A comment: the rest of the line is ignored.

10 REM THIS IS A COMMENT
20 PRINT "X" : REM AND THIS TOO
RUN
X

4. Flow of control

GOTO, GOSUB, RETURN, POP

GOTO <line> continues at that line. GOSUB <line> calls a subroutine, RETURN comes back to the statement after the GOSUB. POP throws away the most recent return address (to leave a subroutine with a GOTO).

10 GOSUB 100
20 PRINT "BACK"
30 END
100 PRINT "SUB"
110 RETURN
RUN
SUB
BACK
10 GOSUB 100
20 PRINT "NOT REACHED"
30 END
40 PRINT "AFTER POP"
50 END
100 POP
110 GOTO 40
RUN
AFTER POP

ON ... GOTO, ON ... GOSUB

ON <number> GOTO <line>,<line>,... jumps to the line with that position (1 is the first). If the number is 0 or larger than the list, the next statement runs. ON ... GOSUB works the same for subroutines.

10 FOR I=0 TO 3
20 ON I GOTO 100,200
30 PRINT "NONE ";
40 GOTO 300
100 PRINT "ONE ";
110 GOTO 300
200 PRINT "TWO ";
300 NEXT
RUN
NONE ONE TWO NONE

FOR, TO, STEP, NEXT

FOR <var>=<start> TO <end> [STEP <step>] repeats the statements up to NEXT [<var>]. The step is 1 unless given and may be negative. The loop body always runs at least once.

10 FOR I=10 TO 1 STEP -3
20 PRINT I;
30 NEXT
RUN
 10  7  4  1

Loops can be nested. A single NEXT can close several loops: NEXT J,I.

10 FOR I=1 TO 2
20 FOR J=1 TO 3
30 PRINT I*J;
40 NEXT J,I
RUN
 1  2  3  2  4  6

IF ... THEN ... ELSE

IF <condition> THEN <line> jumps to the line, IF <condition> THEN <statements> runs the statements when the condition is true (not 0). When it is false, the rest of the line is skipped.

ELSE is an extra of the P65: put a colon in front of it; it runs when the condition is false.

10 FOR A=1 TO 5 STEP 4
20 IF A>3 THEN PRINT "BIG":ELSE PRINT "SMALL"
30 NEXT
RUN
SMALL
BIG
10 A=1
20 IF A=1 THEN PRINT "ONE":PRINT "TWO"
30 IF A=2 THEN PRINT "NOT SHOWN"
40 PRINT "LAST"
RUN
ONE
TWO
LAST

5. Variables and data

LET

LET <var>=<value>. The word LET is optional.

LET A=3
B=A*2
PRINT A;B
 3  6

DIM

DIM <name>(<max>[,<max>...]) creates an array whose indexes run from 0 to max. An array that is used without DIM has indexes 0 to 10. Arrays can have several dimensions and any type. DIM is not allowed twice for the same array (Redim'd array).

10 DIM A(3),B$(2),C(1,1)
20 A(2)=7:B$(1)="HI":C(1,1)=5
30 PRINT A(2);B$(1);A(0);C(1,1)
RUN
 7 HI 0  5

DATA, READ, RESTORE

DATA holds constants (numbers and strings) in the program. READ <var>,... takes them one by one from the first DATA in the program. RESTORE starts again from the first one. Reading past the last one gives Out of data.

10 DATA 1,2,3,"HELLO"
20 READ A,B,C,D$
30 PRINT A;B;C;D$
40 RESTORE
50 READ X
60 PRINT X
RUN
 1  2  3 HELLO
 1

DEF FN, FN

DEF FN <name>(<var>)=<expression> defines a one-argument function that is called as FN <name>(<value>). It can only be defined inside a program.

10 DEF FN SQ(X)=X*X
20 PRINT FN SQ(7)
RUN
 49

SWAP

SWAP <var1>,<var2> exchanges the values of two variables of the same type (a P65 extra).

10 A=1:B=2
20 SWAP A,B
30 PRINT A;B
RUN
 2  1

6. Text output and input

PRINT

PRINT <item><sep><item>... writes to the screen. Items are numbers, strings and expressions.

  • ; between items writes them one after the other (a number has a space or minus sign in front of it and a space behind it),
  • , moves to the next tab stop (every 16 columns),
  • a ; or , at the end keeps the cursor on the line, otherwise PRINT ends the line,
  • TAB(<n>) moves to column n (1 is the first), SPC(<n>) writes n spaces.
PRINT "A";"B","C"
PRINT 1;2,3
AB              C
 1  2            3
PRINT SPC(3);"X"
PRINT TAB(5);"Y"
   X
    Y

HOME

Clears the text screen and puts the cursor in the top left corner. In HGR it does not clear the picture.

PRINT "SOMETHING"
HOME
PRINT "AFTER HOME"

The screen is empty after HOME, only AFTER HOME is left on it.

HTAB, VTAB

HTAB <column> moves the cursor to the column (1 is the first), VTAB <row> to the row (1 is the top).

HTAB 10:PRINT "X"
         X
HOME
VTAB 5
HTAB 20
PRINT "CENTRE"

NORMAL, INVERSE

INVERSE makes the text that is printed next appear dark on light, NORMAL returns to the usual look.

INVERSE
PRINT "INVERTED"
NORMAL
PRINT "NORMAL"
INVERTED
NORMAL

INPUT

INPUT ["<prompt>";]<var>[,<var>...] waits for a line. Without a prompt it shows ?. With several variables the values are typed separated by commas.

10 INPUT "NAME";N$
20 PRINT "HELLO ";N$
RUN
BOB
NAMEBOB
HELLO BOB
10 INPUT A,B
20 PRINT A+B
RUN
3,4
?3,4
 7

INPUT can only be used in a program (Illegal direct otherwise).

GET

GET <var> reads one key without waiting for Return and without showing it. The program waits until a key is pressed.

10 GET A$
20 PRINT "KEY ";A$
RUN
Z
KEY Z

7. Functions

A function gives a value and is used in expressions: PRINT SQR(16).

Numeric

function result
ABS(x) absolute value
SGN(x) -1, 0 or 1
INT(x) the whole number not larger than x (rounds down)
SQR(x) square root
EXP(x) e to the power x
LOG(x) natural logarithm
SIN(x) COS(x) TAN(x) ATN(x) trigonometry in radians
RND(x) random number from 0 up to (not including) 1
PRINT INT(-3.5);SGN(-2);ABS(-4);SQR(16)
-4 -1  4  4
PRINT ATN(1)*4
PRINT SIN(1);COS(1)
PRINT LOG(10);EXP(1)
 3.14159266
 .841470985  .540302306
 2.30258509  2.71828183

RND(1) gives the next random number; for a dice, INT(RND(1)*6)+1:

10 D=INT(RND(1)*6)+1
20 PRINT D>=1 AND D<=6
RUN
-1

Strings

function result
LEN(a$) number of characters
LEFT$(a$,n) the first n characters
RIGHT$(a$,n) the last n characters
MID$(a$,start[,n]) n characters from position start (1 is the first); without n the rest
ASC(a$) character code of the first character
CHR$(n) the character with code n
STR$(x) the number as a string
VAL(a$) the number in the string (0 if it does not start with one)
PRINT LEFT$("HELLO",2);MID$("HELLO",2,3);RIGHT$("HELLO",2)
PRINT MID$("HELLO",3)
HEELLLO
LLO
PRINT STR$(12);VAL("3.5E2");ASC("A");CHR$(66);LEN("ABC")
 12 350  65 B 3

System

function result
FRE(0) free memory for the program, in bytes
POS(0) the column of the cursor (0 is the first)
PEEK(a) the byte at address a
WPEEK(a) the 16 bit word at a and a+1 (low byte first)
VPEEK(a) the byte at address a in the video memory (VRAM, 0 to 16383)
USR(x) calls machine code, see section 11
PRINT FRE(0)>20000
PRINT POS(0)
-1
 0

8. Graphics

The P65 has two screen modes, both from the TMS9918 video chip.

mode command what it is
text TEXT 40 x 24 characters (the usual screen)
HGR HGR graphics: 256 x 160 pixels, 16 colours, with a few lines of text at the bottom

Other modes of the chip (Graphics I, Multicolor) can be set by hand with VDP and VPOKE, see below.

Colours. The colour numbers are those of the TMS9918:

0 1 2 3 4 5 6 7
transparent black medium green light green dark blue light blue dark red cyan
8 9 10 11 12 13 14 15
medium red light red dark yellow light yellow dark green magenta grey white

Colour limit of the chip. In HGR the colour is not stored for each pixel but for each group of 8 pixels side by side in one row: one colour for the lit pixels and one for the dark ones. Drawing in a new colour makes all lit pixels of that group of 8 take the new colour. Two lines of different colours that run through the same group of 8 will change each other's colour near the crossing. Steep lines touch few pixels of a group, shallow lines many. This is how the chip works; keep differently coloured drawings apart.

HGR

Switches to graphics mode, clears the picture and sets the drawing colour to white. Text can still be printed; it appears in the lines at the bottom.

HGR
HCOLOR=15
HPLOT 0,0 TO 255,159

TEXT

Switches back to the text mode.

HCOLOR=

HCOLOR=<colour> sets the drawing colour for HPLOT, HLIN and VLIN (0 to 15). Colour 0 draws with the background and so erases. It only works in HGR (Illegal quantity in text mode).

HGR
HCOLOR=3
HPLOT 10,10 TO 100,50
HCOLOR=0
HPLOT 10,10 TO 100,50

HPLOT

Draws in the HCOLOR. Coordinates: x is 0 to 255, y is 0 to 159 (otherwise Illegal quantity and nothing is drawn).

form draws
HPLOT x,y a point
HPLOT x1,y1,x2,y2 a line, both end points included
HPLOT x1,y1 TO x2,y2 the same line
HPLOT x1,y1 TO x2,y2 TO x3,y3 ... a chain of lines, each starts where the previous one ended
HGR
HPLOT 128,80
HPLOT 0,159,255,159
HPLOT 10,10 TO 100,10 TO 100,120 TO 10,10

A star:

10 HGR
20 FOR I=0 TO 255 STEP 16
30 HPLOT 128,80 TO I,0
40 HPLOT 128,80 TO I,159
50 NEXT
RUN

A sine wave:

10 HGR
20 FOR X=0 TO 255
30 HPLOT X,80+INT(60*SIN(X/20))
40 NEXT
RUN

HLIN, VLIN

HLIN <x1>,<x2> AT <y> draws a horizontal line, VLIN <y1>,<y2> AT <x> a vertical one. The two numbers can be in either order.

HGR
HLIN 10,200 AT 80
VLIN 20,140 AT 128
HLIN 255,0 AT 159

Fifteen colours:

10 HGR
20 FOR C=1 TO 15
30 HCOLOR=C
40 HLIN 0,255 AT C*10
50 NEXT
RUN

COLOR

COLOR <text>[,<background>] or COLOR ,<background> sets the colours of the text screen (and the border in graphics mode). Note: no equals sign (COLOR= is for the Apple, not here).

COLOR 1,14
COLOR 15
COLOR ,6

VDP

VDP <register>,<value> writes a register of the video chip (0 to 7). Use it to set a screen mode by hand. Register 1 keeps the interrupt bit (see section 11).

VDP 7,$F1

VPOKE, VPEEK

VPOKE <address>,<value> writes a byte into the 16 KB video memory (VRAM), VPEEK(<address>) reads one. Addresses are 0 to 16383.

VPOKE 100,77
PRINT VPEEK(100)
 77

In text mode the screen is the 960 bytes of the name table (default address 0 in VRAM, 40 columns per row); writing a character code there puts it on the screen:

HOME
VPOKE 0,65

9. Sprites

There are 32 sprites, each 8 x 8 pixels, one colour each. You define the shape, then place the sprite.

DEFSPR

DEFSPR <shape>,<r1>,<r2>,<r3>,<r4>,<r5>,<r6>,<r7>,<r8> defines the shape number shape. The eight numbers are the rows from top to bottom, one bit per pixel (the highest bit is the left pixel).

DEFSPR 0,$FF,$81,$81,$81,$81,$81,$81,$FF
DEFSPR 1,$18,$3C,$7E,$FF,$FF,$7E,$3C,$18

DRAW

DRAW <sprite>,<colour>,<shape>,<x>,<y> shows a sprite: sprite is 1 to 32, colour 0 to 15, shape the number given to DEFSPR, and x, y the position in pixels. Drawing again with the same sprite number moves it. A colour of 0 makes it invisible. Not more than four sprites fit on one scan line.

DEFSPR 0,$FF,$81,$81,$81,$81,$81,$81,$FF
DEFSPR 1,$18,$3C,$7E,$FF,$FF,$7E,$3C,$18
HGR
DRAW 1,15,0,100,80
DRAW 2,3,1,120,80

A moving sprite:

10 DEFSPR 1,$18,$3C,$7E,$FF,$FF,$7E,$3C,$18
20 FOR X=0 TO 240
30 DRAW 1,9,1,X,80
40 NEXT
RUN

10. Flash storage

About 1 MB of the Pico's flash is a small file system for programs and data. Names are up to 8 characters plus a three letter type; without a type, SAVE and LOAD use .BAS and the binary commands .BIN. Names are strings, so SAVE "GAME"+STR$(L) works. See STORAGE.md for the details of the file system and for copying files to and from a PC.

SAVE, LOAD

SAVE "<name>" stores the program, LOAD "<name>" replaces the program in memory with a stored one.

10 PRINT "HELLO FROM DISK"
SAVE "HELLO"
NEW
LOAD "HELLO"
RUN
HELLO FROM DISK

CATALOG

Lists the files (name, size) and the free space.

10 PRINT "X"
SAVE "ONE"
SAVE "TWO"
CATALOG
ONE.BAS      BAS   11
TWO.BAS      BAS   11
 2 FILES,  1008 KB FREE

ERASE, RENAME

ERASE "<name>" deletes a file, RENAME "<old>","<new>" renames it.

10 PRINT "X"
SAVE "OLD"
RENAME "OLD","NEW"
CATALOG
ERASE "NEW"
CATALOG
NEW.BAS      BAS   11
 1 FILES,  1012 KB FREE
 0 FILES,  1016 KB FREE

BSAVE, BLOAD, BRUN

BSAVE "<name>",<address>,<length>[,<start>] stores a piece of memory as a binary file; <start> is the address where BRUN starts it (0, the default, means the first byte). BLOAD "<name>"[,<address>] loads it back, to the address it was saved from unless one is given. BRUN "<name>" loads the file and calls it as machine code; the program can come back with RTS.

10 POKE 2048,169:POKE 2049,66:POKE 2050,141:POKE 2051,0:POKE 2052,9:POKE 2053,96
20 BSAVE "PROG",2048,6
30 BRUN "PROG"
40 PRINT PEEK(2304)
RUN
 66

(The six bytes are the machine code LDA #66 : STA $0900 : RTS.)

Errors of the storage are normal BASIC errors that ONERR GOTO can catch (see section 12): File not found, Disk full, Bad file name, File type mismatch, File exists, File too big, File corrupt, No storage, Address range.


11. The machine: memory, I/O, machine code

The memory map and the I/O registers are described in MEMORY_MAP.md: 32 KB of RAM at $0000-$7FFF, the I/O page at $8000, the ROM above it.

PEEK, POKE

PEEK(<address>) reads a byte, POKE <address>,<value> writes one (0 to 255). Addresses are 0 to 65535.

POKE 1024,65
PRINT PEEK(1024)
 65

WPEEK, WPOKE

WPOKE <address>,<value> writes a 16 bit value (low byte at address), WPEEK(<address>) reads one.

WPOKE 1024,$1234
PRINT WPEEK(1024)
PRINT PEEK(1024);PEEK(1025)
 4660
 52  18

I/O registers

The three LEDs are at address 32768 ($8000): bits 0 to 2 are LED0 to LED2 (1 = on). Reading gives $F8 plus the bits.

POKE 32768,5
PRINT PEEK(32768)
 253

The keyboard register is 32769 ($8001): bit 7 is set when a key has been pressed (PEEK(32769)>127) and the key code is in the other bits. Writing anything to it clears the flag. (GET does this for you.)

The frame counter

The ROM counts the 60 Hz frame interrupts of the video chip in three bytes at addresses 992, 993 and 994 (a 24 bit number, low byte first), so you can time things:

10 T=PEEK(992)+256*PEEK(993)
20 FOR I=1 TO 100:NEXT
30 U=PEEK(992)+256*PEEK(993)
40 PRINT U>T
RUN
-1

POKE 996,0 turns the frame interrupt off, POKE 996,1 on again.

WAIT

WAIT <address>,<mask>[,<xor>] waits until (PEEK(address) XOR xor) AND mask is not 0. This waits for the next frame (bit 0 of the frame counter changes):

10 WAIT 992,1
20 PRINT "FRAME"
RUN
FRAME

CALL

CALL <address> runs machine code at address. The code comes back with RTS.

POKE 768,96
CALL 768
PRINT "BACK"
BACK

USR

USR(x) calls machine code through a jump instruction at addresses 10 to 12 (POKE 10,76 is the JMP, then the address low and high byte). The value x is passed in the floating point accumulator; whatever the routine leaves there is the result. A routine that only does RTS returns x.

POKE 768,96
POKE 10,76:POKE 11,0:POKE 12,3
PRINT USR(3)
 3

& (ampersand)

& jumps to the machine code at the vector at address 1013 ($03F5), which has to contain a JMP instruction (as in the Apple). The text after the & is where the routine can read its parameters.

HIMEM:, LOMEM:

HIMEM: <address> sets the highest address BASIC uses (the top of the program memory and the strings), LOMEM: <address> the lowest address for variables. They are used to reserve memory for machine code and graphics tables.

HIMEM: 30000
PRINT FRE(0)<20000
 0

TRACE, NOTRACE

TRACE prints the number of every line that is executed, NOTRACE stops it.

10 TRACE
20 A=1
30 B=2
40 NOTRACE
50 PRINT "DONE"
RUN
# 20 # 30 # 40 DONE

The monitor

CALL -151 starts the machine code monitor (prompt *). The most used commands:

typed does
800 shows the byte at $0800
800.80F shows the bytes from $0800 to $080F
800: A9 05 8D 00 80 60 puts bytes into memory from $0800
800L disassembles from $0800 (20 instructions)
800G runs the code at $0800
Ctrl-C back to BASIC

12. Errors

When a statement fails, BASIC stops the program with a message and the line number, for example Syntax error in 20, and returns to Ok.

ONERR GOTO <line> makes the program carry on at the given line when an error happens, instead of stopping. In that routine PEEK(222) gives the error code. RESUME runs the statement that failed again (so the routine has to fix the cause first, or leave with GOTO).

10 ONERR GOTO 100
20 PRINT 1/0
30 PRINT "DONE"
40 END
100 PRINT "ERROR";PEEK(222)
110 GOTO 30
RUN
ERROR 133
DONE

The error codes:

code message
0 NEXT without FOR
16 Syntax error
22 RETURN without GOSUB
42 Out of data
53 Illegal quantity
69 Overflow
77 Out of memory
90 Undef'd statement
107 Bad subscript
120 Redim'd array
133 Division by zero
163 Type mismatch
176 String too long
224 Undef'd function

The storage commands add their own codes: 160 plus the storage error number (see STORAGE.md).


13. Not implemented

These keywords exist in the ROM but do nothing useful:

  • STORE and HEX$ give Advanced feature error.
  • HEX$ is a placeholder; for hexadecimal numbers use $ constants and the monitor.

Applesoft commands that are not in this BASIC: PLOT (use HPLOT), HGR2, XDRAW, SHLOAD, RECALL, FLASH, PR#, IN#, and the low resolution graphics GR, HLIN/VLIN with the lores meaning (HLIN and VLIN exist here as commands of HGR). A line typed with one of these gives Syntax error (HGR2 first runs HGR). ROT= and SCALE= and SPEED= are not keywords either, they are taken as an assignment to an ordinary variable and do nothing.