Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Atari BASIC
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Atari BASIC
(section)
Add topic