Apple Programmer’s Handbook
From the originals
16 scansMachine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.
These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.
Image 1
Apple Programmer's Handbook
SAMS 22175 Apple® Programmer's Handbook Paul Irwin
Dark book cover with a red rule and SAMS logo at top, bold white title text, and a framed photo of seven glossy painted apples in varied colors (white/purple, blue, green, red, dark red, yellow, orange) on a light background, with a spiral binding along the left edge.
Reading notes: The number 22175 at top right is likely a catalog or book number rather than a date; it is listed under printedDates only as printed. The ® symbol after Apple is small and may be partially obscured.
- Printed product names
- Apple
- Printed dates
- 22175
- Languages
- English
PDF page 1
Apple Programmer's Handbook
SAMS 22175 Apple® Programmer's Handbook Paul Irwin
Book cover with a dark background, a red rule and the SAMS logo at top, bold white title text, and a framed photo of eight glossy colored apples (white, blue, green, red, dark red, yellow, orange) with green leaves on a light background, with a spiral binding along the left edge.
Reading notes: The number 22175 at top right is likely a catalog or stock number rather than a date; it is listed under printedDates only as printed. The ® symbol after Apple is small and may be slightly ambiguous in print.
- Printed product names
- Apple
- Printed dates
- 22175
- Languages
- English
PDF page 2
A blank off-white page with a row of rounded binding holes or punched slots along the right edge, showing no printed text or advertising artwork.
Reading notes: Faint paper discoloration and slight shading are present but do not form any legible copy.
PDF page 3
Apple® Programmer's Handbook
A plain white cover page with a binding strip of punched-hole tabs along the left edge and the blue bold title centered in the upper-middle area, with a faint grey smudged image visible in the lower right.
Reading notes: Faint grey background marks in the lower right are not legible text and were not transcribed.
- Printed product names
- Apple
- Languages
- English
PDF page 4
Paul Irwin is a computerist who writes, teaches, a nd consults in Ouawa, Canada. His computer experience ranges from large ma infram es used in governmem administratio n to small microcomputers used in scientific research. He holds a B.Sc. in Mathematics and Physics fro m Laurentian Universit y of Sudbu ry and a certificate in Comput er Programming from Algonquin College (Ouawa). For recreation, Mr. Irwin enjoys skiing, swimming, and sailing. n
Reading notes: Source text contains broken words and spacing from extraction (e.g., 'ma infram es', 'governmem administratio n', 'Universit y of Sudbu ry', 'Comput er', 'fro m'), likely OCR artifacts. Spelling 'Ouawa' may be an OCR rendering of 'Ottawa'; reading preserved as printed.
- Languages
- English
PDF page 5
AppJe® Programmer's Handbook
AppJe® Programmer's Handbook by Paul Irwin Howard W. Sams & Co., Inc. 4300 WEST 62ND ST . INDIANAPOLIS. INDIANA 46268 USA
- Printed product names
- AppJe®
- Languages
- English
PDF page 6
Copyright «:> 1984 by Paul Irwin FfRST EDITION FIRST PRINTING-1984 All rights reserved. No part of this book shall be reproduced. stored in a retrieval system. or transmitted by any means. electronic. mechanical. photocopying. recording. or otherwise. without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. While every precaution has been taken in the preparation of this book. the publisher assumes no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein. International Standard Book Number: 0-672-22175-6 Library of Congress Catalog Card Number: 84-50062 Edited by Don Silengo Illustrated by Jill E. Martin Printed in the United States of America.
Reading notes: Dates '1984' appear in copyright and printing lines; no other dates or prices are printed.
- Printed dates
- 1984
- Languages
- English
PDF page 7
- - .... - - - - - - .... - Preface In 1977, the Apple II computer was launched on a dealership basis across the United States. Prior to that time, Apple was a two-man garage operation making single-board computers for the hobbyists on an order-by-order basis. This hobby market saw the Apple II as cheap, flexible, and somewhat funky. It consisted of a lot of hardware like color graphics, built-in 1/0, on-board bus sockets for peripherals and so forth; but, there were few software features. A manual came with the Apple II. This became known as the red- book and it was as funky as the Apple itself. With startup hints, Integer BASIC description, game instructions and assorted listings, commands and schematics, it gave the dedicated computer hacker a beginning with a wonderful new toy. But Apple found money - lots of money. So, like Cinderella, the Apple II became beautiful. A disk with an operating system was developed. Microsoft BASIC became Applesoft BASIC in a special Apple version. The Monitor that works between most software and the hardware was modified to start the disk automatically at powerup. Called Autostan, this Monitor was fitted to Apples with Applesoft in ROM instead of Integer BASIC. The new version, different only in this firmware, became the Apple II Plus. Meanwhile, the cost of RAM dropped. Many of the early Apples were sold with only 4K of RAM; today, few of these remain with less than 48K RAM in them. An extension card with an additionall 6K of RAM became popular and gave the Apples a RAM complement of 64K . With this additional RAM, users ran other languages like Pascal or simply enjoyed the ability to switch from Appleso ft to Integer BASIC at will. The disk system changed during this period as well. The hardware stayed almost the same - shielding on the ribbon cable to reduce radio interference was the main modification. The disk firmware and software changed to provide sixteen sectors per track instead of the original thirteen. This new version called DOS 3.3 gives almost double density capacity to the 5 Y. -inch diskettes.
Reading notes: Source contains the OCR-style artifact 'additionall' and 'Appleso ft' spacing, which may reflect printing errors The phrase 'Autostan' may be a misspelling of 'Autostart'
- Printed product names
- Apple II · Apple II Plus · Applesoft BASIC · Integer BASIC · Microsoft BASIC · Pascal · DOS 3.3
- Printed dates
- 1977
- Languages
- English
PDF page 8
In 1983, the Apple lie replaced the Apple II Plus. It is compatible with the earlier models and adds several of the features found in common Apple customizations: full ASCII keyboard, lower-case dis- play, and the ability to switch to an SO-column screen display. The Monitor modifications needed to do this were Herculean. It works and it works well. The few programs that can't coexist with the lie model are being superseded by others - the lie model proved to be a success. However great the changes to the Apple II itself, the most powerful changes came from outside Apple Computer Inc. The most powerful feature of the Apple II is the built-in peripheral bus. Unlike much of the competition of the day, Apple published Monitor source listings and schematics. With the listing and bus pin- outs, hundreds of peripheral boards were designed and built. The Apple II became an open system in the truest sense. With an Apple II anyone could configure his own custom computer. If a remote terminal, a data logger, a word processor, a video game, or a super calculator was wanted the answer was the same - get an Apple. This is still true today. You can have all the computers you want by adding reasonably priced peripheral boards to your Apple. This book is for the people who have these Apples. Students, hobbyists, accountants, engineers, scientists, and artists who need specific information can use it to look up just what they want to know. The organization is top down; each topic is treated with specific examples presented in increasing order of depth. For instance, the Applesoft statements you need to address the screen cursor are given before the Assembler statements to do the same thing. All these routines have been tried and tested true; many developed over a period of Apple II programming of two and three years. This book can also be used for self-study by the Apple II user. The top down organization allows the development of concepts from known to unknown. It will be useful in any related course: computer programming, computer science, systems analysis, digital electronics, etc. Chapter One introduces the Apple II with details not emphasized in the manuals. An overview is kept to help you envisage your system in terms of your requirements. Programming is restricted to BASIC and stresses data management needs. The words Apple, Apple II, Apple lie, Apple II Plus, and Applesofl are registered trademarks of Apple Computer Inc. ~ I ~ I
Reading notes: Possible OCR spacing or hyphenation artifacts in several lines (e.g., 'pin-outs', 'SO-column') 'Apple lie' and 'Apple II Plus' reading may be an OCR variant of 'Apple IIe' and 'Apple II Plus'
- Printed product names
- Apple lie · Apple II Plus · Apple II · Apple Computer Inc. · Applesoft · Apple
- Printed dates
- 1983
- Languages
- English
PDF page 9
Chapter Two is a condensed atlas, emphasizing the maps and lo- cations most often needed by the Assembler programmer. Chapter Three can be used alone or with a tutorial text to learn Assembler programming. Those with experience will find useful rou- tines and methods they may add to their repertoires. Chapter Four to Seven need some Assembler programming ex- perience to understand and use. The BASIC programmer can find some command definitions and specific usages, however. Chapter Eight is for the hardware freaks. Some hardware back- ground is needed to build the projects given and suggested there. Hints and cautions to the novice are included to encourage the beginner. Use this book to make your Apple II into the many custom com- puters you want it to be. PAUL IRWIN Acknowledgments To all those who gave so freely of their time and talent to make the .-. first Apples, especiaHy to Stephen Wozinak, this book is dedicated. Thanks, Woz.
Reading notes: Possible OCR artifact in 'Stephen Wozinak' (likely Wozniak) and 'especiaHy' (likely especially).
- Printed product names
- Apple II
- Languages
- English
PDF page 10
Contents CHAPTER ONE GETIJNG IT TOGETHER ...... . . ... ......... . ................. 9 1.1 Requirements- 1.2 Programming- 1.3 File Handling CHAPTER TWO A TLAS OF TH E APPLE II. .. ......... ......... . .. ... ... ........ 57 2. 1 Memory Maps-2.2 Gazetteer CHAPTER THREE MACHINE L ANGUAGE ........... . . ... . ..................... 125 3. 1 The 6502 Processor-3.2 Addressing-3.3 Program Flow-3.4 lntcr- rupts-3.5 Parametcrs-3.6 Arithmetic CHAPTER FOUR APPLESOFT BASIC ...... . ........... . ..................... 229 4. 1 The Languagc-4.2 The St ructurc-4.3 Interfacing to ML Routines CHAPTER FIVE I NTEGER BASIC .......................................... 265 5. 1 The Language-5.2 Structures- 5.3 Ut ilities CHAPTER SIX TEXT AND G RAPHICS ................ . ..................... 3 17 6. 1 The Monitor Tcrminal-6.2 Graphics CHAPTER SEVEN DISK 0 PERA Tl NG SYSTEM . . .......... . ....... . .............. 399 7. I Structures- 7.2 Protocols CHAPTER EIGHT I NPUT / O UTPUT ........................................... 46 1 8.1 Built-in 1/ 0-8.2 Peripheral 110 APPENDIX A BI BLI OGRAPHY AND NOTES ........... . ...... . .............. 499 APPENDIX 8 APPLE II PROGRAMMERS' REFERENCE CARD ................... 505 I NDEX ........................ . .......... . ............... 5 13
Reading notes: OCR spacing artifacts in chapter titles such as 'GETIJNG' and 'A TLAS' Some hyphenated subsection separators run together in the source
- Languages
- English
PDF page 11
CHAPTER ONE Getting It Together
n - - CHAPTER ONE Getting It Together 1.1 REQUIREMENTS 1.1.1 Hardware The Apple II is supplied with a case, a power supply, a keyboard, and a motherboard. You add a video monitor or a tv set with an rf modulator, a disk drive with a controller card, a nd possibly a tape re- corder. If you wish, you can get a motherboard separately, without the Apple firmware. But, however you acquire your Apple, you will probably end up with a disk system operating from version DOS 3.3 or later. The BASIC language supplied is Applesoft except in the older Apples. Before delving too deeply into your Apple's internals, you should be able to program with Applesoft BASIC and have a feel for some of the computer's abi lities. To begin with, look at the major parts of your system first to see what to expect from them. First, the motherboard. Fig. 1-1 shows the motherboard and con- nector locations. This is the Apple II proper, a complete micro- computer. You can buy it separately without case, power supply, or keyboard for special installations. Apple Computer Inc., supplies the real thing, but some equivalent boards offered by several other suppliers come without Applesoft or Apple's other firmware. These so-called clones give you a motherboard that will run VisicalcTM and other software that is independent of the host firmware, but you must still acquire Applesoft and a Monitor before you have an equivalen t 9
Reading notes: Trademark symbol after Visicalc may affect exact product name spelling Page number 9 and stray marks at page start are non-content
- Printed product names
- Apple II · Applesoft · DOS 3.3 · BASIC · Apple Computer Inc.
- Languages
- English