M APPLE IC af — REFERENCE MANUAL oe) |1) —y-) J NOTICE described in this Apple Computer Inc. reserves the right to make improvements in the product manual at any time and without notice. This manual is copyrighted and contains proprietary information All rights ure reserved. This document may not, in copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine readable whole or part, be form without prior consent, in writing, from Apple Computer Inc “1979 by Apple Computer Ine. 10260 Bandley Drive Cupertine, CA 95014 (408) 996-1030 Reorder Apple product number A2LO001A (030-0004-01) Written by Christopher Espinosa “Apple” is a trademark of Apple Computer Inc BO DD 7 Apple II Reference Manual A REFERENCE MANUAL FOR THE APPLE II AND THE APPLE II PLUS PERSONAL COMPUTERS TABLE OF CONTENTS CHAPTER 1 APPROACHING YOUR APPLE 2 THE POWER SUPPLY 3 THE MAIN BOARD 4 TALKING TO YOUR APPLE 5 THE KEYBOARD 6 READING THE KEYBOARD 9 THE APPLE VIDEO DISPLAY 9 THE VIDEO CONNECTOR 10 EURAPPLE (50 HZ) MODIFICATION 10 SCREEN FORMAT 12. SCREEN MEMORY ee a rire 12 SCREEN PAGES 12 SCREEN SWITCHES 14. THE TEXT MODE MODE 17 THE LOW-RESOLUTION GRAPHICS (LO-RES) S) MODE 19 THE HIGH-RESOLUTION GRAPHICS (HI-RE 20 OTHER INPUT/OUTPUT FEATURES 20 THE SPEAKER 22 THE CASSETTE INTERFACE 23. THE GAME I/O CONNECTOR 23 ANNUNCIATOR OUTPUTS 24. ONE-BIT INPUTS 24 ANALOG INPUTS 25 STROBE OUTPUT 25. VARIETIES OF APPLES 25. AUTOSTART ROM / MONITOR ROM 26 REVISION @/ REVISION | BOARD 27 POWER SUPPLY CHANGES 27 THE APPLE Il PLUS CHAPTER 2 CONVERSATION WITH APPLES STANDARD OUTPUT THE STOP-LIST FEATURE BUT SOFT, WHAT LIGHT THROUGH YONDER WINDOW BREAKS! (OR, THE TEXT WINDOW) SEEING IT ALL IN BLACK AND WHITE STANDARD INPUT RDKEY GETLN ESCAPE CODES THE RESET CYCLE AUTOSTART ROM RESET AUTOSTART ROM SPECIAL LOCATIONS “OLD MONITOR” ROM RESET CHAPTER 3 THE SYSTEM MONITOR ENTERING THE MONITOR ADDRESSES AND DATA EXAMINING THE CONTENTS OF MEMORY EXAMINING SOME MORE MEMORY EXAMINING STILL MORE MEMORY CHANGING THE CONTENTS OF A LOCATION CHANGING THE CONTENTS OF CONSECUTIVE LOCATIONS MOVING A RANGE OF MEMORY COMPARING TWO RANGES OF MEMORY SAVING A RANGE OF MEMORY ON TAPE READING A RANGE FROM TAPE CREATING AND RUNNING MACHINE LANGUAGE PROGRAMS Bh DW n A M a n THE MINI-ASSEMBLER 51 DEBUGGING PROGRAMS 53. EXAMINING AND CHANGING REGISTERS 54 MISCELLANEOUS MONITOR COMMANDS SS) SPECIAL TRICKS WITH THE MONITOR 57 CREATING YOUR OWN COMMANDS 59 SUMMARY OF MONITOR COMMANDS 61 SOME USEFUL MONITOR SUBROUTINES 65 MONITOR SPECIAL LOCATIONS 66 MINI-ASSEMBLER INSTRUCTION FORMATS CHAPTER 4 MEMORY ORGANIZATION 68 RAM STORAGE 70 RAM CONFIGURATION BLOCKS 72 ROM STORAGE 73 WOLOCATIONS 74 ZERO PAGE MEMORY MAPS RRR ERVE CHAPTER 9 INPUT/OUTPUT STRUCTURE O6 U 78 BUILT-IN 1/0 79 PERIPHERAL BOARD I/O 80 PERIPHERAL CARD I/O SPACE 80 PERIPHERAL CARD ROM SPACE 81) 1/0 PROGRAMMING SUGGESTIONS 82 PERIPHERAL SLOT SCRATCHPAD RAM 83. THE CSW/KSW SWITCHES 84. EXPANSION ROM CHAPTER 6 HARDWARE CONFIGURATION jee iin Sn) Pn) Set i} DY |) 88 THE MICROPROCESSOR 90 SYSTEM TIMING 92. POWER SUPPLY 94 ROM MEMORY fl 95 RAM MEMORY 96 THE VIDEO GENERATOR it 97 VIDEO OUTPUT JACKS 98 BUILT-IN I/O 99 “USER I’ JUMPER 100 THE GAME I/O CONNECTOR 100 THE KEYBOARD 102 KEYBOARD CONNECTOR 103 CASSETTE INTERFACE JACKS 104° POWER CONNECTOR mw n 105 SPEAKER 105 PERIPHERAL CONNECTORS ” APPENDIX A THE 65902 INSTRUCTION SET ” APPENDIX B SPECIAL LOCATIONS * APPENDIX C ROM LISTINGS '” GLOSSARY “ BIBLIOGRAPHY rrr INDEX 190 GENERAL INDEX 194 INDEX OF FIGURES nd |2| a 195 INDEX OF PHOTOS 195 INDEX OF TABLES 195 CAST OF CHARACTERS ee) ee ss 8ee) T INTRODUCTION This is the User Reference Manual for the Apple I and Apple II Plus personal computers. Like the Apple itself, this book is a tool. As with all tools, you should know a little about it before you Start to use it. This book will not teach you how to program, It is a book of facts, not methods. If you have just unpacked your Apple, or you do not know how to program in any of the languages available for it, then before you continue with this book, read one of the other manuals accompanying your Apple. Depending upon which variety of Apple you have purchased, you should have received one of the following: Apple IL BASIC Programming Manual {part number A2L0005) The Applesoft Tutorial (part number A2L0018) These are tutorial manuals for versions of the BASIC language available on the Apple. They also include complete instructions on setting up your Apple. The Bibliography at the end of this manual lists other books which may interest you. There are a few different varieties of Apples, and this manual applies to all of them. It is possible that some of the features noted in this manual will not be available on your particular Apple. In places where this manual mentions features which are not universal to all Apples, it will use a footnote to warn you of these differences. This manual describes the Apple Il computer and its parts and procedures. There are sections on the System Monitor, the input/output devices and their operation, the internal organization of memory and input/output devices, and the actual electronic design of the Apple itself. For infor- mation on any other Apple hardware or software product, please refer to the manual accompany- ing that product. nmin rr Wi Wi id WW WW Wold Wi Wi id i Wil Wi li lie Wi | | 'y CHAPTER 1 APPROACHING YOUR APPLE THE POWER SUPPLY THE MAIN BOARD TALKING TO YOUR APPLE THE KEYBOARD READING THE KEYBOARD THE APPLE VIDEO DISPLAY THE VIDEO CONNECTOR EURAPPLE (50 HZ) MODIFICATION SCREEN FORMAT SCREEN MEMORY SCREEN PAGES SCREEN SWITCHES THE TEXT MODE THE LOW-RESOLUTION GRAPHICS (LO-RES) MODE THE HIGH-RESOLUTION GRAPHICS (HI-RES) MODE OTHER INPUT/OUTPUT FEATURES THE SPEAKER THE CASSETTE INTERFACE THE GAME I/O CONNECTOR ANNUNCIATOR OUTPUTS ONE-BIT INPUTS ANALOG INPUTS STROBE OUTPUT VARIETIES OF APPLES AUTOSTART ROM / MONITOR ROM REVISION @ / REVISION | BOARD POWER SUPPLY CHANGES THE APPLE II PLUS For detailed information on setting up your Apple, refer to Chapter | of either the Apple BASIC Programming Manual or The Applesoft Tutorial. In this manual, all directional instructions will refer to this orientation: with the Apple's typewriter-like keyboard facing you, *‘front’’ and ‘“*down”’ are towards the keyboard, ‘*back’’ and “up” are away, Remove the lid of the Apple by prying up the back edge until it “‘pops’’, then pull straight back on the lid and lift it off. This is what you will see Power Supply Main Board Speaker Photo 1. The Apple II. Sn 2) of TT Si er)) |2 |2 S| THE POWER SUPPLY The metal box on the left side of the interior is the Power Supply. It supplies four voltages: +5v, —S5.2v, +11.8v, and —12.0v. It is a high-frequency ‘‘switching’’-type power supply, with many protective features to ensure that there can be no imbalances between the different sup- plies. The main power cord for the computer plugs directly into the back of the power supply. The power-on switch is also on the power supply itself, to protect you and your fingers from accidentally becoming part of the high-voltage power supply circuit. a———_—_—— 110 volt model 110/220 volt model Photo 2. The back of the Apple Power Supply. THE MAIN BOARD The large green printed circuit board which takes up most of the bottom of the case is the com- puter itself. There are two slightly different models of the Apple If main board: the original (Revision @) and the Revision | board. The slight differences between the two lie in the elec- tronics on the board. These differences are discussed throughout this book. A summary of the differences appears in the section ‘Varieties of Apples” on page 25. On this board there are about eighty integrated circuits and a handful of other components, In the center of the board, just in front of the eight gold-toothed edge connectors (“‘slots’’) at the rear of the board, is an integrated circuit larger than all others. This is the brain of your Apple. It is a Synertek/MOS Technology 6502 microprocessor. In the Apple, it runs at a rate of 1,023,000 machine cycles per second and can do over five hundred thousand addition or subtrac- tion operations in one second. It has an addressing range of 65,536 eight-bit bytes. Its repertory includes 56 instructions with 13 addressing modes. This microprocessor and other versions of it are used in many computers systems, as well as other types of electronic equipment Just below the microprocessor are six sockets which may be filled with from one to six slightly smaller integrated circuits. These ICs are the Read-Only Memory (ROM) “‘chips”* for the Apple. They contain programs for the Apple which are available the moment you turn on the power. Many programs are available in ROM, including the Apple System Monitor, the Apple Autostart Monitor, Apple Integer BASIC and Applesoft Il BASIC, and the Apple Programmer's Aid #1 util- ity subroutine package. The number and contents of your Apple’s ROMs depend upon which type of Apple you have, and the accessories you have purchased. Right below the ROMs and the central mounting nut is an area marked by a white square on the board which encloses twenty-four sockets for integrated circuits. Some or all of these may be filled with ICs. These are the main Random Access Memory (RAM) “‘chips”’ for your Apple. An Apple can hold 4,096 to 49,152 bytes of RAM memory in these three rows of components.* Each row can hold eight ICs of either the 4K or 16K variety. A row must hold eight of the same * You can extend your RAM memory to 64K by purchasing the Apple Language Card, part of the Apple Language System (part number A2B0006) eee CTI on type of memory components, but the two types can both be used in various combinations of the different rows to give nine different memory sizes.* The RAM memory is used to hold all in RAM programs and data which you are using at any particular time. The information stored disappears when the power is turned off. the flow of The other components on the Apple II board have various functions: they control or information from one part of the computer to another, gather data from the outside world, to you by displaying it on a television screen or making a noise on a speaker. send information The eight long peripheral slots on the back edge of the Apple’s board can each hold a peripheral or card to allow you to extend your RAM or ROM memory, or to connect your Apple to a printer device. These slots are sometimes called the Apple's “‘backplane’’ or other input/output “mother board”’. TALKING TO YOUR APPLE with Your link to your Apple is at your fingertips. Most programs and languages that are used the Apple expect you to talk to them through the Apple's keyboard. It looks like a normal type- writer keyboard, except for some minor rearrangement and a few special keys. For a quick review on the keyboard, see pages 6 through 12 in the Apple I BASIC Programming Manual or pages 5 through I] in The Applesoft Tutorial. Since you’re talking with your fingers, you might as well be hearing with your eyes. The Apple will tell you what it is doing by displaying letters, numbers, symbols, and sometimes colored blocks and lines on a black-and-white or color television set. greater * The Apple Il is designed to use both the 16K and the less expensive 4K RAMs, However, due to the availability and reduced cost of the 16K chips, Apple now supplies only the 16K RAMs THE KEYBOARD = The Apple Keyboard Number of Keys: 52 Coding: Upper Case ASCII Number of codes: 91 Output = Seven bits, plus strobe Power requirements: +5v at 120mA —12v at 50mA Rollover: 2 key Special keys: CTRL ESC RESET REPT —— Memory mapped locations: Hex Decimal Data $COOO 49152 -16384 Clear $C@10 49168 -16368 The Apple IJ has a built-in 52-key typewriter-like keyboard which communicates using the Amer- ican Standard Code for Information Interchange (ASCII)*. Ninety-one of the 96 upper-case ASCII characters can be generated directly by the keyboard, Table 2 shows the keys on the key- board and their associated ASCII codes. ‘Photo’ 3 is a diagram of the keyboard. The keyboard is electrically connected to the main circuit board by a 16-conductor cable with plugs at each end that plug into standard integrated circuit sockets. One end of this cable is con- nected to the keyboard; the other end plugs into the Apple board's keyboard connector, near the very front edge of the board, under the keyboard itself. The electrical specifications for this con- nector are given on page 102. Most languages on the Apple have commands or statements which allow your program to accept input from the keyboard quickly and easily (for example, the INPUT and GET statements in BASIC). However, your programs can also read the keyboard directly. * All ASCII codes used by the Apple normally have their high bit set. This is the same as standard mark- parity ASCII Crna Ts . 25h 3 N ToT 67 5 TT) 9 TT i=) Tl ne f ec a ae = r a ami (ee (aoe Lice I F ree} (. VES taed CV) Wea ik iN ae Aes {7 tic9 5) — ie “Photo” 3. The Apple Keyboard. READING THE KEYBOARD The keyboard sends seven bits of information which together form one character. These seven bits, along with another signal which indicates when a key has been pressed, are available to most programs as the contents of a memory location. Programs can read the current state of the key- board by reading the contents of this location. When you press a key on the keyboard, the value TL O'ER ER EL TPL TEL VFL PL Fl (Fl) in this location becomes 128 or greater, and the particular value it assumes is the numeric code for the character which was typed. Table 3 on page 8 shows the ASCII characters and their asso- or until |i ciated numeric codes. The location will hold this one value until you press another key, your program tells the memory location to forget the character it’s holding. Pi Once your program has accepted and understood a keypress, it should tell the keyboard’s memory location to “‘release’’ the character it is holding and prepare to receive a new one. Your program can do this by referencing another memory location. When you reference this other location, the value contained in the first location will drop below 128. This value will stay low until you press another key. This action is called ‘‘clearing the keyboard strobe’’. Your program can either read or write to the special memory location, the data which are written to or read from that location are irrelevant, It is the mere reference to the location which clears the keyboard strobe. Once you was last have cleared the keyboard strobe, you can still recover the code for the key which pressed by adding 128 (hexadecimal $89) to the value in the keyboard location. These are the special memory locations used by the keyboard: Table 1: Keyboard Special Locations ee ie) |') eh Location: Description i] i Hex Decimal $COOB 49152 -16384 Keyboard Data $CO18 49168 -16368 Clear Keyboard Strobe is The [RESET] key at the upper right-hand corner does not generate an ASCII code, but instead directly connected to the microprocessor. When this key is pressed, all processing stops. When the key is released, the computer Starts a reset cycle. See page 36 for a description of the RESET ue ee function. The |CTRL) and |SHIFT| keys generate no codes by themselves, but only alter the codes produced by other keys. The [REPT] key, if pressed alone, produces a duplicate of the last code that was generated. If you press and hold down the key while you are holding down a character key, it will act as if you were pressing that key repeatedly at a rate of 10 presses each second. This repetition will cease when you release either the character key or (REPT The POWER light at the lower left-hand corner is an indicator lamp to show when the power to the Apple is on. Table 2: Keys and Their Associated ASCII Codes Key | Alone CTRL SHIFT Both Key | Alone CTRL SHIFT Both space SAO SAO SAO $SA@ || RETURN $8D $8D $8D S8D | 1] $BO SBO SBO $BO G $c7 $87 $C7 $87 1! $Bl SBI SAI SAI H $c8 $88 $c8 $88 2" $B2 $B2 SA2 SA2 $c9 $89 $c9o $89 3# $B3 SB3 $A3 $A3 SCA S8A SCA $8A 4$ $B4 SB4 SA4 SA4 $CB S$8B SCB $8B $cc $8C $cc $8C $CD $8D $DD S9D $CE SSE $DE S9E $CF S8F SCF S8F 2 “ = a) o & =) a > ea) a“> © a] $D¢6 $90 $cO $80 $D1 $91 $D1 $91 wvaoiv] wiwol~~] > ao wn" wn> = $D2 $92 $D2 $92 $D3 $93 $D3 $93 $D4 $94 $D4 $94 $D5 $95 $D5 $95 $D6 $96 $D6 $96 Fr 2) wwco o ww ww2 $D7 $97 $D7 $97 $D8 $98 $D8 $98 $D9 $99 $D9 $99 $DA S9A $DA S9A $88 $88 $88 $88 —ammO0Aer>sVIAt+s: lIn BKXKN- OO! |AiyA WM 15 Wd Ww Ww Ww Ww Ww wee WwW Sag ReRSRERARERSTS $400 1024 $480 1152 $500 1280 $580 1408 $600 1536 $680 1664 $700 1792 $780 1920 $428 1064 $4A8 1192 $528 1320 $5A8 «(1448 _ $628 1576 : $6A8 1704 $728 1832 $7A8 1969 $450 1104 $4D6 =—-:1232 $550 1360 $5D0 1488 $650 1616 $6D¢6 1744 $750 1872 $7D0 2000 n Figure 1. Map of the Text Scree Figure 1 is a map of the Apple's display in Text mode, with the memory location addresses for each character position on the screen. THE LOW-RESOLUTION GRAPHICS (LO-RES) MODE In the Low-Resolution Graphics mode, the Apple presents the contents of the same 1,024 loca- of tions of memory as is in the Text mode, but in a different format. In this mode, each byte is displayed not as an ASCII character, but as two colored blocks, stacked one atop the memory any of other. The screen can show an array of blocks 40 wide and 48 high. Each block can be sixteen colors. On a black-and-white television set, the colors appear as patterns of grey and white dots. blocks on the Since each byte in the page of memory for Low-Resolution Graphics represents two is divided into two equal sections, called (appropriately screen, stacked vertically, each byte enough) ‘nybbles"’, Each nybble can hold a value from zero to 15. The value which is in the screen, and lower nybble of the byte determines the color for the upper block of that byte on the the value which is in the upper nybble determines the color for the lower block on the screen The colors are numbered zero to 15, thus: Table 8: Low-Resolution Graphics Colors | Decimal Hex Color Decimal Hex Color ) $@ Black | $8 Brown 1 $1 Magenta | 9 $9 Orange 2 $2 Dark Blue 10 SA Grey 2 3 $3 Purple 11 $B Pink a $4 Dark Green 12 SC _ Light Green 5 $5 Grey | 13 $D Yellow 6 $6 Medium Blue i4 SE Aquamarine | 7 $7 Light Blue 15 SF White (Colors may vary from television to television, particularly on those without hue controls. You can adjust the tint of the colors by adjusting the COLOR TRIM control on the right edge of the Apple board.) brown block on So, a byte containing the hexadecimal value $D8 would appear on the screen as a top of a yellow block. Using decimal arithmetic, the color of the lower block is determined by the quotient of the value of the byte divided by 16; the color of the upper block is determined by the remainder Figure 2 is a map of the Apple's display in Low-Resolution Graphics mode, with the memory location addresses for each block on the screen. the Since the Low-Resolution Graphics screen displays the same area in memory as 1S used for n Text screen, interesting things happen if you switch between the Text and Low-Resolutio modes. For example, if the screen is in the Low-Resolutio n Graphics mode and is full Graphics of colored blocks, and then the TEXT/GRAPHICS screen switch is thrown to the Text mode, the Simi- screen will be filled with seemingly random text characters, sometimes inverse or flashing. text when viewed in Low-Resolutio n Graphics mode appears as long hor- larly, a screen full of aCn izontal grey, pink, green or yellow bars separated by randomly colored blocks. 17 2000 1872 $7D6 $750 1744 $6D0 1616 $650 i= «1488 S5DO 5 1360 $550 a ~=-:1232 $4D6 = 1104 $450 = 1960 S7A8 S 1832 $728 2 1704 S6A8 g 1576 $628 7 1448 $5A8 z 1320 $528 3 1192 $4A8 A 1064 $428 g 1920 $786 3 1792 $708 g 1664 $680 z 1536 $600 5 «(1408 $580 Hy 1280=: $500 Pett «41152 $489 Cc oe 1024 $400 SiSeRadARRRRRS trl PSS mo eer RaARARSERS $20 $21 $22 s s s $ $ $ $ $s s SOF $23 $24 $25 $26 i $s Ss sie $27 Sil dy ESSRESE WwW Ww Wy Wy Wy Wy Way Md Tay Vay Ny, WW WW Wud THE HIGH-RESOLUTION GRAPHICS (HI-RES) MODE The Apple has a second type of graphic display, called High-Resolution Graphics (or sometimes Hi-res’), When your Apple is in the High-Resolution Graphics mode, it can display 53,760 dots in 4 matrix 280 dots wide and 192 dots high. The screen can display black, white, violet, green, red, and blue dots, although there are some limitations concerning the color of individual dots. The High-Resolution Graphics mode takes its data from an 8,192-byte area of memory, usually called a “picture buffer’. There are two separate picture buffers: one for the primary page and one for the secondary page. Both of these buffers are independent of and separate from the memory areas used for Text and Low-Resolution Graphics. The primary page picture buffer for the High-Resolution Graphics mode begins at memory location number 8192 and extends up to location number 16383; the secondary page picture buffer follows on the heels of the first at memory location number 16384, extending up to location number 24575. For those of you with sixteen fingers, the primary page resides from $2000 to $3FFF and the secondary page follows in succession at $4000 to SSFFF,. If your Apple is equipped with 16K (16,384 bytes) or less of memory, then the secondary page is inaccessible to you; if its memory size is less than 16K, then the entire High-Resolution Graphics mode is unavailable to you. Each dot on the screen represents one bit from the picture buffer. Seven of the eight bits in each byte are displayed on the screen, with the remaining bit used to select the colors of the dots in that byte. Forty bytes are displayed on each line of the screen, The least significant bit (first bit) of the first byte in the line is displayed on the left edge of the screen, followed by the second bit, then the third, etc, The most significant (eighth) bit is not displayed, Then follows the first bit of the next byte, and so on. A total of 280 dots are displayed on each of the 192 lines of the screen. On a black-and-white monitor or TV set, the dots whose corresponding bits are ‘‘on’’ (or equal to 1) appear white; the dots whose corresponding bits are “‘off’ or (equal to @) appear black. On a color monitor or TV, it is not so simple. If a bit is “‘off’, its corresponding dot will always be black. If a bit is ‘‘on™’, however, its color will depend upon the position of that dot on the screen. If the dot is in the leftmost column on the screen, called *‘column @°, or in any even-numbered column, then it will appear violet. If the dot is in the rightmost column (column 279) or any odd-numbered column, then it will appear green. If two dots are placed side-by-side, they will both appear white. If the undisplayed bit of a byte is turned on, then the colors blue and red are substituted for violet and green, respectively. Thus, there are six colors available in the High- Resolution Graphics mode, subject to the following limitations: ; 1) Dots in even columns must be black, violet, or blue. 2) Dots in odd columns must be black, green, or red. 3) Each byte must be either a violet/green byte or a blue/red byte. It is not possible to mix green and blue, green and red, violet and blue, or violet and red in the same byte. * On Revision @ Apple bourds, the colors red and blue are unavailable and the setting of the cighth bit is ir- Na ee relevant 4) Two colored dots side by side always appear white, even if they are in different bytes. 5) On European-modified Apples, these rules apply but the colors generated in the High- Resolution Graphics mode may differ. Figure 3 shows the Apple’s display screen in High-Resolution Graphics mode with the memory addresses of each line on the screen. OTHER INPUT/OUTPUT FEATURES Apple Input/Output Features Inputs: Cassette Input Three One-bit Digital Inputs Four Analog Inputs Outputs: Cassette Output Built-In Speaker Four **Annunciator’’ Outputs Utility Strobe Output THE SPEAKER Inside the Apple’s case, on the left side under the keyboard, is a small 8 ohm speaker. It is con- nected to the internal electronics of the Apple so that a program can cause it to make various sounds, The speaker is controlled by a soft switch. The switch can put the paper cone of the speaker in UEL OTL EL ‘EL ‘ER ‘eu fen feu lee ten ‘re len ler two positions: “‘in’’ and “‘out’’, This soft switch is not like the soft switches controlling the vari- ous video modes, bul is instead a foggle switch. Each time a program references the memory address associated with the speaker switch, the speaker will change state: change from “‘in”™’ to “out’’ or vice-versa. Each time the state is changed, the speaker produces a tiny ‘‘click’’. By referencing the address of the speaker switch frequently and continuously, a program can gen- erate a steady tone from the speaker. The soft switch for the speaker is associated with memory location number 49200. Any reference to this address (or the equivalent addresses -16336 or hexadecimal $C@3@) will cause the speaker to emit a click. A program can “‘reference’’ the address of the special location for the speaker by performing a “read*’ or “‘write’’ operation to that address. The data which are read or written are irrelevant, as it is the address which throws the switch. Note that a “‘write’’ operation on the Apple’s 6502 microprocessor actually performs a “‘read’* before the “‘write’’, so that if you use a “‘write™ fen ten ben eho operation to flip any soft switch, you will actually throw that switch twice. For toggle-type soft switches, such as the speaker switch, this means that a ‘write’ operation to the special location 20 seoee SO800O72 2048 SPCR$1000 4096 SICO# 7168 "} $e400 1024 15120 $1400 ——. $1800 6144 In box each C High Grap Scre Figu Map the of 3. ||8232 ||gagsg616|_| ||_| 8744 |_| 8872 |ooee [| | oo4o ||9128827284008528865687848912 $2280 $2200 $2028 $2128 $2228 $21A8 $22A8 $2328 $23A8 $2050 $20D8 $2150 $21D0 $2250 $22D0 $2350 To obtuin the address for any byte, add the addresses for that byte’s box row, box column, and position in box. ae 21 was controlling the switch will leave the switch in the same stale it was in before the operation performed. THE CASSETTE INTERFACE On the back edge of the Apple’s main board, on the right side next to the VIDEO connector, are two small black packages labelled ““IN** and ‘“*OUT"’. These are miniature phone jacks into which you can plug a cable which has a pair of miniature phono plugs on each end. The-other end of this cable can be connected to a standard cassette tape recorder so that your Apple can save infor- mation on audio cassette tape and read it back again. The connector marked “OUT” is wired to yet another soft switch on the Apple board. This is another toggle switch, like the speaker switch (see above). The soft switch for the cassette oul- put plug can be toggled by referencing memory location number 49184 (or the equivalent -16352 or hexadecimal $C@2@). Referencing this location will make the voltage on the OUT connector swing from zero to 25 millivolts (one fortieth of a volt), or return from 25 millivolts back to zero. If the other end of the cable is plugged into the MICROPHONE input of a cassette tape recorder which is recording onto a tape, this will produce a tiny **click’’ on the recording, By referencing the memory location associated with the cassette output soft switch repeatedly and frequently, a program can produce a tone on the recording. By varying the pitch and duration of this tone, information may be encoded on a tape and saved for later use, Such a program to encode data on a tape is included in the System Monitor and is described on page 46. Be forewarned that if you attempt to flip the soft switch for the cassette output by wriling to its special location, you will actually generate two **clicks’’ on the recording. The reason for this is mentioned in the description of the speaker (above). You should only use “read’’ operations when toggling the cassette output soft switch. The other connector, marked “‘IN’’, can be used to “‘listen’’ to a cassette tape recording. Its main purpose is to provide a means of listening to tones on the tape, decoding them into data, and storing them in memory. Thus, a program or data set which was stored on cassette tape may be read back in and used again. The input circuit takes a 1 volt (peak-to-peak) signal from the cassette recorder’s EARPHONE jack and converts it into a string of ones and zeroes. Each time the signal applied to the input circuit swings from positive to negative, or vice-versa, the input circuit changes state: if it was sending ones, it will start sending zeroes, and vice versa. A program can inspect the state of the cassette input circuit by looking at memory location number 49248 or the equivalents -16288 or hexadecimal $C@60. If the value which is read from this location is greater than or equal to 128, then the state is a “‘one’’; if the value in the memory location is less than 128, then the state is a “zero”. Although BASIC programs can read the state of the cassette input circuit, the speed of a BASIC program is usually much too slow to be able to make any sense out of what it reads. There is, however, a program in the System Monitor which will read the tones on a cassette tape and decode them. This is described on page 47. EL ER TER TER TEL ten tee fen let lee Fit ten tex ler 22 THE GAME I/O CONNECTOR The purpose of the Game I/O connector is to allow you to connect special input and output dev- ices to heighten the effect of programs in general, and specifically, game programs. This connec- tor allows you to connect three one-bit inputs, four one-bit outputs, a data strobe, and four ana- log inputs to the Apple, all of which can be controlled by your programs. Supplied with your Apple is a pair of Game Controllers which are connected to cables which plug into the Game I/O connector, The two rotary dials on the Controllers are connected to two analog inputs on the Connector, the two pushbuttons are connected to two of the one-bit inputs. Photo 7. The Game I/O Connector. ANNUNCIATOR OUTPUTS The four one-bit outputs are called ‘‘annunciators’’, Each annunciator output can be used as an input to some other electronic device, or the annunciator outputs can be connected to circuits to drive lamps, relays, speakers, etc Each annunciator is controlled by a soft switch. The addresses of the soft switches for the annun- ciators are arranged into four pairs, one pair for each annunciator. If you reference the first address in a pair, you turn the output of its corresponding annunciator “off; if you reference the second address in the pair, you turn the annunciator’s output ‘on’. When an annunciator is a PHU 23 “off, the voltage on its pin on the Game I/O Connector is near 0 volts, when an annunciator is “on”, the voltage is near 5 volts. There are no inherent means to determine the current setting of an annunciator bit. The annunciator soft switches are: FL EL Fl. Address: Ann. State Decimal Hex v1) off 49240 -16296 $CO58 on 49241 -16295 $C059 ] off 49242 -16294 $CBSA on 49243-16293 $C@5B 2 off 49244 -16292 $C@SC on 49245 -16291 $COSD 3 off 49246 -16299 SCOSE on 49247 -16289 SCOSF Fl ‘El (Fl ONE-BIT INPUTS The three one-bit inputs can each be connected to either another electronic device or to a push- button. You can read the state of any of the one-bit inputs from a machine language or BASIC program in the same manner as you read the Cassette Input, above. The locations for the three one-bit inputs have the addresses 49249 through 49251 (-16287 through -16285 or hexadecimal $C@61 through $C@63). {El ‘Fl ‘El ANALOG INPUTS The four analog inputs can be connected to 150K Ohm variable resistors or potentiometers. The variable resistance between each input and the +5 volt supply is used in a one-shot timing cir- cuit. As the resistance on an input varies, the timing characteristics of its corresponding timing ‘Ei EI |Fl circuit change accordingly. Machine language programs can sense the changes in the timing loops and obtain a numerical value corresponding to the position of the potentiometer. Before a program can start to read the setting of a potentiometer, it must first reset the timing circuits, Location number 49264 (-16272 or hexadecimal $C@7@) does just this. When you reset the timing circuits, the values contained in the four locations 49252 through 49255 (-16284 through -16281 or $C@64 through $C@67) become greater than 128 (their high bits are set). Within 3.060 milliseconds, the values contained in these four locations should drop below 128. The exact time it takes for each location to drop in value is directly proportional to the setting of the game paddle associated with that location, If the potentiometers connected to the analog inputs have a greater resistance than 150K Ohms, or there are no potentiometers connected, then the values in the game controller locations may never drop to zero. EF) tei El IE "hs 24 STROBE OUTPUT There is an additional output, called C#40 STROBE, which is normally +5 volts but will drop to zero volts for a duration of one-half microsecond under the control of a machine language or BASIC program, You can trigger this “*strobe’’ by referring to location number 49216 (-1632@ or $CO4F). Be aware that if you perform a “‘write’’ operation to this location, you will trigger the strobe fice (see a description of this phenomenon in the section on the Speaker). i 7 Table 10: Input/Output Special Locations | Function: aaa ss ___ Decimal Hex aYo Speaker 49200 -16336 $CO30 [ Cassette Out | 49184 -16352 $0020 |__Cussette In 49256 -16288 SCH6O Annunciators* | 49240 -16296 SCOS8 through =through through 49247 -16289 $COSF Flag inputs 49249 -16287 $C #61 R | 49250-16286 +$C062_- |R 49251-16285 $C063._-| R Analog Inputs |49252-16284 $C@64_ | R 49253-16283 SCH6S 49254-16282 $C 66 49255-16281 Sca67_ | Anslog Clear 49264-16272, SCa7@_—|: R/W Uulity Strobe 49216-16320 +=SCO40_ «| R | VARIETIES OF APPLES There are a few variations on the basic Apple II computer. Some of the variations are revisions or modifications of the computer itself. others are changes to its operating software. These are the basic variations: AUTOSTART ROM / MONITOR ROM All Apple I Plus Systems include the Autostart Monitor ROM. All other Apple systems do not contain the Autostart ROM, but instead have the Apple System Monitor ROM, This version of the ROM lacks some of the features present in the Autostart ROM, but also has some features which are not present in that ROM. The main differences in the two ROMs are listed on the following pages. * See the previous table © Editing Controls. The ESC-I, J, K, and M sequences, which move the cursor up, left. right, and down, respectively, are not available in the Old Monitor ROM. FL Fl to introduce a @ Stop-List. The Stop-List feature (invoked by a [CTRLS ), which allows you not available pause into the output of most BASIC or machine language programs or listings, is in the Old Monitor ROM. Old Monitor © The RESET cycle. When you first turn on your Apple or press RESET], the a warm or ROM will send you directly into the Apple System Monitor, instead of initiating cold start as described in ‘The RESET Cycle” on page 36. The Old Monitor ROM does, however, support the STEP and TRACE debugging features of the Fl FL Monitor, described on page 51, The Autostart ROM does not recognize these Monitor System commands. REVISION @ / REVISION 1 BOARD version of The Revision @ Apple II board lacks a few features found on the current Revision | the Apple II main board, To determine which version of the main board is in your Apple, open FL EL TEL (Fl right-hand corner of the board, Compare what you see to Photo 4 the case and look at the upper the four- on page 10. If your Apple does not have the single metal video connector pin between Apple. pin video connector and the video adjustment potentiometer, then you have a Revision @ The differences between the Revision @ and Revision 1 Apples are summarized below. Apple board © Color Killer. When the Apple’s Video Display is in Text mode, the Revision @ to leaves the color burst signal active on the video output circuit. This causes text characters appear tinted or with colored fringes. a RESET @ Power-on RESET. Revision @ Apple boards have no circuit to automatically initiate start using your cycle when you turn the power on. Instead, you must press {RESET} once to Apple. will Also, when you turn on the power to an Apple with a Revision @ board, the keyboard active, as if you had typed a random character. When the Apple starts looking for become this charac- input, it will accept this random character as if you had typed it. In order to erase El ‘El ‘Fl (El JEL ter, you should press after you your Apple when you turn on its power. © Colors in High-Resolution Graphics. Apples with Revision @ boards can generate only four tE\ high bit of colors in the High-Resolution Graphics mode: black, white, violet, and green. The each byte displayed on the Hi-Res screen (see page 19) is ignored. contain 20K or e 24K Memory Map problem. Systems with a Revision @ Apple Il board which actually do. 24K bytes of RAM memory appear to BASIC to have more memory than they See ‘Memory Organization”’, page 72, for a description of this problem, which you © 50 Hz Apples. The Revision @ Apple II board does not have the pads and jumpers and solder to convert the VIDEO OUT signai of your Apple to conform to the Euro- can cut connector, the single pean PAL/SECAM television standard. It also lacks the third VIDEO metal pin in front of the four-pin video connector. VEL TEL OPEL VEL 26 a i @ Speaker and Cassette Interference. On Apples with Revision @ boards, any sound generated . by the internal speaker will also appear as a signal on the Cassette Interface’s OUT connector If you leave the tape recorder in RECORD mode, then any sound generated by the internal speaker will also appear on the tape recording a. ® Cassette Input. The input circuit for the Cassette Interface has been modified so that it will . respond with more accuracy lo a weaker input signal. . POWER SUPPLY CHANGES a. In addition, some Apples have a version of the Apple Power Supply which will accept only a 110 a. volt power line input. the supply These are are not equipped with the voltage selector switch on the back of a. THE APPLE II PLUS a : The Apple II Plus is a standard Apple I] computer with a Revision | board, an Autostart Moni- tor ROM, and the Applesoft I] BASIC language in ROM in lieu of Apple Integer BASIC. pean models of the Apple Il Plus are equipped with a 110/220 volt power supply. Euro- The Apple Mini-Assembler, the Floating-Point Package, and the SWEET-16 interpreter, stored in the : Integer BASIC ROMs, are not available on the Apple II Plus = .. * = = = ES a E. nN~ CHAPTER 2 CONVERSATION WITH APPLES STANDARD OUTPUT THE STOP-LIST FEATURE BUT SOFT, WHAT LIGHT THROUGH YONDER WINDOW BREAKS! (OR, THE TEXT WINDOW) SEEING IT ALL IN BLACK AND WHITE STANDARD INPUT RDKEY GETLN ESCAPE CODES THE RESET CYCLE AUTOSTART ROM RESET AUTOSTART ROM SPECIAL LOCATIONS “OLD MONITOR” ROM RESET 29 Almost every program and language on the Apple needs some sort of input from the keyboard, and some way to print information on the screen. There is a set of subroutines stored in the Apple’s ROM memory which handle most of the standard input and output from all programs and languages on the Apple. The subroutines in the Apple’s ROM which perform these input and output functions are called by various names. These names were given to the subroutines by their authors when they were written, The Apple itself does not recognize or remember the names of its own machine language subroutines, but it’s convenient for us to call these subroutines by their given names, STANDARD OUTPUT The standard output subroutine is called COUT. COUT will display upper-case letters, numbers, and symbols on the screen in either Normal or Inverse mode. It will ignore control characters except RETURN, the bell character, the line feed character, and the backspace character. The COUT subroutine maintains its own invisible ‘‘output cursor’’* (the position at which the next character is to be placed), Each time COUT is called, it places one character on the screen al the current cursor position, replacing whatever character was there, and moves the cursor one space to the right. If the cursor is bumped off the right edge of the screen, then COUT shifts the cursor down to the first position on the next line. If the cursor passes the bottom line of the screen, the screen “‘scrolls*’ up one line and the cursor is set to the first position on the newly blank bottom line. When a RETURN character is sent to COUT, it moves the cursor to the first position of the next line. If the cursor falls off the bottom of the screen, the screen scrolls as described above. THE STOP-LIST FEATURE When any program or language sends a RETURN code to COUT, COUT will take a quick peek at the keyboard. If you have typed a since the last time COUT looked at the keyboard, then it will stop and wait for you to press another key. This is called the Stop-List feature.** When you press another key, COUT will then output the RETURN code and proceed with nor- mal output. The code of the key which you press to end the Stop-List mode is ignored unless it is a (CTRL C). If it is, then COUT passes this character code back to the program or language which is sending output, This allows you to terminate a BASIC program or listing by typing CTRL C| while you are in Stop-List mode. A line feed character causes COUT to move its mythical output cursor down one line without any horizontal motion at all. As always, moving beyond the bottom of the screen causes the screen to scroll and the cursor remains at its same position on a fresh bottom line, A backspace character moves the imaginary cursor one space to the left. If the cursor is bumped off the left edge, it is reset to the rightmost position on the previous line. If there is no previous line (if the cursor was at the top of the screen), the screen does not scroll downwards, but instead * From latin cursus, “runner” Th. OER EL ER BL FL URL ORL CFL ** The Stop-lisi feature is not present on Apples without the Autostart ROM the cursor is placed again at the rightmost position on the top line of the screen, When COUT is sent a “bell” character (CTRL G), it does not change the screen at all, but instead produces a tone from the speaker. The tone has a frequency of 100Hz and lasts for 1/10th of a second. The output cursor does not move for a bell character, BUT SOFT, WHAT LIGHT THROUGH YONDER WINDOW BREAKS! (OR, THE TEXT WINDOW) In the above discussions of the various motions of the output cursor, the words ‘‘right’’, “‘left’’, “top”, and ‘*bottom’’ mean the physical right, left, top, and bottom of the standard 40-character wide by 24-line tall screen. There is, however, a way to tell the COUT subroutine that you want it to use only a section of the screen, and not the entire 960-character display. This segregated section of the text screen is called a “‘window’’, A program or language can set the positions of the top, bottom, left side, and width of the text window by storing those positions in four loca- tions in memory. When this is done, the COUT subroutine will use the new positions to calcu- late the size of the screen. It will never print any text outside of this window, and when it must scroll the screen, it will only scroll the text within the window. This gives programs the power to control the placement of text, and to protect areas of the screen from being overwritten with new text. Location number 32 (hexadecimal $20) in memory holds the column position of the leftmost column in the window. This position is normally position @ for the extreme left side of the screen. This number should never exceed 39 (hexadecimal $27), the leftmost column on the text screen. Location number 33 (hexadecimal $21) holds the width, in columns, of the cursor window. This number is normally 4@ (hexadecimal $28) for a full 40-character screen. Be care- ful that the sum of the window width and the leftmost window position does not exceed 40! If it does, it is possible for COUT to place characters in memory locations not on the screen, endangering your programs and data, Location 34 (hexadecimal $22) contains the number of the top line of the text window, This is also normally @, indicating the topmost line of the display. Location 35 (hexadecimal $23) holds the number of the bottom line of the screen (plus one), thus normally 24 (hexadecimal $18) for the bottommost line of the screen. When you change the text window, you should take care that you know the whereabouts of the output cursor, and that it will be inside the new window. Table 11: Text Window Spe Location: Minimum/Normal/Maximum Value Function: Decimal Hex | Decimal Hex Left Edge 6/0/39 $0/30/S17 ~ Width 33 $21 | 0/40/40 $0/$28/$28 34 $22 | 0/0/24 $0/S0/S18 35 $23 | 0/24/24 $0/$18/S18 PRUNE ial SEEING IT ALL IN BLACK AND WHITE The COUT subroutine has the power to print what's sent to it in either Normal or Inverse text modes (see page 14), The particular form of its output is determined by the contents of location number 5@ (hexadecimal $32), If this location contains the value 255 (hexadecimal $FF), then COUT will print characters in Normal mode; if the value is 63 (hexadecial $3F), then COUT will present its display in Inverse mode. Note that this mode change only affects the characters printed after the change has been made. Other values, when stored in location 5@, do unusual things: the value 127 prints letters in Flashing mode, but all other characters in Inverse, any other value in location 5@ will cause COUT to ignore some or all of its normal character set. TEN El ‘EL ‘Fl (Fl Value: Effect: Decimal Hex 255 SFF | COUT will display characters in Normal mode. 63 $3F | COUT will display characters in Inverse mode {El 127 $7F | COUT will display letters in Flashing mode, all other characters in Inverse mode. The Normal/Inverse ‘*‘mask*’ location, as it is called, works by performing a logical “AND” between the bits contained in location 5@ and the bits in each outgoing character code. Every bit in location 5@ which is a logical **zero’’ will force the corresponding bit in the character code to become ‘‘zero”’ also, regardless of its former setting. Thus, when location 5@ contains 63 (hexa- decimal $3F or binary 0@111111), the top two bits of every output character code will be turned ‘off’. This will place characters on the screen whose codes are all between 0 and 63. As you can see from the ASCII Screen Character Code table (Table 7 on page 15), all of these characters fel TEL (Fl are in Inverse mode. {Fl STANDARD INPUT There are actually two subroutines which are concerned with the gathering of standard input: RDKEY, which fetches a single keystroke from the keyboard, and GETLN, which accumulates a number of keystrokes into a chunk of information called an input line, RDKEY The primary function of the RDKEY subroutine is to wait for the user to press a key on the key- board, and then report back to the program which called it with the code for the key which was pressed. But while it does this, RDKEY also performs two other helpful tasks: 1). Jnput Prompting. When RDKEY is activated, the first thing it does is make visible the hid- den output cursor. This accomplishes two things: it reminds the user that the Apple is waiting for a key to be pressed, and it also associates the input it wants with a particular place on the screen. In most cases, the input prompt appears near a word or phrase describing what is being requested by the particular program or language currently in use. The input cursor itself is a flashing representation of whatever character was at the position of the output cursor. Usually this is the blank character, so the input cursor most often appears to be a flashing square. When the user presses a key, RDKEY dutifully removes the input cursor and returns the value of the key which was pressed to the program which requested it. Remember that the output cursor is just a position on the screen, but the input cursor is a flashing character on the screen. They usually move in tandem and are rarely separated from each other, but when the input cursor disappears, the output cursor is still active. 2). Random Number Seeding. While it waits for the user to press a key, RDKEY is continually adding | to a pair of numbers in memory. When a key is finally pressed, these two locations together represent a number from @ to 65,535, the exact value of which is quite unpredictable. Many programs and languages use this number as the base of a random number generator, The two locations which are randomized during RDKEY are numbers 78 and 79 (hexadecimal S4E and $4F). GETLN The vast majority of input to the Apple is gathered into chunks called input lines. The subroutine in the Apple's ROM called GETLN requests an input line from the keyboard, and after getting one, returns to the program which called it. GETLN has many features and nuances, and it is good to be familiar with the services it offers. When called, GETLN first prints a prompting character, or “‘prompt’’. The prompt helps you to identify which program has called GETLN requesting input. A prompt character of an asterisk (*) represents the System Monitor, a right caret (>) indicates Apple Integer BASIC, a right bracket (]) is the prompt for Applesoft If BASIC, and an exclamation point (!) is the hallmark of the Apple Mini-Assembler. In addition, the question-mark prompt (?) is used by many programs and languages to indicate that a user program is requesting input. From your (the user's) point of view, the Apple simply prints a prompt and displays an input cursor. As you type, the charac- ters you type are printed on the screen and the cursor moves accordingly, When you press [RETURN], the entire line is sent off to the program or language you are talking to, and you get another prompt. Actually, what really happens is that after the prompt is printed, GETLN calls RDKEY, which displays an input cursor. When RDKEY returns with a keycode, GETLN stores that keycode in an input buffer and prints it on the screen where the input cursor was. It then calls RDKEY again. This continues until the user presses [RETURN]. When GETLN receives a RETURN code from the keyboard, it sticks the RETURN code at the end of the input buffer, clears the remainder of the screen line the input cursor was on, and sends the RETURN code to COUT (see above). GETLN then returns to the program which called it. The program or language which requested input may now look at the entire line, all at once, as saved in the input buffer. At any time while you are typing a line, you can type a and cancel that entire line. GETLN will simply forget everything you have typed, print a backslash (\), skip to a new line, and display another prompt, allowing you to retype the line. Also, GETLN can handle a max- imum of 255 characters in a line. If you exceed this limit, GETLN will cancel the entire line and you must start over. To warn you that you are approaching the limit, GETLN will sound a tone every keypress starting with the 249th character. GETLN also allows you to edit and modify the line you are typing in order to correct simple typographical errors. A quick introduction to the standard editing functions and the use of the two arrow keys, [=] and [-], appears on pages 28-29 and 53-55 of the Apple Il BASIC Program- ming Manual, or on pages 27-28, 52-53 and Appendix C of The Applesoft Tutorial, at least one a of which you should have received. Here is a short description of GETLN’s editing features: THE BACKSPACE ([—]) KEY Each press of the backspace key makes GETLN “‘forget™’ one previous character in the input line. It also sends a backspace character to COUT (see above), making the cursor move back to the character which was deleted. At this point, a character typed on the keyboard will replace the deleted character both on the screen and in the input line. Multiple backspaces will delete succes- sive characters; however, if you backspace over more characters than you have typed, GETLN will forget the entire line and issue another prompt. THE RETYPE ([=]) KEY Pressing the retype key has exactly the same effect as typing the character which is under the cur- sor. This is extremly useful for re-entering the remainder of a line which you have backspaced over to correct a typographical error. In conjunction with pure cursor moves (which follow), it is also useful for recopying and editing data which is already on the screen. ESCAPE CODES When you press the key marked on the keyboard, the Apple’s input subroutines go into on ee en) 2| [2 ri ia tre orm ml me escape mode. In this mode, eleven keys have separate meanings, called “escape codes’. When you press one of these eleven keys, the Apple will perform the function associated with that key. After it has performed the function, the Apple will either continue or terminate escape mode, depending upon which escape code was performed. If you press any key in escape mode which is not an escape code, then that keypress will be ignored and escape mode will be terminated. The Apple recognizes eleven escape codes, eight of which are pure cursor moves, which simply move the cursor without altering the screen or the input line, and three of which are screen clear codes, which simply blank part or all of the screen. All of the screen clear codes and the first four pure cursor moves (escape codes @, A, B, C, D, E, and F) terminate the escape mode after operating. The final four escape codes (I, K, M, and J) complete their functions with escape mode active.* {ESC} [A] A press of the key followed by a press of the [A] key will move the cursor one space to the right without changing the input line. This is useful for skipping over unwanted characters in an input line: simply backspace back over the unwanted characters, press [ESC] [A] to skip each offending symbol, and use the retype key to re-enter the remainder of the line. Pressing followed by [B} moves the cursor back one space, also without disturbing the input line. This may be used to enter something twice on the same line without retyping it: just type it once, press [ESC] [B] repeatedly to get back to the beginning of the phrase, and use the retype key to enter it again. * These four escape codes are not available on Apples without the Autostart Monitor ROM, 34 The key sequence moves the cursor one line directly down, with no horizontal movement, If the cursor reaches the bottom of the text window, then the cursor remains on the bottom line and the text in the window scrolls up one line. The input line is not modified by the {C] [ESC] [D]} (below), are useful for sequence. This, and [ESC) positioning the cursor at the beginning of another line on the screen, so that it may be re-entered with the retype key. [ESC] [D]The [D) [ESC) sequence moves the cursor directly up one line, again without any horizon- tal movement, If the cursor reaches the top of the window, it stays there. The input a line remains unmodified. This sequence is useful for moving the cursor to a previous line on the screen so that it may be re-entered with the retype key. {E] The {E| sequence is called ‘‘clear to end of line’. When COUT detects this sequence of keypresses, it clears the remainder of the screen line (nor the input line!) from the cursor position to the right edge of the text window. The cursor remains [E]always clears the rest of the line to where it is, and the input line is unmodified. [ESC] blank spaces, regardless of the setting of the Normal/Inverse mode location (see above). {F] This sequence is called *‘clear to end of screen’’. It does just that: it clears everything in the window below or to the right of the cursor. As before, the cursor does not move and the input line is not modified, This is useful for erasing random garbage on a clut- tered screen after a lot of cursor moves and editing. [@] The [@] sequence is called “*home and clear". It clears the entire window and places the cursor in the upper left-hand corner, The screen is cleared to blank spaces, regardless of the setting of the Normal/Inverse location, and the input line is not changed (note that **[@]"’ is [SHIFT P]). {K] These four escape codes are synonyms for the four pure cursor moves given above. [ESC][J] When these four escape codes finish their respective functions, they do nor turn off the [ESC] |MJescape mode: you can continue typing these escape codes and moving the cursor around [sz]SC][I] the screen until you press any key other than another escape code. These four keys are placed in a ‘‘directional keypad”’ arrangement, so that the direction of each key from the center of the keypad corresponds to the direction which that escape code moves the cur- sor. © > Bo—- > A A) ej Figure 4. Cursor-moving Escape Codes. aT tb hahaha DRY Ob Wb AD We Mb le 35 THE RESET CYCLE FL When you turn your Apple’s power switch on* or press and release the key, the Apple’s 6502 microprocessor initiates a RESET cycle. It begins by jumping into a subroutine in the Apple’s Monitor ROM. In the two different versions of this ROM, the Monitor ROM and the Autostart ROM, the RESET cycle does very different things. AUTOSTART ROM RESET Apples with the Autostart ROM begin their RESET cycles by flipping the soft switches which control the video screen to display the full primary page of Text mode, with Low-Resolution Graphics mixed mode lurking behind the veil of text. It then opens the text window to its full size, drops the output cursor to the bottom of the screen, and sets Normal video mode. Then it Fi FL TL Tl fl sets the COUT and KEYIN switches to use the Apple’s internal keyboard and video display as the Standard input and output devices. It flips annunciators @ and 1 ON and annunciators 2 and 3 OFF on the Game I/O connector, clears the keyboard strobe, turns off any active 1/O Expansion ROM (see page 84), and sounds a “‘beep!”*. These actions are performed evety time you press and release the key on your Apple. At this point, the Autostart ROM peeks into two special locations in memory to see if it’s been RESET before or if the Apple has just been powered up (these special locations are described MFA TFL Fi below). If the Apple has just been turned on, then the Autostart ROM performs a “‘cold start’’; otherwise, it does a “warm start”’. 1) Cold Start. On a freshly activated Apple, the RESET cycle continues by clearing the screen and displaying ‘*‘APPLE II"* top and center. It then sets up the special locations in memory to tell itself that it’s been powered up and RESET, Then it starts looking through the rightmost seven slots in your Apple’s backplane, looking for a Disk Il Controller Card. It starts the search with Slot 7 and continues down to Slot 1. If it finds a disk controller card, then it proceeds to bootstrap the Apple Disk Operating System (DOS) from the diskette in the disk drive attached to the controller card it discovered. You can find a description of the disk bootstrapping procedure in Do’s and Don’ts of DOS, Apple part number A2L0012, page 11. Fl fF TF ‘Fl (Fl If the Autostart ROM cannot find a Disk II controller card, or you press again before the disk booting procedure has completed, then the RESET cycle will continue “lukewarm start’. It will initialize and jump into the language which is installed in ROM on with a IF your Apple. For a Revision @ Apple, either without an Applesoft II Firmware card or with such a card with its controlling switch in the DOWN position, the Autostart ROM will start Apple Integer BASIC. For Apple I-Plus systems, or Revision @ Apple Is with the Applesoft Il Firmware card with the switch in the UP position, the Autostart ROM will begin Applesoft II Floating-Point BASIC. OVE, IF, 2) Warm Start. If you have an Autostart ROM which has already performed a cold start cycle, then each time you press and release the [RESET] key, you will be returned to the language you were using, with your program and variables intact. * Power-on RESET cycles oceur only on Revision | Apples or Revision @ Apples with at least one Disk II con- troller card. YoF IFi VF 36 AUTOSTART ROM SPECIAL LOCATIONS ii The three ‘‘special locations’’ used by the Autostart ROM all reside in an area of RAM memory reserved for such system functions, Following is a table of the special locations used by the Autostart ROM: Table 13: Autostart ROM Special Locations Location: Decimal Hex Sens 1010 $3F2 Soft Entry Vector. These two locations contain 1011 S$3F3 the address of the reentry point for whatever language is in use. Normally contains $EQ03. 1012 $3F4 Power-Up Byte. Normally contains $45. See below. 64367 $FB6F This is the beginning of a machine language (-1169) subroutine which sets up the power-up location. When the Apple is powered up, the Autostart ROM places a special value in the power-up loca- tion. This value is the Exclusive-OR of the value contained in location 1011 with the constant value 165. For example, if location 111 contains 224 (its normal value), then the power-up value will be: Decimal Hex Binary Location 1011 224 SEO 11100000 Constant 165 SAS 10100101 Power-Up Value 69 $45. O1000101 Your programs can change the soft entry vector, so that when you press you will go to some program other than a language. If you change this soft entry vector, however, you should make sure that you set the value of the power-up byte to the Exclusive-OR of the high part of your new soft entry vector with the constant decimal 165 (hexadecimal $A5). If you do not set this power-up value, then the next time you press the Autostart ROM will believe that the Apple has just been turned on and it will do another cold start. For example, you can change the soft entry vector to point to the Apple System Monitor, so that when you press [RESET] you will be placed into the Monitor, To make this change, you must place the address of the beginning of the Monitor into the two soft entry vector locations. The Monitor begins at location $FF69, or decimal 65385. Put the last two hexadecimal digits of this address ($69) into location $3F2 and the first two digits (SFF) into location $3F3. If you are working in decimal, put 10S (which is the remainder of 65385/256) into location 101@ and the value 255 (which is the integer quotient of 65385/256) into location 1811. Now you must set up the power-up location. There is a machine-language subroutine in the Autostart ROM which wil automatically set the value of this location to the Exclusive-OR men- tioned above. Al you need to do is to execute a JSR (Jump to SubRoutine) instruction to the address $FB6F. If you are working in BASIC, you should perform a CALL -1169. Now every- thing is set, and the next time you press [RESET], you will enter the System Monitor. To make the [RESET] key work in its usual way, just restore the values in the soft entry vector to their former values ($E@@3, or decimal 57347) and again call the subroutine described above. rrr ee 37 “OLD MONITOR” ROM RESET A RESET cycle in the Apple II Monitor ROM begins by setting Normal video mode, a full screen of Primary Page text with the Color Graphics mixed mode behind it, a fully-opened text window, and the Apple’s standard keyboard and video screen as the standard input and output devices. It sounds a ‘‘beep!"*, the cursor leaps to the bottom line of the uncleared text screen, and you find yourself fucing un asterisk (+) prompt and talking to the Apple System Monitor. VEL RL FL OE PF) TFL TEL SFL YF, GEL ORL STL SEL EL VEL 38 CHAPTER 3 THE SYSTEM MONITOR ENTERING THE MONITOR ADDRESSES AND DATA EXAMINING THE CONTENTS OF MEMORY EXAMINING SOME MORE MEMORY EXAMINING STILL MORE MEMORY CHANGING THE CONTENTS OF A LOCATION CHANGING THE CONTENTS OF CONSECUTIVE LOCATIONS MOVING A RANGE OF MEMORY COMPARING TWO RANGES OF MEMORY SAVING A RANGE OF MEMORY ON TAPE READING A RANGE FROM TAPE CREATING AND RUNNING MACHINE LANGUAGE PROGRAMS THE MINI-ASSEMBLER DEBUGGING PROGRAMS EXAMINING AND CHANGING REGISTERS MISCELLANEOUS MONITOR COMMANDS SPECIAL TRICKS WITH THE MONITOR CREATING YOUR OWN COMMANDS SUMMARY OF MONITOR COMMANDS SOME USEFUL MONITOR SUBROUTINES MONITOR SPECIAL LOCATIONS MINI-ASSEMBLER INSTRUCTION FORMATS Buried deep within the recesses of the Apple’s ROM is a masterful program called the System Monitor. It acts as both a supervisor of the system and a slave to it; it controls all programs and all programs use it. You can use the powerful features of the System Monitor to discover the hidden secrets in all 65,536 memory locations. From the Monitor, you may look at one, some, or all locations; you may change the contents of any location, you can write programs in Machine and Assembly languages to be executed directly by the Apple’s microprocessor; you can save vast quantities of data and programs onto cassette tape and read them back in again; you can move and compare thousands of bytes of memory with a single command; and you can leave the Moni- tor and enter any other program or language on the Apple. ENTERING THE MONITOR The Apple System Monitor program begins at location number SFF69 (decimal 65385 or —151) in memory. To enter the Monitor, you or your BASIC program can CALL this location, The Monitor’s prompt (an asterisk [+]) will appear on the left edge of the screen, with a flashing cur- sor to its right. The Monitor accepts standard input lines (see page 32) just like any other system or language on the Apple. It will not take any action until you press [RETURN]. Your input lines to the Monitor may be up to 255 characters in length. When you have finished your stay in the Monitor, you can return to the language you were previously using by typing (or, with the Apple DOS, [3][D)[#)[G][RETURN)), or simply press [RESET}.* ADDRESSES AND DATA Talking to the Monitor is somewhat like talking to any other program or language on the Apple: you type a line on the keyboard, followed by a [RETURN], and the Monitor will digest what you typed and act according to those instructions. You will be giving the Monitor three types of information: addresses, values, and commands. Addresses and values are given to the Monitor in hexadecimal notation. Hexadecimal notation uses the ten decimal digits (@-9) to represent them- selves and the first six letters (A-F) to represent the numbers 10 through 15. A single hexade- cimal digit can, therefore, have one of sixteen values from 0 to 15. A pair of hex digits can assume any value from 0 to 255, and a group of four hex digits can denote any number from 0 to 65,536. It so happens that any address in the Apple can be represented by four hex digits, and any value by two hex digits. This is how you tell the Monitor about addresses and values. When the Monitor is looking for an address, it will take any group of hex digits, If there are fewer than four digits in the group, it will prepend leading zeroes; if there are more than four hex digits, the Monitor will truncate the group and use only the last four hex digits. It follows the same pro- cedure when looking for two-digit data values. The Monitor recognizes 22 different command characters. Some of these are punctuation marks, others are upper-case letters or contro! characters. In the following sections, the full name of a command will appear in capital letters. The Monitor needs only the first letter of the command name. Some commands are invoked with control characters, You should note that although the Monitor recognizes and interprets these characters, a control character typed on an input line will not appear on the screen. BL EL FL TFL TRL CEL TEL_ OYEL YEL_ OUEL * This does not work on Apples without the Autostart ROM, The Monitor remembers the addresses of up to five locations. Two of these are special: they are the addresses of the last location whose value you inquired about, and the location which is next to have its value changed. These are called the /ast opened location and the next changeable loca- tion, The usefulness of these two addresses will be revealed shortly EXAMINING THE CONTENTS OF MEMORY When you type the address of a location in memory alone on an input line to the Monitor, it will reply* with the address you typed, a dash, a space, and the value** contained in that location, thus: “E000 EW#H— 24 #300 #344— 99 * Each time the Monitor displays the value contained in a location, it remembers that location as the last opened location. For technical reasons, it also considers that location as the nex! change- able location EXAMINING SOME MORE MEMORY If you type a period (.) on an input line to the Monitor, followed by an address, the Monitor will display a memory dump. the values contained in all locations from the last opened location to the location whose address you typed following the period. The Monitor then considers the last loca- tion displayed to be both the last opened location and the next changeable location. * In the examples, your queries are in normal type and the Apple replies in boldface ** The values printed in these examples may differ from the values displayed by your Apple for the same in- Slructions a 41 +20 O824— #8 *.2B ##21— 28 #6 18 OF OC OO HO ##28— AS #6 D# #7 +300 #304— 99 *, 325 §341— BY 64 68 BA BA BA 99 6308— 64 #8 C8 D# F4 A6é 2B AY O318— 869 85 27 AD CC 63 °.32A #316— 85 41 #318— 84 48 BA 4A 4A 4A 4A 89 0326— CO 85 3F AX 5D 85 3E 26 #328— 43 #3 26 You should notice several things about the format of a memory dump. First, the first line in the dump begins with the address of the location following the last opened location; second, all other lines begin with addresses which end alternately in zeroes and eights; and third, there are never more than eight values displayed on a single line in a memory dump. When the Monitor does a memory dump, it starts by displaying the address and value of the location following the last opened location. It then proceeds to the next successive location in memory. If the address of that location ends in an 8 or a @, the Monitor will ‘*cut’’ to a new line and display the address of that location and continue displaying values. After it has displayed the value of the location whose address you specified, it stops the memory dump and sets the address of both the last opened and the next changeable location to be the address of the last location in the dump. If the address specified on the input line is less than the address of the last opened location, the Monitor will display the address and value of only the location following the last opened location. You can combine the two commands (opening and dumping) into one operation by concatenating the second to the first; that is, type the first address, followed by a period and the second address. This two-addresses-separated-by-a-period form is called a memory range. ©300.32F 8380— 99 BO #48 H8 BHA HA HA 99 #308— #8 #8 C8 D# F4 A6 2B AD #318— #9 85 27 AD CC @3 85 41 @318— 84 48 BA 4A 4A 4A 4A 89 @328— CH 85 3F AX SD 85 3E 28 #328— 43 #3 28 46 #3 A5 3D 4D *30.46 en) i] So sn Si ce Sn) Sr es) ee 2 | ) #838— AA #6 FF AA @5 C2 #5 C2 ##38— 1B FD D# #3 3C OH 48 HO f#i4d— 36 1B) *E815.E025 42 E#15— 4C ED FD E#18— A9 28 C5 24 B# BC AY BD E#26— A# #7 28 ED FD AY . EXAMINING STILL MORE MEMORY A single press of the [RETURN] key will cause the Monitor to respond with one line of a memory dump; that is, a memory dump from the location following the last opened location to the next cight-location “‘cut’’. Once again, the last location displayed is considered the last opened and next changeable location e) ao05— OM +[RETURN| aa 6 *(RETURN| Od08— 40 44 OH OH OH OH OO AO +32 @032— FF +|RETURN) AA @@ C2 65 C2 +[RETURN ##38— 1B FD D# #3 3C OH 3F 64 CHANGING THE CONTENTS OF A LOCATION You've heard all about the “next changeable location’’; now you're going to use it. Type a colon followed by a value “0 Oaee— O4 *: SF Presto! The contents of the next changeable location have just been changed to the value you typed. Check this by examining that location again: +0 rrr O000— SF DP 43 You can also combine opening and changing into one operation: *30@2:42 #302 @302— 42 When you change the contents of a location, the old value which was contained in that location disappears, never to be seen again. The new value will stick around until it is replaced by another hexadecimal value. CHANGING THE CONTENTS OF CONSECUTIVE LOCATIONS You don't have to type an address, a colon, a value, and press for each and every loca- tion you wish to change. The Monitor will allow you to change the values of up to eighty-five locations at a time by typing only the initial address and colon, and then all the values separated by spaces. The Monitor will duly file the consecutive values in consecutive locations, starting at the next changeable location. After it has processed the string of values, it will assume that the location following the last changed location is the next changeable location. Thus, you can con- tinue changing consecutive locations without breaking stride on the next input line by typing another colon and more values. *300:69 @1 20 ED FD 4C @ 3 +300 #348— 69 * [RETURN] /EI ‘EL (8) ‘EN 181 (Fi (Fl ‘Fl ‘El (El !JE lpi #1 28 ED FD 4C #6 @3 °16:0 1 2 3 1B) *:4 567 *10.17 #H1d— OH 61 82 #3 O84 5 86 87 MOVING A RANGE OF MEMORY You can treat a range of memory (specified by two addresses separated by a period) as an entity 44 unto itself and move it from one place to another in memory by using the Monitor's MOVE command. In order to move a range of memory from one place to another, the Monitor must be told both where the range is situated in memory and where it is to be moved. You give this information to the Monitor in three parts: the address of the destination of the range, the address of the first location in the range proper, and the address of the last location in the range. You specify the starting and ending addresses of the range in the normal fashion, by separating them with a period. You indicate that this range is to be placed somewhere else by separating the range and the destination address with a left caret (<). Finally, you tell the Monitor that you want to move the range to the destination by typing the letter M, for “MOVE". The final com- mand looks like this: {destination} < {start} .fend} M When you type this line to the Monitor, of course, the words in curly brackets should be replaced by hexadecimal addresses and the spaces should be omitted. Here are some real examples of memory moves: °0.F #AOH— SF OH 45 87 OH OM OM OG HHHS— OH OH OH 4H OH AO WH Oe *300:A9 8D 2@ ED FD A9 45 2@ DA FD 4C 06 63 #344— AX 8D 24 ED FD AY 45 24 #348— DA FD 4C 68 #3 *0<300.30CM “8.C ##44— AX 8D 24 ED FD A9 45 28 ##48— DA FD 4C Of 43 *310@<8.AM *310.312 #314— DA FD 4C ©2<7.9M *0.C ##88— AX BD 24 DA FD AD 45 26 ##08— DA FD 4C #8 #3 The Monitor simply makes a copy of the indicated range and moves it to the specified destina- tion. The original range is left undisturbed. The Monitor remembers the last location in the ori- ginal range as the last opened location, and the first location in the original range as the next changeable location. If the second address in the range specification is less than the first, then only one value (that of the first location in the range) will be moved, If the destination address of the MOVE command is inside the original range, then strange and (sometimes) wonderful things happen: the locations between the beginning of the range and the aea are replicated throughout destination are treated as a sub-range and the values in this sub-range the original range. See ‘*Special Tricks’’, page 55, for an interesting application of this feature. COMPARING TWO RANGES OF MEMORY much the same format as you You can use the Monitor to compare two ranges of memory using the VERIFY command can use to move a range of memory from one place to another. In fact, be used immediately after a MOVE to make sure that the move was successful. like the MOVE command, needs a range and a destination. In short- The VERIFY command, hand: {destination} < {start} . [end] V at the destination address, If The Monitor compares the range specified with the range beginning there is any discrepanc y, the Monitor displays the address at which the difference was found and the two offending values. °@:D7 F2 E9 F4 F4 ES EE A® E2 F9 A@ C3 C4 CS ‘EL 1E| fe) (6) (E) (El ‘EL ‘El +300<0.DM ei *300<0.DV *6:E4 *300<0.DV #HH6—-E4 (EE) address of the location Notice that the VERIFY command, if it finds a discrepancy, displays the range. If there is in the original range whose value differs from its counterpart in the destination displays nothing, It leaves both ranges unchanged. The last opened and no discrepancy, VERIFY the MOVE command. As before, if the ending next changeable locations are set just as in of the range is less than the starting address, the values of only the first locations in the address is within the origi- ranges will be compared. VERIFY also does unusual things if the destination nal range; see ‘Special Tricks’’, page 55. SAVING A RANGE OF MEMORY ON TAPE a range of memory onto cassette The Monitor has two special commands which allow you to save tape and recall it again for later use. The first of these two commands, WRITE, lets you save the contents of one to 65,536 memory locations on standard cassette tape, and ending addresses of the To save a range of memory to tape, give the Monitor the starting range, followed by the letter W (for WRITE): 46 {start} .{end} W To get an accurate recording, you should put the tape recorder in record m before you press RETURN) on the input line. Let the tape run a few seconds, then press [RET |. The Monitor will write a ten-second “‘leader’™’ tone onto the tape, followed by the data. When the Monitor is finished, it will sound a ‘’*beep!” and give you another prompt, You should then rewind the tape, and label the tape with something intelligible about the memory range that’s on the tape and what it's supposed to be *@.FF FF AD 30 C®@ 88 DO 04 C6 Ol FO O8 C A D@ F6 Ab 06 4C 2 OO 60 rn a «0.14 ##40— FF #H48— CO FF HI AD FH 34 #8 C#@ 88 CA DA D# F6 44 AG W#H10— WH 4C 42 WH 64 “0. 14W It takes about 35 seconds total to save the values of 4,096 memory locations preceded by the ten-second leader onto tape. This works out to a speed of about 1,350 bits per second, average. The WRITE command writes one extra value on the tape after it has written the values in the memory range. This extra value is the checksum. It is the partial sum of all values in the range. The READ subroutine uses this value to determine if a READ has been successful (see below), READING A RANGE FROM TAPE Once you've saved a memory range onto tape with the Monitor's WRITE command, you can read that memory range back into the Apple by using the Monitor's READ command. The data values which you've stored on the tape need not be read back into the same memory range from whence they came; you can tell the Monitor to put those values into any similarly sized memory range in the Apple's memory. The format of the READ command is the same as that of the WRITE command, except that the command letter is R, not W: {start) .fend} R Once again, after typing the command, don’t press [RETURN]. Instead, start the tape recorder in PLAY mode and wait for the tape’s nonmagnetic leader to pass by. Although the WRITE com- mand puts a ten-second leader tone on the beginning of the tape, the READ command needs only three seconds of this leader in order to lock on to the frequency. So you should let a few seconds of tape go by before you press [RETURN], to allow the tape recorder’s output to settle down to a steady tone, “O79 OP OHAHBKDAAKBHAAHHHADA D 60 *8.14 rrr PO #H0— O68 4H 6H OO AH OH OH OO #HH8— OH 40 OH OH WH OH OH AO #H1d— #6 48 OH OH OO *@.14R “0.14 #0HA— FF FF AD 38 C# 88 DO #4 ##48— C6 #1 FA #8 CA D# F6 AG #H1d— #4 4C #2 OH 68 After the Monitor has read in and stored all the values on the tape, it reads in the extra check- sum value, It compares the checksum on the tape to its own checksum, and if the two differ, the Monitor beeps the speaker and displays ““ERR"*. This warns you that there was a problem during the READ and that the values stored in memory aren't the values which were recorded on the tape. If, however, the two checksums match, the Monitor will give you another prompt, CREATING AND RUNNING MACHINE LANGUAGE PROGRAMS Machine language is certainly the most efficient language on the Apple, albeit the least pleasant in which to code. The Monitor has special facilities for those of you who are determined to use machine language to simplify creating, writing, and debugging machine language programs. You can write a machine language program, take the hexadecimal values for the opcodes and operands, and store them in memory using the commands covered above. You can get a hexade- cimal dump of your program, move it around in memory, or save it to tape and recall it again simply by using the commands you've already learned. The most important command, however, when dealing with machine language programs is the GO command. When you open a location from the Monitor and type the letter G, the Monitor will cause the 6502 microprocessor to start executing the machine language program which begins at the last opened location. The Monitor treats this program as a subroutine: when it’s finished, all it need do is execute an RTS (return from subroutine) instruction and control will be transferred back to the Monitor, Your machine language programs can call many subroutines in the Monitor to do various things. Here is an example of loading and running a machine language program to display the letters A through Z: *300:A9 Cl 20 ED FD 18 69 1 C9 DB DO F6 60 *300,30C IF) #308— A9 Cl 24 ED FD 18 69 @1 #348— C9 DB DA F6 64 *300G ABCDEFGHI J KLMNOPQRS TUVWXYZ (The instruction set of the Apple's 6502 microprocessor is listed in Appendix A of this manual.) o I F) F 48 Now, straight hexadecimal code isn't the easiest thing in the world to read or debug. With this in mind, the creators of the Apple's Monitor neatly included a command to list machine language programs in assembly language form. This means that instead of having one, two, or three bytes of unformatted hexadecimal gibberish per instruction you now have a three-letter mnemonic and some formatted hexadecimal gibberish to comprehend for each instruction. The LIST command to the Monitor will start at the specified location and display a screenfull (20 lines) of instruc- tions +300 #3H4— AY Cl LDA #SCI #342— 24 ED FD JSR SFDED #385— 18 CLC #386— 69 #1 ADC #SO1 #348— C9 DB CMP #SDB #34A— DA F6 BNE SA3H2 #34C— 64 RTS #34D— 4 BRK #30E— “4 BRK #30F— “4 BRK #314— aa BRK e311= Ut) BRK #312-— Ut) BRK #313-— a” BRK #314— Ld BRK 8315-— ae BRK #316— a¢ BRK | Wyfoe a6 BRK #318— “4 BRK #319— #8 BRK Recognize those first few lines? They're the assembly language form of the program you typed in a page or so ago. The rest of the lines (the BRK instructions) are just there to fill up the screen. The address that you specify is remembered by the Monitor, but not in one of the ways explained before. It’s put in the Program Counter, which is used solely to point to locations within programs. After a LIST command, the Program Counter is set to point to the location immediately following the lust location displayed on the screen, so that if you do another LIST command it will continue with another screenfull of instructions, starting where the first screen left off. THE MINI-ASSEMBLER There is another program within the Monitor* which allows you to type programs into the Apple in the same assembly format which the LIST command displays, This program is called the Apple Mini-Assembler. It is a ‘*mini’’-assembler because it cannot understand symbolic labels, something that a full-blown assembler must do. To run the Mini-Assembler, type: * The Mini-Assembler docs noi actually reside in the Monitor ROM, but is part of the Integer BASIC ROM RU ae scl. Thus, tt is not available on Apple Il Plus systems or while Firmware Applesoft I is in use 49 *F666G TEI (El You are now in the Mini-Assembler. The exclamation point (!) is the prompt character. During your stay in the Mini-Assembler, you can execute any Monitor command by preceding it with a dollar sign (S$), Aside from that, the Mini-Assembler has an instruction set and syntax all its own. The Mini-Assembler remembers one address, that of the Program Counter, Before you start to enter 4 program, you must set the Program Counter to point to the location where you want your program to go. Do this by typing the address followed by a colon. Follow this with the ‘El \El mnemonie for the first instruction in your program, followed by a space. Now type the operand of the instruction (Formats for operands are listed on page 66), Now press [RETURN]. The Mini-Assembler converts the line you typed into hexadecimal, stores it in memory beginning at (El the location of the Program Counter, and then disassembles it again and displays the disassem- bled line on top of your input line. It then poses another prompt on the next line. Now it’s ready to accept the second instruction in your program. To tell it that you want the next instruc- tion to follow the first, don’t type an address or a colon, but only a space, followed by the next instruction’s mnemonic and operand. Press [RETURN]. It assembles that line and waits for another, If the line you type has an error in it, the Mini-Assembler will beep loudly and display a circumflex (") under or near the offending character in the input line. Most common errors are the result of typographical mistakes: misspelled mnemonics, missing parentheses, etc. The Mini-Assembler also will reject the input line if you forget the space before or after a mnemonic or include an extraneous character in a hexadecimal value or address. If the destination address of a branch instruction is out of the range of the branch (more than 127 locations distant from the address of the instruction), the Mini-Assembler will also flag this as an error. 1300:LDX #02 #344#— wo IDEO +12V GND [>] Pin EI (El ‘El ({E) (Fi } Figure 15, Auxiliary Video Output Connector and Pin. BUILT-IN I/O The Apple’s built-in 1/O functions are mapped into 128 memory locations beginning at SCHOO. On the Apple board, a 74L$138 at location F13 called the I/O selector decodes these 128 special addresses and enables the various functions. The 74LS138 is enabled by another "138 at location H12 whenever the Apple’s address bus con- tains an address between $C0OO and SCOFF. The 1/O selector divides this 256-byte range into eight sixteen-byte ranges, ignoring the range $C@8@ through SC@FF. Each output line of the "138 becomes active (low) when its associated 16-byte range is being referenced. The “@"* line from the I/O selector gates the data from the keyboard connector into the RAM data multiplexer. The “1” line from the I/O selector resets the 74LS74 flip-flop at B10, which is the keyboard flag. The “2” line toggles one hulf of a 74LS74 at location K13, The output of this flip-flop is con- nected through a resistor network to the tip of the cassette output jack, The **3"* line toggles the other half of the 74LS74 at K13. The output of this flip-flop is con- nected through a capacitor and Darlington amplifier circuit to the Apple's speaker connector on the right edge of the board under the keyboard, The **4° line is connected directly to pin 5 of the Game I/O connector. This pin is the utility C046 STROBE JF (Fl (8) (Ei (81 JEt (8) 8; 8) 1Bi The **5”’ line is used to enable the 74LS259 at location F14, This IC contains the soft switches for the video display and the Game I/O connector annunciator outputs. The switches are selected 98 by the address lines 1 through 3 and the setting of each switch is controlled by address line 6 The **6"’ line is used to enable a 74LS251 eight-bit multiplexer at location H14. This mullti- plexer, when enabled, connects one of its eight input lines to the high order bit (bit 7) of the three-state system data bus. The bottom three address lines contro! which of the eight inputs the multiplexer chooses, Four of the mux’s inputs come from a 553 quad timer at location H13., The inputs to this timer are the game controller pins on the Game I/O connector. Three other inputs to the multiplexer come from the single-bit (pushbutton) inputs on the Game I/O connec- tor, The last multiplexer input comes from a 741 operational amplifier at location K13. The input to this op amp comes from the cassette input jack The **7"* line from the I/O selector resets all four timers in the 553 quad timer at location H13 The four inputs to this timer come from an RC network made up of four 0.022«F capacitors, four 100 Ohm resistors, and the variable resistors in the game controllers attached to the Game 1/O connector. The total resistance in each of the four timing circuits determines the timing characteristics of that circuil “USER 1’? JUMPER There is an unlabeled pair of solder pads on the Apple board, to the left of slot @, called the “User 1°’ jumper. This jumper is illustrated in Photo 8. If you connect a wire between these two pads, then the USER | line on each peripheral connectors becomes active. If any peripheral card pulls this line low, a// internal 1/O decoding is disabled. The I/O SELECT and the DEVICE SELECT lines all go high and will remain high while USER | is low, regardless of the address on the address bus. 2 cS 2 to & t 2 . e e _ r oe co b i te » b oa The USER | Jumper Photo 8. The USER I Jumper. iin 99 THE GAME I/O CONNECTOR PB2 C040 STROBE GCé GC2 Gnd Figure 16. Game I/O Connector Pinouts Table 29: Game I/O Connector Signal Descriptions Name: Description: +5v +5 volt power supply. Total current drain on this pin must be less than 100mA. PBO-PB2 Single-bit (Pushbutton) inputs. These are standard 74LS series TTL inputs. C048 STROBE A general-purpose strobe, This line, normally high, goes low during «@ of a read or write cycle to any address from $C@40 through $C@4F. This is a standard 74LS TTL output. 6,7,10.11 GC8-GC3 Game controller inputs. These should each be connected through a 150K Ohm variable resistor to +5v. Gnd System electrical ground. AN@-AN3 Annunciator outputs. These are standard 74LS series TTL out- puts and must be buffered if used to drive other than TTL inputs. No internal connection. THE KEYBOARD The Apple's built-in keyboard is built around a MM5740 monolithic keyboard decoder ROM. The inputs to this ROM, on pins 4 through 12 and 22 through 31, are connected to the matrix of keyswitches on the keyboard. The outputs of this ROM are buffered by a 7404 and are connected to the Apple’s Keyboard Connector (see below). The keyboard decoder rapidly scans through the array of keys on the keyboard, looking for one which is pressed. This scanning action is controlled by the free-running oscillator made up of {Fi three sections of a 7400 at keyboard location U4, The speed of this oscillation is controlled by C6, R6, and R7 on the keyboard's printed-circuit board. } Nooo HOUT! i re bar als eee = 4 sft we 4 “A : . E~ yb ase ’Sante fir | be a . ° i ae Figure 17. Schematic of the Apple Keyboard a} NA | A A 101 The [REPT] key on the keyboard is connected to a 555 timer circuit at board location U3 on the keyboard. This chip and the capacitor and three resistors around it generate the 10Hz ““REPeaT™ ‘FL Fi_ signal. If the 220K Ohm resistor R3 is replaced with a resistor of a lower value, then the [REPT key will repeat characters at a faster rate. = See Figure 17 for a schematic diagram of the Apple Keyboard. peel _ —- KEYBOARD CONNECTOR | — |] The data from the Apple's keyboard goes directly to the RAM data multiplexers and latches, the two 74LS257s at locations B6 and B7. The STROBE line on the keyboard connector sets a i 74LS74 flip-flop at location B10. When the I/O selector activates its “*@’ line, the data which is on the seven inputs on the keyboard connector, and the state of the strobe flip-flop, are mullti- — plexed onto the Apple’s data bus, J Table 30; Keyboard Connector Signal Descriptions = Pin: Name: Description: : 1 +5v +5 volt power supply. Total current drain on this pin must be — less than 120mA. Be 2 STROBE Strobe output from keyboard. This line should be given a pulse ~ at least 10us long each time a key is pressed on the keyboard. The strobe can be of either polarity. = 3 RESET Microprocessor’s RESET line. Normally high, this line should be pulled low when the [RESET] button is pressed. = 4.9.16 NC No connection. _ J 5-7, 10-13 Data Seven bit ASCII keyboard data input. eas 8 Gnd System electrical ground. _ 15 —12v —12 volt power supply. Keyboard should draw less than a] 50mA. oo = = . ~ -— 102 +5v £€ 16 | NC STROBE | 2 15 | —12v RESET | 3 14.) NC NC | 4 13 | Datal Data5 | 5 /2 | Data@ Data 4 | 6 J] | Data 3 Data 6 7 /0 | Data 2 Gnd | 8 9} NC Figure 18. Keyboard Connector Pinouts CASSETTE INTERFACE JACKS The two female miniature phone jacks on the back of the Apple II board can connect your Apple lo a normal home cassette tape recorder Cassette Input Jack: This jack is designed to be connected to the **Earphone’’ or ~‘Monitor™ output jacks on most tape recorders. The input voltage should be | volt peak-to-peak (nominal) The input impedance is 12K Ohms Cassette Output Jack: This jack is designed to be connected to the “‘Microphone™ input on most tape recorders. The output voltage is 25mv into a 100 Ohm impedance load aa WNP PNY 103 POWER CONNECTOR This connector mates with the cable from the Apple Power Supply. This is an AMP #9-35028-1 six-pin male connector. Table 31: Power Connector Pin Descriptions Name: Description: Ground Common electrical ground for Apple board. +5v +5.0 volts from power supply. An Apple with 48K of RAM and no peripherals draws ~1.5 amp from this supply. +12v +12.0 volts from power supply. An Apple with 48K of RAM and no peripherals draws ~400ma from this supply. —12v —12.0 volts from power supply. An Apple with 48K of RAM and no peripherals draws ~12.5ma from this supply. —5v —§.0 volts from power supply. An Apple with 48K of RAM and no peripherals draws ~0.0ma from this supply. Figure 19. Power Connector ‘Fi 6 ow fi | ee (fi (#i («Fi {Fi en (8 (i (Fi til Mi Pi Tei of Fi 104 SPEAKER The Apple’s internal speaker is driven by half of a 74LS74 flip-flop through a Darlington amplifier circuit. The speaker connector is a Molex KK100 series connector, with two square pins, .25” tall, on .10° centers Table 32: Speaker Connector Signal Descriptions | Pin Name Description |] SPKR Speaker signal This line will deliver about .5 watt into an 8 Ohm load |2 + Sy +5 volt power supply. SPKR +5V Figure 20. Speaker Connector PERIPHERAL CONNECTORS The eight peripheral connectors along the back edge of the Apple’s board are Winchester #2HW25C0-111 50-pin PC card edge connectors with pins on .10° centers, The pinout for these connectors is given in Figure 21, and the signal descriptions are given on the following pages ea 105 IF Fl RDY or) DEVICE SELECT D7 D6 D5 D4 D3 D2 01 Al Do $C +12V 1/0 SELECT ~“NWOAOOANDO Figure 21. Peripheral Connector Pinout Table 33: Peripheral Connector Signal Description Pin: Name: Description: / This line, normally high, will become low when the microprocessor references page SCn, where n is the individual slot number. This signal becomes active during @ and will drive 10 LSTTL loads*. This signal is not present on peripheral connector @. 2-17. =A@-Al5 The buffered uddress bus. The address on these lines becomes valid during ®1 and remains valid through ®@. These lines will each drive 5 LSTTL loads*. Buffered Read/Write signal. This becomes valid at the same time the address bus does, and goes high during a read cycle and low dur- ing a write. This line can drive up to 2 LSETL loads*. On peripheral connector 7 only, this pin is con- nected to the video timing generator’s SYNC signal. 20 1/0 STROBE This line goes low during @@ when the address bus contains an address between $C80@ and SCEFF, This line will drive 4 LSTTL loads*. The 6502's RDY input. Pulling this line low during @1 will halt the microprocessor, with the address bus holding the address of the current location being fetched, 22 DMA Pulling this line low disables the 6592's address bus and halts the microprocessor. This line is held high by a 3K resistor to +5v. 23 INT OUT Daisy-chained interrupt output to lower priority devices. This pin is usually connected to pin 28 (INT IN). 24 DMA OUT Daisy-chained DMA output to lower priority devices. This pin is usually connected to pin 22 (DMA IN). 25 +Sv +§ volt power supply. 500mA current is avail- able for all peripheral cards. System electrical ground. * Loading limits are for each peripheral card Neri DPUUNURUVTIV 107 Table 33 (cont'd): Peripheral Connector Signal Description Description: Daisy-chained DMA input from higher priority devices. Usually connected to pin 24 (DMA OUT). Daisy-chained interrupt input from higher priority devices. Usually connected to pin 23 (INT OUT). Non-Maskable Interrupt, When this line is pulled low the Apple begins an interrupt cycle and jumps to the interrupt handling routine at location $3FB. Interrupt ReQuest. When this line is pulled low the Apple begins an interrupt cycle only if the 65@2°s I (Interrupt disable) flag is not set. If so, the 6502 will jump to the interrupt han- dling subroutine whose address is stored in locations $3FE and S3FF. When this line is pulled low the microprocessor begins a RESET cycle (see page 36). When this line is pulled low, all ROMs on the Apple board are disabled. This line is held high by a 3K resistor to +Sv. —12 volt power supply. Maxmum current is 200mA for all peripheral boards. —5 volt power supply. Maximum current is 200mA for all peripheral boards. COLOR REF On peripheral connector 7 only, this pin is con- nected to the 3.5MHz COLOR REFerence sig- nal of the video generator. Fi 7MHz clock. This line will drive 2 LSTTL loads*. 2MHz asymmetrical clock. This line will drive 2 LSTTL loads”. Microprocessor’s phase one clock, This line will drive 2 LSTTL loads’. This line, when pulled low, disables a// internal 1/O address decoding**. * Loading limits are for each peripheral card ** See page 99. 108 coo #P. ‘Fl IFi (Fi (81 Fi Table 33 (cont'd): Peripheral Connector Signal Description :___Name: Description: oO Microprocessor’s phase zero clock. This line will drive 2 LSTTL loads*. DEVICE This line becomes active (low) on each peri- SELECT pheral connector when the address bus is hold- ing an address between $C@nM@ and S$C@nF, where n is the slot number plus $8, This line will drive 10 LSTTL loads*. 42-49 D@-D7 Buffered bidirectional data bus, The data on this line becomes valid 300nS into ©@ on a write cycle, and should be stable no less than 100ns before the end of ©@ on a read cycle. Each data line can drive one LSTTL load. 50 +12v +12 volt power supply. This can supply up to 250mA total for all peripheral cards. * Loading limits are for each peripheral card. PONV 109 lt(dl oe i Ul etvep ens wri vsines NOTE wiry Se ” oe me (aden(8 an ae ee et ja) dl 1 ‘al (al ‘al rope 2ypl—e jr pe pe ppt eI) oJ HeFO iT) fTt mmro fe an om10 fs Ome Clewwrroe Porren a: MLLEts seth eens fee “arn ee fit?4tpl mu) phe oo10ree Ta) HO Wmaeer topo cov ser Dan — | ee > | ‘ ss> Secccéssxscscer en gevte Esse fees cee Do ars Figure 22-1. Schematic Diagram of the Apple II 110 | | | vou al rin r bebbboae ' ‘ ‘ ‘ ‘ Fr . - ; L- : oS a es a ee he i.e. - - — rr . om i TosSa dnBe is Bae sD Be hsBe Bp ARIe rR re ri rr ® PoBe A Mma\ TTT r\ sal rt OeOrOe ¥A ‘a Lak - ~ aaa a Figure 22-2. Schematic Diagram of the Apple II a) - 112 Figure 22-3. Schematic Diagram of the Apple II | to a cee | sssmecsee rf(20 rth | f “i ac} ae yy ini + =F. Oe sta) 6s)6a) 61a) 6S) 61a) (al 61 6a) 6TH) Sa) tl tl Wi tH LO 1 ! ess oui ™ a ' - i 1 ! t } t 4 t Be, br ~- =} — +e be 4 - c -_ } re | e shy ne - = = a 3s a fre < orn t ' ce y Pp; = ~ on - ‘ . ~ - 4 ~- ov ” " * * - + hee. —_ | j = S = | | om - ’ | | im s= ] ube. » l] [ “ nb, om Qa Aa 113 . po” ree + § ; v}e i a \ o “ . awe otto Le ss = - — i} = a sd 1 oF = S Ey ; | te. Ik oh, a =y yt issscecamee i. 7 aA NW MA Ma WY ee ee ASE Res 5 Le aa - ad ¥ ~ - f -_ overs . f —— avevess ~ reba uae peee babe “ts ’ s al a | 4 af Herat? =e | +4 —#. a re = : +f——— —— S55 + —— ++ ret ——= —— = —4 ——— = 44 —_—_—- T + | 3 | 248 | " > } & mt pti phy if cea) | ey re a 3 i= i= — 1 ife = Ge i + +] - - + ~t -~ - 13 - ~ Sd m?ah ; 4 hg 4 a | no L o i. wit fh tt . | | 4 tte eS CEE hae ‘ * 3 Le Sivi*i gi * 1 + as mW . ; i + ] 4 Pt fv \\s 4 mW M4 ust 1} 4-9} wa}, & 3 i aa + a ae ‘ ' ' ' Figure 22-5. Schematic Diagram of the Apple II rs im: ims imi i= Ze 114 bet ey aca am ttt ddd HUNK eed RHT 11S 116 APPENDIX A THE 6502 INSTRUCTION SET 6502 MICROPROCESSOR INSTRUCTIONS aoc Ade Memory to Accumutator with Load Accumulator with Memory Carry Load Index X with Memory “AND” Memory eth Accumutator Loe index ¥ wri Memory Shitt Lett One Get (Memory or Shift Right one Bit (Mamory or Accumulator) Accumulator! Branch on Carry Clear No Operation Branch on Carry Set Branch on Result Zero “OR” Memory with Accumulator Pusan Accumulator on Stack VEL _fel el EL El TEL ORL Tes? Bits in Memory with Accumulator Push Processor Status on Stack Branch on Result Menus Pull Accurnulator trom Stack Branch on Result not Zero Pull Processor Status trom Stack Branch on Result Plus Rotate One Bit Lett (Memory or Force Break Accumulator! Branch on Overtiow Ciear Rotate One Bit Right (Memory or Branch on Overtiow Set Accumulator Ciear Carry Flag Return trom interrupt Cimar Decimal Mode Return trom Subroutine Clear Interrupt Disable Bit Subtract Memory from Accumulator Clear Overflow Fiag with Borrow Cornpare Memory and Accumulator Set Carry Flag Compare Memory and index x Set Decimal Mode Compare Memory and index ¥ Set interrupt Disable Status Decrement Memory by One Store Accumulator in Memory Decrement Index X by One Store index X in Memory Decrement index ¥ by One Store Index ¥ in Memory “Exclusive-Or” Memory with Transter Accumulator to Index X Accumulator increment Memory by One Transter Transter Accumulator to Index ¥ Stack Pornter to Index X (EL fel (Fl TEL (Fi Fl Increment Index X by One increment index ¥ by One Transter Transter index X to Accumulator Index X to Stack Pointer ss Transter index ¥ to Accumulator Jump to New Location dump to New Locabon Saving Return Address THE FOLLOWING NOTATION APPLIES TO THIS SUMMARY: Accumulator FIGURE t ASL-SMIFT LEFT ONE BIT OPERATION Index Registers Memory Borrow Processor Status Register Glaunge _ THE) Stack Pointer ovdrx> FIGURE 2 ROTATE ONE BIT LEFT (MEMORY Change OAR ACCUMULATOR) No Cnange fanooonooeo! Add f MORA ; Logical AND Subtract Logical Exctuswe Or Transter From Stack FIGURE 3 Transter To Stack fo@onnggogo, Transter To Transter To Logical OR Program Counter Program Counter High Program Counter Low NOTE 1 BIT TEST BITS Operans Immediate Addressing Mode Bit 6 and 7 are transterred to the status register if tne result of A AM is zero then Z©1, otherwise Z°0 Ven VY Vn 119 MeL TEL fel fe) PROGRAMMING MODEL A ACCUMULATOR 7 oO 7 ° TE fe): (Fr) x ] INDEX REGISTER X 56 7 0 IF PpCH l - PCL } PR OGRAM COUNTER | 7 Oo [0 | s } STACK POINTER PROCESSOR STATUS REGISTER, "PF CARRY ZERO INTERRUPT DISABLE DECIMAL MOCE BREAK COMMAND OVERFLOW NEGATIVE io) ie) Je) ae |2 i) J) Yn) J) 120 : ‘Assembly MEX T Mame Operation Addressing Language OF | No | ~P” Status Reg ___Bessription Made Form Code | Bytes | wicioyv ADC Adé memory to A-M-C AC | immedate | ADC *Oper @ | 2 Wns accumulator with carry Zero Page ADC Oper 65 2 | Zero Page | ADC Oper.x % | 2 Absolute ADC Oper a 3 | Adsolute.x ADC Oper.x 70 3 Absolute ¥ ADC Oper.Y re] 3 (indirect.X} ADC (Oper.x) 6 2 (indirect) ¥ i Bi ADC AR >. [Oper!.¥ 4 Al 2 , AND AND” memory with AAM } & | 1 ve INY | Increment index Y by one |¥ + 1 -—¥ : implied piv ca; 1 vy JMP | Jump to new location (PC+1) PCL | Absolute JMP Oper 4c 3 = (PC+2} PCH | Inderect 4 JMP (Oper) « + 3 + JSR Jump to new location PCr24 Absotute JSA Oper 2 3 Saving return address (PC+1} PCL | (PC +2) PCH ee + + + —. LOA | Load accumulator |M-~A | Immediate LDA #Oper ag 2 3ie Deana with memory Zero Page LOA Oper AS 2 Zero Page. x LDA Oper,x BS 2 Absolute LDA Oper AD 3 Absolute x LDA Oper.x 80 3 AbsoluteY | LDA Oper.¥ | 3 (indwect.X) | LOA (Oper.x) AY | 2 —— (indivect)¥ 4| LDA (Oper).¥ a} — 2] = LOX | Load index x M =x Immediate LDX aOper A2 2 emcees with memory Zero Page =| LOX Oper Ab 2 Zero Page. Y | LOX Opery 86 2 Absolute LOX Oper AE 3 Absolute Y — en » ———_——__+ | LOX Oper.Y BE —— 3 LOY Load index ¥ M—+yY immediate LOY #Oper AG 2 vv with memory Zero Page LOY Oper a 2 Zero Page xX | LOY Oper.x a4 2 Absolute LOY Oper AC 3 Absolute X | LOY Oper.x Bc | 3 oii | LSA Snitt right one bet (See Figure 1) LSA A (memory of accumulator) LSA Oper LSA Oper.x LSA Oper Absolute x LSA Oper.x NOP No operation No Operation Impled “OR” memory with accumulator immediate Zeto Page g Zero Page.X Absolute Adsolute,x Absolute, ¥ (indirect x} findwect),.Y 22222322 PHA Push accumulator on stack Implied z PHP Push processor status on stack implied |ie i (Fl Pull processor status trom stack Rotate one bet lett (See Figure 2) Accumulator AOL A (memory or accumulator) Zero Page ROL Oper Zero Page.x ROL Oper,x Absolute ROL Oper Absotute ROL Oper.x — IF | Rotate one tit right (See Figure 3) Accumulator ROR A imemory of accumulator) Zero Page ROR Oper Zero Page.x ROR Oper.% Absolute ROR Oper Absolute X ROR Oper,x { | | | Assembly ] T » ae Name Operation «| Addressing Language | Description Mode Form RTI Return trom imterrupt peece implied : yan “0 uyau From Stack ATS - Retutn trom subroutine PCE, PC~t PC) Implied ATS 1 -—___—_—_——_ ——- + —+— - --+ ae SBC | Subtract memory from =| A-M-C +A | immediate SBC *Oper t9 2 vv accumutator with borrow Zero Page SBC Oper } € 2 Zero Page.X | SBC Operx | FS 2 Absolute | SBC Oper ED 3 Absolute X | SBC Operx Fo 3 Absolute Y SBC Oper Y Fo 3 | (indirect.x} | SBC (Oper.xX) | £1 2 (indirect! ¥ SBC [Oper).¥ Fl | 2 + ——————+ oo | SEC Set carry flag 1—C implied SEC x 1 aS is! SED i Set decimal mode 1+D | impties SseD Fe it 1 | SEI Set interrupt disable t+! implied SEI 7%e | status ae | Se eee | =wa STA | | Store accumulator A--M Zero Page STA Oper 6s | 2 in memory Zero Page x STA Oper.x Ss 2 Absolute STA Oper 60 3 Absolute x STA Oper.x 90 3 Absolute.Y¥ STA Oper.Y bE] 3 (indirect.X) STA (Oper,X) 61 2 (inderect).¥ STA (Oper).¥ Pi) 2 — 4 + + so STX Store index Xin memory | X ——M Zero Page STX Oper 86 2 : Zero Page ¥ | STX Oper. % 2 Absolute itSTX Oper 8E 3 sTY $$$} —___+ — | Ye Store index ¥ in memory | ¥ —M Zero Page STY Oper | #4 2 = Zero Page.X =| STY Oper.x 4 2 oo | a | Absolute STY Oper 4 3 7 TAX Transfer accumulator Ax imped TAK AA 1 vv ——— _ 10 index x M 4 + 1 — TAY Transter accumulator lay | bmpleed Tay AB ’ vv to index Y¥ | | + - +- — 4 - —— | TSX | Transter stack pointer $x imphec TSK BA 1 we — [to inden a eae Ae eal e Lt 125 2 Assembly Name Oper stice Addressing Language Oescriptien Mote form IE} XA Transter index X implied TxA to accumulato TXS Transfer index X to Implied stack powiter TYA Transfer index Y lnpled TYA to accumulator iE [E! If if ig imi iti rm tai ie 126 HEX OPERATION CODES BRK SE — LSA — Absolute. x ORA — ‘Indirect, x BM 5F — NOP NOP AND — 'Inderect), ¥ 60 ats NOP NOP 61 — ADC — ‘tnovect, x! NOP NOP 62 — NOP ORA — Zero Page noP 63 NOP ASL — Zero Page AND — Zero Page. x 64 NOP NOP AOL — Zero Page, x 65 — ADC — Zero Page PHP NOP 66 — AOR — Zero Page ORA — immediate SEC 67 — NOP ~ ASL — Accumulator AND — Absolute, ¥ 68 — PLA NoP NOP 69 ADC — immediate NnoP NOP 6A — ROR — Accumulator ORA — Absolute NOP 68 — NOP ASL — Absolute ~ AND — Absolute x 6C — JMP — indirect NnNoP ROL — Absolute, X 60 — ADC — Absolute BPL NOP 6 — ROR — Absolute ORA — lindirect!. ¥ at 6* — NOP NOP EOR — tindivect, Xx! 70 — BVS NOP NOP 71 — ADC — tindirect!, ¥ NOP NOP 72 — NOP ORA — Zero Page, x NOP 73 — NOP ASL — Zero Page. x 45 — EOR — Zero Page 74 — NOP NOP LSA — Zero Page 75 ADC — Zero Page, x c.c at — NOP 76 — ROR — Zero Page. x ORA — Absolute. ¥ PHA 77 — NOP NOP 43— EOR — immediate 78 — SEI NOP 4A — LSR — Accumulator 78 —~ ADC — Absolute. ¥ NOP 45 — NOP TA — NOP ORA — Absolute, X 4c — JMP — Absolute 78 — NOP ASL — Absolute, x 40 - EOR — Absolute 7c — NOP NOP «=— LSR — Absolute 7D — ADC — Absolute, xX NOP JSA +F— NOP 7E — ROR — Absolute. X NOP AND — (indirect, x) Bvc 7F — NOP NOP s1— EOR (indirect), ¥ 80 — NOP NOP noP 81 — STA tincirect, X) BIT — Zero Page NOP a2 NOP AND — Zero Page NOP 83 — NOP ROL — Zero Page EOR — Zero Page, x B4 —STY — Zero Page NOP LSR — Zero Page, x 85 — STA — Zero Page PLP NoP 86 — STX — Zero Page AND — Immediate cu 87 NOP ROL — Accumutator EOR — Absolute. ¥ 88 — DEY NOP NOP 69— NOP BIT — Absolute NOP BA — TXA AND — Absolute NOP 66 — NOP ROL — Absolute EOR — Absolute, x 8C — STY — Absolute aRR 127 80 — STA — Ansolute 64 — LDY — Zero Page. x De — NOP #E — STX — Absolute 85 — LDA — Zero Page. x DC —NOP 6F— nor 86 — LOX — Zero Page. Y DD — CMP — Absolute x 90— acc 87 — NOP DE — DEC — Absolute x 81 — STA = lindwect! ¥ BS — Civ OF — NOP 92 — NOP 89 — LDA — Absotute ¥ £0 — CPX — Immedute 93— NOP BA — TSx €t — SBC — tindirect. x 94 — STY — Zero Page x 6B — NOP &2— nop 95 — STA — Zero Page. x BC —LDY — Atsolute x —3 — nor 96 — STX — Zero Page Y BD —LDA — Absolute. X £4 — CPx — Zero Page 97 — NOP BE — LDX — Absolute, ¥ E5 — SBC — Zero Page 96 — TYA BF — NOP &6 — INC — Zero Page 99 — STA — Ansolute. ¥ CO — CPY — Immediate &7 — NOP 94 — TXS Ct — CMP — tingirect, x E65 — INx 96 — NOP fel ‘Ei {El (El (8, fe) |TE i c? — Nor ES — SBC — immediate 9c — NOP c3 — NOP EA — NOP 90 — STA — Absofute. X C4 — CPY — Zero Page —B — NOP 9£ — NOP C5 — CMP — Zero Page £C — CPX — Absolute of — NOP C6 — DEC — Zero Page ED — SBC — Absolute AD — LDY — immediate Cc? — noP EE — INC — Absolute Al — LDA — tindirect. Xi cB — INY eF — NOP A2 — LDX — immediate Ce — CMP — immediate fo — BEO A3 — NOP CA — DEX F1 — SBC — lindirect), ¥ A4 — AS — LDY — LOA — Zero Page Zero Page cB — NOP CC —CPY — Absolute F2 — NOP F3— NOP I 1Ei fel AG — LOX — Zero Page CD —CMP — Absolute F4 — NOP AT — NOP CE — DEC — Adsolute f5 — SBC — Zero Page. x AB— TAY cr — NOP F6 — INC — Zero Page, x {Fl Aa — LDA — immediate 00 — BNE FT — NOP AA — TAX 01 — CMP — tingirecti. ¥ F6— SED AB — NOP 02 — NOP F9 — SBC — Absolute. ¥ AC — LDY — Absolute 03 — NOP FA — NOP AD — Absolute 04 — NOP Fe — NOP AE — LOX — Absolute 05 — CMP — Zero Page. x FC — NOP AF — NOP 06 — DEC — Zero Page, x FO — SBC — Absolute, x BO — BCS oO? — NOP FE — INC — Absolute, x Bt — LOA — lindirect!, ¥ os—cLoO FF — NOP B2— NOP 09 — CMP — Ansolute. ¥ B3 — NOP OA — NOP 128 APPENDIX B SPECIAL LOCATIONS Table 1: Keyboard Special Locations Location: Hex Decimal Description: $C008 49152-16384 =Keyboard Data $CO16 49168 -16368 Clear Keyboard Strobe Table 4: Video Display Memory Ranges Begins at: Ends at: Sersen Page Hex Decimal Hex Decimal Text/Lo-Res Primary $400 1024 $7FF 2047 Secondary $800 2048 SBFF 3071 Hi-Res Primary $200@ 8192 S3FFF 16383 Secondary $4000 16384 SSFFF 24575 Location: Description: Hex Decimal $CO5@ 49232 -16304 Display a GRAPHICS mode. $CO51 49233 -16303 Display TEXT mode. $C@52 49234 -16302 Display all TEXT or GRAPHICS. $CO53 49235 -16301 Mix TEXT and a GRAPHICS mode. $C@54 49236 -163008 Display the Primary page (Page 1). $C@55 49237 -16299 Display the Secondary page (Page 2). $C@56 49238 -16298 Display LO-RES GRAPHICS mode. $C@57 49239 -16297 Display HI-RES GRAPHICS mode. Address: Ann. = State Decimal Hex 0 off 49240 -16296 $CH58 on 49241 -16295 $C@S59 1 off 49242-16294 S$COSA on 49243-16293 $CO5B 2 off 49244 -16292 $C@S5SC on 49245 -16291 $C@SD 3 off 49246 -16298 S$CBSE on 49247 -16289 SCOSF 130 Table 10: Input/Output Special Locations ee ee (i 2 r Address: , Function Deckinal Hex Read/Write 49200 = -16336 = $C030 Cassette Out | 49184 -16352 $C020 Cassette In 49256 -16288 SCHOO Annunciators | 49240 -16296 $CO58 R/W through through through 49247 -16289 $COSF Flag inputs 49249 -16287 $CH61 49250 -16286 $C 062 49251 -16285 $C063 Analog Inputs | 49252 -16284 $CH64 49253 -16283 $C065 49254 -16282 SCH66 49255 -16281 $C067 49264-16272 SCOT Utility Strobe | 49216-16320 scoae |R_ Table 11: Text Window Special Locations Location: Minimum/Normal/Maximum Value Decimal Hex | Decimal Hex Teh Edse [32820 |070739 —-SO/SW/SIT8 r Width | 33 S21_| 0/40/40 S0/S28/S2 0/0/24 $0/S0/S18 0/24/24 —$0/S18/S18 Table 12: Normal/Inverse Control Values Value: eee ree 255 Decimal Hex Effect: SFF | COUT will display characters in Normal mode. 63 $3F | COUT will display characters in Inverse mode. 127 S7F | COUT will display letters in Flashing mode, all other characters in Inverse mode. Table 13: Autostart ROM Special Locations Location: Contents: Decimal Hex 1010 $3F2 Soft Entry Vector, These two locations contain 1011 $3F3 the address of the reentry point for whatever language is in use. Normally contains SE0@3. 1012 S3F4 Power-Up Byte. Normally contains $45. 64367 SFB6F This is the beginning of a machine language (-1169) subroutine which sets up the power-up location. HN rHUN 131 Table 14: Page Three Monitor Locations Address: Use: Decimal Hex Monitor ROM Autostart ROM 1008 $3F0 Holds the address 1009 $3F1 of the subroutine which handles machine language “BRK* requests (normaly $FAS9). it “1012 S3F4 |None. | Power-up byte. _| 1013 $3F5 | Holds a ‘‘JuMP”** instruction to the 1014 $3F6 | subroutine which handles Applesoft I 1015 $3F7 | ‘*&" commands. Normaly $4C $58 SFF. El (Fl TEL (El TE. 1016 $3F8 Holds a “JuMP"’ instruction to the 1017 $3F9 | subroutine which handles ‘‘User’’ 1018 S3FA CTRL Y}) commands. 1019 $3FB | Holds a “‘JuMP* instruction to the 1020 $3FC | subroutine which handles Non- 1021 $3FD | Maskable Interrupts. 1022 $3FE | Holds the address of the subroutine (Fi 1023 S$3FF | which handles Interrupt ReQuests. Table 22: Built-In I/O Locations $6 $1 $2 $3 $4 SS $6 $7 $8 S9 SA SB SC SD SE $F (Fl $CH00 Keyboard Data Input $CO1@ | Clear Keyboard Strobe i C020 | Cassette Output Toggle Speaker Toggle Utility Strobe rE [$0050 |ex|tx|nomix|mix|pri|sec|tores|hires | and | ant _| _an2?_| and_| '$C60 |cin|poi|pb2 |nbs|wow|wet|eer |vcs| repeat scosasces7 | $C078 |Game Controller Strobe Key to abbreviations: gr Set GRAPHICS mode tx Set TEXT mode nomix Set all text or graphics mix Mix text and graphics pri Display primary page sec Display secondary page lores Display Low-Res Graphics hires Display Hi-Res Graphics an Annunciator outputs pb = Pushbutton inputs ge Game Controller inputs cin Cassette Input 132 TE Table 23: Peripheral Card 1/O Locations : 32 $3 $4 SS $6 S7 S8 $9 SA SB SC SD SE SF Input/Output for slot number Ss IAWhawWNe PROM space for slot number WN SAU Table 25: 1/O Location Base Addresses Base - Slot Address | 2 3 4 5 6 7 $CO90 SCOAO SCHBO $COCO $CODO $SCOEO SCOFO $C091 SCOAIL SCOBI $cacl scab $CHEI SCOFI $C092 SCOA2 SCOB2 $COC2 SCOD2 $CHOE2 SCOF2 $C093 SCOA3 SCOB3 $COC3 $C@D3 SCOE3 SCOF3 $CO94 SCBOA4 SCOB4 $Cec4 $COD4 SCOE4 SCOF4 SCO9S SCOAS $COBS $COCS $CODS SCOES SCOFS $CO96 $CBA6 $SCHB6 $COC6 $COD6 $COE6 SCOF6 $C097 SCBAT SCOB7 $COC7 $C6D7 $COE7 SCOFT $CH98 SCOAB SCOB8 SCOC8 SCOD8 SCOE8 SCOF8 $C899 SCOAYI SCOB9 $Céc9d SCOD9 SCOE9 SCOFY SCO9A SCOAA SCOBA S$COCA S$CODA SCBOEA SCOFA $CO9B SCOAB SCOBB SC@CB SCA#DB S$CBOEB SCHFB sca9c §=6SCHAC.- =OSCOBC. = SC@CC. = SCODC = SCHEC — SCOFC SC@9D S$COAD SCOBD S$C@CD SCODD S$COED SCOFD $CO9E SCOAE SCOBE SCOCE SCODE SCHEE SCOFE SCO9F S$COAF SCOBF SCOCF $CODF SCOEF S$COFF 1/O Locations PONV 33 [— Table 26: 1/O Scratchpad RAM Addresses Base | Slot Number | Address | | 2 3 4 =) 6 $0478 | $0479 SO47A =SO47BSO47C.-—CSM47D ~—SO47E SO4F8 | SO4F9 SO4FA SO4FB SO4FC «SO4FD =SO4FE $0578 | $0579 S@S7A $OS7B S@57C S0S7D = SOSTE fe fe. fel SOSF8 | SOSF9 SOSFA SOSFB SOSFC S@SFD S05FE $0678 | $0679 $067A $067B $067C $067D $067E SO6F8 | SO6F9 SO6FA SO6FB SO6FC SO6FD SO6FE $0778 | $0779 $@77A $077B $077C $077D $077E |SO7F8 | SO7F9 S@7FA SO7FB $07FC S@7FD S@7FE [El TE| IE. TE) 'E\ Tel [Pl (Bi (Ei (8) ‘Fl #6(Fi ‘Bi ‘Hi (8i (8 134 TE oe — APPENDIX C ROM LISTINGS 136 AUTOSTART ROM LISTING 155 MONITOR ROM LISTING IF AUTOSTART ROM LISTING L 0000 5 SOHO MOOHHH SHH HSS HHESE HEE HE 0000 34 000G 4 » APPLE 11 0000 0000 5S * MONITOR 6 13 {Fl TF Fl 0000 7 * COPYRIGHT 1978 By 8000 0000 & * APPLE COMPUTER, 5 * INC [Fl 0000 10 * ALL RIGHTS RESERVED 0000 11+ | i GOOG 12 * STEVE WOZNIAK 0000 i3 0000 14 Hee PORTH SR Oe OHH EeeeHHeeE Hee 0000 ooco i3 +# 16 # MODIFIED NOV 1976 IF 0000 17 # BY JOHN A ’ i \F 0000 ig 0000 LD HHH teeter eee reat eececeteeHHe ery Fsoo 2c ORG sFB00 FeOO 2 OBJ $2000 Faoo Sl SOMOS HH HEHEHE SEH REE HHH HOE OH Se Fsou 23 LOCO EGU $00 Feoo FB0O 24 25 Loc! WNDLFT EGU EGU 801 #20 |[Fl Feoo @é& WNDWDTH EGU $21 FaOO 27 WNDTOP EGU #22 FeoOo 26 WNDBTM EGU $23 FeOO FBOO eo 30 CH cV EGU EQU $24 $25 IF Fl Fa0O0 31 GBASL EGU $26 FeoO 32 GBASH EGU $27 FBOO 33 BASL EGU $28 Feoo 34 BASH EGU $29 FBOO 35 BAS2L EGU 824 FeOO 3é BAS2H EGU $28 Fl iIF. Fs00 37 he EGU $2c FBOO 38 LMNEM EGU $2C FeOO Fs0O 39 40 v2 RMNEM EGU EGU $2D $2D IF FaOO 41 MASK EGU $2E Feaoo FeOoO 42 43 CHASUM FORMAT EGU EGU $2E $2E Fl FeOoO: FBOO 44 4S LASTIN LENGTH EGU EQU $2F $2F | FOO 46 SIGN EGU $2F IF FsO00 47 COLOR EGU $30 Feoo 48 MODE EGU $31 FB00 Fseoo 49 SO INVFLG PROMPT EGU EGU #32 633 IF Fsoo: 53 YSAV EGU $34 Fsoo Se YSAV1 EQU $35 FsOoOo: 52 CSWL EGU $36 F800 54 CSWH EGU $37 FeO0O SS KSWL EQU $38 FB0o FBOO Sé S7 KSWH PCL EQU EQU $39 $34 IB ‘Fl FeOO S8@ PCH EGU $3B FBOO S9 AIL EGU $3C FBOO 60 AlH EQu $3D FBO9O 61 A2L EGU $3E FBOO 62 42H EQU $3F FBOO 63 ASL EGU $40 FeOO 64 AGH EGU $41 FBOO 65 ASL EGU $42 FBOO oé ASH EQU $43 Fe00 67 ASL EGU 844 FeOO: 6E ASH EQU 645 ‘Bi ‘Fi Fi ud) 136 FBOO acc NOTE OVERLAP WITH ASH‘ FBOO XREG FBOO YREG FBOO STATUS FaCO SPNT FaoO RNDL Fsoo RNDH Faco PICK Feoo IN FBOO BRKY NEW VECTOR FOR BRK Fe0O SOFTEV VECTOR FOR WARM START FBOO © PWREDUP THIS MUST » EOR S$A5 OF SOFTEV+1 FBOO AMPERYV APPLESOFT & EXIT VECTOR Faoo > USRADR Feoo NMI FaOO TRG@LOC F600 LINE1 Feco MSLOT Feoo IGADR FeOO KBD Faoo KBDSTRB FOO TAPEOUT Feoo SPAR FBOO TXTCLR FBOO TXTSET FeOO MIXCLR Feoo MIXSET FBOO LOWSCR FeOOo HISCR FBOO LORES FBOO HIRES FeOc SETANO FB00 CLRANO Feoo SETANI Faoo CLRAN1 FS00 SETAN2 Fseoo CLRAN2 FBOO SETANS FeOO CLRAN3 FBOO TAPEIN FeOO PADDLO Fs800 PTRIG FBO0O CLRROM FaOC BASIC FBO00 BASIC2 Feoo Feoo Sh PLOT FBO) 0& Feoe 20 a7 FB GBASCALC Feos 26 FBOé ay WSOF Fe0e8 90 RTMASK FBOA 69 #SE0 FsOC 5os RTMASK MASK FOE PLOT1 (GBASL),Y Feio 4s ~ COLOR Fei2 = MASK Fei4 $2 (GBASL).¥ Fei 91 (GBASL YY Fei6 60 Fe19 20 ele) FG HLINE PLOT Feic c4 HLINEL He FRIE BO RTS1 Fe20 cs > F621 e Fe PLOT! Fe24 90 HLINE?! F626 oF > VLINEZ #eOl F626 46 VLINE =, Feoo e Fe PLOT Faoc 66 Fe2b cs Va Fer 90 VLINEZ F633 60 RTS1 SR 137 IF\ Fe32 AO 142 CLRSCR LDY #S2F Fe34 bo 143 BNE CLRSCe Fase Ao 144 CLRTOP LDY “$27 FB3E 84 145 cLRSC2 SsTY v2 FEaSA AO 146 LDY *#S27 Fesc Ag 147 CLRSC3 LDA #600 Fe3E BS 148 STA COLOR FRSC 20 FG 149 JSR VLINE Fe4a Be 150 DEY IF (El (Fl Fess 10 1s BPL CLRSCS Fe4é 60 152 RTS FaS7 Fas? 49 15S 154 GBASCALC PAGE PHA (Fl Fe46 a4 iss LSR A 29 AND "$05 IF Faas 15e Fe4se oF 157 ORA #504 Fe4D 65 1568 STA GBASH Faar 65 is PLA Faso 29 160 AND ele Fes2 90 lel Bcc GBECALC Fass 49 162 abc #O7F Fgsé Fese 85 OA 143 164 GBCALC STA SBASL ASL al 1Fi TE) Faso OA 165 ASL A Fasa os 166 GBASL Fesc 65 157 GBASL (El FSSE 60 168 FesF As 169 COLOR Feel Feé2 18 69 170 173 #6035 IF. FBé4S ei) 172 SETCOL “BOF F666 85 173 COLOR Fe68 0A 174 Fe69 OF 175 FB6A ier 176 FeéR OA 177 Fl (Fi Feé6C os 178 FB6E B5 179 F870 Fe71 60 an 180 381 SCRN [Fi Fe72 oe 182 F873 20 FS 183 GBASCALC FE7é Bi 184 (GBASL),.¥ IE. Fe78 2e 16s F879 $0 184 SCRN2 RTMSKZ FS7E Fa7c 4A aA 167 188 a A (Fl Fe7D aa 189 4 F@7E: 190 Ei aA A Fa7F 29 191 RIMSKZ “SOF Feet 60 192 Fea2 193 Fase: AS 192 INSDS1 PCL Ei Fees A4 195 PCH Fede 20 FD 196 PRYXe Feey 20 FS 197 PRBLNK Feec Al 198 INSDS2 «PCL, X? FeBe AB 195 Fear an 200 A Fe90 90 201 IEVEN Fi Feo2 6A 202 a Fes3 BO 203 ERR Fees Fe97 cy FO 204 205 #EAD ERR iF FB99 29 206 “857 FS9R aa 207 TEVEN a Fasc AA 208 Fe9D BD Fe 209 FMT1, x FBAO 20 79 Fe 210 SCRNZ — FBAZ tele] 211 GETEMT ae FBAS AO 2ie ERR #880 FRA? Ag 2:3 #300 FBAD AA 214 GETFEMT 138 ] FBAA AS FS LDA Frite. x FBAD STA FORMAT FRAF AND #803 FSBi STA LENGTH Fes3 TYA Feb4 AND #SaF FeB6 TAX F6B7 TYA FeBE LDY #803 FBBA cPxX #S54 FeBC BEG MNNDX3 FSBE MNNDX1 LSR A FOBF BCC MNNDX3 Feci LSR A Fece MNNDX2 LSR A Fac2 GRA #620 Fecs DEY Fecé BNE MNNDX2 Feces INY Fec? MNNDX3 DEY FBCA BNE MNNDX 1 Fecc RTS FecD FF DFB $FF, OFF, SEF FBDO PAGE FeDO FS INSTOSP JBR INSDS! FBD3 PHA FeD4 PRNTOP LDA (PCL).¥ Febé FD JSR PRBYTE Fep? LDX #801 FEDB Fo PRNTBL JSR PRBL2 FBDE cPY LENGTH FREO INY FRE! gcc PRNTOP FBES LDx #803 FeES cPyY #504 FSE7 BCC PRNTBL FRE? PLA FBEA TAY FEE FS LDA MNEML, ¥ FSEE STA LMNEM FEFO Fe LDA MNEMR. ¥ FeF3 STA RMNEM FeFsS 00 NXTCOL LDA #300 Fer? LDY #205 FEF? PRMN2 ASL RMNEM FEFE ROL LMNEM FeEFD ROL al FeFE DEY Forr BNE PRMN2 F901 apc enr F903 FD JSR COUT F906 DEX F907 BNE NXTCOL F909 F9 JSR PRBLNK F90C LDY LENGTH F9OE LDx #b06 F910 PRADR} CPX "503 F912 BEG PRADRS F914 PRADR2 ASL FORMAT F916 BCC PRADRS F916 FS LDA CHARI~1,. x F9IB FD JSR cout F91IE F9 LDA CHAR2-i. x F9e2l BEG PRADR3 F923 FD JSR cout F926 PRADR3 DEX F927: BNE PRADR1 F929 RTS F92A PRADRS DEY F92B Bm PRADR2 F92D FD JSR PRBYTE F930 PRADRS LDA FORMAT F932 CMP #$E8 VON 139 3A 268 LDA «PCL).Y Fe 2e9 gcc PRADR4 2oc PAGE Sé FS 291 RELADR JSR PCADJZ 292 TAY 293 INX O1 294 BNE PRNTYX 295 Iny 296 PRNTYX TYA DA FD 297 PRNTAX PRBYTE 278 PRNTX DA FD 299 PRBYTE 03 300 PRBLNK #303 40 301% PRBEL2 #SA0 ED FD 302 PRBL3 couT 303 Fa 304 PRBL2 305 306 PCADY 2F 307 PCADV2 LENGTH 38 398 PCADJZ PCH 305 ot 310 PCADJ4 311 3A 3i2 PCADUS PCL o1 313 RTSe 314 315 RTS2 316 FMT} $04 317 $20 316 $54 319 $30 320 $0D 321 $80 322 $04 23 $90 324 $03 325 $22 326 $54 327 $33 328 $OD 329 $50 330 $04 331 $90 332 $04 333 $20 334 $54 335 $33 336 sod 337 $B0 338 $04 339 $90 340 $04 341 $20 342 $54 343 $35 344 $0D 345 $80 346 #04 347 $90 346 #00 349 $22 35¢ 44 351 $33 352 s0D 353 sca 254 $44 355 $00 35e $1: 357 $22 35e sag Tel |Ei (8) (Fi ‘Bi {Fi ‘(El (Ei fel fFi (Fl Tei TE, fEi ‘Rl (El 359 $33 360 $0D Li 140 F9aF DFB $ce F990 DFB sac F991 DFB AD F992 o1 DFB $01 F993 DFC $22 F994 DFB $44 F995 DFB $33 F996 DFS $OD F997 80 DFB $0 F998 DFS $04 F999 OFB $90 FOIA DFB $01 F99B DFB 22 F99C DFB $44 F99D DFB $33 FO9E DFB $0OD FO9F DFB $50 F9A0 04 DFB so4 FSAI DFB #90 FIA DFB $26 F9A3 DFB $31 FIA DFB $67 FIAS DFB 894 FIA FMT2 DFB $00 FRA7 DFD $21 FoAG DFB $81 F9AS DFB $82 FoAA DFB $00 F9AB DFB $00 F9AC DFB $59 F9AD DFB $4D FOAE DFB $91 FOAF DFB $92 F9BO DFB $66 FSB1 DFB 844 F9n2 DFS $65 FSB3 DFB $9D FOBS CHARI DFE $AC F9BS DFB Ad F9D6 DFB AC FOB7 DFE AR F9BB DFE SAS FoR9 DFE Bas FOBA CHAR2 DFB $D9 FSBB DFD $00 F9BC DFE $pB FED DFE BA4 FORE DFB SAS FOBRF DFB $00 F9CO MNEML DFD sic FOC DFB sca FSCce DFD sic FICS DOFB $23 F9C4 DFE $5D FSCS DFE $68 F9Cé DFB $1D F9C7 DFE $Al F9CE DFE 89D FOCS DFE $5A FICA DFB $1D FICB DFB $23 F9CC 9D DFB $9D F9CD DFB $8B FSCE DF $1D FSCF DFB $Al F9DO DFE $00 F9D1 DFE #29 F9D2 DFS $19 F9D2 DFS SAE F9D4 DFE $69 FODS DFB SAS F9ODé DFB $19 FOD7 DFB $23 a 141 1 a 434 $24 435 sss 436 S15 437 $23 438 $24 429 €53 440 $19 441 SAI 442 $00 4423 $1A 444 $55 445 $55 446 BAS 447 $69 448 $24 .] i 449 $24 450 AE 451 SAE 452 sag 483 SAD 454 $29 455 $00 456 $7c 457 $00 458 $15 459 $9c 460 6D 461 $9C 462 AS 463 $49 464 $29 465 $53 466 $04 467 $13 468 $34 469 $11 870 SAS 471 $69 472 23 4723 $A0 474 MNEMR SDE 475 $62 476 $50 477 $48 478 $26 479 $42 480 $94 481 soe 462 54 4983 $44 I 4g4 $CcB 465 $54 4gs 968 467 $44 465 sea 498° $94 490 $00 491 $54 492 $08 493 $B4 494 $74 495 $54 496 $26 497 $é6E 4968 $74 499 $F4 500 $cc 501 844 502 $72 503 sF2 504 SAS 505 $84 506 $00 142 FA21 FA22 FA23 FA24 FAQS FaAzé FART FA2e FAD9 FAZA Faen FAZC FA2D FAZE FA2F FAGO FAQ FA32 FA33 FA34 FA35 FABé FAR7 FASB FA29 FA3A FASE FASC FASD FASE FAgF FA4O FA4O 53° IRG Faaz FAS3 FA44 Faas FAa6 >DP> Faa? o3 BREAK FAa9 FE 03 ¢IRGLOC) Fasc 547 BREAK FA4aD 4c FF SAV1 FASO FAS! 3h PCL FASS FASS 3B PCH FAS FO (BRAV) . BRAV WRITTEN OVER BY DISK BOOT FAS? “> < $54 OLDBRK INSDS1 Fasc DA RGDSP 1 FASF oS MON FAG62 557 RESET ; DO THIS FIRST THIS TIME Faas B4 SETNORM FaA6sé 2F INIT FA69 93 SETVID FA&C 89 SETKBD FaAGF 58 562 INITAN SETANO . ANO TTL HI FA72 SA SETANI « ANI TTL HI FA75 SD CLRAN2 « ANZ TTL LO FA7S SF CLRANS . ANS TTL LO FA7B FF CLAROM . TURN OFF EXTNSN ROM FA7E 10 KBDSTRE ; CLEAR KEYDOARD FABI 568 NEWMON FaB2 34 BELL ; CAUSES DELAY IF KEY BOUNCES FAES F3 SOFTEV+1 1:IS RESET HI FABB As #BAS i@ FUNNY COMPLEMENT OF THE FABA F4 PWREDUP | PWR UP BYTE 7?7 FASD 17 PWRUP i NO SO PWRUP FAaF Fa SOFTEV ; YES SEE IF COLD START FA92 OF NOFIX + HAS BEEN DDNE YET? FAg4 EO SEO $ ?? FAq6 F3 SOFTEVei | ?7 FA99 os NOFIX , YES SO REENTER SYSTEM Fass 03 $79 FIXSEV #3 » NO SO POINT AT WARM START ITV 143 FAa9D STY SOFTEV , FOR NEXT RESET — Faao: JmP BASIC 4 AND DO THE COLD START & FAA. NOF IX JMP (SOFTEV) | SOFT ENTRY VECTOR FAAG SLOPE PSHEOESESHREHOHSSEEH HER ODED FAAS: PWRUP JSR APPLEII FAA? SETPGS EQU 1 SET PAGE 3 VECTORS FAAS: LDx #5 FAAB FA SETPLP LDA PWRCON-1.X% ) WITH CNTRL B ADRS FAAE 03 STA BRKV-1,X 1 OF CURRENT SASIC FABL DEX FAB2 BNE SETPLP FABS LDA #$CB LOAD HI SLOT +1 FABS STX LOCO SETPG3 MUST RETURN x=0 Fans. STA LOC SET PTR H FABA SLOOP LDY #7 Y IS BYTE PTR FABC DEC LOC! IE FABE LDA LOC1 Faco CMP #sCO + AT LAST SLOT YET? - Faco BEG FIXSEV | YES AND IT CANT BE A DISK a Face. 07 STA MSLOT FAC? NXTBYT LDA (LOCO),Y . FETCH A SLOT BYTE 5 FACS: FB CMP DISKID-3.Y : IS IT A DISK 7? “ Face: BNE SLOOP . NO SO NEXT SLOT DOWN = FACE; FACE DEY + YES SO CHECK NEXT BYTE FADO: BPL NXTBYT . UNTIL 4 CHECKED FADS 00 JMP (LOCO) FADS FADS NOP FAD7 # REGDSP MUST ORG SFAD7 IF. FAD7 FD REGDSP JSR CROUT FADA RGDSP1 LDA #$45 Fapc STA A3L FADE LDA #800 FAEO STA ASH FAEQ LDX #$F5 FAES RDSP1 LDA #$A0 FAES JSR COUT FAES LDA RTBL=-251,x FAEC: JSR COUT FAEF LDA #€BD FAFL: JSR COUT FAF4 * LDA ACC#S, xX TE Fi (Bl (Ei FAFS DFE $BS, $44 FAFé: FO JSR PRBYTE FAF9 rd z bal 'F1 FAFA. BMI RDSPt FAFC FAFD PWRCON DW OLDBRK FAFF 45 DFE $00, $E0. $45 Fpo2 00 FBOS DISKID DFB $20, $FF, $00, SFF FBO6 ac DFB $03, $FF.$3C FBO? po TITLE DFE $C1,$D0, $D0 FBOC Ao DFB SCC, $C5, SAO FROF DFB $DD, SDB FB11 XLTBL EQU +# FB11 c1 DFB $C4, $C2, $C1 FB14 DFB SFF,8C3 FBlé: FF DFE $FF, SFF, SFF FBI? * MUST ORG $FB19 FB19: De RTBL DFB $C1, SDB, D9 FBIC: DFB $DO, $D3 FBIE co 2) S| Se tsi, PREAD LDA PTRIC FB21i LST ON FB21: LDY #800 FB23 FB24 FB25 co PREAD2 LDA PADDLO,x FB28 BPL RTS2D FB2A: Fe2B FB2D 4 BNE PREAD2 RTS2D INIT #300 STATUS co LORES co Pep LOWSCR co SETTXT TXTSET #00 SETWND r g SETGR TXTCLR co MIXSET Fe CLRTOP #si4 SETWND WNDTOP #s00 WNDLFT #28 bwNK OOO [Pw WNDWDTH #18 om WNDBTM esi7 TABY cv FC VTAB FC ee eo APPLEII UNO HOME 4 CLEAR THE SCRN #8 FB STITLE TITLE-1.¥ +} GET A CHAR C4 LINE1+14,¥ STITLE 03 SETPWRC SOFTEV+1 HSAS 03 PWREDUP VIDWAIT ° ; CHECK FOR A PAUSE #9D » ONLY WHEN I HAVE A CR NOWAIT , NOT SO, DO REGULAR co KBD ; IS KEY PRESSED? NOWAIT ; NO #893 s 3s Iv CTL S ? NOWAIT : NO SO IGNORE co KBDSTRB ; CLEAR STROBE co KBDWAIT KBD + WAIT TILL NEXT KEY TO RESUME KBDWAIT , WAIT FOR KEYPRESS #s8S i IS IT CONTROL C ? NOWAIT | YES SO LEAVE IT co KBDSTRE ; CLR STROBE FB NOWAIT VIDOUT . DO AS BEFORE ESCOLD 4 INSURE CARRY SET FC Esc ESCNOW i USE CHAR AS INDEX Fa XLTBL-8C9.Y ; XLATE IJVAM TO CBAD FB ESCOLD , DO THIS CURSOR MOTION FD RDKEY « AND GET NEXT ESCNEW #SCE 41S THIS AN N ? ESCOLD , N OR GREATER DO IT #sC? + LESS THAN I > ESCOLD . YES SO OLD WAY escc i IB ITAL ? ESCOLD . DO NORMAL ESCNOW | GO DO IT CIV 145 FBBB NOP FoBC NOP FBBD NOP FRBE NOP FBBF NOP FBCO NOP FBC1 7é * MUST ORG S$FBCI1 FBC1L BASCALC PHA FBCe2: a FBC3S #303 FBCS #304 FEC? BASH FBC? FBCA #618 FBCC BASCLC2 FBCE eS7F FBDO BASCLC2 STA BASL FBD2 A FBD3 4 FBD4 BASL FBDé BASL FEDS FBD? BELL1 cmp #887 FBDE RTS2B FBDD #$40 FBDF Fc WAIT FRE2: #sC0 FBES BELL2 LDA #60C FBES Fc WAIT FBES: co SPKR FBEC FBED BELL2 FBEF RTS2B RTS FBFO FBFO STORADV LDY Ch FEFe (BASU), ¥ FBFS ADVANCE INC CH FEFé CH FEFE WNDWDTH FBFA CR FBFC RTS3 RTS FEFD VIDOUT CMP #SA0 FBFF STORADV Fco. Fco2 STORADYV FCO4 #38D FCOé CR FcoB #854 FCOA LF FCoc #s88 FCOE: BELL! Fc10 BS DEC CH Fcl2 RTSS FC14: WNDWDTH FC16 CH FC1B CH FCIA: WNDTOP Fcic cv FCIE RTS4 Fc20 cv FC22: cv Fc24 FB BASCALC FC27 WNDLFT FC29: BASL FC2B: Fcac “sco + Esc @? FC2E HOME + IF SO DO HOME AND CLEAR FC30 #S6FD + ESC-A OR B CHECK FC32 ADVANCE , A: ADVANCE FC34: BS + B, BACKSPACE FC36: @SFD « ESC-C OR D CHECK || 7) 7) J) 2) J) si? See Se) Se) J) To) 2) Sn) So) Si) FC38: LF i Cy DOWN FCA: uP + D, GO UP ‘ri 146 FC3c 143 #SFD eSc-E OR F CKECK FCSE 144 CLREOL E, CLEAR TO END OF LINE FC40 145 RTS4 ELSE NOT F, RETURN Fc42: 146 CLREOP CH ESC F IS CLR TO END OF PAGE FC44 147 cv Fc4é6 148 CLEOP1 FC47 FC 149 VTABZ FC4A FC 150 CLEOLZ FC4D 151 #600 FC4F 152 FcsoO 153 #00 FcSse 154 WNDBTM FCS4: 155 CcLEOP1 FCcSé 156 VTAB FcS8 157 HOME WNDTOP FCSA 158 cv Fese 159 #300 FCSE 160 CH FCé60 163 CLEOF? FCé2 162 FCé2 163 cR #300 Fcé4 164 CH FCéé 165 LF cv FC4e 166 cv FC6éA 167 WNDBTM FCéc 168 VTABZ FCéE 169 cv FC70 170 SCROLL WNDTOP Fc72 171 FC73: FC 172 VTABZ FC7é 173 SCRL1I BASL FCc7e 174 BAS2L FC7A 175 BASH FC7C 176 BAS2H FC7E 177 WNDWDTH Fcso 178 Fca1 179 Fcs2 180 #601 FCB4 181 WNDBTM FCBé 162 SCRL3 FCcee 163 Fce9 FC 184 VTABZ FCB8C 185 SCRL2 (BASL),.Y FCBE: 186 (BAS2L), Y FC9O 187 FC91 186 SCRL2 FC93 189 SCRL1 FC9S: 190 SCRL3 #00 FC9?: FC 191 CLEOLZ FCPA 192 VTAB FC9C 193 CLREOL CH FC9E 194 CLEOLZ #SA0 FCAO 195 CLEOL2 (BASL).Y Fcae 196 FCAS 197 WNDWDTH FCAS 198 CLEOL2 FCA7 199 FCAS 200 WAIT FCA? 201 WAIT2 FCAA 202 WAITS #301 FCAC 203 WAITS FCAE 204 FCAF 205 #601 FCB. 206 wWAIT2 FCB3 207 FCB4 208 NXTAG ASL FCBé 209 NXTAL FCBS 210 ASH FCBA 211 NXTAI ALL FCBC 212 AaL FCBE 213 AlH Fcco 214 A2H Fcce 215 AlL a 147 BNE RTS4E INC A1H RTS4B HEADR #645 FCCB 20 DB FC ZERDLY HEADR #SFE HEADR #$21 FCDé. 20 DB FC WREIT ZERDLY ZERDLY ZERDLY WRTAPE $32 ONEDLY ONEDLY FCES: AC 20 CO WRTAPE TAPEOUT #¢2c RDBYTE #s08 RDBYT2 FCEF: 20 FA FC RD2BIT a #E3A4 RDBYT2 FCFA: 20 FD FC RD2BIT RDBIT RDBIT FCFE: AD 60 CO TAPEIN LASTIN RDBIT LASTIN LASTIN #380 RDKEY CH (BASL),Y #S3F #640 (BASL),Y FDIG» 6C 36 00 (ASL) KEYIN RNDL 6Fi OIF. 6fPiD 6ofFl 6oNF) (Fi 6oTFl 6OfFl 6o0F) oUF. UTP) 6fF) {Fl KEYINe RNDH FD2i: 2c 00 CO KEYIN2 KBD KEVIN ‘ READ KEYBOARD Fi (BASL),.¥ FD28: AD 00 CO KBD FD2B: 2C 10 CO KBDSTRE FD2F:. 20 OC FD Esc RDKEY FD32 20 AS FB ESCNEW FD35: 20 OC FD RDCHAR RDKEY #893 esc NOTCR INVFLG #SFF INVFLG FD44 BD 00 O2 IN.X FD47 20 ED FD couT INVFLG 148 IN, xX #$65 BCKSPC #s98 CANCEL #SFB NOTCR1i BELL NOTCR1 NX TCHAR CANCEL #sDC COUT GETLNZ CROUT GETLN PROMPT COUT #s01 BCKSPC GETLNZ 35 FD NXTCHAR RDCHAR ess CAPTST (BASL). ¥ CAPTST #$E0 ADDINP ODF 4 SHIFT TO UPPER CASE oo o2 ADDINP IN, X #seaD NOTCR 9C FC CLREOL CROUT #seD court PRAL ALH AIL BE FD PRYX2 CROUT 40 F9 PRNTYX #600 SAD ED FD cOUT XxAMB AL #907 A2L AlH A2H MODSCHK AL #S07 DATAOUT 2 FD XAM PRAL DATADUT #BA0 ED FD cOuUT (A1L),Y¥ DA FD PRBYTE BA FC NXTAL MODBCHK RTS4Cc XAMPM A xAM A A A2L ADD “SFr ADD AL *SBD ED FD couT PRBYTE >>>> NU 149 PRHEXZ 1 a PRHEX #sOF PRHEXZ #sB0 #SBA cout e806 couT (CSWL) couTi #SA0 couTz INVFLG couTz YSAV1 FB VIDWAIT GO CHECK FOR PAUSE YSAV1 BLI YSAV xAMG BLANK SETMDZ #SBA XAMPM STOR MODE AeL (ASL). ¥ ASL RTSS A3H RTSS SETMODE YSAV o1 IN-1,Y SETMDZ MODE LT #301 LT2 A2L, x ASL, X ASL, x LT2 MOVE fALL).Y (A4L),.¥ FC NXTAS MOVE (ALL).Y (AaL),¥ VF YOK FD PRAL (A1L).Y FD PRBYTE #3A0 FD COUT #348 FD couT (ASL), ¥ FD PRBYTE #BAd FD cout FC VF YOK NXTA4 VFY FE LIST ALPC #514 LIsT2 Fa INSTDSP F9 PCADJ PCL PCH 150 FE7O: £9 O1 435 SBC #801 FE? DO EF 435 BNE LISTe FE74: 60 437 RTS FE75 438 PAGE FE7S: 8A 439 A1PC TxA FE76: FO 07 440 BEG AIPCRTS FE78: BS 3c 441 ALPCLP LDA AIL, x FETA: 95 34 442 ST& PCL. xX FE7C: CA 443 DEX FE7D: 10 F9 444 BPL ALPCLP FE7F: 60 445 AIPCRTS RTS FE6O: AO 3F 446 SETINV LDY #$3F FEB2 DO O2 447 BNE SETIFLG FEBS: AO FF 4468 SETNORM LDY #6FF FEB6: 84 32 449 SETIFLG STY INVFLG Fess: 60 450 RTS FEe9: Az 00 $51 SETKBD LDA #800 FEGB: 85 3E 452 INPORT STA AL FESD: A2 38 453 INPRT LDX #KSWL FEGF: AO 1B 454 LDY #KEYIN FE91; DO 08 455 BNE IOPRT FE93: A 00 456 SETVID LDA #600 FE9S: 85 3E 457 OUTPORT STA A2L FE97; Al 36 458 OUTPRT LDX #CSWL FESS: AO FO 459 LDY #COUT! FE9B: AS 3E 460 IOPRT LDA A2L FE9D: 29 OF 4e1 AND #80F FE9F: FO 06 462 BEG IOPRTt FEAL: O09 CO 463 GRA #IOADR/256 FEA3: AO 00 404 LDY #$00 FEAS: FO 02 465 BEG IOPRT2 FEA7: A FD 466 IOPRTi LDA #COUT1/256 FEA 467 IDPRT2 EGU *# FEAS: 94 00 468 STY LOCO.,xX « $94,$00 FEAB: 95 02 469 STA LOC1,.x% + $95, 801 FEAD: 60 470 RTS FEAE: EA 71 NoP FEAF; EA 72 NOP FEBO: 4C 00 EO 473 XBASIC JMP BASIC FEBS: 4C 03 EO 474 BASCONT JMP BASIC2 FEB6: 20 75 FE 475 90 VSR AIPC FEB9: 20 3F FF 476 JSR RESTORE FEBC: 6C 3A 00 477 JMP (PCL) FEBF: 4C D7 FA 478 REGZ JMP REGDSP FEC2: 60 479 TRACE RTS FEC3 480 * TRACE IS GONE FECS: EA 481 NOP FEC4: 60 482 STEPZ RTS i STEP IS GONE 493 NOP 454 NOP FEC7: EA 485 NOP FECe: EA 456 NOP FEC9: EA 487 NOP FECA: 4C F& 03 488 USR JMP USRADR FECD 469 PAGE FECD: A? 40 490 WRITE LDA #840 FECF: 20 C9 FC 491 JSR HEADR FED2: AO 27 492 LDY #827 FED4: Az 00 493 WRI LDX #800 FEDé6 41 3C 494 EOR (AIL.X) FEDS 48 495 PHA FED? Ai 3c 496 LDA (A1L,X) FEDB. 20 ED FE 497 JSR WRBYTE FEDE: 20 BA FC 498 JSR NXTAL FEE1, AO 1D age LDY #$1D FEES: 668 300 PLA FEES: 90 EE $01 BCC WRi FEEé: AO 22 502 LDY #822 hs FEES: 20 ED FE 503 JSR WRBYTE FEEB. FO 4D 504 BEG BELL FEED: Az 10 505 WRBYTE LDX #810 FEEF: OA $06 WRBYT2 ASL A FEFO: 20 Dé FC 507 JSR WRBEIT VN NS VV 151 WRBYT2 FEF&é: 20 00 FE CRMON BL MONZ FEFD: 20 FA FC READ RD2BIT #E16 FFOe2: 20 C9 FC HEADR CHKSUM FFO? 20 FA FC RD2BIT fe ee |fn RD2 #$24 FFOC: 20 FD FC RDBIT RD2 FFii: 20 FD FC RDBIT #¢35 FF1i6é: 20 EC FC RD3 RDBYTE (AIL.X) CHKSUM CHKSUM FFIF; 20 BA FC NXTAL #635 RDS FF26: 20 EC FC RDBYTE CHKSUM BELL PRERR #6C5 couT “#sD2 COUT FF37: 20 ED FD cout FF3A: A? 87 BELL #887 FF3C: 4C ED FD court FFSF FEOF. AS 48 RESTORE STATUS FF41 48 ASH RESTR1 XREG YREG SAVE ASH Savi XREG YREG FFSO: O68 FFSi: 66 FFS2: 85 48 STATUS FFS4: BA FFSS: 86 49 SPNT FFS7: FFSe: DS 60 OL OP ORL oP) oT. oF. OF) oF) IF, Fi FFS?: 20 84 FE OLDRST FFSC: FFSF. 20 20 2F 93 FB FE Fi FFé2: 20 89 FE MON Fi FF66: 20 3A FF MONZ FF6D: 20 67 FO FF70, 20 C7 FF ZMODE FF73; 20 A7 FF NXTITM GETNUM YSAV eSi7 CHRSRCH MON FF7D: D9 CC FF CHRTBL. Y CHRSRCH FF82: 20 BE FF TOSUB YSAV FFS7: 4¢ 73 FF NXTITM pic #$03 ‘Fi ‘Bi 'Ri vw) 152 FFaC OA ASL FFeD OA ASL FFGE OA ASL FFeF OA ASL FF9O OA NXTBIT ASL FF9L 26 3E ROL FF93 26 oF ROL FF9S cA DEX FF96 10 Fe BPL FF9B 4s 31 NXTBAS LDA FF9A BO 06 BNE FF9C FFSC BS a LDA FFIE FFOE 95 ap STA FFAO o FFAO 95 41 STA FFA2 EG NXTESE2 INK FFAS FO F3 BEG NXTBAS FFAS DO 06 BNE NX TCHR FFA7 A2 00 GETNUM LDXx #s00 FFAS Bé ae STK A2L FFAB 86 oF STX A2H FFAD B9 00 NXTCHR LDA IN.Y FFBO ce INY FFB 49 BO EOR #$B0 FFB3 cy OA cmp #B0A FFES 90 D3 BCC DIG FFB7 69 66 apc #s8e8 FFB? cy: Fa CMP eSFA FFBB BO cD BCS DIG FFBD 60 RTS FFBE Ag FE TOSUB LDA 960/256 FFCO 46 PHA FFC1 B9 E3 LDA SUBTBL. Y FFC4: 46 PHA FFCS as 31 LDA MODE FFC7 ao tole) ZMODE LDY #800 FFCS B4 i STY MODE FFCB 60 RTS FFCC PAGE FFCC Bc CHRTBL DFE sac FFCD Be DFB $B2 FFCE BE DFB $BE = FFCF e DFB $SBo i T CMD NOW LIKE USR FFDO EF DFB ser FFD1 ca DFB sc4 + FFD2 e DFB $Be S CMD NOW LIKE USR FFD3 Ag DFB SAP FFD4 BE DFB $BDB FFDS 46 DFB $A6 FFDé as DFB SAS FFD7 06 DFE $06 FFDe 935 DFB $95 FFDS 07 DFB $07 a FFDA . OFS 202 FFDB os DFB $05 FFDC FO DFB sFO FFDD oc DFB $00 FFDE EB DFB SEB FFDF $3 DFB $92 FFEO a7? DFB a7 FFE cé DFB scé FFE2 so DFB 899 y FFES e SUBTEL DFS $b2 FFES co DFB sce FFES BE DFB SBE FFE6 ci DFB sci FFE? 35 DFS $35 FFEe 6c DFB sac FFE? c4 DFB $c4 FFEA 96 DFB $96 FrFEB AF DFB BAF a 153 Ir FFEC DFB FFED DFB FFEE DFB Ione aPon FFEF ooo DFB FFFO D DFB FFF1 DFS FFF2 cuw DFB FFF3 coc0 ~OD oo DFB FFF4 DFB FFFS DFB IF) FFFSé DFB FFF? DFS FFFe DFB FFFS9 DFB FRFA Dw FFFC DW FFFE nno >?wW Dw IF ENDASM IF aA|WR} MW Z. — DO DDO n rors? terre TT as ‘ o re) ? AVIAN t o 7 > + + ’ a) ‘ 2 um cnctden Cttet Y 1M c a ae NMOR FE +-~NNOI Aw O 3 3 “* ie eb we a fee eee ~~ eeeb--a > =F ) * « oe Be-e f--> ia a ed Ad c * = - > . ? = * ie < . . 7 * . >a . * mo . * t & oH . . + ™ . } Go Ge)ad 1 oO} a2) & 431)J 1 a) e) Lj a) } . 6 a . Oe Oe Oe Re Oy By) CyOy Oe Oy Ge OD, My & 1 na Re) . z | J = . i Oyu Oe Oy my Oy Oy fy de oy Oy Oy ee & 4, Oo, 4% eee By By « E oe te na Mra In e388 ss se Imo . WY) a 3 ) io * f a . * = . °° = - * cas iD nw ) HI HH DY wD OMD TH EA hn > . EeT rr 7rTeTr ” ’ NCR IAN 4 i = * 2 wo ANNA INN "i * ? . . — Twn IHN r +m WNW IO Ju =) m + ot * a) . —« . . "4 . > . . i > * * } J . Gr * . . . * * * “vee eee ee * + SPNT $49 RNOL S4E RNDH S4P ach $50 ACK $51 XTNOL $52 XTNDE $53 AUXL $54 AUXE $55 PICK $95 IN $0200 USRADR $03Fa NMI $03FB IRQLOC $03FE IOADR $c000 1) Ae Ai ee ok od |A K8D scuud KB OS TRB $col0 TAPEOUT $co20 SPKR $c030 TXTCLR $cu5e TXTSET $cu5l MIXCLR scus2 Ir) iF MIXSET $co53 LOWSCR $scu54 HISCR $co55 LORES $Cu56 HIRES $Cv057 TAPEIN scoéu PADDLO 3C064 fri © PTRIG $Culu 3ASIC SEQUU BASIC2 SEUu3 SF6u0 HOM START ADDRESS Fouu: PLOT A ¥-COORD/2 Féul: SAVE LSB IN CARRY Fov2: GBASCALC CALC BASE ACR iN GEACL,H F3su5s: RESTORE-LSB FRCM CARRY Pout: #30F MASK $0F IPF EVEN Poud: RTMASK Foua: #SE0 MASK $F0 If ODD Fa0c: RTMASK MASK FSO0E: PLOT1 (GBASL) ,¥ DATA Pald: COLOR XOR COLOR F812: MASK AND MASK Fel4: {GBASL),Y XOR DATA Fal6: (GBASL),¥ TO DATA F618: F819: Ps HLINE PLOT PLOT SQUARE Felc: HLINE1] H2 DONE? FSle: RTS1 YES, RETURN F820: NO, INCR INDEX (X-COORD) F821: PB PLOT1 PLOT NEXT SQUARE F824: HLINE] ALWAYS TAKEN P826: VLINEZ #$01 NEXT Y¥-COORD Fe2¢: VLINE SAVE ON STACK F829: FS JSR PLOT PLOT SQUARE Fa2c: PLA F820: v2 DONE? PS2e: VLINEZ NO, LOOP. Fs3l: P3832: aS2F MAX ¥, FULL SCRN CLR Pos: CLRSC2 ALWAYS TAKEN F836: #527 MAX Y, TOP SCRN CLR Pd38: STY v2 STORE AS SOTTOM COORD FOR VLINE CALLS PO3A: LDY #$27 RIGHTMOST X-COORD (COLUMN) P33C: LDA #Su TOP COORD FOR VLINE CALLS P@3E: COLOR CLEAR COLOR (BLACK) Pado: PS VLINE DRAW VLINE P843: NEXT LEPTMOST X-COORD P44: SPL CLRSC3 LOOP UNTIL DONE. Fe46: RTS F847: GBASCALC FOR INPUT OOODEFGH fie Se, Jee ie, Je) fe, Sin it i) i, Al F848: A rf 156 Fads: Fe48: GENERATE GBASH=000U01FG F64D: PO4F: AND GBASL*HDEDEO0UO Peso: Pd52: 02 Fa54: F8S6: GeCALCc Pease: F859: FSSA: FESC: FP6SE: FoSf: NXTCOL INCREMENT COLOR BY 3 Fs6l: Pd62: Po64: SETCOL SETS COLOR=17*A MOD 16 F866: BOTH HALF BYTES OF COLOR EQUAL Food: F869: FBGA: Fees: Fuéc: PO6E: Pu7vu: Pé7l: SCRN READ SCREEN Y-COORD/2 P872: SAVE LSB (CARRY) Fu73: Fs GBASCALC CALC BASE ADDRESS FO76: (GBASL),¥ GET BYTE F878: RESTORE LSB FRCM CARRY Fa79: SCRN2 RIMSK2Z IP EVEN, USE LO H FR7B: F87C: Fs7D: SHIFT HIGH HALF BYTE DOWN PS7E: FOF: RTMSKZ MASK 4-BITS Podl: Pdo2: INSDS1 PRINT PCL,H F684: Fes6: FO P89: Fg FOLLOWED BY A BLANK Fasc: GET OP CODE Fu3E: INSDS2 FadF: EVEN/ODD TEST FSU: F892: SIT 1 TEST Pays: XXXXXX11 INVALID OP Fags: Fo97: OPCODE $89 INVALID Fe99: MASK BITS FoyB: TEVEN LS8 INTO CARRY FOR L/R TEST FeSCc: Pe9D: Fg FmMT1,% GET FORMAT INDEX SYTE F8AG: FP6 SCRN2 R/L H-BYTE ON CARRY F6A3: GETPMT F6AS5: ERR #580 SUBSTITUTE S8U POR INVALID OPS PuAT: #50 SET PRINT FORMAT INDEX TO 0 FUAS: GETFMT PRBAA: FS FUT2,X INDEX INTO PRINT FORMAT TABLE PBAD: FORMAT SAVE FOR ADR FIELD FORMATTING PoAF: #03 MASK FOR 2-BIT LENGTH {P=1 BYTE, 1l=2 BYTE, 2=3 BYTE) FéBl: LENGTH FeB3: OPCODE P8B4: #S8F MASK FOR IXXX10lu TEST P3Bé: SAVE IT PSB?: OPCODE TO A AGAIN Foes: #$03 FBBA: #56A Feec: MNNDX3 FoBE: MNNDX1 A MNNDX3 FORM INDEX INTC MNEMONIC TABLE PoBF: Fécl: A hPa ae AP OO OW Paha WW OY nD 157 PoC2: MNNDX2 A 1) 1XXX1010e>001U1xKXxXx FeC 3: #S2uU 2) XXXYYYUL#>VULLIXXX Fecs: 3) XXXYYYLC]#>VULLOXXX Fece: MANNDX2 4) XXAY¥LUUe>OU]U0XXX F8C&: 5) XXXXXO0UG=>UU0XXXAX FeC9: MNNDX3 FSCA: 4“NNDX1L Facc: FeCD: FP SFF,SPF,SFF Paoo: Fé INSTOSP Insosl SEN PMT, LEN SYTES Pubd3: SAVE MNEMONIC TABLE INDEX Pada: Fade: FD PRNTOP (PCL),Y PRBYTE (Fl MF. il FL Feds: #501 PRINT 2 BLANKS Fads: FS PRNTBL PRBL2 PSDe: LENGTH PRINT INST (1-3 3YTES) FoEU: IN A 12 CHR FIELG F8E1: PRNTOP PSE3: #303 CHAR COUNT FOR MNENGNIC PRINT PoE5: #504 POE?: PRNTSL PRES: RECOVER ANEMONIC INDEX FBEA: FPUEB: Fy MNEML,Y PREE: LMNEM FETCH 3-CHAR MNEMONIC PoFu: PA MNEMR,Y (PACKED IN 2-3 YTES) PeF3: RMNEM PBFS: PRMNI #500 FoP7: sSu5 FoRS: PRMN2 RMNEM SHIFT 5 BITS OF PcFB: LMNEM CHARACTER INIC A PorD: A {CLEARS CARRY) PoFE: POPF: PRUN2 F901: #S8F ADD "?" OFFSET F903: FO COUT OUTPUT A CHAR OF MNEW F9U6: F9U7: PRMN1L F9uU9: Pg PRALNK OUTPUT 3 BLANKS F9OC: LENGTH POUE: #$u6 CNT FOR 6 FORMAT SITS P910: PRADR1 #$u3 F912: PRADRS IF X=j THEN ADDR. F914: PRADR2 FORMAT F916: PRADRS F918: ES CHARI1-1,% F915: Fo cour FSLE: Fd CHAR2-1,% FS21: PRADR3 F423: FD cour F920: PRADRJ F927: PRADR1 F929: F92a: PRADR4 F9Za: FRADR2 F920; F930: FD PRADRS PRBYTE FORMAT | i F932: $SE6 HANDLE REL ADR MODE P934: {(PCL),¥ SPECIAL (PRINT TARGET, P936: PRADR4 NOT OFFSET) PS36: Fg RELADR PCADJ3 F938; PCL, PCH+OFFSET+1 TO A,¥ P93C: PRNTYX +1 TO Y¥,X {Fi Fi P9330: PO3F: P94uU; PRNTYX Fs4l: PD PRNTAX PRBYTE CUTPUT TARGET ADR P44: PRNTX OF BRANCH AND RETURN P945: PD PRBYTE P9468: PRBLNK a$a3 BLANK COUNT PO4A: PRSL2 #SA0 LOAD A SPACE F94C: FD PRSL3 cout OUTPUT A SLANK PO4F: 158 F DU PS PRBL2 LOOP UNTIL F ou e 3d PCADJ 0=1-SYTE,1 F AS 2F PCADJ2 LENGTH 223-BYTE e A4 3S PCADJ3 PCH P AA F lu ul PCADJ4 F a) g 65 3A PCADJ4 P 90 Ql TH(OR DISPL)+1 TO CARRY iNTC ¥ CH) XXXXXXYO INS re) Gg * 2D . * P9 v4 20 rr F 30 uD PMT1 DFS FS¢ dU U4 F U3 22 DFB FY 54 33 E bo ud v w ro ” © 5 uv F 30 U4 Rs 54 33 Fs uD gu F 90 u4 $U0,$80,904,3 P9 20 54 uC 8u F u4 SU Pg 22 44 FY 33 ub F 44 us Fy 11 22 Ps 33 uD F ca 44 FS 44 33 F BU 04 PY99: gv ul F99C: 44 33 FOSE: uD 6U FOAL: FYAZ: 26 31 PYAS: DFS P9A6: ud PMT2 DFS P9AT: 1 DFB oN Je P9Ad: 481 DFB FYA9: 82 DPB B FOIAA: 00 DPB M P9AB: uv we &te OFS FYAC: 3 DFB FSAB: &ts N ARNR ouweuwe OFS NNO PSAE: be DFB FYAF: & CFB “ FOBO: we DFS FYB1: wrRmrR DFS F9B2: w DFB SHDy PNA >NA F9B3: be Wtw NueKEO Gs OF8 > OOo Mao> rp>aune F9B4: FOB7: Ab ASC FSBA: DY UvU F9BD: Ad AG CFS $03,5900,5D8,5 “y",0, "XS$",0 MNEML is OF FORM: (A) (8) (C) (BD) AXXYYY10 (E} XXXYYY¥O1L { X#INDEX) F9Cu: 1c BA a SR F9IC3: 23 5D OFB $1C,$8A,$1C,$ F9Cb: 13 Al F9C9: OPB $1B,SA1,$9D,$ FOCC: FYCF: DFB $9D,588,51D,$ F9D2: FYDS: DFB 919,SAE,S69,5 FyDs: F9DB: DFS $24,$53,51B,$ FODE: DFB $19,5Al {&) FORMAT ABOVE F9EU: F9E3: DFB $00,S14,558,$ FSE6: OFB $24,524 (B) FORMAT P9Ed: P9EB: DFB SAE,SAE,SA6,5 PSEEs OFB $7C,300 (Cc) PORMAT POPO: POP3: OFS $15,$9C,560,5 FOFo: DFB $29,353 (D) FORMAT FOFS: FOPB: OFB $84,$13,5$34,$ FOFE: oFB $23,5A0 (E) FORMAT PAGO: FAQ3: MNEMR DFB $06,$62,$5A,$ FAQ: PAOS: OFS $94,588,554,5 FAUC: PAOF: OFB $68,544,SE5,$ FA12: FAILS: 1)33) $0d,584,574,$ FAld: FA18: OFS $74,5F4,SCC,$ FALE: OFS SA4,S8A (A) FORMAT PA20: PA23: OFB $00,SAA,SA2,$ PA26; OFS $74,372 (B) FORMAT FA28: FA2B: OFS $44,$68,$B2,$ FA2E: DFB $22,500 (C) FORMAT PA30;: FA33: DFB S1A,51A,$26,$ FAJ6: ora $38,$C8 (0) FORMAT PA38: FA3B: oFB SC4,$CA,$26,5 FAJE: OFS SA2,SCB8 (€) FORMAT FA4U: OFB SFF,SPF,SFF PA43; STEP JSR INSTOSP DISASSEMBLE ONE INST PA46: PLA AT (PCL,H) FA4?: STA RTNL ADJUST TC USER FA49: PLA STACK. SAVE FA4A: FA4C: PA4E: 10 PB 376 XQINIT STA LDX LDA RTNH 5U6 INITBL-1,X RTN ADR. INIT XEQ AREA ne ed ed dd | de FAS1: STA XQT,X FA53: PA54: DEX BNE XQINIT IF) PAS6: LDA {PCL,X) USER OPCODE SYTE FA58: BEC XSRK SPECIAL IF BREAK FASA: LbY LENGTH LEN FROM DISASSEMBLY PASC: CMF #$2uU PASE: BEQ XJSR& HANDLE JSR, RTS, JME, FAod: CMP #560 JME ( }, RTI SPECIAL PAG2: BEQ XRTS PAo4: CHP #54C FAG6: BEQ XJMP FAbS: CMP #S6C FAoA: BEG XJMPAT PAeC: #540 fF) OIF 6'F) Fi CMP FAoE: SEQ XRTI PATO: AND #S1P FA72: EOR #514 FAT74: CMP #Su4 COPY USER INST TO XEQ AREA FATo: BEC XQ2 WITH TRALLING NOPS FA78: LDA (PCL),Y¥ CHANGE REL BRANCH 7) Fi PATA: 3c U0 40u STA XQTNZ,Y DISP TO 4 FOR i FA70: JMP TO SRANCH OR FATE: xQ1 NBRANCH FROM XEQ. FAS8U: FF RESTORE RESTCRE USER REG CONTENTS. FA63: uo XQTNZ XEQ USER OP FROM RAM PASO: IRQ Acc {RETURN TO NBRANCH) PAGS: PAGS: **IRO HANDLER PAGA: A PAGB: A PASC: A FAUD: BREAK TEST FOR SREAK PASF: 03 (IRQLOC) USER ROUTINE VECTOR IN RAM PA92: BREAK FA93: PP SAV1 SAVE REG'S ON BREAK FASO: INCLUDING °C FA9?: PCL FAY9: FASA: PCH FASC: XBRK INSDS1! PRINT USER PC. FAYF: RGDSP1 AND REG'S FAA2: MON GO TO MCNITOR FAAS: XRTI PAAG: SIMULATE RTI BY EXPECTING FAA?7?: STATUS STATUS FROM STACK, THEN RTS FAAS: XRTS RTS SIMULATION FAAA: PCL EXTRACT PC FROM STACK FAAC: AND UPDATE PC BY 1 (LEN#=d) FAAD: PCINC2 PCH PAAF: PCINC3 LENGTH UPDATE PC BY LEN FAB1: Fy PCADJ3 FAB: PCH FAZ6: FAS7: NEWPCL FABS: XJSR FABA: Pg PCADJ2 UPDATE PC AND PUSH FABD: ONTO STACK FOR FABE: JS SIMULATE FASF: FACU: FACIL: FAC2: #502 FACS: XJMP FACS: XIMPAT (PCL),Y¥ FACT: LOAD PC FOR JMNF, FACS: (JME) SIMULATE. FACS: (PCL) ,¥ FACB: PCH FACL: NEWPCL PCL FACP: XIMP FADL: RTNIMP TNH FAD3: FAC4: RTNL FAD6: PAD?7: FD REGDSP CROUT DISPLAY USER REG FADA: RGDSP1 #Acc CONTENTS AITH PADC: A3L LABELS FADE: pACC/256 ia a Vee dia PAEU: A3H PAE2: Sra PAE 4: RDSP1 #SA0 PAE6: FD cout FAE9: FA RTBL-SFB,X PAEC: FD couT PAEF: #S58D PAPI: FD cour PAF 4; ACC+5,X PAP6: FO PRBYTE PAFS: FAFA: ROSP) FAFC: FAFD: BRANCH BRANCH TAKEN, FAFE: ol Sol ADD LEN+2 TO PC FBOu: 3A (PCL) ,¥ nnn) ee 161 PBO2: 56 PCADI3 Feus: 3A PCL PBu7: FBus: FBUY: A2 PCINC2 FBus: 4A 24 NBRNCH SAVE NORMAL RETURN AFTER FRUE: XEQ USER OF FBRUF: 9E PCINC3 GO UPDATE FC Fall; INITBL FB12: DUMMY PILL FOR FB13: uB FB NBRNCH XEQ AREA PB16: FD FA BRANCH Ply: RTBL $Cl FBLA: $D6 PBIB: $D9 FBlC: $DU FS1D: $D3 FBIE: Cu PREAD PTRIG TRIGGER PADDLES FB21: sud INIT COUNT €B23: COMPENSATE POR IST COUNT FB24: F825: cu PREAD2 PADDLO,X COUNT ¥-REG EVERY PE2s: RTS2 12 USEC FB2A: OF. NPL OP Fl PL TFL PE28: PREAD2 EXIT AT 255 MAX FB2C: PB2E; RTS2D FB2P: INIT #Suu0 CLR STAIUS FOR DEBUG PB31: STATUS SOP TWARE FBI33: LORES FB36: LOWSCR INIT VIDEO MODE FE3Y: SETTXT TXTSET SET FOR TEXT MODE FBSC: Suu FULL SCREEN WINDOW PB3E: SETWND FB4U: SETGR TXTCLR SET FOR GRAPHICS MODE IF WF, | FB43: MIXSET LOWER 4 LINES AS F846: CLRTCP TEXT WINDOW PB43: #514 FB48: SETWND WNOTOP SET FCR 40 COL WINDOW PBdD: #500 TOP IN A-REG, PR4F: WNDLFT STTM AT LINE 24 FeSl: FBS3: F855: FBS/: VTAB TO ROW 23 FBS9: FBSB: TABV VTABS TO ROW IN A=REG PBSO: FC FBou: Fe MULPM ASS VAL OF AC AUX F863: MUL INDEX FOR 16 SITS Fae5: MUL2 ACK * AUX + XTND PB67: TO AC, XIND FB6s: IF NO CARRY, FS6A: NO PARTIAL PROD. FBG: #5FE FRED: MUL3 XTNOL+2,X ADD MPLCND (AUX) FROF; AUKL+2,X TO PARTIAL PROG FB71: XTNOL+2,% {XTND). F873: FBR74: MULI F876: MUL4 #$03 FBid: MUL5 #S70 FB79: FBIA: #SSu (Fi IP (Fl FB7B: MUL5 PBID: PBIE: MUL2 Fi PBYd: FBbl: PB DIVPM MD1 ABS VAL CF AC, AUX, PBu4; DLV eSlu INDEX FCR 16 SITS FBS6: DIv2 ACL FBS: ACH FBGA; XTNOL XTND/AUX 162 1%, {Fi Fi PRsC: 20 $3 $47 ROL XTNDH TO AC, FBSE: 38 346 SEC FBSP: AS 52 544 LOA XTNDL FB91: ES 54 550 38C AUXL NCD TO XTND. PES3: aA 551 TAX PEY4: AS 53 532 LDA XTNDH PBYo: &5 55 553 S8C AUXH FB¥b: YU vo 53 gcc DIV3 FBSA: 86 52 555 STX XTNOL PBSC: 65 53 550 STA ‘TNO PBYE: Eb 50 557 INC ACL FBAU: 3d 553 odDfV3 OEY FRAIL: Bu &3 555 BNE DIV2 FEA: 6u SoU RTS FBA4: Au uw S61 MD! LOY a#suu ASS VAL OF AC, AUX FBAG: 64 2F 562 STY SIGN WITH RESULT SIGN PBAB: AZ 54 563 LDX #AUXL IN LSB OP SIGN. PBAA: 20 AF FB 564 JSR MD2 FBAD: A2 5uU 565 LOX #ACL FBAF: B35 ul 566 MD2 LDA LOCc1,x X SPECIFIES AC OR AUX PBBI: 10 0D 567 BPL MORTS FBB3: 3d 56d SEC PBB4: 98 569 MO3 ra FBBS: FS OU 570 SBC LOCO,xX COMPL SPECIFIED REG FBB7: 95 Wu 571 STA LOCO,X IF NEG. FBB9: 98 572 TYA PBBA: F5 ul $73 spc Locl,x PBBC: 95 ul 574 STA Locl,Xx PBBE: E6 27 575 INC SIGN FBCU: 60 576 MORTS RTS FeCl: 48 577 SASCALC PHA CALC BASE AOR IN BASL,H PBC2: 4A 578 LSR A FOR GIVEN LINE NO. PBC3: 23 U3 573 AND #$03 O<*LINE NO.<#$17 FBCS5: ug u4 358uU ORA #$04 ARG=0QUABCDE, GENERATE PBC7: 35 29 561 STA BASH BASH#OU0001CD FBC3: 63 582 PLA AND FBCA: 29 16 303 AND 4518 BAS L=EABASUGG Facc: 90 v2 534 BC BSCLC2 FBCE: 69 7F 585 ADC +#S7F FSDU: 65 28 346 S8SCLC2 STA BASL FBD2: OA 587 ASL A PBDS: vA 508 ASL A FBD4: U5 24d 589 i?) SASL FBDo: 385 28 59u STA SASL FED&: 60 591 RTS FBDY: C9 67 592 BELLI CMP #587 BELL CHAR? (CNTRL-G) FEDB: DU 12 593 SNE RTS2B NO, RETURN PBOD: AX 40 594 LDA #$40 DELAY .ul SECONDS FEOF: 20 AB FC 395 JSR WAIT FBE2: AO CU 536 LDY ¥#SCO FBE4; AY uC 597 BELL2 LDA =#$0C TOGGLE SPEAKER AT FBEo: 20 A&B FC 598 JSR WAIT 1 *HZ POR .1 SEC. FBES: AD 3u CO 599 LDA SPKR FBREC: 5 6u0 OEY FBED: Bu PS 601 BNE BELL2 PREF: 60 6u2 &KTS28 RTS FBFuU: A4 24 v03 STOADV LDY CB CURSER H INDEX TO Y-KEG FBF2: 91 26 5u4 STA (BASL),Y STOR CHAR iN LINE FBF4: Eo 24 ev5 ADVANCE INC CB INCREMENT CURSER H INDEX FBFo: AS 24 bub LDA CH (MOVE RIGHT) PBF6: C5 21 607 CMP WNDWOTH SEYOND WINDOW WIDTH? FBPA: BU 66 60d BCS CR YES CR TO NEXT LINE PBFC: 60 609 RTSJ RTS NO, RETURN PBFO: Cy AU olu vibcur CMP #SAU CONTROL CHAR? PBFF: BU EF 611 BCS STOADV NO,OUTPUT IT. PCul: Aé6 612 TAY INVERSE VIDEO? FCO2: lu EC 613 BPL STOADV YES, OUTPUT IT. FCu4: C3 aD é14 CMP #¢58D CR? PCu6: Fu SA 615 BEG CR YES. FCOs: C9 6A ol6 CMP #$6A LINE FEED? FCUA: FU 5A 617 BEQ LF IF SO, DO IT. Fcoc: C9 68 ols CMP *#$88 BACK SPACE? (CNTRL-H) FCOE: Du C9 619 SNE BELLI NO, CHECK FOR SELL. Veda aaa 163 FCLO: 35 DECREMENT CURSER H INDEX PC12: IF POS, OK. ELSE HOVE UP FCl4: SET CH TO WNOWDTH-1 FClo: FC1ls: (RIGHTMCST SCREEN POS) FCA: UP CURSER V INDEX Fcle: PCIE: IF TOP LINE THEN RETURN FC2u: DECR CURSER V-INDEX FC22: VTAB cv GET CURSER V-INDEX FO24: PB VTASZ BASCALC GENERATE BASE ADDR FO27: WNDLFT ADD WINDOW LEFT INDEX FPC2y: BASL TO BASL FPC2B: RTS4 PSC: £scl #SCU ESC? FC2E: HOME IF SO, OC HOHE AND CLEAK FC30: #5FO0 ESC-A OR 8 CHECK FC32: ADVANCE A, ADVANCE PC34: BS B, BACKSPACE PCJ6: Esc-¢ OR D CHECK FC3d: C,COWN PC3A: do, GO UP FC3C: ESC-E OR F CHECK PCIE: E, CLEAR TC END CF LINE FC40: NOT FP, RETURN FC42: CLREOP CURSOR TO Y INDEX FPC44: CURSCR V TO A-REGISTER FC46: CLEOP1 SAVE CURRENT LINE ON STK PC4): Fc CALC BASE ADDRESS FC4A: FC CLEAR TO EOL, SET CARRY FC4D: CLEAR FROM H INDEX=U FOR REST FC4F; INCREMENT CURRENT LINE FC5u: (CARRY IS SET) FCS2: DONE TO BOTTOM OF WINDOW? FC54: NO, KEEP CLEARING LINES FCS6: YES, TAB TO CURRENT LINE FCSé: HOME INIT CURSOR V FCSA: AND H-INDICES Fcse: FPCSE: THEN CLEAR TO ENC OF PAGE FCe0: FCe2: ca CURSCR TO LEFT CF INDEX FC64: (RET CURSOR Ku) FC66: LP INCR CURSOR V(DCWN 1 LINE) FCod: PC6A: CFF SCREEN? FPC6C: NO, SET BASE ADDR FC6E: cv DECR CURSOR V(BACK TO S0TTOM) FO7O: SCROLL WNDOTOP START AT TOP OF SCRL WNDW FC72: FC73: VTABZ GENERATE BASE ADDRESS FCi6: SCRLi BASL COPY BASL,E FC78: SAS2L TO BAS2L,H PC7A: BASH FC?7C: SAS2H PCIE: WNDWDOTR INIT ¥Y TO RIGHTMOST INDEX PC&U: OF SCROLLING WINDOW PCSl: PC&2: #501 INCR LINE NUMBER PCd4: WNDBTM DONE? Pca6: SCRL3 YES, PINISH od Tf) J) Jo) S| J) fn) 2) Si ||A Jo) Sn) Ae) eee io)) FPCba: FC89: Pc VTABZ FORM SASL,H (BASE ADDR) FcEc: SCRL2 (BASL),¥ MOVE A CHR UP CN LINE FCuE: (BAS2L),¥ PC¥U: NEXT CHAR CF LINE FCS1; FC93: NEXT LINE FC95: CLEAR BOTTOM LINE PC97: FC GET BASE ADDR FOR SCTTOM LINE PC9A: CARRY IS SET Fc9sc: CLREOL CURSOR H INDEX PCSE: CLEOL2Z 164 FPCAuU: 91 238 093 CLEOL2 STA (BASL),Y STORE SLANKS FROM ‘HERE’ POA2: Ca by4 INY TO END OF LINES (WNDWOTH) FCA3: C4 21 695 CPY WNDWDTH FCAS: %u P9 356 BCC CLEOL2 FCA7: 6u 097 RTS FCAS: 38 63d WAIT SEC FCAS: ade 639 WAIT2 PHA FCAA: £9 Ul 700 WAITS sec #501 FCAC: Du Fc 701 8NE WAITI 1.0204 USEC FCAE: 66 7uU2 PLA (L34+271L2*Ae512°A2A) FCAF: E9 Ol 7u3 ssc $01 FCal: DU Fo 704 BNE WAIT2 FCB3: 60 7u5 RTS FCS4: Eo 42 706 NXTA4 INC A4L INCR 2-8YTE A4 FCB6: Bo v2 707 BNE WXTAI AND Al FCB8: Es 43 708 INC A4H FCBA: AS 3C 7u3 =NXTAL LDA AIL INCR 2-83YTE Al. FCBC: C5 3e 710 CMP A2L FCBE: A5 3D 711 LDA AlH AND COMPARE TO A2 FCCu: ES 3F 712 S8C A228 FCC2: E6 3c 713 INC Al1L (CARRY SET IF >=) Foca: Du u2 714 BNE RTS4B FCC4: E6 3D 715 Inc AlH FCCs: 60 716 aTs4s RTS PCCY: Au 48 71?) «=6EADR LOY #548 WRITE A*%256 ‘LONG 1 PCCB: 2u 08 FC 718 JSR ZERDLY HALF CYCLES FCCE: Du F3 119 SNE HEAOR (650 USEC EACH ) FCOG: oy FE 720 ADC #$FE FCD2: Bo F5 721 BCS HEADR THEN A ‘SHORT v' FCD4: Ad 21 722 LOY #$21 (400 USEC) FCOo: 20 DB FC 723 WRBIT JSR ZERDBLY WRITE TWO HALF CYCLES FCD9: Ca 724 INY OF 250 USEC ('U") FCDA: cs 725 INY OR 500 USEC ('0' PCCOB: go 726 ZERDLY DEY FCDC: Du FD 127 BNE ZERDLY FCDE: 90 05 728 scC WRTAPE ¥ IS COUNT FOR PCEU: AU 32 #29 LDY #$32 TIMING LOOP FCE2: 3s 730 ONEDLY DEY PCE 3: Du FD 731 BNE ONEDLY FCES: AC 20 CY 732 WRTAPE LDY TAPEOUT FCEo: AG 2C 733 LDY #$2C PCEA: CA 734 DEX FCEB: 6uU 735 RTS FCEC: Az us 736 RDBYTE LDX ¥#$uUé 8 BITS TO READ PCEE: 46 737 + =RDOBYT2 PHA READ TWO TRANSITIONS FCEF: 20 PA FC 738 JSR RD2BiT {FIND EDGE) FCF2: 68 739 PLA FCF3: 2A 2740 ROL A NEXT SIT FCF4: Au 3A 741 LOY #S3A COUNT FOR SAMPLES FCF6: CA 42 OEXx FCF7: bd FS 743 BNE RDBYT2 PCF9: 6u 44 RTS FCPA: 2U FD FC 745 RD2BIT JSR RDBIT FCFD: 36 746 ARDBIT DEY DECR Y UNTIL PCPE: AC 60 CU 747 LDA TAPEIN TAPE TRANSITICN FDU1; 4S 2F 748 EOR LASTIN FOU3: lu Fo 749 SPL ROBIT FDO35: 45 2F 750 EOR LASTIN POuU7: o5 2F 751 STA LASTIN POO: Cu du 752 CPY #S8U SET CARRY ON Y=-REG. FOUB: 60 153 RTS Fbuc: A4 24 S54 ROKEY LOY CH FOUE: Bl 2d 755 LDA ({BASL) ,Y SET SCREEN TO FLASH FOO: 48 756 PHA POll: 2y 3F 757 AND #SiF FD13: ug 4u 736 >) #540 FD15: 91 20 739 STA (BASL),Y FOl?: 066 76u PLA FDlo: oC 38 Uv Jol JME {KSWL) GO TO USER KEY-IN FO1B: Eo 46 462 KEYIN INC RWDL FD1D: Cu v2 763 BNE KEYIN2 INCR RND NUMBER SRS FOIF: Eo 4F 164 INC RNDH FO21: 2C uv CU 765 KEYIN2 BIT KBD KEY DOWN? 165 "4 ‘ FO24: LOGP FO2e: REPLACE FLASHING SCREEN PO2Z6: GET KEYCODE FO28: CLR KEY STROBE FD2E: FD2F: FO32: esc RDKEY Escl GET KEYCODE HANDLE ESC FUNC. IF. fl TF FO35: RDCHAR RDOKEY READ KEY PO33: 2595 Esc? FO3A: Esc YES, CON‘'T RETURN FO3C: PD3o: NOTCR INVPLG FORF: POA: #SFF FD42: INVFLG ECHO USER LINE Po44: u2 IN,X NON INVERSE POd7: FD CouT PO4A: Fo4B: INVELG FC40: 02 IN,X FD: 3: #88 CHECK FOR EDIT KEYS FDS2: BCKSPC 8S, CTRL-X. FDS: #595 FD5e: CANCEL FD53: #SP& MARGIN? FOSA: NOTCRI FeSC: PP. BELL YES, SOUND BELL FOSF: NOTCRI ADVANCE INPUT INDEX F060: NXTCHAR FD62: CANCEL #$DC BACKSLASH AFTER CANCELLED tI FD64: FD 7 couT FC67: FO GETLNZ CROUT OUFPUT CR POO6A: GETLN PROMPT Foec: PO 7 COUT OUTPUT FRCHPT CHAR POOF: Sul INIT INPUT INDEX FO71L: BCKSPC WILL BACKSPACE TO uv FD72: GETLNZ FO74: FO75: FD 6 NXTCHAR ROCHAR FO/d: #PICK USE SCREEN CHAR POUA: CAPTST FOR CTRL-U FLiC: (BASL),¥ FDIE: CAPTST SEU FDou: ADDINP CONVERT TO CAPS 6. fF. 6) 6fF OTF oF) fF) OFA 6TF) off) (Fi FOB2: g5DF FOo4: v2 ADDINP IN,X ADD TC INPUT BUF POo?7: #546D FouS: NOTCR FOoa: CLREOL CLR TG ECL IF CR FObE: #S8D FO$u: cour FD92: All PRINT CR,Al iN HEX FO94: AlL FD90: crcour FE39: Fg PRNTYX FDIC: #S5u0 FOSE: FDAG: PC #SAD cour PRINT ‘~° {Ei (Fl ‘Fi Fi PDA3: ALL FDA5: S07 SET TO FINISH AT PDAT: A2L “OD 337 FOAS; AlB FDAB: A2# FDAD: MOD SCKK ALL FOAF; #S07 FCB1: CATAOUT PDS: FD KAM PRAL FD86: DATACUT #SA0 FDBS: FD cour OUTPUT BLANK FOBRB: (A1L),¥ FORO: FD PRBYTE OUTPUT BYTE IN HEX ‘Fi Fi ‘i FDC: Fc NATAL FDC3: 838 MODGCHK CHECK IF TIME TO, FOCS: RTS 4C PRINT ADDR FOC6: XAMPM A DETERMINE IF MCN FDC7: XAM MODE IS XAM FOC9: A ADD, OR SUB FOCA: A FOCB: A2L FDCD: ADD FOCF: eSPr SUB: FORM 2'S COMPLEMENT FbooL: ADD ALL FCD3: FDD4: #S5D FDD6: FD cocT PRINT 'e#', THEN RESULT FODY: FDDA: PRBYTE PRINT SYTE AS 2 HEX FDDB: DIGITS, DESTROYS A-REG FDODC: FDCOD: rr FDDE: A FDOOF: FD PRHEXZ FDE2: FDE3: PRHEX #SoF PRINT HEX DIG IN A~REG PDES: PRHEXZ #$B0 Ls3's FCE7: #584 FDEs: Cour FOEB: #506 FDED: ccuT (CSWL) VECTCR TO USER CUTPUT RCUTINE FDFO: couTl #540 POF2: CouTz CON'T OUTPLT CTRL‘S INVERSE PDP4: INVELG MASK WITH INVERSE FLAG FPDF6: couT2 ¥SAV1 SAV Y-REG FDFS: SAV A-REG FDFY: FB viIboUT CUTPUT A-REG AS ASCII POPC: RESTCRE A-REG PCPC: ¥SAVIL AND Y-REG FDFF: THEN RETURN FEuu: BLI ¥YSAV FEu2: XAMS FEU4: BLANK BLANK TO MON FEu5: SETMDZ AFTER SLANK FEu?: #SBA DATA STORE MODE? FEUY: XAMPM NO, XAM, ADD CR 5UB8 FEUS: STOR MODE KEEP IN STCRE MCLE FEOD: A2L FEOF: (A3L),¥ STORE AS LOW BYTE AS (A3) FE1I: A3L FE13: RTS5 INCR A2, RETURN FELS: Ait FE17: RTS5 FEl8: SETMODE ¥SAV SAVE CONVERTED ‘:', '+!', FELA: vl In-1,¥ ‘=", '." AS MODE. FE10: SETMD2 MODE PELF: FE20: LT Sul FE 22: LT2 A2L,X COPY A2 (2 BYTES) TO FE 24: A4L,X A4 AND A5 FE 26: ASL,X FE23: FE29: Lt2 FE 2B: FE2C: MOVE (ALL),¥ MCVE (Al TO A2) TO FE2E: (ASL),¥ (A4) PE 30: ec NXTA4 PE33: MOVE PE35: PEJS: VFY (ALL),¥ VERIFY (Al TO A2) WITH FE28: (ASL),¥ (A4) PERA: VF YOK PE3C: PRA] PE3F: (AlLL),¥ FE41: PD PRBYTE PE44: #SAU FE46: FD cour HUH aaa d 167 ] a FE49: #SAc¢ PE4B: coLT FE4E: (A4L),¥ PES&: PREYTE FESS: #5A9 FESS: COUT FESS: NATA4 PESB: VFY FESO: FESE: AlPC MOVE Al (2 3YTES FEol: sl4 PC IF SPEC'D AN FEo3: DISSEMBLE 2u IN PEb4: INSTOSP (Fl IFi IF. FEo/: FCACJ ACJUST PC EACH INSTH PEGA: PCL i PE6C: PCH FEGE: PEF: PEVu: asul NEXT GF 2u INSTKE PE72: LIST2 PE74: PEV5: ALPC IF USER SFEC'D ADA PE76: ALPCRTS COPY FROM Ai TO PC PE7a@: AlpPCLP ALL,X PETA: PCL,X FETC: PE7O: ALPCLP FETIP: ALPCRTS FEBU: SETINV #S3F SET FOR INVERSE VID PEG2: SETIFLG VIA COUTL FEG4: SETNORM #SFE SET FOR NORMAL VID FE6O: SETIFLG INVPLG FE@S: FEBS: SETKBD #500 SIMULATE PCRT ¢0 INPUT FESB: INPORT A2L SPECIFIED (KEYIN ROUTINE) FES6D: INPRT #KSWL FESF: #KEYIN (Fl IF, (F) IF. PE91: IOPRT PEY3: SETVID #500 SIMULATE PORT 90 OUTPUT FEY5: OUTPORT A2L SPECIFIED (COUT] ROUTINE) FE97: OUTPRT #CSWL FE99: sCOUT1 FESB: IOPRT A2L SET RAM IN/OUT VECTORS FEYD: #SUF PESF: LOFRTI FEAL: #IOADR/256 FEA3: asu0 PEAS: IOPRT2 PEA?7: IOPRT1 aCOUT1/256 PEAS: IOPRT2 LCocu,x PEAS: LOC1,x PEAD: PEAE: PEAF: PEBU: XBASIC BASIC TO BASIC WITH SCRATCH PEB3: BASCONT BASIC2 CONTINUE BASIC FES6: GO AlPc ADR TO PC IF SPEC'D FEBS: RESTORE RESTORE META REGS FEBC: (PCL) GO TO USER SUBR FEGP: REGZ REGDSP TO REG DISPLAY FEC2: TRACE YSAV FEC4: STEPZ Alec ADR TO PC IF SPEC'D PEC7: STEP TAKE ONE STEP FECA: USR USRADR TO USR SUBR AT USRADR FECD: WRITE #540 FECP: HEADR WRITE 1U-SEC HEADER FED2: #$27 FED4: wRi Foue PEGS: (ALL,X) FEDS6: FEDY: (ALL,X) vl (fi (Fi ‘Fi ‘#1 11 168 FEDB: PE 332 WRBYTE FEDE: FC 983 NXTA1 FEEL: od4 #91D FEE3: 365 FEE4: 386 WRI FEEo: yo? FS22 FEES: FE y68 WRBYTE FEEB: 969 BELL FEED: 39U WRBYTE #510 PEEF: 991 WRBYT2Z A PEFO: 992 WRBEIT PEF3: 993 WRBYT2 PEPS: 394 PEP6: $95 CRMON SL1 HANDLE CR AS BLANK PEFS: 996 THEN POP STACK PEFA: S97 AND RIN TO MON FEPB: 998 MONZ FEFDO: $399 READ RD2BIT PiND TAPEIN EDGE FFuO: ludu #$16 FFO2: luol HEADR DELAY 3.5 SECONDS FFUS: 1002 CHKSUM INIT CHKSUM=SFF FFu?: luu3 RD2BIT PIND TAPEIN EDGE FFUA: l0u4 RD2 #524 LOOK FOR SYNC SIT FFUC: 1005 RDBIT (SHORT W) FROF: luvs RDZ LOOP UNTIL FOUND FF11: LOU? ROSIT S&1® SECOND SYNC H-CYCLE PP14: lous #$38 INDEX POR J/l TEST PFlo: 1u09 RD3 ROBYTE READ A BYTE PRI9: lulu (A1LL,X) STORE AT (Al) PPlB: loli CHKSUN FF1D: lul2 CHKSUM UPDATE RUNNING CHKSU! PRLE: lul3 NATAL INCR Al, COMPARE TC A2 PP22: lul4 #535 COMPENSATE U/l INDEX PF24: 1u15 RDI LOCP UNTIL DONE FR26; i| q lule ROBYTE READ CHKSUM BYTE FF29: lul? CHKSUM FF2B: lilo BELL GOOD, SOUND BELL AND RETURN PF2D: 1019 PRERR #$C5 FFSF: FD 1020 couT PRINT "ERR", THEN SELL PF32: lu2l #$D2 FF34; FD 1622 cour ana??? ab) ab Un a? al aR PF37: PE3A: FRSC: PE3F: Fo FD 1u23 lu24 1625 1U26 3ELL RESTORE cour 6S87 cout STATUS OUTPUT BELL AND RESTORE 6502 REG CCNTENTS RETURN PR41: 1u27 USED BY DEBUG SOFTWARE FP42: lu2e Acc PR44: 1029 RESTRI XREG PP4o: luju YREG FF4d: lu3l P49: 1u32 FRSA: lu33 SAVE acc ie a\i FR4C: PR4E: FPSu: PFS51: 1034 Lu35 1036 iu37 3AV1 XREG YREG PFS2: lult STATUS FP54; lu33 os iy PES5: ludu SPNT PRS7: Lu4sl PES3: Lu42 PFS3: 1043 RESET SETNORN SET SCREEN MODE FFSC: lu44 Init AND INIT KBO/SCREEN PFSF: 1lu45 SETVID AS 1/0 DEV'S PFo2: 1u46 SETKSD PF65: 1U47 MON MUST SET HEX MCDE! FFo6: lu4s BELL PR69: 1049 MONZ SAA *‘** PROMPT FOR MCN WN wi FOB: 1us5u PROMPT FF6eD: lusl GETLNZ READ A LINE PFT7O: 41052 ZMODE CLEAR MON MODE, SCAN IDX PF73: 1053 NXTITM GETNUM GET ITEM, NON-HEX PEi6: 1054 YSAV CHAR IN A-REG —WF 169 FP76: 1055 X-REG*U IF NO HEX INPUT FP7A: 1u56 CHRSRCH FF7B: 1057 NOT FOUND, GO TO MON PFID: FP 1056 FIND CMND CHAR IN TEL PFo6u: 1059 PFB2: PF luée FOUND, CALL CCKRESPONDING P65: 1061 SUBROUTINE PFbo7: fF 1062 FRBA: 1lue4 DIG PRac: 1u64 FFuD: 1u65 GOT HEX DIG, FFGE: 1u66 SHIFT INTO A2 PROF: lge7 FPSU: 1065 NXTBIT FF91: lusey A2L FF93: Wi A2H FP95: 1lv71 LEAVE X=SFP IF CIC FRY: 1u7z2 NXTBIT PR9G: lu7i NATBAS MCLE PRSA: 1u74 NXTBS2 iP MODE IS ZERO FRSC: 1073 A2H,X THEN COPY A2 tO FFSE: 1076 AlH,X Al AND Al PPAU: luv? Aj3H,X FFA2: 1078 NXTSS2 FFA3: 1079 NXTBAS PRAS: luau NXTCER FFA?: 1usl GETNUM asuu PRAY: 1U62 A2L FRAB: 1083 A2H FRAD;: v2 lus4 N&TCHR IN,Y FFBU: lubs PRBI: luse #$30 PFB3: luw? #508 PFSS: ldsd DIG If HEX OIG, THEN PPB: 1lvéeg9 was PFBY: 10su #SPA FPBB: iugl 01G FFBC: luge FFBE: 1u93 rosue #G0/256 PUSH HIGH-ORDER FFCU: lu34 SUBR ACR GN STK FPCL: luss SUBTSL,Y PUSH LOW ORLER FRC4: luyo SUBR ACR ON STK FECS: luy/ MODE PRCT: 1036 ZMODE #5uu CLR “ODE, OLD NODE PFCY: luss MODE TO A-REG FFCB: llug GO TO SUBR VIA kTS FECC: llul CHRTBL $3ac F("CTRL-C") FFCD: ilu2 SB2 F("CTRL-Y") FRCE: 1103 SBE F("CTRL-E") FFCF: llu4 SEO 3 Pat at] FFDU: 1105 SEF PcC°V") PRODI: 1iué $c4 F(“CTRL-K") PFD2: 1107 SEC F("S") FFD3: 1106 SA9 P("CTRL-P") FFO4: lilug $88 F("CTRL-3") FFDS: lilv SA6 F(*=-") FFD6: 1111 SA4 thud ated| FFO7: 1112 $u6 F("M") {(PsEX-OR $30+$89) FFDS: 1113 $95 ee) FFCY: 1114 $07 F(°N") PPDA: 1115 $02 etere) FFDB: i116 $05 F("L") FFCC: 1il7 SFU Pe“W") PFOD: 1118 $uuU F("G") PFCE: 1119 SEB F("R") FFDF: ll2u $93 B:GuS9) FFEU: 1121 SA7 F(".") FFE1: 1122 $C6 F("CR") FFE2: 1123 $99 F (BLANK) FFE3: 1124 SUBTBL #BASCONT~1 FFE4: 1125 #USR-1 FFES: 1126 #REGZ-1 170 FFE6: Cl 1127 DFB #sTRACE-1 PRPE7: 35 1126 OFPB #VFY-1 PFEG: oC 1129 DPB #INPRT-1 PRES: C3 Lll3u CPB #STEPZ-1 FFEA 96 ii31 OFB »pOUTPRT-1 FFES: MF 1132 DFS #X8ASIC-1 PREC: 17 1133 DFB #SETMODE-1 PFED 17 i134 DFB sSETMODE-1 FFEE: 23 1135 DFS sHOVE-1 FFEF iF 1136 CFB #LT-1 PFFU: 83 1137 DFS #sS5ETNORM-1 FFFI: if 1lj6é OFS *#SETINV-1 FFF2: 5D li3s DFB *#LIST-i FPF3: CC 1146 DFB #WwRITE-1 FFF4: B85 1i4l DFB #G0-l FFF5:' FC 1142 OFB *READ-1 FFFo: Li 1143 OFB #SETMODE-1 FRP7:. 17 Liss DFB *SETMOCE-1 PPPs: FS 1145 DFB #CRMON-1 FPRFS: U3 Li46 CFS #BLANK-1 PRFA FB 1147 CFB 4aNmMI NMI VECTOR uj 1146 OFS PPFC $9 1143 OFB RESET VECTOR FFFO FF 115 DFS FFFE && 151 DFE iRG VECTCR FFFF FA 1152 DFS 1i53 XQTNZ EQU UU ‘Vn \n\n 171 SYMBOL TABLE (NUMERICAL ORDER) 0000 FC76 SCRL1 FBSB TABYV 0022 FC9E CLEOLZ FB78 VIDWAIT 0026 FCAA WAITS FB9B ESCNOW 002A FCc9 HEADR FBD9 BELL1 002D FCES WRTAPE FBF4 ADVANCE o02E FCFD RDBIT FC1A 0030 FD2F ESC Fc2c 0034 FDé2 CANCEL FC62 0038 0001 LOCc1 FCac 003¢ 0023 WNDBTM FCAO 0040 0027 @BASH FCB4 0044 002B BAS2H FCD6 0047 002D RMNEM FCEC O04F QO02F LASTIN FDOC O3F2 0031 MODE FD35 O3FB 0035 YSAV1 FD&7 cooo 0039 KSWH 0020 C030 003D 41H 0024 cos3 MIXSET 0041 A3H 0028 cOS7 HIRES 0045 ASH oo2c COSB CLRANI 0048 STATUS 002E COSF CLRAN3 0095 PICK 002F CFFF CLRROM O3F4 PWREDUP 0032 FBOC RTMASK O3FE IRQLOC 0036 F826 VLINEZ co00 KBD 003A F836 CLRTOP co50 TXTCLR 003E Fasé GBCALC cos4 LOWSCR 0042 F87F RTMSKZ coss SETANO 0045 F8AS ERR cose SETAN2 0049 FEC? MNNDX3 coé0 TAPEIN 0200 FeFS NXTCOL EOOO BASIC O3F5 AMPERYV F926 PRADR3 FBOE PLOT1 0400 LINE1 F940 PRNTYX F828 VLINE co10 KBDSTRB FO4A PRBL2 F838 CLRSC2 cos1 TXTSET F956 PCADJ3 F864 SETCOL. coss HISCR F9AS FMT2 Fase INSDS1 cos? CLRANO FAOO MNEMR FBA? GETFMT cosp CLRAN2 FA6é2 RESET FSDO INSTDSP C064 PADDLO FAAS NOF IX FaF9 PRMN2 £003 BASIC2 FABA SLOOP F92A PRADR4 F819 HL INE FAE4 RDSP1 F941 PRNTAX Feat RTS1 FB11 XLTBL F94C PRBL3 Fe3c CLRSC3 FB2E RTS2D F9SC PCADJ4 F871 SCRN FB4B SETWND F9B4 CHAR1 Fasc INSDS2 FBOF SETPWRC FA4O IRQ F8BE MNNDX 1 FB97 ESCOLD FA6F INITAN FeD4 PRNTOP FBDO BASCLC2 FAAG PWRUP F910 PRADR1 FBFO STORADV FAC7 NXTBYT F930 PRADRS FC10 FAFD PWRCON F944 PRNTX FC2B FB19 RTBL F953 PCADJ FCs8 FB2F INIT F961 RTS2 172 FIBA CHAR2 F914 PRADR2 FDFO cOuT1 FA4C BREAK F938 RELADR FEOB STOR FAS1 NEWMON F948 PRBLNK FE20 LT FAA? SETPGS3 F954 PCADJ2 FE58 VF YOK FAD7 REGDSP F962 FMT1 FE78 A1IPCLP FBO2 DISKID F9CO MNEML FEB6 SETIFLG FBLE PREAD FAS? OLDBRK FE93 SETVID FB39 SETTXT FASB FIXSEV FEA7 IOPRT1 FB460 APPLEIT FAAB SETPLP FERS co FBeS KBDWAIT FADA RGDSP 1 FECA USR FBAS ESCNEW FBO? TITLE FEEF WRBYT2 FRE4 BELL2 FB25 PREAD2 FF16 RD3 FBFC RTS3 FB40 SETGR FF44 RESTR1 FC22 VTAB FB465 STITLE FF65 MON FC42 CLREOP FB94 NOWATT FFBA DIG FC46 LF FBC1 BASCALC FFA7 GETNUM FC9S SCRL3 FBEF RTS2B FFCC CHRTBL FCAS WAIT FBFD VIDOUT FDB4 ADDINP FCBA NXTA1 FC24 VTABZ FDA3 XAMB FCDB ZERDLY FC46 CLEOP1 FDCS RTS4¢ FCEE RDBYT2 FC70 SCROLL FDE3 PRHEX FD18 KEYIN FC9C CLREOL FDFé couTz FD3D NOTCR FCA? WAIT2 FE17 RTSS FDé6A GETLN FCccs RTS4B FE22 LT2 0021 WNDWDTH FCE2 ONEDLY FESE LIST 0025 FCFA RD2BIT FE7F ALIPCRTS 0029 FD21 KEYIN2 FEB? SETKBD o02c FDSF NOTCR1 FE9S OUTPORT OO2E FD71 BCKSPC FEA? IOPRT2 O02F FD75S NXTCHAR FEBF REGZ 0033 FD92 PRAL FECD WRITE 0037 FDB3 XAM FEF6 CRMON 0038 FDD1 ADD FF2D PRERR OO3F FDED COUT FF4A SAVE 0043 FEO4 BLANK FF69 MONZ 0046 FE1D SETMDZ FF9O NXTBIT 004E FE36 VFY FFAD NXTCHR O3FO FE7S A1PC FFE3 SUBTBL O3F8 FE84 SETNORM FDSE CROUT O7F8 FESD INPRT FDAD MODSCHK co20 TAPEOUT FE9B IOPRT FDC& XAMPM cose MIXCLR FEB3 BASCONT FDES PRHEXZ co5sé LORES FEC4 STEPZ FEOO BL1 COSA SETANI FEED WRBYTE FE18 SETMODE COSE SETAN3 FFOA RD2 FE2c MOVE co70 PTRIG FFF RESTORE FE63 LIsT2 F800 PLOT FFS9 OLDRST FESO SETINV Feic HLINE1 FF7A CHRSRCH FESB INPORT F832 CLRSCR FFA2 NXTBS2 FE97 OUTPRT F847 GBASCALC FFC7 ZMODE FEBO XBASIC F879 SCRN2 FD7E CAPTST FEC2 TRACE F89B IEVEN FD96 PRYX2 FED4 WR1 Fsc2 MNNDX2 FDBS DATAQUT FEFD READ FSDB PRNTBL FDDA PRBYTE FF3A BELL n\n \ie 173 FF4C SAV1 FF73 NXTITM FF98 NXTBAS FFBE TOSUB SYMBOL TABLE (ALPHABETICAL ORDER) 003D A1H F956 PCADUS IOPRT1 FE7F ALPCRTS 0095 PICK IRG 0040 ASL F910 PRADR1 KEYIN 0044 ASL F930 PRADRS LASTIN FBF4 ADVANCE FDDA PRBYTE LIST 002A FDES PRHEX LOc1 0029 FSDB PRNTBL LT FD71 0033 PROMPT MNEML. FEOO O3F4 PWREDUP MNNDX3 Fc1o FFI6 RD3 MON FOBA FD35 RDCHAR NMI 0024 FAD7 REGDSP NOWAIT cos? FFSF RESTORE NXTBIT FC9C OO4F RNDH NXTCHR Fs3c FS7F RTMSKZ OLDRST | FDED FCé2 F961 003C RTS2 A1L PADDLO PCADJ4 0025 OO3F A2H PLOT1 FBAS 0043 A4SH PRADR2 FB97 0045 acc PRBL2 FIAG O3F5 AMPERV PREAD 0026 FBC1 BASCALC PRHEXZ FDéA EO0O BASIC PRNTOP FCC9 FBD9 BELL1 PRYX2 Fe19 FEO4 BLANK PWRUP 0200 FDé2 CANCEL RDBIT Fes2 OO02E CHASUM RDKEY cooo FCAO CLEOL2 REGZ OSFE COSB CLRAN1 RESTR1 cooo FC42 CLREOP RNDL 0038 F832 CLRSCR RTS1 0400 FDFO couT1 RTS3 0000 FEF& CRMON ALPCLP FE22 FDB6 DATAOUT A2L cos3 Fc2c Esci A4L Fsc2 FD2F ESC ADDINP FF69 OO2E FORMAT APPLEII FAS81 F856 @BCALC BASCLC2 FDSF FFA7 GETNUM BASIC2 FF98 cO57 HIRES BELL2 FD75 FCS8 HOME BREAK FAS? FB2F INIT CAPTST FE97 OUTPRT Fe8Cc INSDS2 CHRSRCH 174 FC9E CLEOLZ FF3A BELL cosc SETAN2 cosD CLRAN2 O3FO BRKV FEB6 SETIFLG CFFF CLRROM FOB4 CHARI FE18 SETMODE F836 CLRTOP FFCC CHRTBL FBOF SETPWRC FDF6 COUTZ FC46 CLEOP1 002F SIGN 0037 CSWH COSF CLRANS 0049 SPNT FFBA DIG F838 CLRSC2 FEOB STOR FBAS ESCNEW 0030 COLOR co60 TAPEIN FA9B FIXSEV FDSE CROUT FEC2 TRACE F847 GBASCAL.C 0036 CSWL FECA USR FBAS GETFMT FBO2 DISKID FESS VF YOK FEB6 FB9B ESCNOW F828 VLINE cos5 F962 FMT1 FCAS WAIT Fe9B 0027 GBASH 0022 WNDTOP FESB FD67 GETLNZ FEEF WRBYT2 FBDO o0e2c He FDA3 XAMB FEAQ FS1C HLINE1 FB1i XLTBL co10 FA6F INITAN 0034 YSAV FD21 FES8D INPRT FC8C SCRL2 oo2F 0032 INVFLG FC70 SCROLL FE63 FE9B IOPRT COSE SETANS cosé FBS88 KBDWAIT FE8O SETINV ooze 0039 FES84 SETNORM FAQO MNEMR FC&6 FB39 SETTXT FDAD MODSCHK 002Cc FABA SLOOP FE2c MOVE co54 0048 STATUS FAAS NOF IX cosa FBFO STORADYV FCBA NXTA1 FEBE MNNDX 1 co2z0 TAPEOUT FFA2 NXTBS2 0031 MODE co50 TXTCLR FEFS NXTCOL. O7F8 MSLOT o3F8 USRADR FCE2 ONEDLY FD3D NOTCR FBFD VIDOUT F954 PCADJ2 FCB4 NXTA4 FC24 VTABZ 0038 PCH FAC7 NXTBYT FCAA WAITS F800 PLOT FF73 NXTITM 0021 WNDWDTH F926 PRADR3 FE9S OUTPORT FEED WRBYTE F94C PRBL3 F953 PCADJ FDC6 XAMPM FB25 PREAD2 003A PCL 0046 XREG FEF? PRMN2 FD92 PRAI FCDB ZERDLY F944 PRNTX F92A PRADR4 FF4C SAV1 C070 PTRIG F948 PRBL.NK FC95 SCRL3 FCFA RD2BIT FF2D PRERR cose SETANO FCEE RDBYT2 Fo41 PRNTAX F864 SETCOL FAE4 RDSP1 F940 PRNTYX FE89 SETKBD F938 RELADR FAFD PWRCON FAAg SETPG3 FADA RGDSP1 FFOA RD2 FE93 SETVID FB19 RTBL FCEC RDBYTE o3F2 FBEF RTS2B FEFD READ FEC4 FCc8 RTS4B FAé2 RESET FFE3 FE75 A1PC 002D RMNEM FBO? 0041 A3H FeOCc RTMASK cos1 0045 45H FB2E RTS2D 002D FDD1 ADD FDCS RTS4C FB78 VIDWAIT 002B BAS2H FE17 RTSS Fc22 VTAB FEBS BASCONT FC2B RTS4 0023 WNDBTM 0028 BASL FC76 SCRL1 FED4 WR1 Peeter F879 SCRN2 175 IF. FECD WRITE FDB3 XAM 0047 YREG FFC7 ZMODE FF4A SAVE F871 SCRN COSA SETAN1 FB40 SETGR FE1D SETMDZ FAAB SETPLP FB4B SETWND C030 SPKR FB65 STITLE FBSB TABYV FFBE TOSUB FC1A UP FE36 VFY F826 VLINEZ FCA? WAIT2 0020 WNDLFT FCDé WRBIT FCES WRTAPE FEBO XBASIC 0035 YSAV1 SYMBOL TABLE SIZE 2589 BYTES USED 2531 BYTES REMAINING SLIST 4A Jee) fee) Jie) de) dee Jee S| | |a TT 176 GLOSSARY Hy PY hy apy ahh yet iB 51 s 6502: The manufacturer's name for the microprocessor at the heart of your Apple. Address: As a noun: the particular number associated with each memory location. On the Apple, an address is a number between @ and 65535 (or $0600 and SFFFF hexadecimal). As a verb: to refer to a particular memory location. Address Bus: The set of wires, or the signal on those wires, which carry the binary-encoded address from the microprocessor to the rest of the computer. Addressing mode: The Apple’s‘6562 microprocessor has thirteen distinct ways of referring to most locations in memory. These thirteen methods of forming addresses are called addressing modes. Analog: Analog measurements, as opposed to digital measurements, use an continuously vari- able physical quantity (such as length, voltage, or resistance) to represent values. Digital meas- urements use precise, limited quantities (such as presence or absence of voltages or magnetic fields) to represent values. AND: A binary function which is ‘‘on’’ if and only if all of its inputs are *‘on’’. Apple: 1. The round fleshy fruit of a Rosaceous tree (Pyrus Malus). 2. A brand of personal computer. 3) Apple Computer, Inc., manufacturer of home and personal computers. OF IF. ORL TFL YF SFL TF. F\ Fl ASCII: An acronym for the American Standard Code for Information Interchange (often called *““USASCII”’ or misinterpreted as **ASC-II"*), This standard code assigns a unique value from @ IF to 127 to each of 128 numbers, letters, special characters, and control characters. Assembler: |) One who assembes electronic or mechanical equipment. 2) A program which converts the mnemonics and symbols of assembly language into the opcodes and operands of machine language. Assembly language: A language similar in structure to machine language, but made up of mnemonics and symbols. Programs written in assembly language are slightly less difficult to write and understand than programs in machine language. TFA UPL IF. Fl BASIC: Acronym for ‘Beginner's All-Purpose Symbolic Instruction Code’’. BASIC is a higher- level language, similar in structure to FORTRAN but somewhat easier to learn. It was invented Fi by Kemney and Kurtz at Dartmouth College in 1963 and has proved to be the most popular language for personal computers. Binary: A number system with two digits, ‘‘@’ and ‘‘1’’, with each digit in a binary number representing a power of two. Most digital computers are binary, deep down inside. A binary sig- nal is easily expressed by the presence or absence of something, such as an electrical potential or a magnetic field. Binary Function: An operation performed by an electronic circuit which has one or more inputs and only one output, All inputs and outputs are binary signals. See AND OR, and Exciusive-OR. Bit: A Binary digiT. The smallest amount of information which a computer can hold. A single bit specifies a single value: ‘*@"’ or “‘1"’. Bits can be grouped to form larger values (see Byre and Nybble). Board: See Printed Circuit Board. 178 Bootstrap (‘‘boot’’): To get a system running from a cold-start. The name comes from the machine's attempts to “pull itsef off the ground by tugging on its own bootstraps.”* Buffer: A device or area of memory which is used to hold something temporarily. The “‘picture buffer’? contains graphic information to be displayed on the video screen; the “‘input buffer’’ holds a partially formed input line. Bug: An error. A hardware bug is a physical or electrical malfunction or design error, A software bug is an error in programming, either in the logic of the program or typographical in nature. See ““feature’’. Bus: A set of wires or traces in a computer which carry a related set of data from one place to another, or the data which is on such a bus. Byte: A basic unit of measure of a computer's memory. A byte usualy comprises eight bits. Thus, it can have a value from @ to 255. Each character in the ASC// can be represented in one byte. The Apple’s memory locations are all one byte, and the Apple’s addresses of these loca- tions consist of two bytes. Call: As a verb: to leave the program or subroutine which is currently executing and to begin another, usualy with the intent to return to the original program or subroutine, As a noun: an instruction which calls a subroutine. Character: Any grapitic symbol which has a specific meaning to people. Letters (both upper- and lower-case), numbers, and various symbols (such as punctuation marks) are all characters. Chip: See /ntegrated Circuit. Code: A method of representing something in terms of something else. The ASCII code represents characters as binary numbers, the BASIC language represents algorithms in terms of program statements, Code is also used to refer to programs, usually in /ow-level languages. Cold-start: To begin to operate a computer which has just been turned on. Color burst: A signal which color television sets recognize and convert to the colored dots you see on a color TV screen, Without the color burst signal, all pictures would be black-and-white, Computer: Any device which can recieve and store a set of instructions, and then act upon those instructions in a predetermined and predictable fashion. The definition implies that both the instruction and the data upon which the instructions act can be changed. A device whose instruc- tions cannot be changed is not a computer. Control (CTRL) character: Characters in the ASC// character set which usually have no graphic representation, but are used to control various functions. For example, the RETURN control character is a signal to the Apple that you have finished typing an input line and you wish the computer to act upon it. CRT: Acronym for *‘Cathode-Ray Tube’’, meaning any television screen, or a device containing such a screen. Cursor: A special symbol which reminds you of a certain position on something. The cursor on a Slide rule lets you line up numbers; the cursor on the Apple's screen reminds you of where you are when you are typing. TT WHNNVOT 179 Data (datum): Information of any type. Debug: To find bugs and eliminate them, DIP: Acronym for ‘Dual In-line Package"’, the most common container for an Integrated Cir- TFA TEL EL cuit. DIPs have two parallel rows of pins, spaced on one-tenth of an inch centers. DIPs usually come in 14-, 16-, 18-, 20-, 24-, and 40-pin configurations. Disassembler: A program which converts the opcodes of machine language to the mnemonics of assembly language. The opposite of an assembler. Display: As a noun: any sort of output device for a computer, usually a video screen. As a TEL TE, VEL noun: to place information on such a screen. Edge connector: A socket which mates with the edge of a printed circuit board in order to IE exchange electrical signals. Entry point: The location used by a machine-language subroutine which contains the first exe- cutable instruction in that subroutine; consequently, often the beginning of the subroutine. Excusive-OR: A binary function whose value is “‘off"’ only if all of its inputs are ‘off’, or all of its inputs are “‘on”’. } Execute: To perform the intention of a command or instruction, Also, to run a program or a portion of a program. Feature: A bugas described by the marketing department. Format: As a noun: the physical form in which something appears. As a verb: to specify such a form. (El UBL TE, Wei Graphic: Visible as a distinct, recognizable shape or color, Graphics: A system to display graphic items or a collection of such items. Hardware: The physical parts of a computer. Hexadecimal: A number system which uses the ten digits @ through 9 and the six letters A through F to represent values in base 16. Each hexadecimal digit in a hexadecimal number represents a power of 16. In this manual, all hexadecimal numbers are preceded by a dollar sign (S$). High-level Language: A /anguage which is more intelligible to humans than it is to machines. High-order: The most important, or item with the highest vaue, of a set of similar items. The high-order bit of a byte is that which has the highest place value. High part: The high-order byte of a two-byte address. In decimal, the high part of an address is the quotient of the address divided by 256. In the 6502, as in many other microprocessors, the high part of an address comes last when that address is stored in memory. Hz (Hertz): Cycles per second. A bicycle wheel which makes two revolutions in one second is running at 2Hz. The Apple’s microprocessor runs at 1,023,000Hz. 180 1/0: See /nput/Output. IC: See /ntegrated Circuit. Input: As a noun: data which flows from the outside world into the computer. As a verb: to obtain data from the outside world, Input/Output (1/0): The software or hardware which exchanges data with the outside word. Instruction: The smallest portion of a program that a computer can execute. In 6502 machine language, an instruction comprises one, two, or three bytes; in a higher-level language, instruc- tions may be many characters long. Integrated circuit: A small (less than the size of a fingernail and about as thin) wafer of a glassy material (usually silicon) into which has been etched an electronic circuit. A single IC can con- tain from ten to ten thousand discrete electronic components. ICs are usually housed in D/Ps (see above), and the term IC is sometimes used to refer to both the circuit and its package. Interface: An exchange of information between one thing and another, or the mechanisms which make such an exchange possible. Interpreter: A program, usualy written in machine language, which understands and executes a higher-level language. Interrupt: A physical ettect which causes the computer to jump to a special interrupt-handling subroutine, When the interrupt has been taken care of, the computer resumes execution of the interrupted program with no noticeable change. Interrupts are used to signal the computer that a particular device wants attention. K: Stands for the greek prefix ‘‘Kilo’’, meaning one thousand. In common computer-reated usage, “‘K"’ usually represents the quantity 28 or 1024 (hexadecimal $400). Kilobyte: 1,024 bytes. Language: A computer language is a code which (hopefully!) both a programmer and his com- puter understand. The programmer expresses what he wants to do in this code, and the com- puter understands the code and performs the desired actions. Line: On a video screen, a ‘‘line’’ is a horizontal sequence of graphic symbols extending from one edge of the screen to the other. To the Apple, an input line is a sequence of up to 254 char- acters, terminated by the control character RETURN. In most places which do not have personal computers, a line is something you wait in to use the computer, Low-level Language: A /anguage which is more intelligible to machines than it is to humans. Low-order: The least important, or item with the least vaue, of a set of items. The low-order bit in a byte is the bit with the least place vaue. Low part: The /ow-order byte of a two-byte address. In decimal, the low part of an address is the remainder of the address divided by 256, also called the ‘taddress modulo 256."" In the 6502, as in many other microprocessors, the low part of an address comes first when that address is stored in memory. Machine language: The lowest level language which a computer understands. Machine Ha VHHVMHVH 181 languages are usually binary in nature, Instructions in machine language are single-byte opcodes sometimes followed by various operands. Memory address: A memory address is a two-byte value which selects a single memory location out of the memory map. Memory addresses in the Apple are stored with their low-order bytes first, followed by their high-order bytes. Memory location: The smallest subdivision of the memory map to which the computer can refer. Each memory location has associated with it a unique address and a certain value. Memory locations on the Apple comprise one byte each. Memory Map: This term is used to refer to the set of all memory locations which the micropro- cesor can address directly. It is also used to describe a graphic representation of a system's memory. Microcomputer: A term used to described a computer which is based upon a microprocessor. Microprocessor: An integrated circuit which understands and executes machine language pro- grams. Mnemonic: An acronym (or any other symbol) used in the place of something more difficut to remember. In Assembly Language, each machine language opcode is given a three letter mnemonic (for example, the opcode $60 is given the mnemonic RTS, meaning *‘ReTurn from Subroutine™’). Mode: A condition or set of conditions under which a certain set of rules apply. Modulo: An arithmetic function with two operands. Modulo takes the first operand, divides it by the second, and returns the remainder of the division. Monitor: 1) A closed-circuit television receiver. 2) A program which allows you to use your computer at a very low level, often with the values and addresses of individual memory locations. Multiplexer: An electronic circuit which has many data inputs, a few selector inputs, and one output. A multiplexer connects one of its many data inputs to its output. The data input it chooses to connect to the output is determined by the selector inputs. Mux: See Multiplexer. Nybble: Colloquial term for half of a byte, or four bits. IE fi Opcode: A machine language instruction, numerical (often binary) in nature. OR: A binary function whose value is ‘‘on”’ if at least one of its inputs are *‘on”’. lf Output: As a noun, data generated by the computer whose destination is the real world. As a verb, the process of generating or transmitting such data. Page: 1) A screenfull of information on a video display. 2) A quantity of memory locations, addressible with one byte. On the Apple, a “‘page’’ of memory contains 256 locations. Pascal: A noted French scientist. PC board: See Printed Circuit Board. 182 Peripheral: Something attached to the computer which is not part of the computer itself. Most peripherals are input and/or output devices. Personal Computer: A computer with memory, languages, and peripherals which are well-suited for use in a home, office, or school. Pinout: A description of the function of each pin on an IC, often presented in the form of a diagram. Potentiometer: An electronic component whose resistance to the flow of electrons is propor- tional to the setting of a dial or knob. Also known as a “‘pot’’ or “‘variable resistor’. Printed Circuit Board: A sheet of fiberglass or epoxy onto which a thin layer of metal has been applied, then etched away to form traces. Electronic components can then be attatched to the board with molten solder, and they can exchange electronic signals via the etched traces on the board. Small printed circuit boards are often called ‘‘cards’’, especially if they are meant to con- nect with edge connectors, Program: A sequence of instructions which describes a process. PROM: Acronym for ‘Programmable Read-Only Memory’. A PROM is a ROM whose contents can be altered by electrical means. Information in PROMs does not disappear when the power is turned off. Some PROMs can be erased by ultraviolet light and be reprogrammed. RAM: See Random-Access Memory. Random-Access Memory (RAM): This is the main memory of a computer. The acronym RAM can be used to refer either to the integrated circuits which make up this type of memory or the memory itself. The computer can store values in distinct locations in RAM and recall them again, or alter and re-store them if it wishes. On the Apple, as with most small computers, the values which are in RAM memory are lost when the power to the computer is turned off. Read-Only Memory (ROM): This type of memory is usually used to hold important programs or data which must be available to the computer when the power is first turned on. Information in ROMs is placed there in the process of manufacturing the ROMs and is unalterable. Informa- tion stored in ROMs does not disappear when the power is turned off. Reference: 1) A source of information, such as this manual. 2) As a verb, the action of examin- ing or altering the contents of a memory location. As a noun, such an action. Return: To exit a subroutine and go back to the program which called it. ROM: See Read-Only Memory. Run: To follow the sequence of instructions which comprise a program, and to complete the process outlined by the instructions. Scan line: A single sweep of a cathode beam across the face of a cathode-ray tube. Schematic: A diagram which represents the electrical interconnections and circuitry of an elec- tronic device. Scroll: To move all the text on a display (usually upwards) to make room for more (usually at the bottom). ee ea 183 1E\ Soft switch: A two-position switch which can be ‘‘thrown”’ either way by the software of a com- puter. Software: The programs which give the hardware something to do. Stack: A reserved area in memory which can be used to store information temporarily. The information in a stack is referenced not by address, but in the order in which it was placed on the stack. The last datum which was *‘pushed”’ onto the stack will be the first one to be “‘popped”’ off it. Strobe: A momentary signal which indicates the occurrence of a specific event, Subroutine: A segment of a program which can be executed by a single call. Subroutines are used to perform the same sequence of instructions at many different places in one program. Syntax: The structure of instructions in a given /anguage. If you make a mistake in entering an instruction and garble the syntax, the computer sometimes calls this a ‘SYNTAX ERROR.” Text: Characters, usually letters and numbers. ‘‘Text’’ usually refers to large chunks of English, rather than computer, language. Toggle switch: A two-position switch which can only flip from one position to the other and back again, and cannot be directly set either way. Trace: An etched conductive path on a Printed-Circuit Board which serves to electronically con- nect components, Video: 1) Anything visual. 2) Information presented on the face of a cathode-ray tube, Warm-start: To restart the operation of a computer after you have lost control of its language or fe) 5) © | operating system. Window: Something out of which you jump when the power fails and you lose a large program. TE) Really: a reserved area on a display which is dedicated to some special purpose. 184 | Re fet ofl OTP 6 oe) fei et _ BIBLIOGRAPHY Here are some other publications which you might enjoy: Synertek/MOS Technology 6500 Programming Manual This manual is an introduction to machine language programming for the MC65@2 microproces- sor. It describes the machine lanuage operation of the Apple’s microprocessor in meticulous detail. However, it contains no specific information about the Apple. This book is available from Apple. Order part number A2L0003. Synertek/MOS Technology 6500 Hardware Manual This manual contains a detailed description of the internal operations of the Apple's 6502 microprocessor. It also has much information regarding interfacing the microprocessor to exter- nal devices, some of which is pertinent to the Apple. This book is also available from Apple. Order part number A2L0002. The Apple II Monitor Peeled This book contains a thorough, well-done description of the operating subroutines within the TRA FEL TEL Ei 8) TEI (EL i. Apple’s original Monitor ROM. This is available from the author: IE\ William E. Dougherty 14349 San Jose Street IE! Los Angeles, CA 91345 Programming the 6582 This book, written by Rodnay Zaks, is an excellent tutorial manual on machine and assembly- language programming for the Apple's 6542 microprocessor. This manual is available from Sybex Incorporated, 2020 Milvia, Berkeley, CA 94704. It should also be available at your local computer retailer or bookstore. Order book number C202. 6582 Applications This book, also written by Rodnay Zaks, describes many applications of the Apple’s 6502 microprocessor. This is also available from Sybex. Order book number D302. System Description: The Apple II Written by Steve Wozniak, the designer of the Apple computers, this article describes the basic construction and operation of the Apple II. This article was originally published in the May, 1977 issue of BYTE magazine, and is available from BYTE Publications, Inc. Peterborough, NH 30458. i 186 FF SWEETI6: The 6542 Dream Machine Also written by Steve Wozniak, this article describes the SWEET16® interpretive machine language enclosed in the Apple's Integer BASIC ROMs. This article appeared in the October, 1977 issue of BYTE magazine, and is available from BYTE Publications, Inc. Peterborough, NH 30458. More Colors for your Apple This article, written by Allen Watson III, describes in detail the Apple High-Resolution Graphics mode. Also included is a reply by Steve Wozniak, the designer of the Apple, describing a modification you can make to update your Revision @ Apple to add the two extra colors available on the Revision | board. This article appeared in the June, 1979 issue of BYTE magazine, and is available from BYTE Publications, Inc. Peterborough, NH 30458. Call APPLE (Apple Puget Sound Program Library Exchange) This is one of the largest Apple user group newsletters. For information, write: Apple Puget Sound Program Library Exchange 6708 39th Ave. Southwest Seatte, Wash., 98136 The Cider Press This is another large club newsletter. For information, write: The Cider Press c/o The Apple Core of San Francisco Box 4816 San Francisco, CA 94101 PITT 187 188 ta tay yaTd) Nid) NT) SNSNSN Nadi Vy Ne Mai 190 GENERAL INDEX 194 INDEX OF FIGURES 195 INDEX OF PHOTOS 195 INDEXOF TABLES 195 CAST OF CHARACTERS is 189 GENERAL INDEX @ boards, Revision. ................00.ceccceeeeeeees 3, 26 buses, address and data ..............::cc:c0008 88, 90 1 board, Revision..... 3, 26 DYIO, POWEL-UD.....ccseessrennesssovecassvetnensansene 37, 65 2716 type PROMG........scssccsscsrearesescessersencess 94 S0OHz modification, Eurapple ................00..... 10 Ov 6502 instruction Sel..........c6cccc 652 internal registers. card, Apple Language.............:..scs-crsersossserees 6502 MICFOPFOCESSOT..........cccccceeeceereeersees card, Apple Firmware... cassette interface jacks... Poy ees cassette interface ........... CASSEULS TAPS) SAVING (0... .evcscoscacsvosvconcencasecrs Access Memory (RAM), Random cassette tape, reading from.,............c.ccccc000 47 address and data buses changing memory ................. address multiplexer, RAM. character code, ASCII. addresses and data 00.0.0... :ccceseeeeesseeeseeees character, backspace ... addressing MOdES.............0..ccccceeeeeeeeseeeseeeee character, line-feed..... analog inputs ............ character, RETURN ... . annunciator outputs............... rl (ae | annunciator special locations ........0...0.......... Characters, prompting ........00..c6cccccececseesseees Apple Firmware card............. 73 characters, keyboard.... my PRS Apple Language Card .............c:ccccssssssserseeeneee 3 Characters, COMUO] ..........cccccccecceseeeeseeesseeseeees 7 Apple main board, the ............cccc000c0008 3, 89 clearing the keyboard strobe............0ccccccces 6 Apple Mini-assembler...........0cc:cccccscesrseeesees 49 code, ASCII character................. 5, 6, 7, 8, 15 Apple, photo Of the ............:cccccessssrsserssereeveee 2 codes, escape Apple power supply, the.. 2, 92 codes, keys and ASCII Apple, setting up the.... stack cold start ........00..... Apples, ‘Variettes: OF ...<5s¢icsccvcacvesvsyeoeepensvenred 25 colors, Low-Res.... ASCII character code....... 5, 6, 7, 8, 15 colors, High-Res.................... mm ASCII codes, keys and ...............cccccecrseeesoceres 7 colors, European High-Res.....................-...-- Autostart ROM listing.................. Appendix C command loops, Monitor ............ Autostart ROM Reset...............-::c:scsserrerereee 36 commands, creating your own it Autostart ROM special locations . . . . . . . . . 37 commands, summary of Monitor................ 59 Autostart ROM..............00000+ peavurcestasibucxieiins 25 comparing memory............ auxiliary VideO COMMECHOF ..............00cceeeceeeeee 9 configuration block pinout... configuration blocks, RAM ads PPA TRL UPL OOF. ORL PPL PRL TEL SEL NRL (Fl fF) «B= configuration, RAM memoty ..................0.+- 70 connector pinout, peripheral......................106 backspace: character. 230i a 30 connector, keyboard .............. 5, 102 backspace key ........ connector, power ..... ...104 BASIC, entering .... connector, speaker....... aed BASIC, reentering. connector, Game I/O......... 23, 100 bell character: ........0...c:s:ci600 connector, auxiliary video .................00..:.0006 9 block pinout, configuration.................00..0.... 71 CONMSCUOE, “VEOOS ccccsscoarsrccvvcacserconserenkaauvesuends 9 blocks, RAM configuration .................0..0.... 70 connectors, peripheral ..............:.s0::0000 3, 105 board 1/0, peripheral..........0.c.ccuc ees 719 connnector pinouts, keyboard... ..103 board, Revision @......... 3, 26 CORO! CHAPACTOTS a seicsconsacvccnscsevccsavcanccsevocces 7 board, Revision 1... 3, 26 control values, Normal/Inverse................... 32 board, the Apple main..... 3, 89 Controllers, Game.............:cseesees 24, 100 board schematic, main............0ccccusee 110 COUT, KEYIN switches,.,.........:cccscessseeeesees 83 buffer. pleturesncécecsseane ne ea: 12 COUT standard output subroutine.............. 30 buffer: taputssssts cei 33 creating your own commands...................... 57 builtin 9/0 cscascccntnenaeainane 78, 98 CSWLKSW switeines istic ccscocesacsscravtessrvnct 83 ‘Fi F| Fl Fi FI Fh EI 190 IORDEINIT 231 Zaius ven nnssnsicoteuuautatastasexenaeuesndseaicinon 30 BIGH-RGS GCADIIOS iss sssssvevcssccoresacaesiecessxsistes cursor, outpul...... High-Res screen, the.........0:...ssccssscssseossevorss cycle, the RESET ...............cscscssssrsorvessesessees 36 High-Res video mode, the . ERIBRRCS COMOTS css ccsecissavecesssgceesssvonceness Pe en data buses, address and ...................cc:cceeree data, addresses and........... IMput bufber. oo... cceeccccsccessseeseeeeerseereeeeedd debugging programs................ input line, editing an i - display special locations, video —- input lines, GETLN and...........c..cecceceeeeeee 33 Cisplay, Vid@O..........cccccrcssessssssscesssccssccessenseeaee INPUL PFOMPLING...........cccccccccssecssseeseeeseesseees 32 input subroutine, RDKEY standard... a x input/outpul features............0cccccceccceeceeesees 20 input/output special locations............. editing an input line ...............:cccscereseeeeeeeees INPUL/OUTPUL .... eee eceeeceee editing features................. inputs, data.................. entering BASIC ................ inputs, one-bit (**flag”’)... entering the Monitor........ inputs, analog ..................... entry vector, soft........... - : inputs, single-bit pushbutton... CHORE AEC) MON 9 sssiccc sere cosa scecccosseccceeeesie instruction set, 6502 0.0.0... Appendix A Eurapple 50Hz modification .....................--- instructions, Mini-Assembler ...................0.- 66 European High-Res colors... ; interface jacks, cassette examining memory interface, cassette ............ CXPAMSIOT Ro visniesecns ances sccascsasswassasessxes 84 internal registers, 6502 Ty,| a Be eee inverse text MOUE..............-ccccsserssserrseeeee I/O connector, Game .....,......-...-+ feature, the Stop-List .............00esesecseeees 26, 30 I/O programming suggestions ... features, input/OULPUL ..............ccscccseseeesereeee 20 I/O special locations .................eersesessseerseeees AGMETIT OS, COMTI i aaccscicscovencrscesevesccsaceresduospan 25 BAGS IE scans vatcerosnesesncoersateescesassocaseoen features, keyboard 1/O, peripheral board. a, features, MICTOPFOCESSOT...........66.cceseeeseeereees 88 L/S PTIDINEIE SIDE sinc:cccensconpsinverstenorsieosycesss features, power SUpplY...........c:ccceseseeseerseees Firmware card, Apple.... ie oa Ja (“flag”) inputs, one-bit.....................-5 Format Text ecreen iccoacnoncanennun 16 jacks, cassette interface..................0000+8 22, 103 format, Low-Res screen .... jacks, video output .... format, High-Res screen furmper, “USER ee ccccicisxeccovces uccsoeccceeccon tans from cassette tape, reading..................0:006. 47 = on we G «- Mey, RCRRINOE aici eiiiaiaircas cockactan bends beaten 34 Game Controlletsssiiiicsiin cai 24 key, retype Game I/O connector ...........c002cscee0c00 keyboard charactetys..ic5.0s:ccscecvovscovevascesavtce 7,8 generator, the VideO .............:ccccscccesseseccsesans keyboard connector ..............000.........5, 102 GETLN and input lines.. we keyboard connnector pinouts.. SlaPics MOPESS sie RAR AS keyboard features (ioc cieeeis keine graphics; High+Res)s.ccicnacaaniniie keyboard schematic.......:..cccccccccsessssstescesseee graphics; Low: Res sisi cs keyboard special locations .0.0.......000..000000. keyboard strobe................... 6, 78, 79, 98, 102 guile. keyboard strobe, clearing the ......0....000.000.. 6 keyboard, review of the keyboard, reading the......cc.ccccscccciesvscnsseostecees KEVIN: switches, COUT | ccc.uuiiniicnnes. 83 191 koysand ASCH codess accsieinerinititeinc 7 mode, the Low-ReS video ........cccccccceceeeceees 17 mode, the High-Res video .. me ) 4 aa Tyce mode, inverse text............... Kaad mode, normal text..... FrereV3 Language card, Apple................c0c:c0c08 3, 69 modes, addressing .. 66 leaving the Mini-Assembler .........0.....0.000. 50 Modes, graphics..........cc.ssc0000 ak line, editing an input ...i.cc.c.5:.iccveccesssccsesopsses 33 modification, Eurapple 50Hz... eh line-feed character ssiisciiicsaiNicitecctuacteteseass 30 Monitor command loops ............... 56 lines, GETLN and inpult..................c00.008 33 Monitor commands, summary of................ 59 listing, Autostart ROM....... .Appendix C Monitor promot: (¢) ncaa caeseniccnescee 40 listing, Monitor ROM................0 Appendix C Monitor ROM RESET sisssicsiccscstccseseiasce 38 listing machine language programs.............. 49 Monitor ROM listing..... . Appendix C list of special locations... ...Appendix B Monitor ROM................... si2S locations, list of special.......... .... Appendix B Monitor special locations ...........000:000:0ccce 65 locations, annunciator special ...........0.......... 24 Monitor subroutines, some useful.... sand locations, video display special .................... 13 Monitor, entering the...........:0....ccccesscsessseees 40 locations, input/output special..................... 25 SHOVING MOMIONY: ccsssssessssiceceeierwaratencaninees 44 locations, text window special ..................... 31 multiplexer, RAM address ..............:ce000000 %6 locations, Autostart ROM special................ 37 locations, Monitor special.. 565 an Nia locations, keyboard special .............ccsseecceeees locations, I/O special ......... aie NOFMal tOXt MONE casccrsissirsisorsoreciecccrseversesaves 32 loops, Monitor cOMMANG ..............000cceeeeeees Normal/Inverse control values... 32 LAW- ROS COIOIS sass iesacccciecestiarnainseccesseeaseieaens notation, hexadecimal............:ccsccssecsesesreeee 40 Low-Res screen, the.......... HUMOR TANGOM ay cncssccasccssvccssciacarcansacacnesie 33 Low-Res video mode, the. LUKSWATINSISIS isis. cama sie inte a One (system stack), Page ........-.:.ceecseeereeee 69 ee d 4 one-bit (‘flag’) inputs................-... 24, 25, 78 machine language programs, listing............. 49 main board, the Apple .................... 3, 89 OUDUL CUTER acon scanwimnanaminase 30 OULpUl jackS, VIdEO ...,....,..-:cceereeceeeses 97 IFA main board schematic..... 110 output subroutine, COUT standard... MAP, SYSTEM MEMOTY oo......ccccccccccseeseeeeeeeeeene 68 outpul, ulility strobe...........0......... IF maps, zero page Memoty................. i I4 outputs, annunciator.., pawx Memory (RAM), Random Access.............-.- 3 OUTPUIE, StIOBE. 0 ccccaspsesesceceneseensas 8 Memory (ROM), Read-Onlly.................0000 3 own cammands, creating yOUr..............00 57 memory configuration, RAM ................006 70 memory map, system ............... ...68 A gee memory maps, zero page ah TIGTIOLY: PAB Roso ecssccnanscrceseossnccrsapeseenscaavenascs 68 page MeMOry MAPS, ZETO.............:cscseeeeeeee 74 TOIMOTY, CRAIG, ioisiscics cgas cs anpse c acensensts 41 page one (system Stack) ........0...::ccsceeeeeeeeee 69 EMOLY, CHMTBI NG 5ssc. .neses rens recsesusecasesacis 43 PEGS PEIO os ssscicccnsssonrsoaneeayoy .69, 74 WNSIIGTY. WHO VIING vis ses esensncorsrecnvsscoveoncecontsncss 44 PUROR IOCLOBIT ciescvaccxarncocerecanceonoanaxennsos 12 MEMOTY, COMPAFING..............cceseeeceseseeeeeseers 46 pages, memory ........... 68 memory, RAM......... .68, 95 peripheral board I/O............ wenDD memory, ROM............... 72, 94 peripheral connector pinout................006 106 microprocessor features . . . . . . . .c:scecse e e es 88 Peripheral COMMECCOSS ..........ccceeereeeereers 3, 105 microprocessor, 6502 ............... 3, 88 peripheral Slot 1/0 ............:cssssccrseseesseeerssees 79 Mini-Assembler instructions ...............:00064 66 peripheral slot RAM... Mini-Assembler prompt (1!) ..0..........00:-2ce0e 50 peripheral slot ROM... Mini-Assembler, Apple ....................:.:c00000 photo of the Apple . . . . .-.c c c cs e se se rerenrese ’ 2 Mini-Assembler, leaving the.... picture buffer..........-....-..00+ sob? mode, the text Video ............cccccseeesseseeeeeeeee pinout, peripheral connector..........0.....0006 106 FOF éCFiA 'F) UF) F) Fi 5} 192 pinout, configuration block..............0::00000 71 ROM: Autoutart icin. ic ee eee 25 PANOUG, ROME S, sisscscszctevcdipovesaviveacveistesonstitat 95 ROMS MONOR ioiiseccsedscicesdcsasscvcbeccatsvasavesuds 25 PAMOUT, RAM siaveiccsestyrcsttsncticnrisycistsvcenstisune 96 ROM, peripheral slot...............ccccecessesesesserees 80 pinouts, keyboard connnector.... ...103 ROM or PROM, expansion .................0:006 84 PO WOE! CONMOOIGR iSieiicesdss haiiieeteccedceseeteats 104 running machine language programs........... 48 power supply features .............:cccccscccesseseaees 92 power supply schematic ........00..cccceccseeeeeees 93 eal, We power supply, the Apple .. .2, 28, 92 power-up Wyle icici ccccestieccevacsepcccceeesatets 37, 65 Saving to cassette tape ......0......ccccceeeceeeeeeee 46 programming suggestions, I/O .................. 80 schematic, keyboard ....... 101 programs, running machine language... schematic, power Supply.........ccccsccseseeeeenes 93 programs, listing machine language............. schematic, main board....... 110 programs, debugging ...........0...:cccceseseeee screen Tormaticsccacnadnmeni. I PROM, peripheral card........... screen forttiat, Text cc.ssccasiscascstesincs 16 PROM, expansion ROM or.... screen format, High-Res .............::c:ccceseeee 21 PROMs, 2716 type ................. screen format, LOW-RES ........ccsccsesseeseeseeees 18 prompt (+), Monitor............... GCTEON: PARES esc csssccesen cs ieiean Souansincteansteasaxancis 12 prompt (!), Mini-Assembler... SCTLON: SOM. SWIRCHES ccs scscnicetctavecscevcesa s e ns 12 Prompting Characters ..:.....ccscccescssesecssccconsonss Boren. (he TOK sss asacscte eeesanmaaids 16 PLOMPplinig, WPUlsissscccvcsscsisscorvivecovscocsensnesere screen, the LOwW-ReS 3 e-csis es ec ieszcesearieranes 18 pushbutton inputs, single-bit..........0..0..00.6 screen, the High-Res... set, 6502 instruction ... yy setting up the Apple.............-cs:cccssssscsessssseseens 2 signals and relationships, timing................. 9) RAM address multiplexer .......00...:00.000:008 96 single-bit pushbutton inputs ..............000006 78 RAM configuration blocks...........00...0..20008 70 slot 1/0, peripheral................ RAM memory configuration .............0...000 70 slot RAM, peripheral...... RAM memoty ..........cc0000000e slot ROM, peripheral...... RAM pinout........000.0... soft entry vector .......... RAM, peripheral slot.... SOLU BWHCNON sss ccscsiccnsscancsnsveceevacvevers random access memory (RAM) ..........-.:0000+ 3 SOFt SWITCHES, SCTEEN 5....cecsnevesssesseresaveesesuennes SATO UNDE ois sass cia tcccatiacaceceatscasconsestice 33 speaker connector........... RDKEY standard input subroutine ............. 32 special locations, list of. reading from cassette tape......... 47 special locations, video display ................... reading the keyboard.............. special locations, input/output..... read-only memory (ROM).. special locations, text window ..... roenteritig BASIC cis ssisseniicccigsescrccassis 34, 54 special locations, Autostart ROM registers, 6502 internal .........0...00.00:0008 53, 81 special locations, Monitor.................00+6 relationships, timing signals and.................. 91 special locations, keyboard .... RESET Cycles (06 csiscas ccossecsassasssssscovsteecenesnen 36 special locations, I/O......... RESET, Autostart ROM. . . .:sc cs csc s socers e s 36 stack), page ome (SySteEM ............-ccseeeereees RESET, Monitor ROM..........:c:sesscssseseesveees standard input subroutine, RDKEY ............ 32 return character ............... standard output subroutine, COUT............. 30 FOR DO ROY wiccess ccusewevccececsupsvicxencsraisinvarsansceans BUY CO J. ocscessevecenceicas nnpeapsceeasecores 36 review of the keyboard... Start, lukewarm................0004. 36 Revision @ boards......... SEE REI is re ea ivsgsscccny ain sveientenamronneetax svar36 Revision | board .......... STEP and TRACE....... ..26, 51 ROM listing, Autostart..... Stop-List feature, the .........cccceeeceeeees 26, 30 ROM listing, Monitor... Strobe OUtpul, Utility... cc ccceeseeeeeeeeeee 25 ROM memory .............. SILODS: GUTS, ,.....:ccsneseerennarennne 18 ROM PIN QUE viacoscccassasconncacevensexoquessiarcetontsers strobe, clearing the keyboard ............0:10eee0+ 6 ROM RESET, Autostart........c0ccccccccceeeeeees subroutine, COUT standard output............. 30 ROM RESET, Monitor................. os subroutine, RDKEY standard input............ 32 ROM special locations, Autostart subroutines, some useful Monitor............... 61 A a suggestions, I/O programming .............206 80 WIIOW |CHS TORE ai adieadeidgiavicccepsecenscueaens 31 summary of Monitor commands . . .,. . . . .+ 59 Supply features, POWET...........ccccereerseerrseers 92 eh Aen supply schematic, POWET...........2:ccerseereeers 93 supply, the Apple power ................--- 2, 28, 92 your own commands, creating...............00.... 57 Switches, SOft.......ccccereee --e12, 79, 98 Switches, SCTEEN SOML...........-.ceceseessecseesseeeses 12 Bas, Ae SWITCHER, COBRIO. <...ncsncnreoerssoriaveeynsoeseasesaneanive 79 switches, COUT, KEYIN.. 83 ZETO PABE MEMOLY MAPS.............cescccrrseseveeee 74 switches, CSW/KSW......... ...83 WOES DOM Cine tiiievcstatiscactsasSccetvevavcdbebeaues’ 69, 74 system memory map.......... (system stack), page onc... 69 SHSTGMUAUMITT siarcsvsvessosscccacancacincesstanssexcevcaser 90 =P INDEX OF FIGURES tAPe, SAVING tO CASSEITE \.........cececcrsssocrseresees 46 Figure 1, Map of the Text screen............... 16 tape, reading from cassette... 47 Figure 2, Map of the Low-Res mode......... 18 text mode, inverse................ wove Figure 3. Map of the High-Res screen....... 21 GORE TOMS THOMA665s c aceciscvs c scivevios ta citas 32 Figure 4. Cursor-moving escape codes....... 35 HEKU SCHOO, TG iseavsescvassvdavecssvcecnandeteace 11, 16 Figure 5. System Memory Map.............-++ 68 TEXt VIdEO MODE, MO iii. caesevsccccisstvscceesnceses 14 Figure 6. Memory Configurations ........,..... 71 text window special locations.... Figure 7. Configuration Block Pinouts ....... 71 text window, the...................00.. Figure 8. Expansion ROM Enable circuit...85 timing signals and relationships... 9] Figure 9. $CFXX decoding ................ timing, System ...........0.0000005 90 Figure 10, The Apple Main Board... TOQRIG SWICHOS SG... ciivivencaces cities 79 Figure 11, Timing Signals..................- TRACE, STEP and: isa ecenks 26, 51 Figure 12. Power Supply Schematic meee Of Figure 13. ROM Pimout..............0.-csseceeesees Figure 14. RAM Pinouts................s:00:0008 OPA ORL OOPL OVRL PPL PL fF. (Fl Figure 15. Auxiliary Video Connector ....... 98 SUSER 1” PUMpetess css eeccecssseeSEeesae Figure 16. Game I/O Connector Pinout...100 useful Monitor subroutines, some.. Ree Figure 17. Keyboard Schematic Drawing .101 Utility strobe: output sisi sscccke iis ness Figure 18, Keyboard connector Pinout.....103 Figure 19, Power Connector.............000.00 104 ea Wee Figure 20, Speaker Connector.................. 105 Figure 21. Peripheral Connector Pinout...106 values, Normal/Inverse control..............06 32 Figure 22. Main Board Schematic......110-115 varieties of Apples vector, soft entry... VidEO CONNECLOF ........:cc cess video connector, aUXiliaLy ............ccesserreseerees 9 Vithoo Citeany ss cistes sasiesccciecccrashazcTeeneereee eek 9 video display special locations . aks. video generator, the ........6.0+ 96 video mode, the text.. 14 video mode, the Low-Res .... ew ) video mode, the High-Res ... wld Video: OUtpUL jacks. «.ccnniiianiiirnses 97 FP OIF) FP) OF 'F) OFA OTF oo: Weise Lt TG epee errrroe pte Fey SE OPES TTT POP CD window special locations, text Fi 1f INDEX OF PHOTOS CAST OF CHARACTERS Photo l.- The Apple’ Eh wssiscacatiuernusanrne Photo 2, The Apple Power Supply ............... Photo 3, The Apple Keyboard........ Photo 4. The Video Connectors Photo 5, Eurapple jumper pads..................... Photo 6. The Apple Character Set................ Photo 7, The Game I/O Connector... Photo 8. The USER 1 Jumper.cc.cssscsssss-sss.« - : (colon) ..... er ENDELION) eastanieet eee Besecesezeiena 4} INDEX OF TABLES a Table 1. Keyboard Special Locations............ Table 2. Keys and their ASCII codes .... Table 3. The ASCII Character Set................ Table 4. Video Display Memory Ranges.........12 Table 5. Screen Soft Switches............0.... BK a Table 6. Screen Mode Combinations..... 13 Table 7. ASCII Screen Character Set..... wS Table 8. Low-Resolution Colors............... kT Table 9. Annunciator Special Locations ....... 24 Table 10. Input/Output Special Locations.......25 Table 11. Text Window Special Locations.......31 Table 12. Normal/Inverse Control Values.......32 Table 13. Autostart ROM Special Locations....37 Table 14. Page Three Monitor Locations ........ 65 Table 15. Mini-Assembler Address Formats ...66 Table 16. RAM Organization and Usage ...... 69 Table 17. ROM Organization and Usage .........72 Table 18. Monitor Zero Page Usage......... ..714 Table 19. Applesoft Il Zero Page Usage..........74 Table 20. DOS 3.2 Zero Page Usage............. 75 Table 21, Integer BASIC Zero Page Usage......75 Table 22. Built-In 1/O Locations .................. 719 Table 23. Peripheral Card I/O Locations...... 80 Table 24. Peripheral Card PROM Locations....81 Table 25. 1/O Location Base Addresses........ 82 Table 26. 1/O Scratchpad RAM Addresses......83 Signal Descriptions: Table 27. PRU ssicsc asic scccassavsusscaieatiotosien Table 28. Auxiliary Video Output .. Table 29. Game I/O Connector...... Table 30. Keyboard Connector...............-.00 Table 31. Power Connector :<.ssssesisveversessece Table 32. Speaker Connector....... Table 33. Peripheral Connector eee a rrr 196 FE td th i di ‘di Fy ld iain ee = =~ = —- an ee € se ies Fl AB)” /: fs aot ff yff WZ bs f f —r AY My OY ny A YY OY YO YY YY @apple computer inc. 10260 Bandley Drive Cupertino, California 95014