Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Atari BASIC
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Input/output=== The Atari [[operating system|OS]] includes a subsystem for [[peripheral]] device input/output (I/O) known as CIO (Central Input/Output). Most programs can be written independently of what device they might use, as they all conform to a common interface; this was rare on home computers at the time. New device drivers could be written fairly easily that would automatically be available to Atari BASIC and any other program using the Atari OS, and existing drivers could be supplanted or augmented by new ones. A replacement {{mono|E:}}, for example could displace the one in ROM to provide an 80-column display, or to piggyback on it to generate a [[checksum]] whenever a line is returned (such as used to verify a type-in program listing). Atari BASIC supports CIO access with reserved words {{mono|OPEN #, CLOSE #, PRINT #, INPUT #, GET #, PUT #, NOTE #, POINT #}} and {{mono|XIO #}}. There are routines in the OS for simple graphics drawing functions but not all are available as specific BASIC keywords. {{mono|PLOT}} and {{mono|DRAWTO}} for line drawing are supported while a command providing area fill for primitive linear geometric shapes is not. The fill feature can be used through the general CIO entry point, which is called using the BASIC command {{mono|XIO}}. The BASIC statement {{mono|OPEN #}} prepares a device for I/O access: <syntaxhighlight lang="basic"> 10 REM Opens the cassette device on channel 1 for reading in BASIC 20 OPEN #1,4,0,"C:MYPROG.DAT" </syntaxhighlight> Here, {{mono|OPEN #}} means "ensure channel 1 is free," call the {{mono|C:}} driver to prepare the device (this will set the cassette tape spools onto tension and advance the heads keeping the cassette tape player "paused"). The {{mono|4}} means "read" (other codes are {{mono|8}} for write and {{mono|12 {{=}} 8 + 4}} for "read-and-write"). The third number is auxiliary information, set to 0 when not needed. The {{mono|C:MYPROG.DAT}} is the name of the device and the filename; the filename is ignored for the cassette driver. Physical devices can have numbers (mainly disks, printers and serial devices), so "{{mono|P1:}}" might be the plotter and "{{mono|P2:}}" the daisy-wheel printer, or "{{mono|D1:}}" may be one disk drive and "{{mono|D2:}}" and so on. If not present, 1 is assumed. The LPRINT statement sends a string to the printer. A is read by {{mono|PEEK}}ing memory locations maintained by the keyboard driver or by opening it as a file (e.g. {{code|2=basic|OPEN 1,4,0,"K:":GET #1,A$}}). The latter waits for a keypress. Typing {{kbd|DOS}} from BASIC exits to the [[Atari DOS]] command menu. Any unsaved programs are lost unless a memory-swapping file feature has been enabled on the current disk. There is no command to display a disk directory from within BASIC; this must be done by exiting to DOS.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)