User Tools

Site Tools


notes:atari:basic

Atari BASIC

Commands

Command Description
ENTER “H1:PROGRAM.BAS” Load a BASIC program
LIST “H1:PROGRAM.BAS” Save a BASIC program
NEW Clear the computer's memory by erasing any old instructions
DOS Switch to DOS
PRINT FRE(0) Check how much memory is available
BYE Activate Self Test
PRINT#6;“HELLO” Display characters in the graphics window in a split-screen mode

PRINT

Examples of using PRINT:

PRINT "TEXT",                   TEXT followed by a tab
PRINT "TEXT";"ABC"              Concatenated strings: TEXTABC
PRINT "TEXT":PRINT "ABC"        Two instructions in the same line
PRINT                           New line

Input/Output

The Atari disk input/output commands:

  • OPEN #num, code, 0, file
  • CLOSE #num
  • PRINT #num
  • INPUT #num
Parameter Description
num A reference number between 1 and 7 that is used to refer to the file throughout a program.
The reference number is also called IOCB number (Input/Output Control Block).
code An open code is a number that tells the computer if you want to read, write:
4 - read
8 - write; first erase the file and start writing at the beginning
12 - read/write
9 append; add to end of file
file A file specification composed of the device and filename.

Example:

DIM F$(20)
F$="H1:TEST.DAT"
 
OPEN #1,8,0,F$                          Open a file TEST.DAT for writing
PRINT #1;"HELLO!"                       Write a string to the file
PRINT #1; 123.4                         Write a number (as a string) to the file
PRINT #1;"THERE IS MORE:"; 987          Write a string and a number (as a string) to the file
CLOSE #1                                Flush the buffer and close the file
 
OPEN #2,4,0,F$                          Open a file TEST.DAT for writing
REM                                     Note that we could use #1 again as the file has been closed
DIM D$(30):REM                          Allocate memory for a string we want to read from the file
INPUT #2,D$                             Read the string to the variable D$
PRINT D$:REM                            Prints HELLO!
INPUT #2,D$:REM                         Read the next string (which is a number stored as a string)
PRINT D$:REM                            Prints 123.4

More on using disks with Atari BASIC can be found here.

Editor

  • ^ - Control key
  • ! - Shift key
  • Delete a line by typing its number.
  • Stop the LIST instruction: Control + 1
  • Display a graphical symbol: Control + key
  • Switch to graphical symbols mode: Control + Caps
  • Insert a space: Control + Insert
  • Insert a line above the current line: Shift + Insert
  • Delete the current line: Shift + Delete
  • Arrows: Control + arrow key
notes/atari/basic.txt · Last modified: 2018/01/10 by leszek