Instruction | Description | Type |
ABS | Returns the absolute value of a number | Function, numerical |
| PRINT ABS(-5) |
AND | Returns true if both conditions are true | Operator, logical |
| A=5: B=10 IF A=5 AND B=10 THEN PRINT "OK" |
ASC | Returns the numerical value of a char | Function, numerical |
| PRINT ASC("A") |
ATN | Returns the arctangent of a number | Function, numerical |
| PRINT ATN(1) |
CHR$ | Returns the character corresponding to the number | Function, string |
| PRINT CHR$(65) |
CLOSE | Closes a file | Instruction/command |
| 10 OPEN 1,8,2,"FILE" 20 PRINT#1,"AMEDEO" 30 CLOSE 1 |
CLR | Delete variables arrays, data, … | Instruction/command |
| A=10 CLR PRINT A |
CMD | Changes the data output to other peripheral | Instruction/command |
|
|
| CMD 4 |
CONT | Resumes execution of a BASIC program | Command |
| 10 PRINT "1" 20 END 30 PRINT "2" RUN CONT |
COS | Returns the cosine of an angle (rad) | Function, numerical |
| PRINT COS(0) |
DATA | Stores constant information in the program code | Instruction/command |
| 10 DATA 5,10,15 20 READ A,B,C 30 PRINT A,B,C |
DEF FN | Defines a user-defined function | Instruction |
| 10 DEF FNS(X)=X*2 20 PRINT FNS(4) |
DIM | Allocates space in array memory for a new array | Instruction/command |
| 10 DIM A(5) 20 A(1)=42: A(2)=36 30 PRINT A(1) |
END | Ends the processing of the current program | Instruction/command |
| 10 PRINT "1" 20 END 30 PRINT "2" |
EXP | "e" with the power given by the argument | Function, numerical |
| PRINT EXP(1) |
FN | Executes a function defined by DEF FN | Function, numerical, special |
|
|
| 10 DEF FNA(X)=X+1 20 PRINT FNA(5) |
FOR | Program loop start (FOR … TO … STEP … NEXT) | Instruction/command |
| 10 FOR I=1 TO 8 STEP 3 20 PRINT I 30 NEXT I |
FRE | Returns the number of unused bytes of BASIC RAM | Function, numerical, special |
| PRINT FRE(0) |
GET | Reads one or more chars from the keyboard | Instruction |
| 10 GET A$: IF A$="" GOTO 10 20 PRINT A$ |
GET# | Reads single characters from the specified device | Instruction/command, special |
| 10 OPEN 1,8,2,"FILE" 20 GET#1,A$ 30 PRINT A$ 40 CLOSE 1 |
GO TO | Jumps to a line number | Instruction/command |
| 10 GO TO 100 20 PRINT "1" 100 PRINT "2" |
GOSUB | Jumps to a subroutine … RETURN | Instruction/command |
| 10 GOSUB 100 20 END 100 PRINT "SUBROUTINE" 110 RETURN |
GOTO | Jumps to a line number | Instruction/command |
| 10 GOTO 100 20 PRINT "1" 100 PRINT "2" |
IF | Tests a condition IF … THEN or IF … GOTO | Instruction/command |
|
|
| 10 A=5 20 IF A=2 THEN PRINT "2!!!" 30 IF A=5 THEN PRINT "A = 5!!!" |
INPUT | Reads data from the keyboard | Instruction |
| 10 INPUT "WHAT IS YOUR NAME";A$ 20 PRINT A$ |
INPUT# | Reads data from a file stored on peripheral device | Instruction |
| 10 OPEN 1,8,2,"FILE" 20 INPUT#1,A$ 30 PRINT A$ 40 CLOSE 1 |
INT | Rounds a number | Function, numerical |
| PRINT INT(5.7) |
LEFT$ | Left chars of a string | Function, string |
| 10 A$="AMEDEO" 20 PRINT LEFT$(A$,3) |
LEN | Returns the number of characters in a string | Function, numerical |
| PRINT LEN("TEST") |
LET | Assigns values in a variable | Instruction/command |
| LET A=10 PRINT A |
LIST | Displays the BASIC program in memory | Instruction/command |
| 10 PRINT "HELLO" 20 GOTO 10 LIST |
LOAD | Loads a program | Instruction/command |
|
|
| LOAD"PROGRAM",8 |
LOG | Natural logarithm with the basis e | Function, numerical |
| PRINT LOG(10) |
MID$ | Inner chars of a string | Function, string |
| 10 A$="HELLO" 20 PRINT MID$(A$,2,3) |
NEW | Clears RAM and program | Instruction/command |
| NEW |
NEXT | Program loop end (FOR … TO … STEP … NEXT) | Instruction/command |
| 10 FOR I=1 TO 5 20 PRINT I 30 NEXT I |
NOT | Reverses true to false | Operator, logical |
| PRINT NOT 0 |
ON | Contruct ON … GOTO, ON … GOSUB | Instruction/command |
| 10 X=2 20 ON X GOTO 100,200,300 30 END 100 PRINT "1": END 200 PRINT "2": END 300 PRINT "3": END |
OPEN | Opens a file or a channel | Instruction/command |
| 10 OPEN 1,8,2,"FILE" 20 PRINT#1,"AMEDEO" 30 CLOSE 1 |
OR | Returns true if one or both conditions are true | Operator, logical |
|
|
| A=0: B=10 IF A=5 OR B=10 THEN PRINT "OK" |
PEEK | Returns the memory content | Function, numerical |
| PRINT PEEK(53280) |
POKE | Changes the content of any memory address | Instruction/command |
| POKE 53280,0 |
POS | Determines the actual position of the cursor | Function, numerical, special |
| PRINT " ";POS(0) |
PRINT | Prints data to the current output device | Instruction/command |
| PRINT "AMEDEO" |
PRINT# | Stores data in a file | Instruction/command |
| 10 OPEN 1,8,2,"FILE" 20 PRINT#1,"AMEDEO" 30 CLOSE 1 |
READ | Reads constant values from DATA | Instruction |
| 10 DATA 42, 100, 232 20 READ A 30 PRINT A |
REM | Comments | Instruction/command |
| REM THIS IS A COMMENT |
RESTORE | Clears the pointer of the next data value | Instruction/command |
|
|
| 10 DATA 5,10,15 20 READ A,B 30 PRINT A,B 40 RESTORE 50 READ A,B 60 PRINT A,B |
RETURN | Finishes a subroutine: GOSUB … RETURN | Instruction/command |
| 10 GOSUB 100 20 PRINT "1" 30 END 100 PRINT "2" 110 RETURN |
RIGHT$ | Right chars of a string | Function, string |
| 10 A$="HELLO" 20 PRINT RIGHT$(A$,2) |
RND | Generates a random floating point number | Function, numerical |
| PRINT RND(1) |
RUN | Starts a program | Instruction/command |
| RUN |
SAVE | Saves a program | Instruction/command |
| SAVE"PROGRAM",8 |
SGN | Returns the sign of a number (-1, 0, 1) | Function, numerical |
| PRINT SGN(-5) |
SIN | Returns the sine of an angle (rad) | Function, numerical |
| PRINT SIN(0) |
SPC( | Sets a number of spaces | Function, PRINT (Carry = 0!) |
|
|
| PRINT SPC(5);"HELLO" |
SQR | Calculates square root of a number | Function, numerical |
| PRINT SQR(9) |
ST | Gets I/O status byte | Reserved variable |
| PRINT ST |
STEP | Program loop increment/decrement (FOR … TO … STEP … NEXT) | Instruction/command, special |
| 10 FOR I=1 TO 8 STEP 3 20 PRINT I 30 NEXT I |
STOP | Breaks a program | Instruction/command |
| STOP |
STR$ | Converts numerical values or variables into a string | Function, string |
| PRINT STR$(123) |
SYS | Calls an assembly language subroutine | Instruction/command |
| SYS 64738 |
TAB( | Sets the cursor column | Function, PRINT (Carry = 1!) |
| PRINT TAB(10);"HELLO" |
TAN | Returns the tangent for a given angle (rad) | Function, numerical |
|
|
| PRINT TAN(1) |
THEN | Tests a condition IF … THEN | Instruction/command, special |
| 10 A$="H" 20 IF A$="H" THEN PRINT "OK!" 30 IF A$<>"H" THEN PRINT "NO!" |
TI | Gets the system time (seconds/60) | Reserved variable |
| PRINT TI |
TI$ | Gets or Sets the system time (HHMMSS) | Reserved variable |
| PRINT TI$ |
TO | Program loop target (FOR … TO … STEP … NEXT) | Instruction/command, special |
| 10 FOR I=1 TO 5 20 PRINT I 30 NEXT |
USR | Calls an assembly language subroutine with argument | Function, numerical/string |
| 10 POKE 785,254: POKE 786,186 20 PRINT USR(85): REM DIVIDE BY 10 |
VAL | Returns the numerical value of a string | Function, numerical |
| PRINT VAL("123") |
VERIFY | Verifies a saved program | Instruction/command |
| VERIFY"PROGRAM",8 |
WAIT | Waits for a memory location to assume specific values | Instruction/command |
|
|
| 10 POKE 198,0 20 WAIT 198,1 30 PRINT "KEY PRESSED" |
+ | Sum | Operator, numerical/string |
| PRINT 5+3 |
- | Subtraction | Operator, numerical |
| PRINT 5-3 |
* | Multiplication | Operator, numerical |
| PRINT 5*3 |
/ | Division | Operator, numerical |
| PRINT 6/3 |
^ | Exponent | Operator, numerical |
| PRINT 2^3 |
> | Greater | Operator, logical |
| IF A>5 THEN PRINT "GREATER" |
= | Equal | Operator, logical |
| IF A=5 THEN PRINT "EQUAL" |
< | Less | Operator, logical |
|
|
| IF A<5 THEN PRINT "LESS" |
π (pi) | 3.1415926… | Function, numerical, special |
| PRINT "PRINT " + CHR$(222) π MUST BE GENERATED BY CHR$(222) |
Where is STATUS (short ST) command?
Just added! Thank you!
I was able to find ցood info fгom your aгticles.
Great, thank you!
Keep up posting these content. Thank you!
Thanks!
This is vегy interesting, You're a very skilled blogger.
I've joined your fеed and look forwarԁ to seeking more of your wonderful post.
Also, I have shared your website in my social networks!
Thank you very much!
I've learn some excellent stuff here. Definitely bookmarking for revisiting.
I surprise how so much effort you place to make one of these great informative website.
Many thanks!
I admit that it is very interesting and I would like to write a project from scratch with your help mostly because I am completely new to any type of programming. Your courses are interesting but often leave me with gaps that I struggle to fill. For a few days I've been trying to write a game but without success and I'd like to have your help or some advice.
In the meantime, I thank you for all your precious legacy
Imparare la programmazione non è facile, soprattutto all'inizio. Poi, quando si capisce la logica che c'è alla base, tutto diventa più semplice. Purtroppo, per mancanza di tempo, non riesco a seguire progetti individuali. Ti consiglio di partire da listati già esistenti online, andando poi a modificare qualcosa, giusto per capire come si interviene sul listato. Solo in un secondo tempo potresti partire da un nuovo progetto.