Intermediate Apple
From the originals
13 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
$14.95 INTERMEDIATE APPLE By Bill Parker Take that intermediate step from elementary BASIC to machine language programming!
A book cover with a blue sky background, large red beveled title letters, and an illustration of an Apple II computer with a red apple, floppy disk, ruler, pencils, paperclips, test tube, and software boxes such as 'The Elementary' and 'RAP' stacked around the monitor on a wooden base.
Reading notes: The small 'apple II' logo on the computer is stylized and read as 'apple II'; the small publisher logo at top left and small fine print on the keyboard are not legible enough to transcribe. The software box labels in the illustration are partly obscured and only 'The Elementary' is clearly legible; 'RAP' is a visible stylized word on a box.
- Printed prices
- $14.95
- Languages
- English
PDF page 1
$14.95 INTERMEDIATE APPLE By Bill Parker THE ELEMENTARY from DATAMOST INC. ZAP Take that intermediate step from elementary BASIC to machine language programming! Apple II
A blue sky background shows a cartoon Apple II computer whose monitor screen holds stacked objects including a ruler, pencils, a test tube, a floppy disk, a red apple, and software boxes labeled THE ELEMENTARY and ZAP.
Reading notes: Small text on software boxes such as the 'from DATAMOST INC.' line and the ZAP box lettering is partly obscured and uncertain. The fine print on the keyboard and the small label on the lower left of the keyboard is illegible. The mark in the top-left corner is a publisher logo and was not transcribed as text.
- Printed product names
- Intermediate Apple · Apple II · The Elementary
- Printed prices
- $14.95
- Languages
- English
PDF page 2
Intermediate Apple by Bill Parker Illustrated by Robert J. Peters 20660 Nordhoff Street Chatsworth, CA 91311 -6152 (818] 709-1202
Reading notes: No image was supplied; fields are based only on the provided extracted copy, so layout and artwork could not be verified. The first line 'Intermediate Apple' is treated as the headline, but its role as a headline versus a title or byline is not confirmed. The phone number is printed as '(818]' with a mismatched bracket, reproduced as supplied in the source copy. The address and phone number are contact details, not advertised products or prices, and no printed dates appear in the copy.
- Languages
- English
PDF page 3
[@] DATAMOSl:,. ISBN 0-88190-241-1 Copyright© 1984 by DATAMOST, Inc. All Rights Reserved This manual is published and copyrighted by DATAMOST, Inc. Copying, duplicating, selling or otherwise distributing this product is hereby expressly forbidden except by prior written consent ofDATAMOST, Inc. The word APPLE and the Apple logo are registered trademarks of Apple Computer Inc. Apple Computer Inc. was not in any way involved in the writing or other preparation of this book, nor were the facts presented here reviewed for accuracy by that company. Use of the term Apple should not in any way be construed to represent any endorsement, official or otherwise, by Apple Computer Inc. Brief excerpts from software and documentation on B.E.S. T., Edit-Soft and APLUS used by permission of Sensible Software. Apple II is a registered trademark of Apple Computer Inc. Used by permission of Apple Computer Inc., 20525 Mariani, Cupertino, CA 95014. Printed in U.S.A.
Reading notes: Possible OCR spacing artifacts in 'B.E.S. T.' and 'DATAMOST' sequence at the start of the copyright notice Headline absent; primary heading not identifiable from the supplied copy
- Printed product names
- APPLE · Apple II · B.E.S. T. · Edit-Soft · APLUS
- Printed dates
- 1984
- Languages
- English
PDF page 4
ACKNOWLEDGMENTS To Bill Sanders for the methodology and motivation to finish this book Dedicated to Nancy and Z. Parker, two of my closest friends.
Reading notes: Irregular spacing in the names 'Bill Sanders' and 'Nancy and Z. Parker' may reflect extraction artifacts.
- Languages
- English
PDF page 5
Table of Contents Chapter 1: Introduction to Structured Programming .... 11 The Hazards of Unstructured Programming .... .. 11 Benefits of Structured Programming . . . . . . . . . . . . 15 The Three Control Structures . . . . . . . . . . . . . . . . . . . 15 The Problem with GOTOs . . . . . . . . . . . . . . . . . . . . . . 19 ASA: An Alternative to GOTOs . . . . . . . . . . . . . . . . . 20 Nesting ..................................... 21 A Word on Variable Names .................... 22 Program List Formatting . . . . . . . . . . . . . . . . . . . . . . 23 Summary .................................... 27 For Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Chapter 2: Problem Solving Using Structured Programming .............................. ; . . . . . 31 The Five Steps of Algorithm Development . . . . . . . . 31 An Actual Example: The Shadow and the Building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 The Four Standard Program Modules . . . . . . . . . . . 37 Summary ...... ............ ........ .... ... ... 40 For Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Chapter 3: Introduction To Flow Diagrams . . . . . . . . . . . 43 The Bas.ics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 The Control Structures . . . . . . . . . . . . . . . . . . . . . . . . 47 Nesting ..................................... 48 Flow Diagrams vs. Flowcharts . . . . . . . . . . . . . . . . . . 49 Refining Flow Diagrams . . . . . . . . . . . . . . . . . . . . . . . 51 Actual Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Summary .. . .. ..... ........ ................. . 57 For Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Chapter 4: Useful Algorithms . . . . . . . . . . . . . . . . . . . . . . . . 59 Sort Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Bubble Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Select Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Shell Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Reading notes: Table of contents entries contain OCR-style spacing and punctuation artifacts (e.g., 'Bas.ics', 'Structure .. . ..') Page numbers and dot leaders may be partially garbled in places
- Languages
- English
PDF page 6
DOS Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Load Directory Into An Array . . . . . . . . . . . . . . 64 RWTS ......... .. .. . .............. . ...... 66 EXEC Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Summary .............................. : . . . . . 69 For Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Chapter 5: Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Purpose of Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Structure of Text Files and the Disk . . . . . . . . . . . . . 71 Basic File Structure: Records and Fields . . . . . . . . . 74 Sequential and Random Access Files . . . . . . . . . . . . 75 Text File Memory Requirements . . . . . . . . . . . . . . . . 77 File Design Considerations . . . . . . . . . . . . . . . . . . . . . 79 Useful File Handling Techniques ......... ... .... 81 Make a Sequential File ........ ............ 82 Read a Sequential File ..... . ............... 83 Make a Random Access File . . . . . . . . . . . . . . . . 84 Read a Random Access File . . . . . . . . . . . . . . . . 85 Appending Sequential Files . . . . . . . . . . . . . . . . 85 Appending Random Access Files . . . . . . . . . . . . 86 External Sort of a Sequential File . . . . . . . . . . . 88 External Sort of a Random Access File . . . . . . 90 Merge Sequential Files . . . . . . . . . . . . . . . . . . . . 92 Merge Random Access Files . . . . . . . . . . . . . . . . 93 Summary ..... ... .. . .... ... .................. 95 For Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Chapter 6: Enhanced Graphics . . . . . . . . . . . . . . . . . . . . . . 99 Limitations of Applesoft . . . . . . . . . . . . . . . . . . . . . . . 99 Introduction to the HI-RES Screen .. . . ......... 101 Introduction to Shapes . . . . . . . . . . . . . . . . . . . . . . . 103 Shape Creating Summary . . . . . . . . . . . . . . . . . . . . . 109 The Lunar Lander Demonstration . . . . . . . . . . . . . . 110 Creating the Lunar Lander Shape . . . . . . . . . . 110 Lunar Lander 1: Display Lander ........... 112 Lunar Lander 2: Lowering the Lunar · Lander . ... ... . .. . .. .. .. ... .. . . . .. .. 116 Lunar Lander 3: Display Terrain . . . • . . . . . . 117 Lunar Lander 4: Sound Effects . . . . . . . . . . . . 118 Lunar Lander 5: Button Control . . . . . . . . . . . 119
Reading notes: Table of contents with dotted leaders; no advertised products, prices, or dates are present in the supplied copy. Some OCR-like spacing and garbled characters appear in headings (e.g., 'Summary ..... :' and 'Useful File Handling Techniques' spacing).
- Languages
- English
PDF page 7
Lunar Lander 6: J oystick/Paddle Control . . . 120 Lunar Lander 7: Explosions . .. .. . ....... . . 120 The Complete Lunar Lander Program . . . . . . . . . . 122 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Chapter 7: Special Printer Techniques ... ..... .... .. 129 The Three Types of Printers . .. , . . . . . . . . . . . . . . . 129 Printing Out Normal Text ... .. . .. . ...... . ..... 130 Special Printer Commands . . . . . . . . . . . . . . . . . . . . 131 Programming the Printer Interface Card . . . . . . . . 133 HI-RES Screen Dump . ...... . . . . .. . .... ... . . . 137 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 For Further Reading .. .. . .. .. ..... . .......... 140 Chapter 8: PEEKs, POKEs, CALLs and Tricks of the Trade . ... ...... .... ........ ... . ...... .. ....... . 14.3 Ampersand ........ ... .... .. ..... .. ..... .... 143 Applesoft Program Pointers ................. .. 143 DOS ............. .... ........ .. ..... ....... 144 Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Command Error Tables ....... . ........... 144 Greeting Program ............ . ........... 146 Last Loaded File .. ..................... . 147 MON Flags .... ... ...................... 147 RWTS .............. .. ... ... ............ 147 Error Handling ..... . . . ....... ... .......... . . 148 Game I/0 ............ . ..... . ..... . ..... ..... 149 Reading Paddles/Joystick ............ ..... 149 Reading Pushbuttons . . . . . . . . . . . . . . . . . . . . 150 HI-RES Graphics ........... . . . .............. 150 Shape Table Pointer . . . . . . . . . . . . . . . . . . . . . . 150 Select HI-RES Page ..... . ................ 150 Clear HI-RES Page .......... .. .......... 151 Display Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Page Flipping . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Reading the Keyboard . . . . . . . . . . . . . . . . . . . . . . . . 152 Move Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Reset Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Screen Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Sounds ...... .... ..... .... .. ...... . ......... 154 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 For Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . 155
Reading notes: Source is a table of contents with dotted leaders; page numbers are not reliable headings Some characters are spaced or split (e.g., 'J oystick', '14.3' for chapter page)
- Languages
- English
PDF page 8
Chapter 9: How To Use An Assembler
Chapter 9: How To Use An Assembler . • • • • . . . . • • • • . • 157 Advantages and Disadvantages of Assembly Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 A Comparison: Applesoft and Machine Code . . . . . 157 Choosing an Assembler . . . . . . . . . . . . . . . . . . . . . . . 159 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Your First Assembly Language Program . . . . . . . 162 Enhancing Your Program . . . . . . . . . . . . . . . . . . . . . 164 Editing Your Program . . . . . . . . . . . . . . . . . . . . . . . . 167 Inside the 6502 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Loading Big Numbers: High and Low Bytes .... 170 Using Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Control Structures in Assembly Language . . . . . . 173 Basic Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Sample Applications . . . . . . . . . . . . . . . . . . . . . . . . . 178 DOS/ Applesoft Problem . . . . . . . . . . . . . . . . . . . . . . 180 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 For Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . 182 Chapter 10: Program Development Aids . . • • . • . . . . . . 183 RDLN ................ .. .................... 183 ASA .............. .. ........ · ... . ........... 187 Programming Aids by Sensible Software . . . . . . . . 195 Edit-Soft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 APLUS ............... . ................. 198 B.E.S.T. . . ..... .... ... ....... . ...... .. .. 201 Programming Aids by Delta Micro Systems . . . . . 203 BASIC' .. ..... .......................... 203 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Ampersand Utilities . . . . . . . . . . . . . . . . . . . . . . 207 Applesoft Editors . . . . . . . . . . . . . . . . . . . . . . . . 207 Applesoft Pre-Processors ................. 207 Applesoft Optimizers ............... : . . . . . 207 Chapter 11: Structures Languages • • . . . . . . . . . . . • . . . 209 Applesoft .... ... ... . .. . . ... .... . . . . .. .. . : . . . 209 Pascal . . ..... .... ....... ... ... . . ... . .... . .. . 210 c ........ ... .. .... ............... ... ....... 210 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 Index . .......• ... ...•..• •.. .• ....... •........•... 215
Reading notes: Table of contents with OCR-damaged characters and dot leaders Some product names such as BASIC' and ASA may be garbled by OCR
- Printed product names
- Applesoft · RDLN · ASA · Sensible Software · Edit-Soft · APLUS · B.E.S.T. · Delta Micro Systems · BASIC' · Pascal · 6502
- Languages
- English
PDF page 9
EDITOR'S INTRODUCTION
EDITOR'S INTRODUCTION William B. Sanders, Ph.D. This book is for the computer user who understands the fun- damentals of BASIC programming and is wondering what to do next. There is a point when the novice computer user reaches a plateau, where he or she decides whether or not to learn more about computer programming. At this point, one has little alter- native than to make a giant leap into the world of machine level language or into various other higher level languages. Mastering elementary BASIC is often traumatic enough to dissuade the budding programmer from risking his life on the cliffs of machine language. So the decision is often limited to taking a leap into the morass of a new language or doing nothing at all. This book offers another choice. It is an INTERMEDIATE step that will immensely improve Applesoft BASIC programming skills and provide a whole array of proven programming tech- niques. Yet at the same time, it deals with the familiar constructs of Applesoft BASIC. In fact, the purpose of this book is to make programming easier, not more difficult. Rather than looking at BASIC in terms of single statements, functions or commands, it shows the user how to deal with program blocks and modules. Small, simple programs are fine for learning how to program, but there will come a point at which you will want to write a useful, fairly large program. If you've spent any time at all program- ming, you must have LISTed others' programs and asked your- self, "How could they keep a big program like that straight?" This book shows you how. You may well wonder how writing larger, more sophisticated programs can be easier than writing a small simple program. For the most part, a large program is nothing more than a well organized set of small programs, and the key to that is organiza- tion and structure. First, rather than rewriting an entire pro- gram every time you sit down at the computer this book shows you how to save and then re-use program modules that can be employed in several programs. With only a few program lines, it is possible to connect several previously written modules into a larger program. Thus, the larger program is actually simpler than blindly piecing together a small one. Also by using struc- tured programming techniques, you will be able to see more clearly what you have done. For anyone who has written a huge 9
- Printed product names
- Applesoft BASIC
- Languages
- English
PDF page 10
program and then gone back to it, one is often at a loss to remem- ber what everything does and why it does it. By clearly docu- menting and arranging it, any Applesoft progam can be made clearer. Mr. Parker even provides some utilities to assist in mak- ing Applesoft more lucid. In addition to showing the user how to attack a programming problem, this book shows how to master some of the more advanced features of Applesoft. In my introductory book, The Elementary Apple, I only wanted to get a new user started in pro- gramming. The book was for someone who brought home their computer and wanted to get started without too many tears. However, DATAMOST wanted a book that would take the next step in programming the Apple Computer. Therefore, many of the features that were just touched upon in The Elementary Apple, such as graphic animation, shape tables, POKEs, PEE Ks and disk file handling, are explored in depth here. Next, the book takes the first step toward advanced program- ming. It is not the giant leap described above, but rather it is an introduction to assembly language programming. The best way to introduce an assembly level program is to explain how to use an assembler, and that is exactly what it does. This gives the user a chance to take a look before the leap. You will be shown how to get an assembler up and working, along with some sample assembly level programs. Everything will be kept simple, and while you cannot expect to become an expert at assembly level programming, you will learn enough to get started. Finally, the book concludes with a number of utility programs provided by the author, along with some suggested commercial programs. All of these programs are utilities to make program- ming easier, clearer and more efficient. MEET THE AUTHOR Bill Parker has the ideal background for creating a book such as this. With a solid background in both journalism and computers, he has both the ability to communicate clearly in English and to write computer programs. Bill is a staff writer for Call-A.P.P.L.E., and former editor of the Sandy Apple Press, the club magazine of Apple Corps of San Diego. He has taught computer courses in both the University of California, San Diego and at San Diego State University Extension programs. He is currently a full-time computer consultant and writer. 10
Reading notes: Possible OCR spacing artifacts in words such as 'progam', 'PEE Ks' and 'Mr. Parker' Reading order of the excerpt begins mid-text, so the start of the source may be missing
- Printed product names
- Applesoft · The Elementary Apple · Call-A.P.P.L.E. · Sandy Apple Press
- Languages
- English
PDF page 11
CHAPTER I INTRODUCTION TO STRUCTURED PROGRAMMING ON THE APPLE
CHAPTER I INTRODUCTION TO STRUCTURED PROGRAMMING ON THE APPLE This book will take you from the point of being a fledgling Apple programmer and show you some important principles that can help you handle more complicated programming problems. The method emphasized here is a technique known as structured programming: a "one-step-at-a-time" method of reducing big problems into smaller, more manageable ones. The Hazards of Unstructured Programming on the Apple Consider the following two programs: Program 1: 1001=I+1 110 GOSUB 200 120 GOTO 100 130: 200 PRINT I 210 IF I< 100THEN 120 220 RETURN RUN 1 2 3 4 5 6 7 11
Reading notes: Program listing line '100' appears as '1001=I+1', possibly an OCR error for '100 I=I+1' Program 1 output sequence (1 through 7, then 11) is partially uncertain in reading order
- Printed product names
- Apple
- Languages
- English