Coleco ADAM Vs
Total Page:16
File Type:pdf, Size:1020Kb
The First Book of ADAM Using and Programming the Coleco AD AM .\ The First Book of ADAM Using and Programming the Coleco AD AM Pamela 1. Roth Que Corporation Indianapolis Copyright@ 1984 by Que Corporation All rights reserved. Printed in the United States of America. No part of this book may be reproduced in any form or by any means, or stored in a data base or retrieval system, without prior written permission of the publisher except in the case of brief quotations embodied in critical articles and reviews. For information, address Que Corporation, 7999 Knue Road, Suite 202, Indianapolis, Indiana 46250. Library of Congress Catalog No.: 83-63253 ISBN 0-88022-063-5 8887868584 8765432 I Interpretation of the printing code: the rightmost double-digit number is the year ofthe book's printing; the rightmost single-digit number, the number of the book's printing. For example, a printing code of 83-4 shows that the fourth printing of the book occurred in 1983. About the Author Pamela J. Roth Pamela Roth received her B.A. degree, cum laude, from the New College of Hofstra University in Hempstead, New York, in 1975. In 1977 she completed an M.S. in technical writing at the Rensselaer Polytechnic Institute, and in 1983 a J.D. degree from Boston's New England School of Law. After completing her B.A. degree, Ms. Roth served as associate editor for a photography magazine, where she was responsible for writing columns. As a free-lance technical writer, she has written articles for Desktop Computing and The Word Guild Magazine. Ms. Roth, who has worked as a systems analyst and documentation specialist, has documented several accounting software programs, including the NEC Astra Business Systems. She has lectured college students on writing about computers and led technical-writing workshops for data processing professionals. iii Editorial Director David F. Noble, Ph.D. Editors Brenda Friedman, M.S. Jeannine Freudenberger, M.A. Managing Editor Paul L. Mangin Technical Editor Thomas Maddox iv Table of Contents Illustrations ............................................. xi Preface. .. xiii How to Use This Book. .. xiv Acknowledgments . ..................................... xv Trademark Acknowledgments ........................ xvi Introduction .......................................... xvii CHAPTER 1 Coleco's ADAM in the Home Computer Industry. .. 1 Home Computers vs. Business Computers .................... I Home Computers ...................................... I Business Computers .................................... 3 The Evolution of Coleco's ADAM ......................... .4 ADAM's Design ....................................... 4 ADAM's Software ..................................... 5 ADAM's SmartBASIC ............................... 5 ADAM's SmartWRITER ............................. 6 ADAM's Games ..................................... 6 The Competition ......................................... 6 A Comparison of Home Computers ..................•..... 7 Coleco ADAM vs. IBM PCjr ........................•... 7 ADAM's Success in the Home Computer Market ............. 9 v CHAPTER 1 The Family Computer System and Module .............................. 11 Overview ............................................... 12 Hardware Components ................................... 13 Keyboard ............................................ 13 Standard Keys ...................................... 14 SMARTKEYs and SMARTKEY LABELs ............. 14 Command Keys ..................................... 16 Cursor Keys ........................................ 19 Memory Console ...................................... 20 Memory Module for the Coleco Vision Video Game System ............................................... 22 Digital Data Pack ..................................... 24 Printer ............................................... 25 Television or Monitor. ................................. 26 Joysticks ............................................. 28 Software ............................................... 28 SmartWRITER ....................................... 28 BUCK ROGERS PLANET OF ZOOM Super Game Pack ................................................ 29 SmartBASIC ......................................... 29 CHAPTER 3 Introduction to Programming ....... 31 Programs and Programming .............................. 31 Programs ............................................ 31 Programming ......................................... 32 Information about Your Computer Needed for Programming ........................................... 32 How to Use the Keyboard .............................. 33 How Much Internal Memory ........................... 34 How Much Storage .................................... 34 What Programming Language Will Run on the Computer ... 34 Whether the Language Is in a Chip ...................... 35 The Role of Documentation ............................... 35 The Requirements Definition .............................. 36 The Functional Specification .............................. 37 Programming as a Profession .............................. 39 vi CHAPTER 4 Programming Adam: Tutorial ...... 45 Exercise I: Getting Started .............................. .46 Exercise 2: Your First Program ........................... 48 Exercise 3: Using ADAM as a Calculator .................. 49 Exercise 4: Assigning Line Numbers ....................... 51 Exercise 5: Defining Input ............................... 55 Variables ............................................. 55 INPUT and GET Statements ............................ 56 DATA and READ Statements .......................... 59 RESTORE Statement .................................. 59 REM Statement ....................................... 59 Exercise 6: Comparing Strings ............................ 61 Exercise 7: Saving Programs ............................. 65 Exercise 8: Loops ....................................... 68 Exercise 9: Conditions and Branches ....................... 71 Exercise 10: Changing the Current Output Device ............ 74 Summary ............................................... 76 CHAPTER 5 The SmartBASIC Language ........ 77 Viewing a Program ...................................... 78 Input ................................................ 78 Process .............................................. 79 Output ............................................... 79 Use of the Program .................................... 79 Putting It All Together ................................... 85 Turning Specifications into Code ........................... 86 Defining SmartBASIC Statements and Functions ............ 87 Crossing the Language Barrier .......................... 88 Defining the Source of Input ............................ 88 IN# ............................................... 88 INPUT ............................................ 89 GET .............................................. 90 READ, DATA, and RESTORE ...................... 90 Defining Input ........................................ 92 Constants and Variables ............................. 92 Variable Names ..................................... 93 Real Numbers and Real Variable Names ............... 93 Integers and Integer Variable Names ................... 93 Numeric Functions .................................. 94 vii RND ........................................... 95 DEF FN ........................................ 95 Strings and String Variable Names .................... 95 Arrays and Dimensions .............................. 98 Processing Instructions ................................. 98 Using Expressions and Operators ...................... 99 Branching to Other Lines or to Subroutines ............ 101 GOTO ......................................... 101 GOSUB ........................................ 101 RETURN ...................................... 101 ON ... GOTO .................................. 102 ON ... GOSUB ................................ 102 POP ........................................... 102 IF ... THEN ................................... 104 Creating and Using Loops: FOR and NEXT ........... 104 Defining Output ..................................... 105 PR# .............................................. 105 PRINT ........................................... 106 TEXT ............................................ 106 HOME ........................................... 107 SPC ............................................. 107 TAB ............................................. 108 HTAB ............................................ 109 VTAB ............................................ 109 POS ............................................. 109 INVERSE ........................................ 110 NORMAL ........................................ 111 SPEED= .......................................... 111 CHAPTER 6 Text Screen and Printout Design .. 113 Introduction to Screen Design ............................ 114 Adjusting for the Width of the Text Screen ............... 114 Using White Space ................................... 116 Creating the Illusion of More Than One Screen ........... 117 Using a Screen to Introduce a Program .................. 117 Reversing ........................................... 119 Using Subroutines To Place Screen Instructions in a Program ............................................ 120 Introduction to Printout Design .......................... 121 viii CHAPTER 7 Sample Program: A Multiplication Drill ................................ 125 LOADing SmartBASIC ................................. 126 SAVEing the Sample Program