Page 285 ..... 1sn[ l.|)gM. >|J0/v\. O1 agqgssod sg lg. 'Meugq. Z-aseq ug sg pue
sg. 1L|S!310 s8ug11s. Lg1g/v\. >g.|0/v\. O1. Bug/mg ... 'SL. +gp+. OQSZ. +. 9607.
ZS1U9|EA!I'\b9. |ewg;>ap asoq1 ppe'an|e/\. |eLupap ann eq; ...... SE6. v.
246. SF6. g. 231. SE7. w. 247. SF7. h. 232. SE8. x. 248
.
Copyright
© 1984
by David Heiserman
FIRST EDITION FIRST PRINTING
All rights
reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. While every precaution has been taken in the preparation of this book, the publisher assumes no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein.
International Standard Book Number: 0-672-22277-9 Library of Congress Catalog Card Number: 83-51616 Edited by Welborn Associates Illustrated by D.B. Clemons
and 8001" are trademarks of and used by permission of Atari, Inc. ATARl®, 4001"
book is published by Howard W Sams & Co., Inc. which is not affiliated with Atari, Inc. and Atari is not responsible for any inaccuracies. This
Printed in the United States of America.
David L. Heiserman has been a freelance writer since 1968. He is the author of more than 100 magazine articles and 20 technical and scientific books. He studied applied mathematics at Ohio State University and is especially interested in the history and philosophy of science. He is the author of the Sams books Intermediate Programming for the TRS-80 and Intermediate-Level Apple ll Handbook.
That is not to say that a beginner cannot learn anything from this book-quite the contrary. The organization of material in this book is most satisfactory for a beginner who has a desire to experiment with new ideas and techniques on a first-hand basis. Although such an individual might not fully understand the finer points of some topics, the mere effort guarantees a level of success that is often difficult to achieve from simpler, step-by-step presentations. would like to acknowledge the invaluable assistance offered by my personal secretary, Robin M. Yates. She prepared many of the tables and drawings, proofread the drafts, and assembled the final manuscript for us. I
DAVID HHSERMAN
CHAPTER 2 ATARI BASIC Notation, Rules, and Limitations NUMERIC AND STRING CONSTANTS
.................
Numeric Constants .................... String Constants .........................
BASIC VARIABLES AND VARIABLE NAMES
....
Numeric Variables ................................. String Variables ......................................
DIMENSIONING STRING VARIABLES AND NUMERIC ARRAYS
..................................................
D|Mensioning String Variables .................... Subscripted Numeric Variables and Arrays ....
OPERATIONS AND OPERATORS
................
Arithmetic Operators ...................... Relational Operators ............... Logical Operators ...................... Order of Precedence for Operators .....
CHAPTER 3
The BASIC Programming Language A SUMMARY
or
FUNCTIONS A SUMMARY
.,............_
STATEMENTS, COMMANDS, AND
................................................
or ATARI
BASIC SYNTAX AND APPLICATIONS
CHAPTER 4
The Text and Graphics Screens FEATURES
COMMON TO
...............
ALL SCREEN
MODES __ MODE-0 GRAPHICS ._....__._..........._......._._. Organization of the Mode-0 Color Registers ....... Working With the Mode-0 Column/Row Format .... Working With the Mode-0 Margins ................ Using the POSITION Statement ................. Alternative Column/Row Techniques ....... .__ Using LOCATE, GET, and PUT in Mode 0 .... ._ The Mode-0 Screen RAM Format ........... ._ MODE-1 AND MODE-2 GRAPHICS ..____.__.____....... . Organization of the Mode-1 and Mode-2 Color Reglsters .__._..._..._......._......_..._....___._. Accessing the Character Set From Modes 1 and 2 ....___.. Working With the Mode-1 and -2 Column/Row Format __ Using the POSITION Statement _......__...._..._..._.._._ Alternate Column/Row Techniques ._..._..____..._._ _._ Using LOCATE, GET, and PUT in Modes 1 and 2 ._.__. The Mode-1 and Mode-2 Screen RAM Formats __.. Full-Screen Formats __.._.._..._....__.......___.._.._.._.._ CUSTOM CHARACTERS SETS FOR MODES 0, 1, AND 2 _.__._. _
_
_
_
_ _
_
_
_ _
_
.......................... ............... ........................................
USING THE XIO COMMAND Controlling Outgoing Lines With XIO 34 Configuring Baud Rate, Word Size, and Stop Bits with XIO 36 Setting Translation Modes and Parity with XIO 38
_
......
CHAPTER 7 A
Miscellany of Principles and Procedures ....
.
.......... The SOUND Statement .............., Reproducing Musical Scores .......
MORE ABOUT THE SOUND FEATURES
Experimenting With Sound Effects
._
_
....
.................. ................
MORE ABOUT THE USR FUNCTION Passing Values to a Machine Routine Passing Values From a Machine Language Routine SCREEN DISPLAY LISTS
A LOOK AT TOKENIZED BASIC
. .
.
CHAPTER 8 The ATARI Memory Map .............
_
.............
.............
_
_
.......
ZERO-PAGE AND STACK RAM OPERATING SYSTEM AND BASIC RAM ._._ Operating System RAM: 512-1151 .... BASIC System RAM: 1152-1535 .._.. DOS RAM USAGE: 1792-10879 .........__. BASIC ROM AREA: 40960-49151 .._.._._____ HARDWARE I/O ROM AREA: 53248-55295 .. The CTIA (or GTIA) Device
_
.....
................................... .........................
The ANTIC Instruction Set Structure of a Display List ..... Locating the Display List ......
_
_
_
_
. _
_
_
The POKEY Device ............._.._.. The PIA Device ....._.._.__..._.._.__....._ THe ANTIC Device __._............._.....__. OPERATING SYSTEM ROM AREA: 55296-65535
_
_
_
_ _
_
CHAPTER 9
The 6502 Instruction Set
...............
.
APPENDIX A
Number-System Base Conversions ..........
............. .............
HEXADECIMAL-TO-DECIMAL CONVERSIONS DECIMAL-To-HEXADECIMAL CONVERSIONS CONVENTION/\L DECIMAL TO 2-BYTE DECIMAL FORMAT
Fig. 1-2. The ATARI
800 Home Computer console. (Courtesy Atari,
Inc.)
There are a couple of less-obvious differences. For one, the ATARI 800 Home Computer can accept two different program cartridges, while the 400 can accept only one. Fig. 1-3 shows the arrangement of jacks and switches along the right-hand side of the ATARI 800 console unit. The arrangement for the model 400 is similar, but does not include the MONITOR jack. That simply means that the 400 must use an ordinary tv receiver as its display screen, while the 800 offers the option of using a tv receiver or a monitor.
PER|PHERAL
MONITOR
Fig. 1-3. Connection panel for
I 2-CHAN-3
Pom”
_ ' ggvgfgl
l
the Model 800. The Model 400
identical except for the lack of
a
is
MONITOR jack.
For the most practical purposes, however, the 400 and treated as such throughout this book. Also, it will be assumed through this book that the ATARI BASIC cartridge is installed. As far as the 400 model is concerned, that means plugging it into the only slot that 800 models are identical, and they are
14
The power-transformer assembly is plugged into an ordinary 120 V ac outlet, and the smaller plug goes into the POWER IN jack on the side of the console unit. A cable and plug attached to the rear of the console goes to the antenna terminals on a standard tv receiver. lf you plan to use the tv for viewing ordinary programming, that antenna connection should be made through an antenna switch that is provided with the basic unit. To get this configuration into operation: 1. Turn on the tv set. 2. If you are using the
antenna switch, set the switch to
its COMPUTER position.
Turn on the computer console, using the POWER switch located on the left-hand side of the unit. 4. Set the CHAN switch on the side of the console for either Channel 2 or 3, and match the tv channel selector accordingly. Use the channel that can be tuned for the lesser amount of outside interference. 3.
When all is going well, the tv will show a blue background color, a lighter blue READY message, and a lightblue square just below the message. At that time, the system is ready to operate in ATARI BASIC.
lf you have an ATARI 800 system and wish to work with a monitor unit instead of a tv receiver, the hardware arrangement is somewhat simpler. You have no need for the antenna switch nor the tv cable coming from the back of the console. Simply run the monitor cable from the 5-slot MONITOR jack on the side of the console to the video and audio input terminals on the monitor. The CHAN selector switch setting is not relevant at all.
Minimum System Plus Program Recorder Fig. 1-5 shows the minimum system configuration as extended to include the ATARI 410 program recorder. Using the program recorder enables you to save programs on the magnetic tape in a standard tape cassette, and then reload those programs at some later time. 16
Turn on the tv receiver or monitor, and then insert a diskette into the disk-drive unit. That diskette must be properly formatted and include the DOS system programming (the DOS system disk supplied with the disk assembly will include that programming). Next, turn on the disk-drive unit. Do not have the console unit turned on at this time. Only when the disk drive stops running (the red light will go out) should you turn on the console.
Common Multiple-Peripheral System Fig. 1-6 illustrates one of the most common ATARI configurations: the basic console unit, a tv receiver or monitor, a single disk-drive unit, a model 850 serial interface module, and a printer. The start-up sequence for such arrangements is quite A
critical.
In
this particular case:
Turn on the tv set or monitor. Insert a diskette containing the DOS system programming into the disk-drive unit. 3. Turn on the disk-drive unit and wait for the drive to stop running. 4. Turn on the 850 serial interface module. 5. Turn on the printer. 1. 2.
There are many other possible configurations that can be far more complex that these-using multiple disk drives, for instance. Consult the manuals that are supplied with the peripherals for exact details. Generally speaking, however, the turn-on procedure follows the same general plan: turn on the tv or monitor, boot DOS by turning on disk-drive 1, turn on the console, turn on the interface module, and turn on peripherals that are connected through the interface module.
18
Much of the material remaining in this book deals with the nature of those BASIC commands. During the Course of working with those commands, however, it is often necessary or desirable to execute some special keyboard functions.
Some Control Keys Most of the ATARI computer keyboard
is identical to that of a conventional typewriter. There are some special keys and key functions that are generally irrelevant for ordinary typing operations, but quite important for operating a
computer.
The key is perhaps the most-used control key. You must strike the control key whenever you want the computer to execute a command that you’ve given it in a typewritten form. When you are ready to execute _a BASIC program, for example, you should type RUN on the keyboard, and then strike the key to get the computer to read andexecute the command. The special controlkey operations described in this section do not have to be followed by a keystroke, however. The two keys serve much the same function as the shift keys on an ordinary typewriter. There are some differences, though. For instance, when you turn on the ATARI system, you find that all letters of the alphabet are printed to the screen in an upper-case format. Depressing a key while typing letters of the alphabet will cause the system to print lower-case letters. That is just the
reverse of ordinary typewriters. It is possible to change the format by striking the key. Having done that, all letters of the alphabet are normally printed in their lower-case form; and you must hold down one of the keys in order to print upper-case letters. To return to normal upper-case printing, hold down one of the keys and strike the key again.
20
The four arrow keys located near the right side of the keyboard allow you to move the cursor to any desired point on the screen. In order to use them, however, you must be holding down the key at the same time. The key serves the purpose of the tab functions on an ordinary typewriter. Strike that key alone, and the cursor will jump to its next horizontal tab location on the screen. You can set new tab positions by first setting the cursor to the desired tab position, and then striking the key while holding down one of the keys. Finally, you can clear a current tab setting by holding down both the key and one of the keys while striking the key. The key is used for stopping the execution of a program. The key, like the key, changes the normal functions of other keys. Whereas you must hold down the key while striking another key, you use the key in sequence: first strike the key, release it, and then strike another key. The special and operations are described in later discussions in this book.
SOME SCREEN EDITING FEATURES When working in BASIC, it is often necessary to change some of the material printed in the program. The ATARI system offers some program-editing features that make the task much simpler. The most important point to bear in mind is that the ATARI screen is “live.” That is to say, what you see on the screen is what is actually in program memory. So change something on the screen, and you also change the programming as well.
22
If you wish, you can listen to the audio tones during a data recording or playback session. If you are using an ordinary tv set as a screen monitor for the system, simply turn up the volume control; or if you are using a monitor, make sure that the audio plug is inserted into the monitor’s audio input jack, and turn up the volume control on that unit.
Connecting the Program Recorder to the System Fig. 1-5 shows the arrangement of the system if you are using no peripheral devices other than a tv or monitor and the program recorder. The program recorder plugs directly into the peripheral connector on the side of the ATARI console unit. If the program recorder is used in conjunction with several other peripheral devices, it must be connected to the system through a serial interface module, and it must be the last peripheral in line. Saving and Loading Programs With the Program Recorder The most commonly used command for saving BASIC programs on cassette is CSAVE; and getting a BASIC program from tape and into the ATARI computer is by means of the CLOAD command. To save a BASIC program on the program recorder, first use the FAST FORWARD and REVERSE keys on the program recorder to find the end of any programming that currently exists on the tape. Note the reading on the recorder’s tape counter for future reference. Set the recorder to its record mode by depressing both the RECORD and PLAY levers; and immediately follow that by entering the following command at the ATARI console: CSAVE
24
ROUTINE DISK OPERATIONS Fig. 1-6 shows a disk-drive unit connected to the ATARI system. When using more than one disk drive, determine the proper installation procedures from the user’s manual. Assuming that DOS is properly booted as described earlier in this chapter, typing DOS and striking the key brings up the DOS menu-it is a convenient guide to running variety disk utility operations. See the two common versions of the DOS menu in Chart 1-1.
Chart 1-1. Two Common Versions of the DOS Menu DOS Version 1.0 DISK DIRECTORY RUN CARTRIDGE COPY FILE DELETE FILE(S)
FORMAT DISK DUPLICATE DISK BINARY SAVE BINARY LOAD RUN AT ADDRESS DEFINE DEVICE DUPLICATE FILE
RENAME FILE LOCK FILE UNLOCK FILE WRITE DOS FILE
DOS Version 2.0S
E.
F.
G. H.
DISK DIRECTORY RUN CARTRIDGE COPY FILE DELETE FILE(S) RENAME FILE LOCK FILE UNLOCK FILE WRITE DOS FILE
M. N.
O.
FORMAT DISK DUPLICATE DISK BINARY SAVE BINARY LOAD RUN AT ADDRESS CREATE MEM.SAVE DUPLICATE FILE
Displaying the Current Disk Directory Execute the DOS command from the keyboard, and then select menu option A. The system will respond by printing this prompting message: DIRECTORY-SEARCH SPEC, LIST FILE?
26
In a manner of speaking, the asterisk tells the system to work with any combination of letters and numerals in that part of the file name. By way of another example, suppose that you want to see the directory of all file names that begin with the letters ALT. This sort of response will do that for you:
D:ALT*.*
Returning to BASIC The all-around safest way to return to BASIC from the DOS menu is to strike the key. Alternatively, you can elect menu item B, but there is a chance that you will lose some BASIC programming that is resident in the system. Actually the purpose of DOS menu item B is to return program control to the resident cartridge. If that happens to be the BASIC cartridge, the system begins running in BASIC. Or if it is a special language or game cartridge, selecting menu item B begins execution of that program. Copying Files to the Same Disk DOS menu item C provides a means for copying files and programs onto their own disk. This feature is most often used for generating backup copies on the same diskette. Perhaps you are planning to revise a program that already exists on the disk. You want to save the original version, but create a copy that you can modify. That is the primary application of DOS menu selection C. Upon entering that selection, you will see this prompting message:
COPY FILE-FROIVLTO?
28
You can also use global (or “wild-card”) file names under the file-copying option. Suppose that you want to transfer all of the SYS, or system, routines from drive 2 to drive 1. The appropriate response to the prompting mes-
sage
is:
D2:*.SYS,D1:*.SYS Or if you want to copy all files beginning with FUS to the same disk, but add a BAK extension, the appropriate entry is:
FUS*.*,FUS*.BAK Finally, there is the option of merging disk files-adding the content of a source file to the end of an existing destination file. The only catch is that both files must have been saved in an ATASCII format (see Chapter 6). The general syntax of such an operation is:
source,dest/A where source is the file name for the source file, and dest is the file name of the destination file. The suffix /A is what prevents the source file from completely writing over the destination file.
Deleting Files There is little point in cluttering valuable disk space with files and programs that are no longer of any use. DOS menu option D allows you to delete, or erase, any unwanted programs or files. Upon selecting menu option D, the system displays this
prompting message:
DELETE FILE SPEC
You should respond by
entering the name of the file to be deleted. And if you enter a file name that exists on the disk, the system will ask you whether or not you really want to delete it: TYPE "Y" TO DELETE.
30
,
Locking Files DOS menu option F allows you to lock a file so that it cannot be changed or renamed as long as the file remains locked. Responding with that menu selection brings up this prompting message: WHAT FILE TO LOCK?
Simply respond by entering the name of the file-one that already exists in the directory. You can use the global option to lock all files having a
specified name or extension in common. It is a good idea, for example, to lock all SYS files so that they cannot be inadvertently changed, erased, or renamed. Do that by responding with: *.SYS
Unlocking Files There are instances where it is necessary to unlock a previously locked file; perhaps to modify it or erase it altogether. DOS menu option G offers this feature. Selecting that option brings up this sort of prompting message: WHAT FILE TO UNLOCK?
Simply respond with the name of the file to be unlocked, and the computer will take care of the task for you.
Copying DOS files finished disk of BASIC programs ought to contain the system files that boot DOS for you. That circumvents the troublesome need to boot DOS with a special systems disk and then replacing it with your working BASIC disk. Electing DOS menu item H does that for you. The mechanical procedures are different for DOS 1.0 and 2.05. If you are using version 1.0, the system prints this A
prompting message:
TYPE "Y" TO WRITE NEW DOS FILE
32
The general idea is to respond with the disk-drive number of the disk to be copied (the source disk), a comma and the disk-drive number of the new copy (the destination disk). The appropriate response and operations from that point are slightly different, depending on whether you have one or two disk drives available. If you have just one disk drive available, you must respond to the prompting message by entering 1,1. That, in effect, says that the source and destination disks will both be in drive 1. Obviously you cannot fit two disks into the same drive unit, so the system will respond with this message: lNSERT SOURCE DlSK, TYPE RETURN
Insert the disk to be copied and strike the key. The system will load up the ATARI RAM with disk data; and when it is full, you will see this message: INSERT DESTINATION DISK, TYPE RETURN
Respond by replacing the source disk with a clean and formatted disk, and striking the key. The system will then load the most recent blocks of data to that disk. When using a single disk drive in this fashion, it is often necessary to alternate the source and destination disks several times. This swapping operation will come to an end only after the entire contents of the source disk is copied to the destination disk. Things are a lot simpler for the operator when two disk drives are available. Electing the disk copy operation, as before, brings up this prompting message: DUP DISK-SOURCE,DEST DRIVES?
Respond by entering two different disk-drive numbers: the source followed by the destination. Suppose that you want to copy the content of the disk in drive 1 to a fresh disk in drive 2. That being the case, the appropriate response to that prompting message is: 1,2
34
Upon selecting DOS menu item O, the system prints this prompting message: NAME OF FILE TO l\/IOVE?
Respond with the file name of the file to be copied. Having done that, the system will prompt you to insert the source disk and strike the key. After that, it prompts you to replace the source disk with the destination disk-and strike the If the file is a fairly long one, you will have to switch the source and destination disks several times.
key.
The Machine-Language Options DOS menu items K, L, and M deal with machine-language
program operations. Chapter 6 describes these operations in detail.
Saving and Loading Programs With the Disk Drives Starting with a properly formatted diskette, simply insert the diskette into a drive unit and enter a command of this general form: SAVE "D[n]":fi/ename[.ext]
That command includes a couple of optional expressions that are included in brackets. Expression n is necessary only when (1) using more than one disk drive and (2) you want to save the program on a drive other than drive No. 1. The filename is not optional, and it must follow these general rules:
must be composed of nothing but numerals and capital letters. It must be no more than eight characters long. It must begin with a letter of the alphabet.
1. It 2. 3.
36
Numeric Constants A numeric constant is some fixed numerical value. Here are a few numeric constants that are expressed in rather familiar forms: 23
- 212
1.6888
9.9999
1432000
Numeric constants can be very small or very large numbers, they can be positive or negative, and they can be whole numbers or numbers having decimal parts. just ordinary number values-that is all numeric constants are. There are a few special rules, limitations and forms of notation that apply to numeric constants in BASIC. For one, large numbers must not use commas in the conventional fashion; in fact they must not use commas at all. So if you wish to express a value of one million in BASIC, you must enter it as 1000000, and not as 1,000,000. In keeping with the usual arithmetic convention, negative-valued numeric constants are preceded by a minus sign, while positive values can be expressed with a plus sign or no sign at all. If you enter a PRINT -128 command, for example, ATARI BASIC will respond by printing - 128 on the screen. But if you enter a PRINT +128 command, BASIC will exercise the no-sign option and print 128. ATARI BASIC uses a number format called floatingpoint notation. Among other things, that means it expresses very large and very small values in terms of powers-of-10, or scientific notation. Very large numbers, in this context, are positive or negative numbers having more than nine digits to the left of the decimal point; and very small numbers are those between -0.01 and 0.01. To see how ATARI BASIC handles very large values, enter this command: PRINT 12345678901 and you will see this response:
1.2345678901
40
E+1 O
The same principle applies to fractional numbers. A constant such as 0.00123456789123456789 has 20 significant digits to the right of the decimal point. Eighteen of them are nonzero digits, so ATARI BASIC will treat the number as 0.00123456789 and display it as 1.23456789E-03. Summarizing the limitations and conventions required for numeric constants in ATARI BASIC: 0 Large numeric values must not include commas. O A negative sign ( - ) must precede a negative-valued constant, but a plus sign +) is optional for positivevalued constants (ATARI BASIC will always print positive values without the plus sign). 0 ATARI BASIC uses scientific notation for expressing very large and very small numeric constants. O ATARI BASIC will deal with only nine nonzero significant digits; any beyond that number will be set to (
zero.
String Constants Whereas numeric constants must be composed of meaningful numeric values, string constants can be constructed of any combination of letters, punctuation marks, special symbols and numerals. What’s more, string constants usually must be enclosed in quotation marks. The following BASIC statement prints a string constant, HELLO:
PRINT "HELLO"
The string constant in that instance is composed entirely of upper-case letters of the alphabet and, as is usually the case, the constant is enclosed in quotation marks. When you execute that PRINT command, however, you will see ATARI BASIC printing HELLO without the quotes. As implied earlier, a string constant can be built from all sorts of letters and punctuation. For example: PRINT "Hello,
42
there, you silly goose!"
NOTE: There is
a special string constant that contains no characters whatsoever. It is defined by a pair of successive quotation marks, '”’, and is called the null string.
Summarizing the rules and limitations for expressing string constants:
0
most instances, string constants must be enclosed quotation marks. (The special exceptions will be described in later discussions.) 0 String constants may be composed of any characters except a quotation mark. 0 Numerals appearing within a string constant are treated as literal characters rather than numeric values. I The recommended maximum length of a string constant is 130 characters. In
in
BASIC VARIABLES AND VARIABLE NAMES Most arithmetic and control operations in BASIC make reference to variables and, particularly, variable names. A variable is an expression that can take on a wide variety of different values-values that are assigned to variables through the normal execution of a program. A variable name is a set of one or more alphanumeric characters that you, the programmer, devise yourself according to a few simple rules. NOTE: ATARI BASIC allows up to 128 different variables to be used through the execution of a program.
BASIC uses two kinds of variables: numeric variables and string variables. The following discussions point out their differences.
44
3.
Numeric variable names should not include the words shown in the Reserved Word List, Chart 2-1. (Although ATARI BASIC will usually accept variable names from the Reserved Word List, there are many instances where such names will cause an Errorinterrupt during the execution of a program.)
Chart 2-1. ATARI BASIC Reserved Words List ABS ADR AND
RESTORE
IF
INPUT INT
ASC
RETURN RND RUN SAVE
CLOSE
LEN LET LIST LOAD LOCATE LOG LPRINT
CLR
NEW
SOR STATUS
COLOR COM CONT
NEXT
STEP
NOT NOTE ON OPEN
STICK STRIG
OR PADDLE PEEK PLOT POINT
END ENTER EXP FOR FRE GET
THEN TO TRAP USR VAL
POKE
XIO
GOSUB GOTO GRAPHICS
RAD READ REM
ATN BYE CLOAD CHRS CLOG
COS CSAVE DATA DEG DIM
DOS DRAWTO
SETCOLOR SGN SIN
SOUND
STOP STR$
POP POSITION PRINT PTRIG PUT
These words should not be used as variable names, nor should they appear within variable names. It is possible to break that rule in many instances, but a wise programmer will avoid the risks involved. NOTE:
Here are some examples of valid numeric variable names: TRY
46
AXIS
MODEL1
NAMESFROMTABLE100
There has to be at least one valid character and a dollar sign in a string variable name, but the maximum number of characters is limited only by the ability to fit the name into the lines of BASIC programming that use it. 4. String variable names should not include the words shown on the Reserved Word List, Chart 2-1. (Like some numeric variable names, ATARI BASIC will often accept variable names from the Reserved Word List, even when appended with a dollar-sign symbol; but the risk of causing an Error-interrupt during the execution of a program makes it unwise to use such names.) Here are some examples of valid string variable names: 3.
TRY$
AX|S$
MODEL1$
NAMESFROMT/\BLE`l0$
And here are some invalid string variable names: NYS
lTRY$ DARUNG-SETS MlX$lV|0NEY$ CHRS SALT
(uses lower-case letters) (begins with a numeral) (includes punctuation) (includes $ as punctuation) (uses a reserved word) (does not end with S)
NOTE: All string variables must be DIMensioned before they are used in a program. See DIMENSIONING String Variables and Numeric Arrays.
DIMENSIONING STRING VARIABLES AND NUMERIC ARRAYS
statement is always important for setting the DIMension of numeric and string variables. It is especially important in ATARI BASIC because it is required for establishing the maximum length of constants that are assigned to every string variable in the program. The DIM statement also sets up subscripted numeric variables and multidimensional numeric arrays. ln spite of appearances to BASIC’s DIM
48
Line 10 dimensions string variable NA$ for a maximum of 5 characters, but line 20 assigns a string constant that has
characters in it. When line 30 prints the current string constant that is thus assigned to NAS, it will show only the first 5 characters: SOMET. In actual practice, it is often inconvenient, and sometimes impossible, to determine the maximum number of characters that will ever be assigned to a given string variable. The temptation in such instances is to go overboard, and dimension the variable at some large figure; say, DIM X$(200). That should be avoided wherever possible, however, because the dimensioning operation reserves memory space for the string characters; and using needlessly large dimensioning values uses up memory that might be put to better use. Incidentally, a CLR statement within a program clears all previous dimensioning specifications. That can, in effect, make it possible to redimension a string variable during the course of a program. But CLR makes it necessary to redimension all string variables to be used and sets the DATA pointer to the first item in the lowest-numbered data list. In other words, the notion of using a CLR statement to redimension a variable during the execution of a program is of questionable value. Summarizing the procedures for dimensioning string 9
variables:
0 All string variables must be dimensioned with regard to the maximum number of characters they can
handle.
0 String variables must be dimensioned prior to using
them, generally gramming.
in
one of the first lines of pro-
0 String variables cannot be dimensioned more than one time during the execution of a program unless a CLR statement is first used to zero-dimension all pre-
viously dimensioned variables.
50
The idea is to indicate the sum of four different numeric variables that are closely related, but are able to take on different numeric-constant values. Because BASIC does not use subscripted characters, it is necessary to indicate
those characters within parentheses. Here form of the “textbook” equation just cited:
is
the BASIC
Y=X(1 )+X(2)+X(3)+X(4) A program cannot refer to such subscripted numeric variables in ATARI BASIC without first dimensioning them with regard to the largest-value subscript you intend to use. So before it is possible to execute that BASIC statement, the program must include a DIM X(4) statement. The general form of a subscript dimensioning statement ns:
DIMnumvar(d)
where numvar is any valid numeric variable name, and d is the largest subscript index to be used. Thus a typical line of programming for dimensioning several subscripted numeric variables might look like this: 10 DIM X(3), FE(20), YY(9)
That one will dimension subscripted variable
X for four variables-X(0) through X(3). By the same token, it dimensions FE for subscripted variables FE(0) through FE(20), and YY for YY(0) through YY(9). The following program prompts you to enter four different numbers. After that, it displays the four numbers, their sum, and their average. In this particular case, the numeric values are assigned to subscripted variables N(0) through N(3) by means of INPUT and assignment state-
ments within a FOR NEXT loop. It can be very helpful to realize that the execution of a RUN command automatically sets any subscripted numeric values to zero. That eliminates the need for zeroing them as one of the first steps in a program. .
52
_
.
The next program lets the user enter two different words, prints them in alphabetical order, and asks whether or not the user wants to do the whole operation again.
10 DIM K$(1),X$(10),Y$(10) 20 PRINT "ENTER A WORD "; 30 INPUT XS 40 PRINT "ENTER A SECOND WORD "i 50 INPUT YS 60 IF XS > =YS THEN PRINT YSZPRINT XSZGOTO 80 70 PRINT XSZPRINT YS 80 PR|NT:PRINT "DO AGAIN (Y/N)"; 90 INPUT KS 100 IF KS="N" THEN END 110 PRlNT:PRlNT:GOTO 20 Program lines 20 through 50 prompt the user to enter two words and, in the process, the statements assign those words to X$ and Y$. The conditional statement in line 60 compares the two words; and if XS occurs later alphabetically, or is identical to YS, the program prints YS followed by X$. But if the relational condition in line 60 is not satisfied, the program executes line 70 to print XS followed by Y$.
As mentioned earlier in this discussion, there is something more to using strings with relational operators than looking at alphabetical arrangements. BASIC actually looks at the strings in terms of the ATASCII code number for each character. (ATASCII is an acronym for ATari ASCII; and ASCII is an acronym for the standard charactercoding format, American Standard Code for Information Interchange.) Table 2-3 shows the ATASCII code numbers for the characters most relevant to this discussion; and a complete listing appears in Appendix B.
60
' '
Table 4-14. Starting and Ending Addresses for Each Row of the Mode-4 Screen RAM Row Row O Row 1 Row 2 Row 3 Row 4 Row 5 Row 6 Row 7 Row 8 Row 9 Row 10 Row 1 1 Row 12 Row 13 Row 14 Row 15 Row 16 Row 17 Row 18 Row 19 Row 20 Row 21 Row 22 Row 23
Addresses
Start 40320 40330 40340 40350 40360 40370 40380 40390 40400 40410 40420 40430 40440 40450 40460 40470 40480 40490 40500 40510 40520 40530 40540 40550
End
40329 40339 40349 40359 40369 40379 40389 40399 40409 40419 40429 40439 40449 40459 40469 40479 40489 40499 40509 40519 40529 40539 40549 40559
Addresses
Row
Row 24 Row 25 Row 26 Row 27
Row 28 Row 29 Row 30 Row 31
Row 32 Row 33 Row 34 Row Row Row Row
35 36 37 38
Row 39
Start 40560 40570 40580 40590 40600 40610 40620 40630 40640 40650 40660 40670 40680 40690 40700 40710
End
40569 40579 40589 40599 40609 40619 40629 40639 40649 40659 40669 40679 40689 40699 40709 40719
Text window begins here
Row Row Row
O
Row
3
1
2
40800 40840 40880 40920
40839 40879 40919 40959
THE 2-COLOR MODE-8 SCREEN
The Mode-8 screen offers the highest resolution of all. It uses the same 8-bit screen-data format as Modes 4 and 6 (see Fig. 4-38), the same graphics commands, and the same general 2-color scheme. Aside from the higher level of resolution, the only difference between the Mode-8 and other 2-color modes is the organization of the two color
registers.
216
°- - i-
Table 4-1 6. Starting and Ending Addresses for Each Row of the Mode-20 Screen RAM Row Row Row Row Row
0 1
2 3 Row 4 Row 5 Row 6 Row 7 Row 8 Row 9 Row 10 Row 11 Row 12 Row 13 Row 14 Row 15 Row 16 Row 17 Row 18 Row 19 Row 20
Row 21
Row 22 Row 23
Addresses Start End 40320 40329 40330 40339 40340 40349 40350 40359 40360 40369 40370 40379 40380 40389 40390 40399 40400 40409 40410 40419 40420 40429 40430 40439 40440 40449 40450 40459 40460 40469 40470 40479 40480 40489 40490 40499 40500 40509 40510 40519 40520 40529 40530 40539 40540 40549 40550 40559
Row
Flow 24 Row 25 Row 26
Row 27 Row 28
Row 29 Row 30 Row 31 Row 32 Row 33 Row 34 Row 35 Row 36 Row 37 Row 38 Row 39 Row 40 Row 41 Row 42 Row 43 Row 44
Row 45 Row 46
Row 47
Addresses
Start 40560 40570 40580 40590 40600 40610 40620 40630 40640 40650 40660 40670 40680 40690 40700 40710 40720 40730 40740 40750 40760 40770 40780 40790
End
40569 40579 40589 40599 40609 40619 40629 40639 40649 40659 40669 40679 40689 40699 40709 40719 40729 40739 40749 40759 40769 40779 40789 40799
Fig. 4-39 shows that the Mode-8 colors refer to register 1 and 2. This can cause some difficulty when working with the text-window versions, because adjustments in the graphics color will affect the luminance of the textwindow characters and both portions of the screen have the same background color. When adjusting the Mode-8 graphics color, you have two options:
SETCOLOR 1,hue,/um
and
POKE
709,16*/um + hue
Conveniently, you can PLOT that color by first execut1 statement.
ing a COLOR
218
Table 4-1 7-cont. Starting and Ending Addresses for Each Row of the Mode-22 Screen RAM Addresses
Row Row 72
Row 73 Row 74 Row 75 Row 76 Row 77
Row 78 Row 79
Row 80 Row 81
Row 82 Row 83
Msa
Start 40320 40340 403 60
40380 40400 40420 40440 40460 40480 40500 40520 40540
40339 40359 40379 40399 40419 40439 40459 40479 40499 40519 40539 40559
Addresses
Row
End
Row 84 Row 85 Row 86
Row 87 Row 88
Row 89 Row 90 Row 91 Row 92 Row 93
Row 94 Row 95
Start
End
40560 40580 40600 40620 40640 40660 40680 40700 40720 40740 40760 40780
40579 40599 40619 40639 40659 40679 40699 40719 40739 40759 40779 40799
SCREEN DATA BYTE
Lsa
an VALUE
P|XEL,0’1{2'3|4,5|i|_Ll '* '* '* '*
"
"
LEFT
0 1
RIGHT
EQu|vA|_ENT COLOR VALUE COLOR 0 COLOR 1
REG|sTEn USED 4 0
Fig. 4-38. Organization of screen data bytes for Modes 4, 6, and their
variations.
But when it comes to the background color, you must SETCOLOR or POKE the information by designating register 2; and then use a COLOR 0 statement to access it.
220
Table 4~1 8-cont. Color Register Sequences and Screen Data Bytes for 8-Pixel/ Bit Screens (Modes 4,6,8, and Their Variations) (Left ----------- Right) 0 0
Data 32 33 34 35
O
0 0 0
O
O
1
O
0 0 0 0
O
0
1
O
0
1
O
0
O
1
O
O
1
O
1
1
O
1
0
0 0
1
O
1
1
1
1
36 37 38 39
1
0
O
0
40
1
O
0
1
41
1
O
1
1
0 O
0 0 0 0 0 0 0 0 O
1 1
0 0
0 0 0
0
O
O
0
1
1
0
1
1
0 0
O
0
1
O
1
0
1
O
1
O
1
0 0
O
1
0
1
1
0
0
O
1
O
1
1
O
1
1
1
1
0
1
1
1
1
0 0 0
0 0 0
0 0
0
1
0
48 49 50
O
O
1
1
51
1
O
0
0
1
0 0
0 0 0
0 0
O O O
0 0
0
1
1 1
0 0 0
0 0
1
1
1
1
O
1
1
O
1
1
1
1
1
1
1
0 0
1
42 43 44 45 46 47
1
52 53
O
1
1
O
1
1
O
O
54
O
1
1
O
1
1
1
55
0
O
1
1
1
O
O
1
1
1
0 0
0 0
0
0 0
0
O
1
1
1
O
1
1
1
0
0
1
1
1
56 57 58 59
0 0
0 0
1
1
1
1
0
0
60
1
1
1
1
O
1
61
O
O O
1
1
1
1
1
O
1
1
1
1
1
1
0
222
1
62 63
Table 4-1 8-cont. Color Register Sequences and Screen Data Bytes for 8-Pixe|/ Bit Screens (Modes 4,6,8, and Their Variations) (Left -------~--- Right) O
0 0 0 0
0
1
0 0 0
1
1
O
0 0 0 0
0
1
1
0
1
O
1
1
O
1
1
1
1
1
1
1
1
1
O
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
O
1
O
0 0 0 0 0
0 0 0 0
Data 0 0 0 0
O O
0
0 0
0
0
1
1
O
97 98
1
1
99
1
O
0
100
1
0
1
101
1
1
0
1
1
1
O
O
0
1
1
O
1
1
1
0 0 0 0
1
1
0
0
1
1
O
1
1
96
O
102 103 104 105 106 107
0 0 0 0
1
1
1
0
108 109 110
1
1
1
1
111
1
1
O
O
O
0
1
1
1
O
1
O
1
1
1
1
1
1
0 0
0
0
0 0 0
112 113 114 115
1
1
1
0
1
1
1
1
O
1
1
1
1
1
1
1
1
1
1
1
1
1
O
1
1
0
1
1
0 0
0 0 0 0 0 0
O
0 0
1
O
1
1
0 0
0 1
1
1
0
1
1
1
1
O
O
O
0
120
1
0
1
121
1
1
O
1
0
1
1
O
1
1
1
1
1
1
1
0
O
O
1
1
1
1
1
O
1
O
1
1
1
1
1
1
O
O
1
1
1
1
1
1
224
116 117 118 119
1
122 123 124 125 126 127
Table 4-1 8-cont. Color Register Sequences and Screen Data Bytes for 8-Pixe|/ Bit Screens (Modes 4,6,8, and Their Variations) (Left ----------- Right) 1
O
1
1
O
1
O
1
1
O
1
1
O
1
0
1 1
Data
O
O
O
O
0 0
0
O
0
160
1
161
O
0 0
1
O
0
0
O
1
1
1
O
0
1
0
O
1
O
O
1
O
1
O
1
O
O
1
1
O
0
0
0
1
1
1
1
1
O
1
O
1
O
0
O
1
1
0
0
1
O
1
1
162 163 164 165 166 167
1
0 0
1
O
1
O
168 169 170
1
O
1
O
1
1
171
O
1
O
1
1
O
O
O
1
O
1
1
O
1
1
O
1
O
1
1
1
O
1
O
1
O
1
1
1
1
1
O
1
1
1
1
O
0 0
0
1
O O
O O
O
1
1
1
1
O
O
1
1
O O
O
1
0
1
1
1
0
1
1
O
1
O
O
O
180
1
1
1
O
1
O
1
181
1
O
1
1
O
1
1
O
1
O
1
1
O
1
1
1
1
O
1
1
1
O
O
O
1
O
1
1
1
O
O
1
1
O
1
1
1
O
1
O
1
O
1
1
1
O
1
1
1
O
1
1
1
1
O
0
O
1
1
1
1
1
O
1
1
O
1
1
1
1
1
O
188 189 190
1
O
1
1
1
1
1
1
191
1
0 0
1 1
1
226
1
172 173 174 175 176 177 178 179
182 183 184 185 186 187
Table 4-1 8-cont. Color Register Sequences and Screen Data Bytes for 8-Pixe|/ Bit Screens (Modes 4,6,8, and Their Variations) (Left ---------~- Right)
Data
0 0 0
0 0
0 0
0 0
O
O
1
1
O
0
0
O
1
1
227
1
1
O
O
0
228
1
1
1
1
1
1
0
229 230
1
1
1
0 0 0
0
1
0 0 0 0
1
1
1
1
1
231
1
1
1
O
1
O
O
1
1
O
1
0
0
1
O
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1 1
0 1
1
224 225 226
1
O
1
0
1
O
1
1
232 233 234 235
0
1
1
236
1
1
1
0
0 0
0
O
1
1
1
0
237 238
1
1
O
1
1
1
1
239
1
1
1
1
O
1
1
0 0
240
1
1
241
1
1
1
1
1
1
1
1
0 0 0 0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
O
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1 1
228
0 0
0 0 0
1
1
0
1
1
242 243
0 0
0
244
1 1
1
O
1
1
1
247
0 0
0 0
0
248
1
249
1
O
1
250
1
1
0
0
1
1
251
1
1
1
1
1
1
1
1
0 0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
0 0 0
1
1
O 1
245 246
252 253
254 255
3
O
QQ
fiis llll EE 3
U,
,_
llll llll llll llll llll llll llll llll llll IIII Illl llll llll llll llll llll llll llll llll llll llll |||| :nun llll :ilu llll llll llll llIl llll llll llll n||| llll llll |||| llll llll llll
”
/ O
O
3 Qi' _
Mousamdvus
ZW
CV
(0
I0
F) F) FJ
v-
F) U1 CV
N (V ID
N C9
N EG
2 l\ vI0 vF) Q-
vvU3
|\ ID
F) Q-
O
i- ;
Table 4-1 9. Starting and Ending Addresses for Each Row of the Mode-8 Screen RAM Row Row 0 Row 1 Row 2 Row
3 4 5 6 7 Row 8 Row 9
Row Row Row Row
Row 10 Row 11 Row 12 Row 13 Row 14 Row 15 Row 16 Row 17 Row 18 Row 19 Row 20
Row Row Row Row
21
22 23 24
Row 25
Row 26 Row 27 Row 28 Row 29 Row 30
Row 31 Row 32 Row 33 Row 34 Row 35
Row 36 Row 37 Row 38 Row 39
Row 40 Row 41
232
Addresses Start End 33104 33143
33144 33184 33224 33264 33304 33344 33384 33424 33464 33504 33544 33584 33624 33664 33704 33744 33784 33824 33864 33904 33944 33984 34024 34064 34104 34144 34184 34224 34264 34304 34344 34384 34424 34464 34504 34544 34584 34624 34664 34704 34744
33183 33223 33263 33303 33343 33383 33423 33463 33503 33543 33583 33623 33663 33703 33743 33783 33823 33863 33903 33943 33983 34023 34063 34103 34143 34183 34223 34263 34303 34343 34383 34423 34463 34503 34543 34583 34623 34663 34703 34743 34783
Row Row 42 Row 43 Row 44 Row 45 Row 46 Row 47 Row 48 Row 49 Row 50 Row 51 Row 52 Row 53 Row 54 Row 55 Row 56 Row 57 Row 58 Row 59 Row 60 Row 61 Row 62 Row 63 Row 64 Row 65 Row 66 Row 67 Row 68 Row 69 Row 70 Row 71 Row 72 Row 73 Row 74 Row 75 Row 76 Row 77 Row 78 Row 79 Row 80 Row 81 Row 82 Row 83
Addresses
Start 34784 34824 34864 34904 34944
34984 35024 35064 35104 35144 35184 35224 35264 35304 35344 35384 35424 35464 35504 35544 35584 35624 35664 35704 35744 35784 35824 35864 35904 35944 35984 36024 36064 36104 36144 36184 36224 36264 36304 36344 36384 36424
End
34823 34863 34903 34943 34983 35023 35063 35103 35143 35183 35223 35263 35303 35343 35383 35423 35463 35503 35543 35583 35623 35663 35703 35743 35783 35823 35863 35903 35943 35983 36023 36063 36103 36143 36183 36223 36263 36303 36343 36383 36423 36463
--- _-li
Table 4-20. Starting and Ending Addresses for Each Row of the Mode-24 Screen RAM Addresses
Row Row Row Row Row Row Row Row Row Row Row Row Row Row Row
Row Row Row
Row
O 1
2 3 4 5 6 7 8 9
10 11
12 13 14 15 16 17 18 19
Row Row Row 20
Row 21 Row Row Row Row
Row Row Row Row Row Row Row Row Row Row
236
22 23 24 25 26 27 28 29 30 31
32 33 34 35
Start
End
33104 33144 33184 33224 33264 33304 33344 33384 33424 33464 33504 33544 33584 33624 33664 33704 33744 33784 33824 33864 33904 33944 33984 34024 34064 34104 34144 34184 34224 34264 34304 34344 34384 34424 34464 34504
33143 33183 33223 33263 33303 33343 33383 33423 33463 33503 33543 33583 33623 33663 33703 33743 33783 33823 33863 33903 33943 33983 34023 34063 34103 34143 34183 34223 34263 34303 34343 34383 34423 34463 34503 34543
Row
Row Row Row Row Row
36 37 38 39 40
Row 41 Row 42 Row 43 Row 44 Row 45
Row 46 Row 47
Row 48 Row 49 Row 50
Row 51 Row 52
Row 53 Row 54 Row Row Row Row Row Row Row Row Row Row Row Row Row Row Row Row Row
55 56
57 58 59 60 61
62 63 64 65 66 67 68 69 70 71
Addresses
Start
End
34544 34584 34624 34664 34704 34744 34784 34824 34864 34904 34944 34984 35024 35064 35104 35144 35184 35224 35264 35304 35344 35384 35424 35464 35504 35544 35584 35624 35664 35704 35744 35784 35824 35864 35904 35944
34583 34623 34663 34703 34743 34783 34823 34863 34903 34943 34983 35023 35063 35103 35143 35183 35223 35263 35303 35343 35383 35423 35463 35503 35543 35583 35623 35663 35703 35743 35783 35823 35863 35903 35943 35983
DOS RAM USAGE: 1792-10879 If DOS is not active in the ATARI system, BASIC programming information will normally begin at address 1792. Booting DOS, however, fills at least 9088 bytes of system RAM with DOS and file-management programming. As indicated in Chart 8-5, that programming begins at address 1792 and extends to 10879, or to the current LOMEM setting. That being the case, BASIC programming picks up from the end of the DOS area.
Chart 8-5. DOS Usage of System RAM: 1 792-1 0879. or LOMEN
$0700-$12FF 1792-4863 File-management RAM area; 3072 bytes.
$1300-$267F
4864-9855
DOS operating system RAM area; 4992 bytes.
$2680-$2A7F 9856-10879 DOS I/O buffers; 1024 bytes.
BASIC ROM AREA:
40960-49151
The ATARI BASIC cartridge overlays any RAM that might be present in the area that it uses. Chart 8-6 offers a map of that section of the memory map.
Chart 8-6. BASIC ROM AREA: 40960-491 51 $AO00-$A04C
40960-41036
$A04D-$A05F
41037-41055
BASIC cold start routine.
BASIC warm start routine.
338
Chart 8-6-cont. BASIC ROM Area: 40960-491 51 SB916-$B9B6 47382-47542 Error-handling routines. $B9B7-SBA74
47543-47732
Graphics-handling routines. SBA75-SBDA4
47733-48548 l/O-handling routines. SBDA5-SBFF9
48549-49145
Trigonometric function routines.
SBFFA-SBFFB 49146-49147 Left cartridge start address. $BFFC
49148
Left-cartridge installed byte: 0 = cartridge installed nonzero = cartridge not installed SBFFD-49149 Purpose is unclear. $BFFE-$BFFF
49150-49151
Cartridge initialization address; jump point after executing SYSTEM reset under BASIC.
HARDWARE I/O ROM AREA: 53248-55295 Chart 8-7 gives an overview of the hardware I/O ROM area. This is regarded as ROM only in a casual sense. Some addresses are devoted to RAM-like read/write operations; the practical difficulty, from a programmer’s point of view, is that such areas are available for write operations only during the screen’s vertical retrace interval.
Chart 8-7. Hardware I/O ROM Area: 53248-55295 SDOOO-SDOFF $D100-$D1 FF
$D200-SDZFF $D300-$D3FF $D400-$D5FF $D600-$D7FF
340
53248-53503 53504-53759 53760-54015 54016-54271 54272-54783 54784-55295
CTIA (or GTIA)
Unused POKEY PIA
ANTIC
Unused
Chart 8-8-cont. CTIA (or GTIA) I/O Map Detail: 53248-53503 SDOOD
Shape
of
53261 player O/player
GRAFPO/P1 PL
1
player collision.
53262 GRAFP1/P2PL Shape of player 1/player 2 player collision. SDOOE
53263 GRAFP2/P3PL Shape of player 2/player 3 player collision. $DO0F
$D01O
Shape
53264
of
player 3/joystick
SDO11
Shape of
all
O
trigger.
53265 missiles/joystick
GRPFP3/TRIGO GRAFM/TRIG1
1
trigger.
$DO12 53266 COLOPMO/TRlG2 Color of player and missile O/joystick 2 trigger.
$D013
53267
COLOPM1/TRlG3
Color of player and missile 1/joystick 3 trigger.
SDO14 53268 COLOPM2/PAL Color of player and missile 2/European TV sync. flag. SDO15 53269 Color of player and missile 3.
COLOPM3
$DO16 53270 Color of playfield 0.
COLPFO
$D017
53271
COLPF1
$DO18 53272 Color of playfield 2.
COLPF2
SDO19 53273 Color of playfield 3.
COLPF3
$DO1A 53274 Color of background.
COLBK
Color of playfield 1.
$DO1 B
53275
PRIOR
Figure priority-select; determines whether located behind or in front of another.
342
a
figure is to be
Chart 8-9-cont. POKEY Map Detail: 53760-5401 5 SD204 53764 Audio voice 3 frequency/paddle
2
AUDF3/POT4 setting.
$D205 53765 AUDC3/POT5 Audio voice 3 volume and distortion/paddle 5 setting.
$D206 53766 AUDF4/POT6 Audio voice 4 frequency/paddle 6 setting. SD207 53767 AUDC4/POT7 Audio voice 4 volume and distortion/paddle 7 setting.
$D208 53768 AUDCTL/ALLPOT Audio voice master control/ all paddles. $D209 53769 STIMER/KBCODE Start POKEY timers/ keyboard latch. SD20A
53770
Random-number counter/register. $D20B 53771 Read paddles flag. $D20C Not used. $D2OD
RANDOM
POTGO
53772
53773 Serial I/O register.
SEROUT/SERIN
$D20E 53774 IRQEN/IROST Interrupt request enable and interrup I status FSQUBS( register. $D20F
53775 SKCTL/SKSTAT Serial control and status register; includes keyboard debounce, keyboard scanning, and serial port mode cont rol $D21O-$D2FF 53776-54015 Duplicate of $D200-$D2OF (53760-53775)
344
Chart 8~11-cont. ANTIC Map Detail: 54272 54303 SD405 54277 Vertical-scroll enable. SD406 Unused.
VSCROL
54278
$D407 54279 PMBASE Most-significant byte of the player/missile base address SD408
Unused. $D409
54280 54281
Text character bit map base address. $D4OA 54282 Wait-for-horizontal sync flag. $D4OB
54283 Vertical-scan line counter. $D4OC
VCOUNT PENH
54285
PENV
54286
NMIEN
Vertical position of light pen. $D4OE
WSYNCH
54284
Horizontal position of light pen. $D4OD
CHBASE
Enable nonmaskable interrupt.
$D4OF 54287 NMIRES/NMIST Clear interrupt-request, reset any nonmaskable interrupts. and return current interrupt status.
$D41O-$D41F 54288-54303 Duplicate of $D400-$D4OF 54272-54287
OPERATING SYSTEM ROM AREA:55296-65535 The uppermost section of the ATARI memory map is devoted to ROM operations for the operating system, itself. This section is common to both the 800 and 400 systems, and it is used whether a BASIC cartridge is installed or not.
346
Chart 8-1 2-cont. Operating System ROM Area: 55296-65535 SFOE3-$F3E3 61667-62435 Monitor handler routines. $F3E4-SFFFF 62436-65535 Display and keyboard handler routines.
348
Table 9-1. Summary of the 6502 Instruction Set as Organized by Op Codes Hex
Op code $00
Dec Op
0
BRK
1
ORA
$01
$02 $03 $04 S05 S06 $07 S08 $09 SOA SOB SOC SOD SOE $OF
S10 $11 $1 2 S1 3 $14 $15 $16 $17
$18 $19 $1A $1 B
$1C $1 D $1 E $1 F
350
_
"'“°'“°"'°
code
2
3 4 5
6 7 8 9 10
ORA ASL
PHP ORA ASL
1 1
12 13 14 15 16 17 18 1 9
ORA ASL
implied (indirect, x) not used not used not used zero page zero page not used implied
immediate accumulator not used not used absolute absolute not used
BPL
relative
ORA
(indirect),Y not used not used
20
JSR
21
ORA ASL
zero page,X zero page,X not used
CLC ORA
implied absolute,Y not used not used not used absolute,X absolute,X not used
22
23 24 25 26
27 28 29 30 31
ORA ASL
Table 9-1 -cont. Summary of the 6502 Instruction Set as Organized by Op Codes Op Code
Hex
OpDec Code
SCO SC1 SC2
SC6 SC7
192 193 194 195 196 197 198 199
SC8 SC9
201
SC3 SC4 SC5
SCA SCB SCC SCD SCE SCF
202 203
SDO SD1
208 209
SD2 $D3 SD4 SD5 SD6 SD7 SD8 SD9 SDA SDB SDC SDD SDE SDF
356
200
204 205
206 207
210 21
Mnemonic CPY
immediate
CMP
(indirect,X) not used not used
CPY
DEC
zero page zero page zero page not used
INY
implied
CMP
CMP DEX CPY
CMP DEC BNE
CMP
1
212 213
214 215 216
217 218
CMP DEC
CLD
CMP
219 220 221
222 223
CMP DEC
immediate implied not used
absolute absolute absolute not used
relative (indirect),Y not used not used not used zero page,X zero page,X not used implied absolute,Y not used not used not used absolute,X absolute,X not used
BNE Branch
on result not zero
Operation: Branch
if Z=O
Status register
(P)
NZCIDV Addressing Assembly Language Mode Format Relative
BPL Branch
BNE
Oper
Op Code
Hex
Dec Op Code
DO
208
Bytes 2
on result plus
Operation: Branch
if N=O
Status register
(P)
NZCIDV Addressing Mode
Relative
BRK
Assembly Language Format BPL
Oper
Op Code
Hex
Dec Op Code
10
16
Bytes 2
Forced break
Operation: Interrupt, PC+21PI Status register
(P)
NZCIDV ___-|__ Addressing Mode
Implied
362
Assembly Language Format BRK
Hex
Op Code O0
Dec Op Code O
Bytes 1
ROL Rotate memory or
Operation:
accumulator 1 bit to left L‘]l§ElE]El]E]
Status register Z *
*
Addressing Mode
Accumulator Zero Page Zero Page,X Absolute Absolute,X
Assembly Language Format ROL ROL ROL ROL ROL
C
_
Dec
Op Code
2A
Oper Oper,X Oper Oper,X
V
_
Hex
Op Code
A
(P)
D
I
*
C
Bytes
42 38 54 46
26 36 2E 3E
62
ROR Rotate memory or accumulator 1 bit to right
Operation
EEBHEHE
C
Status register
Addressing Mode Accumulator Zero Page Zero Page,X Absolute Absolute,X
374
Assembly Language Format ROR
A
ROR ROR ROR ROR
Oper Oper,X Oper Oper,X
(P)
N
Z
C
I
D
~k
-k
1-
_
_
V
Hex
Dec Op Code
6A
106 102 118
Op Code 66 76 6E 7E
1
10
126
Bytes
SEC Set carry flag Operation: 1 C
-
Status register
(P)
_-1___
N
Lrngutge
Mode
Format
Implied
SED Set
Z
C
’
D
I
V
I
Op Code
SEC
Op Code
38
W
56
1
decimal arithmetic mode
Operation:
1
-
D
Status register
(P)
-_-_1_
N
Addressing Mode Implied
SEI
Assembly Language Format SED
Z
C
Hex
Op Coda F8
D
I
V
Dec Op Code
Bytes
248
1
Set disable interrupt flag 1 ->I
Operation:
Status register
(P)
NZCIDV ___-|__ Addressing Mode Implied
376
Assembly Language Format SEI
Hex Op Code
78
Dec Op Code 120
Bytes 1
TAX
Transfer accumulator to
Operation:
A
-
X
Status register N *
Addressing Mode
TAX
C
I
D
V
'A'
_
_
_
_
AA
Transfer accumulator to
Operation:
A
-
Y
(P)
Z
Assembly Language' Hex Format Op Code
Implied
TAY
register
X
I
Dec ,Bytes Op Code 170
1
register
Y
Status register
(P)
NZCIDV *k* ____ Addressing Mode
Assembly Language Format
Implied
TSX
TAY
A8
Transfer stack pointer to
Operation:
Hex
Op Code
S
-
X
Dec Op Code 168
Bytes 1
register
X
Status register (P)
NZC|DV ar* ____ Addressing Assembly Language Mode Format Implied
378
TSX
Hex
Op Code BA
Dec Op Code 186
Bytes 1
I
LQS
'uga1sAs
Jaqumu gelugznap Sql punoge Aga/\gsn|;>xa BSPQJIJBI) W03 ;)|g\/Q |}1V_|_V 8L|1p9USgS9p /{aL|10s '1391 12111 10 age/me axe/vg sJaaug8ua ggvlv 'u1a1s/(S Jaqwnu (gg aseq) geugaap /(mu -gpgo aLg1 5191:-nd g|g1s u0g1e|nd0d |eJauaS 9L|1 ‘/(3uag3g10Jd 198.13 q1g/vg sgaqumu gewgaapexaq l.|1gM >gJ0/vg O1 uneag ues s1au.|\ueJ80Jd a8en8ue|-augL|:JeLu /(uew 'paapug ‘agggg/Vg °sJa13e1em.|J
gewgaapexaq 0/vu 1sn[ l.|)gM >|J0/v\ O1 agqgssod sg lg ‘Meugq Z-aseq ug sg pue sg 1L|S!3 10 s8ug11s Lg1g/v\ >g.|0/v\ O1 Bug/mg 10 pea1sug ‘og 'Jaqwnu gewgaapexaq a|8ugs e /(q pa1uasa1d -ax aq uea (agqqgu e paggea sau1g1au|0s) sxaqumu /(Jeugq m01 10 dn0.|8 AJBAB f.|f`lO} 10 sdn018 ug s.|aqLunu /(1eugq1e s>g00g Lua1sAs Jaqwnu (gg aseq) gewgaapexaq a|.|l's1aqLunu gewgoapexaq sg smqumu 10 SUO!1E1U8S9.Id3.| Meugq /(gamd O1 3A!1EU.|31|E au() 'awosgaqwna /(Ja/\ me ‘s|_ pun S0 10 /(ga/\gsn|3xa dn apew Sugaq ‘sgaqumu Lpng '19/\9MOL| ‘gga/vg pue >gugq1 10u op agdoad
Ma/\ sJaqLunu /(Jeugq
L|1g/vg
>|10/v\
'LU8L|1
10 91/(q ||n1 e.-sxaqumu Meugq 1gq-Q Lg1g/v\ s>g.|0/v\ (959 aq1 suaddeq os lg puv 'Lua1s/(s Jaqwnu ‘Meugq 10 ‘Z aseq su0g1eJad0 :>g80| pue ‘3g1awLg1g1e '|0J1u03 s1g 10 gge saop 1eLg1
e
ug
Jossaaoxdongw sg
(wa1s/(S
ZOSQ
ggvlv Sql
aq1 faugqaew /(Jeugq e /(ggegwassa /(gugeuaa) 1a1ndu10:> /(ue 1n0qe 1sn[
suogsxa/guog aseg \ua1s,(g-1aqlunN V
xgpuaddv
£85
'Luz->1s/Ls
|}|Vj_\/ am.|1 uo >|1o/v\ ;o nos |ensn aq1 ||e Jo; SUOQSJSA -uoa |ewpap-o1-|eu1g;>apexaq Jo; auanbape sg L-V a|qej_ |eLupap Jo ‘Q + 35; 0; |enba °|_ pue Z suum|oa asn1sn[ '§5L
sg'aaue1sug1o;'gj)5|ewpapexa|_| ‘Jaqwnu |ewpapexaq aJe|d-o/vu
e SULIJBAUOD me nof( ;|
'|e\.ug3ap Us sus 01 lenba Ss Jews '5P1°M 191110 UI 'sua 10 ‘SL + gp + OQSZ + 9607 ZS1U9|EA!I'\b9 |ewg;>ap asoq1 ppe ‘an|e/\ |eLupap ann eq; 193 O1 'uaql °A|a/\g13adsaJ ‘g|_ pue gp_L pue Z suLun|o9 mum; s1ua|e/qnba |ewpap 1gaL|11a8 sam8g; o/vu 1se| sql `0Q§Z_!u\.un|o:» Lum; an|e/\ aqx uo sa>|e1 1}B| eq; u1o1;Ja1Je1e\.|;> puoaas aql 95017-9 uwn|o9 ug umoqs
;ua|e/qnba |eu1pap e sa>|e1 1}9| Sql uo 1a1:>eJe\.p 1s1g; aq_|_ '|eLupap ozug :|g\/Lg 9I'I|EA |eu1g:>apexaq amp ua/\uoa 01 we/v\ nof( 1eq1 asoddns 'S)|JOM a|qe1 Sql M0l.| aas ol
O9
V
9L L
3 8
L L
Cl
3
7L SL
:I
9 Z
L
L
O7Z
3
7ZZ
77
V
O
0
L
L
Z
Z
96 08 79 87
S
9 9 7
9 9 7 8
ZL
L
L
6 8
OL
L L
L
0788
:I
G
8OZ Z6 L
7898
8Z!!
3 8 6 8
8Z L
6 8
XBH
O30
ZLOS
9 L8Z
099Z
70!Z 87OZ Z6L L
L
7ZOL
7
989 08Z
S
9
L L
89L
S.
ZS 9L 0
Z
XBH
:4
3 Cl
3 8 V
6 8 L
9 9 7 S
Z L9
Z
9§Z 0
L
0
030
L
0
OBCI
X3H
UOQSJSAUOQ
077 L9
77!L9 87Z!9 Z9 L67
:L
3 CI
O
99097 09607 79896
El
V
89LZ! ZL98Z 9L§7Z
6 8 L
9 9 7 8
0870Z 7869
L
88ZZ
L
Z6 L8
Z
9607
L
0
0
030
XBH
7 GSW
S
Z
L
ES1
a|qeJ_
|ewgoaq/|e\.ugaapexa|.| 'L-V
a|qe_|_
SSS
DISV8 P91U9!J0
-gewgoap ug SUO!1EI)O| ssaxppe dn 8ug11as go ned e ||e sg 1g 1nq ‘/(sea1‘usg uog1eJado ue qans ‘gewgaap ug '1e'w1o1a1/(q-Z e 01U! pa1;>a11e aq O1 ssmppe aq1 ua/\uoa O1 Agessaaau sg 1g o1ug sJaqwnu a1/(q-Z se sassmppe 8ug3)|()d uaq/VL
‘/(Jowaw
.L\'/W!:|O:| `l\'/WIOHG 3.|.A8°Z OJ. 1VWlO3CI 1VNOI.l.N3/\NOO
~san|e/\ |ewgaapexaq 01 sangen gemgoap Bugualxuog) ‘L-V 'BH LV
snavi 01 uaaau suaawnu Nwmoo*
hvwgoacgvxaul zmvs L
Z
=
(1vw|oac|> meer
Nwmoo NINITIOO
8 NWTTIOO
*P
NINFUOO
_L 'H zu
9l8Z _
LOEZSZ 7889i _
*"7L!6L
HBEWON `|VWIO3U
Z
L
E
7
lN3`|V/\|fID3 TVWIOBGVXEIH
‘uoguuado
am.|1 sazpewwns L-V 'SH 'Zggpg gewgaapexaq se amues aq1 sg pLg5L |eLug:Jap1e\.|11no sum11g '1aq1a8o1 S!l|1||B Sugnnd gewgaapexaq |eug1 amp os gewgaap ‘L uwngoa u.|o13'Z
°Z$
sg
J:->1aeJeq:>
fZ$|eu1g:>apexaL| se auges ang;
= ZLL _ #LL °pLL S!L{1
Z
-
01
puv
'Z
sg Z
Lum; ZLL ange/\ a|qe1aq113eJ1qns ‘Aggeugg -Zgpg sg Jaqumu geuugaapexaq aq1 ‘1ugod uedJa1uno9 geuggaapexaq s1g pue 'ZLL sg
sg
uumgoa Lum; ange/\ gewgaap Ja/v\o|-1xau
0!6Z¥0£6Z
WOJJ 9L9Z
sql °pLL =
9"|9/\ alqel W1 Uellqns
9LgZ
MON
ABE
'L 9 10 0 B .|sq;!s SU!B1UOI) suo!;e:>o| ;gq-9 ssoq; ;o q:>e§| 'uog;gsod ;gq ;ueJg}gu8gs-;ses| sq; 8ug;e3 -[pug oxsz l.|]!M '; q8noJq; 0 ps|sqe| sw suopgsod sql usq -umu Meugq ;gq-9 ue ;o u/v\op>|es.|q sq; SMOL|S Z-V 'SH 'sxsqwnu (;gq-9L) s;/(q-Z Lum; uogs -1s/\uo9 sq; op 0; /Uesssosu sg 1; usq/v\ suogseaao sJe sJsq; qSnoq;|e 's1sqwnu /Ueugq (;gq-9 Jo) s;,(q-L l.|],!M ;no psp SUOQSJSAUOI) |eLupsp-o;-/(Jeugq ;so\.u ‘sJg;:>eJd u|
-Jes sm
NOISE!/\NOO `|VWlO3C|'O.L'AU\'lN|9 '6bQ9Z |eu1psp o; s;ugod A||en;:>e p0|_ pue gg( s1squ.1nu |eu.|psp ;o uogeugqwoza sql 'ssn|e/\ |eLupsp s;Aq-Z |eu sq; ;o uog;e;usssJdsJ |BUO!1U9/\U03 sq;-1; s,;eq1 -g8gJo
61’99Z
=
SL
+ 80Z + 8VOZ + £9Si'Z = 89:|G$
:;1ed1s;uno3 |eu.|psp ||n; s;g o;ug Jsqwnu |ewg suop sq 0; sugem,usJ ;eq; ||V
-aspexsq ;eq; us/\uo;> 0;
sg
'89:lCI$
S!
;ew1o; |e\.upsp s;Aq-Z ;eq; ;o uog;e;usss1ds1 |eu1g:>spexsq H919/\0 Bl!! ‘QS1 941
S!
89$ PU? SSW 991
S!
=|G$ 93U!S '89$
= pg; |eu1psp pue gg; = gg; |eu.|g:>sp fs;1edJs;uno3 |ewg -aspexsq lgsq; o;ug s.|sq\,unu ;o s;ss q;oq IJSAUOD ‘;s1g:| g;usssJdsJ Asq; op ‘Jsqwnu |eLug;>sp 'asw alll Ss vm PUB ‘lvwsvap SIM;-z 1° 'SSSJPPH 12L|/v\
ug 351 sq; se dn sum; gg; slsq/v\ saumsug ue Jspgsuoj) ';gq e wsq; q;gM ,(e|d o; s/\eq noA ‘;euuo; |eu.|;:>sp |EUO!1U9/\U03 e o;ug sJsqLunu ;o Jged ;eq; ;sS 0; ;ue/v\ no/K ;g fsJsqu1nu |ewg:Jsp om; ;o ;ss e se smsdde sss1ppe s;,(q-Z e 'uoggpuoo ;eq; :spun °;eLu1o;3|gVg ‘ps1usg1o-|ewpsp e ug ps;usss1d sg ;eq; aug; -no; s8en8ue|-sugqaew e Bugz/(|eue sxe nof( ;eq; ssoddng
lVWHO:|
1VW|O3C| 'IVNOLLNE/\NOO Ol 'IVWIOEIG 3J.A8'OM.L
688 'qgg sg Jaqumu /(Jeugq1gq-gxeqmgo uogs -ga/\ gewgaapexaq ang; ‘agogagaql 's/vgoqs 5-V agqel se '1as
puoaas eq; go; Q pue '1BS1SJ!}9l.|1JO}6 sg 1ua|e/ggnba |eLug -Japexaq aLgl°|_0|_|,pue|_00g‘a1aL|(sa|qqgu Jo) s1gq 7 go S195 agaql '|_0|_LL00|_ sg Jaqumu /(geugq ang; asoddng o/vu age
OL
EIS
L L
:LS
GS OS
l
L
L L
L
OOL
l
LOL
0
VS
L
SS
LOL LOL
OOOL
88
LOOL
6S
OL LO
9S SS
LO
LS
VS
L L
LO L0
00
LO
L000
LS
L00 L00
O
ZS
L
SS
Axeugg
xa|.|
0000
OS
9|qB_l UOQSJQAUOQ |8l.U!09p9X9|-|/AJ9|.|!g ‘Q-V
L L
BVOZ
SL ZL
960V
VL
89LZ! V8!9L
agqel
SL
Z6 L8
Ol 6 8
VZOL Z LS
99Z
S
8
V
9L
S
8ZL V9 ZS
L
9
V
Z
Z
L
O
L
UZ
Z
U
4° 5-|9M°d 'Z'V 9|q9.L
L6£
;|!$
VZS
OOLOOLOO LLOOOLOO OLOOOLOO LOOOOLOO OOOOOLOO
9ZS SZS
OL LOOLOO LO LOO LOO
LLLOOOOO
/_ZS
LLLOOLOO
OLOLOOOO LOOLOOOO OOOLOOOO
OZS OZS SZS VZS 6ZS 8ZS
L LOLOLOO OLOLOLOO LOOLOLOO OOOLOLOO
:IZS BZS
LLLLOLOO OLLLOLOO
OSS
OOOOLLOO
LSS
LOOOL LOO
SES ZSS
OLOOLLOO
V!$
OOLOL LOO
SSS
LO LOL LOO
9!S
LLLOLLOO OLLOLLOO
8!S
OOOLLLOO
GSS
LOO
VSS
LLLLLLOO OLLLLLOO LOLLLLOO OOLLLLOO LLOLLLOO OLOLLLOO LOOL
L
L
LOOL LOO
LOL LOLOO OOL LOLOO
NIH
BSS GSS OES
SSS
LES
SZS ZZS LZS
OZS
XBH
LLLLLOOO OLLLLOOO LOLLLOOO OOLLLOOO LLOLLOOO OLOLLOOO LOOL LOOO
OOOLLOOO LLLOLOOO OLLOLOOO LOLOLOOO OOLOLOOO L
LOO LOOO
OLOOLOOO LOOOLOOO OOOOLOOO LLLLOOOO OLLLOOOO LOL LOOOO OOL LOOOO L
LO LOOOO
:ILS
LS GZ BZ
GLS
OS
3l$ OLS
SLS VLS GLS
SLS LLS
9L$ SLS VLS
LZ
9Z SZ VZ
!Z ZZ LZ
OZ
LL
LLS OLS
6L 8L
S LS ZLS
9L
L
LOS
6 8
60S 80S
OL
VL
BOS GOS DOS EOS VOS
SL
:LOS
EL ZL L L
S
SOS
LOLOOOOO OOLOOOOO LLOOOOOO OLOOOOOO LOOOOOOO OOOOOOOO
9
90S
OL LOOOOO
330
NIS
VOS
SOS ZOS LOS OOS
XBH
V
8 Z L
O
O30
gg; q6no.|\.|_|_ 0 same/\ |eLugaaq zo; 9Iq9.L 'U9U!8/|9W!°9P9X9H/|9W!°9Cl 'V'V 9lq9.|. '91/(q e1ep /(ue 01 /(|dde ||g/v\ aJaq umoqs san|e/\ 10 a8ue1 Sql 1nq ‘wa1s/(S mvlv aq1 10 a8ueJ /(Jowaw 9.l!1U9 aq1 101 SUOLSJBAUOJ aL|1 a1e|nqe1 O1 |e9g1:>eJdwg °anosaJ aq1 01 aluoa uea 9-V a|qej_ ‘SUOLSJBAUOD 10 10| e Bugop Jo111eaq ou a/\eq OL.|M sJapeaJ 103 1|
sg
Jaqumu
99Z‘0
TVWIOBCI 80:1
3`|8Vl NOISHHANOO 3.|.3`|dWO3
V
E68
11111101
01111101
:18S
161
11111001
01111001
LHS
11101101
981 981 781
68S 88S
00011101
11011001
L81
88S
10111001
061 681 881
10111101
00111101
11011101
01011101
10011101
01101101
10101101
00101101
38S OBS
OSS VHS
881 181
SEIS
Z81
98S
00111001 01011001 10011001
00011001 11101001
01101001 10101001
LL1
1E|S
01001001
10001101
6L1 8L1
00101001
081
78S 88S Z8$
01001101
11001101
00001101
11110101
01110101
10110101
00110101
11010101
01010101
10010101
SLL
:IVS BVS GVS DVS
9L1
08S
8V$ VVS
LVS
11100101
6VS 8V$
00010101 01100101
9V$
7L1 8L1 ZL1 1L1
0L1
691 891 L91
991 991 791 891 091
OVS
191
ZVS 1V$
10000101
7VS 8V$
11000101
SVS
10100101
00100101 01000101 00000101 NI8
a|qe_L
X3H
Z91
11001001
091 671 871
96S 96S 76S 86S
191
L6S
851 ZS1
66S 86S
991 S91 791
V6S
06S
L91
C|6S
691 891
36S
:|6S
86S
L71
871
:18S
11110001
971 971 771
06S
00001001
10001001
01110001 10110001
Z6S 16S
38S GSS
88S V8$ 68S 88S
00010001
08S
00110001 11010001
01010001 10010001 11100001
01100001 10100001
00100001 11000001
01000001 10000001 N18
O30
00000001
Z71 171
071 681 881 L81
981 781 881
98S 98S 78S 88S
981
LSS
Z8$ 18S
085
XEH
Z81 181
081 6Z1 8Z1 SHCI
gg; q6no.|q_l 0 san|e/\ |ewgoaq zo; Axeugg/|ewgaapexa|.|/|ewgoa(| 'IUOO-7-V 91991
S6£
°a.|npa9oJd 8ugzgua>|o1 3L|1}O uogssnasgp e 10; L Jmdeqj) SSS ‘SGPOD JSDBJBLP ||35V_|_V Ja8uo| se pa/\es aq ues Aamp Jo ‘;eu.uo; paw;/\aJqqe sgqx ug >|sgp Jo ade1a11asse:> uo pa/\es aq ues sweJ8o1d 3|gyg 'p1eoqAa>| sq; ww; paJa1ua an Amp se WV; ug pazgua>|o1 an IRQ) suopoun; pue ‘s.|o; -2.1:-ado ‘spueunuoa ;)|gVg |}|Vj_V eq; smoqs |_-g a|qej_ 'saweu a|qeg1e/\ se pasn aq ;ou 1sm.u 10; SPJOM P~=>~°S=->1 =~>\l1S1S!| L-a 11210 GSGLI1
'olsva mvlv
sua>|o1 pue SP-'OM P9’\-|3998 DISVH Il|V1.V
q xgpuaddv
L68
VSS
3/\VSf)
92S 98S
C|V0`IZ)
P9!ld\»U!
LES
(*91UAS)- HOHHEI
J.3'|
3.|.ON
SOLVLS
3/\VS GVO1 N3dO
H LS
V LS GLS
8
LS
Z LS
H10
EIZS
S LS
930
17
WIC]
OSS :IZS
9 9
GN3
LES
3.L\/301 HO`100l3S
SSS ZSS
.LN|Hd1 CINOOS
OLMVHCI
S00
MEIN
L LS LS LS LS
LOS
:ll
60S 80S
H0:|
VZS
J.X3N
SAE
\'/ZS SZS 8ZS LZS 9ZS SZS
:IOS
.LNOO
SZS
OLS
INOI)
SC)|Hd\'/HE)
LS
33013
OZS
.LOWd
CIZS
N0|J.|SOd
ind
135) Z
d0d dOiS NDH NUDLBH
32101838
OZS
lN|¥:!d
LZS
CI\'/H
SZS ZZS
CIVBH
3>|0d N0 OIX
J.N|0d
:I LS
3 LS G LS
3
LS
xa|.|
p.|oMAa)|
:Jag
dVUl
80805) Ol OD
0109
L
BOS CIOS
DOS
SOS VOS
90S
.L3`| H3_|.N3 .LS|`|
H0103
SOS VOS
OOS
WSU
SOS ZOS lOS
V.I.VCl
if`ldN|
|)JOMA9)|
xa|.|
:Jag
suaqol pueunuog sua>|o_|_ puewwog sua>|oj_ |eLugaapexa|.|/|ewg:JaC| .ngaql pue SP-'°N\'\9)l PUUWWUO OISVS II:lV.|.V 'L'8 9Iq9l
£07
z-mms
,.
H
..
l'_L:|IHS
zzs Lzs
_
ZLS
Li
ELS
§+L
soo
v LS
'}
V30
J.-1HJ.3
>LvN
n-win
NAS
A-'luis
ala
/v\-'Lum
Nvo
x-‘Lula
wa
A-'Lula
'ans
z-ww
asa
asa/asa
sa
--1u1:>/asa
S9
=~'|uL:>/asa
3 LS
_,_
su
+-‘Lula/asa
:ns
if;
sn
.-1L-no/asa
(aoeds)
Jag aoedg
L;_J
zoo
a-wir)
s-mio
|o.|1uo31o (s)a>|o.|;sAa)|
.|a19e.|eq;) IIOSV
035
Cl
*L
15
; ’1
Li FTW gur
0
a
LS
LS
LS
vLs 6Ls 8Ls LLs
I
II
9Ls 9Ls
; _
Jsggmqo
“V
19S 191991943 I|OSV.|.V IUVLV
°P°0
alll '1U00*
L
O
9|q91
501'
ws
>
>
=
-
|o.|1sAa)|
5'.‘ wwsmqo IIOSVLV
vss
apog
19S -|9199-'9'-IO |I3S\'/.LV |l:|V.|.V 9'-ll. '1U03-
I.
O
alqel
L07
0
u/v\o1
P
0 HMO1
995
Q
9
3 u/v\o1
99$
u.§.
;
auM01
:>
a u/v\o1
a.|eq3
6L 8L LL 9L
§L VL
SL
ZL LL
OL
69 89 L9
99 99 V9
9°
upon
WOH
mg 1e;:>amq3 |eu.|a;u| 'N-'99-Z'O 9Iq9l
9.W919AS IHVLV 9|-ll
Table C-2-cont. The ATARI System’s Internal Character Set Code
ROM Map Addresses
Character
Decimal
Hexadecimal
Start
End
Start
End
$50
57984
57991
SE280
SE287
81
$51
57992
57999
SE288
$E28F
82
$52
58000
58007
SE290
SE297
83
$53
58008
58015
SE298
$E29F
84
$54
58016
58023
$E2A0
$E2A7
85
$55
58024
58031
$E2A8
$E2AF
86
$56
58032
58039
$E2B0
$E2B7
87
S57
58040
58047
SEZB8
$E2BF
88
$58
58048
58055
$E2C0
$E2C7
89
$59
58056
58063
SE2C8
$E2CF
90
$5A
58064
58071
$E2D0
SE2D7
91
$58
58072
58079
$E2D8
$E2DF
92
$5C
58080
58087
SE2E0
$E2E7
93
$5D
58088
58095
SE2E8
$E2EF
94
$5E
58096
58103
$E2F0
$E2F7
95
$5F
58104
58111
$E2F8
$E2FF
Dec
Hex
80
422
!ZV
Pua
wus
:wa
61183
ooeas
Loses
aosas
aosas
96189
01896
ueas
S7189
8L!3$
911699
19189
ozeas
Lzsas
69189
azsas
azsas
A9189
ossas
Leeas
9L189
aesas
aeeas
68189
ovsas
Lveas
118189
16189
sveas
avsas
Z6L89
66189
09839
1.98219
LOZ89
89838
9969s
8OZ8S
91z89
09838
Lssas
91289
ezz89
8969s
=19sas
oLsas
Maas
8Lsas
#sas
6ez89 18z89
ii
VZZSQ
C*
z8z89
OOZ89
r__
o11
39S
111
ass
801
39S
‘{
601
69s
N
'pg
§"`
89S
v9s
LOL
901
.
|ewg:>epaxe|.|
LZl89
9L189
69s
If L;
89s
901 VOL
86
z9s
66
69s
.Zi
oo1
V98
91
LOL
99s
itJ
09189
o Ll!
89189
z9189 VVLBG
98189
I
w
"1
8Zl89
oz189
-2
z 1 L89
.|310B¢lBI.|Q
Les 99$
19s
09S
was
|su|g:>aq
X911
Jewemqg
sassezppv dew wgg
wg
5.'-1191558 IHVLV 9\|.|.
601
zo1
L6
96
390
9900
|eu1a1u|
'1U°°_Z°O alqel
Table
C-2-cont. The ATARI System's Internal Character Set
ROM Map Addresses
code Character Dec 12
1
Hex
$70
{:
Hexadecimal
Decimal
Start
End
Start
End
58240
58247
SE380
SE387
58248
58255
SE388
$E38F
{_-_ 113
$71
114
$72
‘{'°
58256
58263
SE390
SE397
115
$73
3 L_; ._
58264
58271
SE398
$E39F
116
$74
'L
58272
58279
$E3A0
$E3A7
17
$75
1_1
58280
58287
$E3A8
$E3AF
118
$76
‘-,J
58288
58295
$E3B0
$E3B7
119
$77
5.-'J
58296
58303
$E3B0
$E3BF
120
S78
:;.;:
58304
5831
$E3CO
$E3C7
121
$79
:ii
58312
58319
$E3C8
$E3CF
122
$7A
E
58320
58327
$E3DO
$E3D7
123
$78
58328
58335
$E3D8
$E3DF
124
$70
58336
58343
$E3E0
$E3E7
125
$70
58344
58351
$E3E8
$E3EF
126
$7E
58352
58359
$E3F0
$E3F7
127
$7F
59360
58367
$E3F8
$E3FF
1
='Z1_
"1 F"`1
I
424
‘T §
E
4 *
1
SZ?
°sapo9
amp ;o aauanbas |e:>g1amunu amp O1 Sugpmoae pazgue8.|o sg 1; 1nq 'uopeu.uo;ug amues amp s1sg| 9-Q a|qel °sapoJ |eu|g;> -apexaq pue |emug3ap Bugpuodsauoa pue a>|onsAa>| amp uopeuuo;ug amp 1sg| g-(1 m|8no.|mp L-Q sa|qe1
gU!M0l..|S /(q
'mua1s/(S |}|Vj_V amp
U!l..|1!M pa1eJaua8 Apuanbasqns axe zemp sapoa pue sa>|ons -/(a>| asomp 1sg| a.|am| UMOL|S sa|qe1 am|j_ °uop:>e p1eoqAa>| s1uasaJdaJ xemp apoa 1a1oeJem|9 sa:>npoJd sa>|oJ1s ;o uopeugqmuoa alepdmdde pue a>|oJ1sAa>| Ma/mg
zemp
me
-Aa>|
SGPOJ P1P°°|K=>>| luvmv (1
xgpuaddv
-li
Table D-1. Keystrokes and Corresponding Key Codes (Single-Key Operations) Key
Space Bar "
# $
% & ' ( )
*
+ .
-
/ O 1
2 3 4 5 6 7 8
426
Code Dec
Hex
32 33
$20
34 35 36 37 38 39 40
$22 $23 $24 $25 $26 $27 $28 $29
41
42 43 44 45 46 47 48 49 50 51
52
53 54 55 56
$21
$2A $2B $2C $2D $2E $2F
$30
Key
9 ;
< = >
Code
Dec 57
$39
58
S3A $3B
59
60 61
?
62 63
@
64
A
65
B C
66 67 68
D
E
69
F
70
G
71
H
72 73
I
$31
J
$32 $33 $34 $35 $36 $37 $38
K L
M N
O P O
Hex
74 75 76 77 78
79 80 81
$3C $3D $3E $3F $40 $41 $42 S43 $44 $45 $46 $47 $48 $49 $4A $4B $4C $4D $4E $4F
$50 $51
LZ?
36s 365
oss ses aes
GSL
8§l LSL L
99
L
99
VZL
oLs
LzL
'a Ls
9zL 9zL
cms
BLS
LZL
3Ls
ws 6Ls aLs
as 9Ls 9Ls vLs
us us LLS
oLs
39s
zzL LzL
ozL 61 L
8l ll
L
L
91
L
9 ll bl
L
9 Ll
z
Ll
LLL
6oL 8oL
39s
oL
39S
oss
L
seq __-____ xaH
9P°O
13s
an
Lu3sN| 313130 Nun13u
avi
s >|:>va HVETO
:>s3
ass
v9s 69s 895 L9s 99$
sas vss ass z9s
2 A X
M A L1
1
S 1
b d
0 U
w L
Ae)|
L9s
39s 39s
oss ass ass vss ess ass Lss 99s
1.0L
90L 9oL
ess vss ass zss
xa|.|
>L
I
L
ZOL
6
soL
u
VOL
P
ooL
9
LoL
es as L6 S6
vs as ze L6
oe
68
as L8
98
illl sa va
as za
aaq
°P°:J
(suogmxadg Aa)|-a|6ugg) sapog Aa)| Bugpuodsauog pus sa>|onsAa)| °1uo:J- |,-Q
v q 2
'
I
/ 1
z A
x M
/\
n 1
s
u Aa)|
a|qe_|_
Table D-2. Keystrokes and Corresponding Key Codes (CTR L-Key Operations) Code
Key CTRL-, CTRL-A CTRL-B CTRL-C CTRL-D CTRL-E CTRL-F
CTRL-G CTRL-H CTRL-I CTRL-J CTRL-K CTRL-L CTRL-M CTRL-N CTRL-O CTRL-P CTRL-O CTRL-R
Code
Ke
Dec
Hex
y
Dec
Hex
0
$00 $01
19
1
2 3 4 5 6 7 8 9
$02 $03 $04 $05 $06 $07 $08 $09
CTRL-S CTRL-T CTRL-U CTRL-V CTRL-W CTRL-X CTRL-Y
$13 $14 S15 S16 S17 $18 $19
10
SOA SOB SOC SOD SOE SOF
11
12 13 14 15 16 17 18
$10 $11
$12
CTR L-Z CTRLCTRLCTRLCTRLCTRL-_ CTRL-;
CTRL-2 CTRL-3 CTRL-DELETE CTRL-INSERT
20 21
22 23 24 25 26 28 29 30
$1 A $1 C
S10 $1 E
31
S1 F
96 123 253 155 254 255
$60
$78 SFD
S98 SFE SFF
operations that are not indicated here will generate the same codes as their non-CTRL counterparts. NOTE: CTRL-key
428
GZL’
DOS SGS VOS
6O$ 8OS
OZZ
6LZ 8 LZ L LZ
DVS
X
BVS OVS
Z ]
SVS VVS
M S W >| 3 O @ < 8 9
' ) ‘8 Z°'IH.L3 A"lU.|.3 X‘1¥:|J.3 M'1\:|l3 /\"|U.LfJ S"l!:|.L3 )|"\U.|.1`)
O'1l:|.|.D |ousAa)| -7-Q a|qe_|_
Table D-4-cont. Keystrokes and Corresponding Key Codes Arranged With Key Codes in Numerical Order C0d6
066
Hex
86 87 88 89 90
$56 $57 $58 $59
91
92 93 94 95 96 97 98 99 100
101
102 103 104 105 106 107 108 109 110
1 1 1
15 16 17
118 119 120 121
122 123 124 125 126 127 128
432
X
131
Y
132 133 134 135 136 137 138 139 140
\
1
_
CTRL-_
$61
a
$62 $63
b
$64 $65 $66 $67 $68 $69 $6A
$68 $6C
$60 $6E
$70
114
129 130
[
$60
$71
$72 $73 $74 $75 $76 $77 $78 $79 $7A
$78 $70
$7D
s7E $7F $80
Code 066 Hex
W Z
$5E $5F
$61=
13
v
$58 $50 $50
11
1
°Y
$5A
112
1
K
c
d
e f 9 h j
k I
m n 0 p q r
s 1
u v
w x y 1
CTRL-; CLEAR BACK s TAB CTRL-,
141
142 143 144 145 146 147 148 149 150 151
152 153 154 155 156 157 158 159 160 161
162 163 164 165 166 167 168 169 170 171
$81
$82 $83 $84 $85 $86 $87 $88 $89 $8A
$88
sac
$80 $8E $8|=
$90 $91
$92 $93 $94 $95 $96 $97 $98 $99 $9A
$98 $90 $90 $9E
$9|= SAO $A1
SA2 $A3 SA4 $A5 $A6 SA7 $A8 $A9 SAA SAB
K
°y
CTRL-A CTRL-8 CTRL-C CTRL-0 CTRL-E CTRL-P CTRL-G CTRL-H CTRL-I CTRL-.1 CTRL-K CTRL~L CTRL-M CTRL-N cTRL~0 CTRL-P CTRL-Q CTRL-R CTRL-S CTRL-T cTRL~u CTRL-V CTRL-W CTRL-X CTRL-Y CTRL-Z RETURN and CTRL 3 DELETE INSERT TAB
SET
space
!
"
#
%
'
$
&
( )
*
+
SH’
lH3SN|'1HlC) 313130-1uLo z-1u1:> I
2
sas
ssz vsz esz zsz LSZ
osz GVZ
9!Z
:Jas
sez
ovz 6ez
oss das aas
Las
1
A
~\
X
n
w
u |
L
>| F
L
Q
q 2
- P°w
6l M08 8l M08 Ll M08 9L M08 9 L M08 7 L M08 8L M08
Zl M08 L L M08 OL M08 6 M08 8 M08 L M08 9 M08 9 M08 7 M08 8 M08 Z M08 I, M08 0 M08
Mau
OISVB
luvlv 104 Svswppv °1n|°Sqv 'z-a
°|