BASIC09 Programming Language Reference Manual

Total Page:16

File Type:pdf, Size:1020Kb

BASIC09 Programming Language Reference Manual BASIC09 Programming Language Reference Manual BASIC09: Programming Language Reference Manual Copyright © 1983 by Dragon Data Ltd. and Microware Systems Corporation. All Rights Reserved. Basic 09 is a trademark of Microware Systems Corporation and Motorola Inc. Revision History Revision F February 1983 Table of Contents 1. Introduction .......................................................................................................................9 Comments on BASIC09...............................................................................................9 The History of BASIC09 ............................................................................................10 2. Introduction to BASIC09 Programming.....................................................................11 What is a Program?....................................................................................................11 A Simple BASIC09 Program .....................................................................................12 Basic Programming Techniques: Loops and Arithmetic ......................................14 Listing Procedure Names..........................................................................................15 Requesting More Memory ........................................................................................16 Storing and Recalling Programs ..............................................................................16 How to Print Program Listings ................................................................................17 BASIC09’s Four Modes:.............................................................................................18 More about the Workspace... ....................................................................................19 Where to go From Here? ...........................................................................................19 3. System Mode ...................................................................................................................21 System Mode Commands .........................................................................................22 4. Edit Mode .........................................................................................................................29 Overview of Edit Commands...................................................................................29 How the Editor Works...............................................................................................30 Line-Number Oriented Editing................................................................................30 String-Oriented Editing.............................................................................................31 Moving the Edit Pointer ..................................................................................31 Inserting Lines...................................................................................................32 Deleting Lines ...................................................................................................32 Listing Lines ......................................................................................................32 Search: Finding Strings ....................................................................................33 Change: String Substitution ............................................................................33 5. Execution Mode...............................................................................................................35 Running Programs .....................................................................................................35 Execution Mode: Technically Speaking ..................................................................35 6. Debug Mode ....................................................................................................................37 Overview of Debug Mode ........................................................................................37 Debug Mode Commands..........................................................................................37 Debugging Techniques ..............................................................................................39 Debug Mode as a Desk Calculator ..........................................................................40 7. Data Types, Variables and Data Structures................................................................43 Why are there different data types?.........................................................................43 Data Structures ...........................................................................................................43 Atomic Data Types ...........................................................................................43 Type BYTE .........................................................................................................44 Type INTEGER..................................................................................................44 Type REAL.........................................................................................................45 Type STRING.....................................................................................................45 Type BOOLEAN ...............................................................................................46 Automatic Type Conversion ...........................................................................46 Constants .....................................................................................................................46 Numeric Constants...........................................................................................47 Boolean Constants ............................................................................................47 v String Constants................................................................................................47 Variables ......................................................................................................................48 Parameter Variables ...................................................................................................48 Arrays...........................................................................................................................49 Complex Data Types..................................................................................................49 8. Expressions, Operators, and Functions ......................................................................51 Evaluation of Expressions.........................................................................................51 Operators.....................................................................................................................51 Operator Precedence ........................................................................................52 Functions .....................................................................................................................53 9. Program Statements and Structure..............................................................................57 Program Structure......................................................................................................57 Line Numbers .............................................................................................................57 Assignment Statements.............................................................................................57 LET Statement ...................................................................................................57 POKE Statement ...............................................................................................58 Control Statements.....................................................................................................59 IF Statement: Type 1 .........................................................................................59 IF Statement: Type 2 .........................................................................................59 FOR/NEXT Statement .....................................................................................60 WHILE..DO Statement.....................................................................................60 REPEAT..UNTIL Statement.............................................................................61 LOOP and ENDLOOP/EXITIF and ENDEXIT Statements .......................62 GOTO Statement...............................................................................................63 GOSUB/RETURN Statements........................................................................63 ON GOTO/GOSUB Statement.......................................................................64 ON ERROR GOTO Statement.........................................................................64 Execution Statements.................................................................................................65 Run Statement...................................................................................................65 Parameter Passing ............................................................................................66 Calling External Procedures............................................................................66 KILL Statement .................................................................................................67 CHAIN Statement ............................................................................................68
Recommended publications
  • ROM OS-9 Into Your Coco Boisy G
    ROM OS-9 Into Your CoCo Boisy G. Pitre Imagine turning on your CoCo and instead of being greeted with the all-to-familiar Microsoft BASIC copyright message and OK prompt, you see “OS9 BOOT”. In two seconds, the OS-9 copyright banner and an OS9: prompt appears, and you have an OS-9 shell at your fingertips without having anything plugged in the CoCo’s expansion port! It may sound far out, but it’s actually quite easy to set up a ROM-based OS-9 CoCo. It can be done simply by replacing the Microsoft BASIC ROM that comes in all CoCo systems with a ROM containing OS-9 with special modifications to certain modules to allow booting from ROM. OS-9 Sans Disk? It may sound strange that OS-9 could be run totally from ROM, but indeed, this is the way that OS-9 was designed to run: without any disk storage. In the embedded OS-9 world, a disk drive or other mass storage device is incidental, or in most cases, impractical. Yet in the CoCo world, we have become accustomed to thinking of OS-9 as a Disk Operating System (DOS) as opposed to an embedded operating system. This was reinforced by the fact that Tandy/Radio Shack catalogs stated that OS-9 required a disk drive, and indeed, for the particular boot strategy that Tandy and Microware employed, a disk drive was and still is necessary. So if it is possible to use OS-9 without a disk drive, then what’s the point? How useful can OS-9 be without a disk drive? The answer: extremely useful.
    [Show full text]
  • INSIDE THIS ISSUE Been a Much More of a Loss Thall I Am Now, Regarding the from the President's Platen I Words of Freedom 5 Mailing List
    VOLUME XI I , NUMBERVII j -b.-~1 3 2 A GLENSIDE PUBLICATION AUGUST I SEPTEMBER SINCE 1985 /992 ISSUE From the President's Platen - by Tony Podraza o you know what the cost of data one is an affront to us all. recovery is fora20 Meg hard drive? I have been cautioned against bringing this up in the newslet­ D ter, as it is not in the positive line of thinking, but I can't just let Can"you say "backup"? it pass, so give me a little leeway, here, if you please. At the recent CoCoFEST! gathering in Chicago, a number of items ended up Can you imagine the desperate flurry of changing possession while not changing ownership. I'm not going activity that takes place when the database to spell it out for you, you know what I'm saying. These items were which has the names and addresses for a 200 not inconsequential items in value, neither were there just one or entry mailing list suddenly goes into never­ two items in total. Occurrences of this sort discourage the never land? Ask me! I've recently had that participation of some good people in future gatherings. experience. And it isn't a fun one! You know the saying, "bum me once, shame on you ... bum It would be one thing ifl were the only me twice, shame on me." Some people don't want to expose person affected by th.is instance, but I wasn't. themselves to a second chance at being bumed. It's been a while All of you were, too.
    [Show full text]
  • Hot Coco Vol. 2 No. 8
    CHILDREN'S TELEVISION WORKSHOP r--------------1 Send me a 1985 Computer Catalog. I Mail To: Shack, �A-353 I Tandy Center, Dept. Texas I Radio I 300 One Fort Worth, 78102 I NAME I I ADDRESS I I I I CITY I I STATE ZIP I I PHONE I L ______________ J Cover concept and graphics by Donna Wohlfarth Digre�ons There's No Royal Road to AssemblyLanguage _� 4 --------­ Michael E. Nadeau Will Dennis Kitsz's Learning the 6809 really teach you Assembly? 20 Richard Ramella Instant CoCo Directory ___ 6 Relate Better to Yo ur Data ----------------­ Elite-File is a true relational database manager. 24 Tips on EnteringOur Programs _ 6 Scott L. Norman Feedback 8 A ProductivityTool for Everyone '--·�--� ------------­ 30 The BasicBeat 12 Use Homespread for household number crunching or bookkeeping at the office. �W WoM Adrian Rose Take Stock in CoCo �-------------­ 38 If you want to win on Wall St., these two programs will give you a leg up. e Carl Christensen CoCo for Hire 70 So you want to go into business for A Shaper of Screensto Come __�1� -------------­ yourself? Having trouble designing your textual video screens? Try this helpful utility. 46 Terry Kepner and Linda Tiernan Glen Tapanila and Dick Court 68()1)On Line ROM Hacker Part 72 IV _________________ Happy Anniversary, AT&T. Begin construction of your computer-controlled robot 50 Bobby Ballard James J. Barbare/lo arm. The Educated Guest PrintIt Pretty 74 L�......._J_ ________________ _ Education and the InformationAge. Use your dot-matrix printer to create fancy letterhead or pleasing graphics.
    [Show full text]
  • Mastering OS-9 on the Tandy Color Computer
    Mastering OS-9 on the Tandy Color Computer A comprehensive learning guide for OS-9 Level 2 complete with step-by-step tutorials. Requires an 80 column display (RGB preferred), two 40 track double sided disk drives, and 512K of memory. Written by Paul K. Ward edited by Francis G. Swygert Published by FARNA Systems THIRD EDITION FARNA Systems Publishing Printed in USA by CopyMasters 524 N. Houston Lake Blvd. Centerville, GA 31028 Copyright March 1995, FARNA Systems Tandy Color Computer 3 Mastering OS-9 on the Tandy Color Computer 3 An enjoyable, hands-on guide to OS-9 Level 2 complete with step-by-step tutorials. Requires an 80 column display (RGB preferred), two 40 track double sided disk drives, and 512K of memory. First and Second Editions copyright 1988 by Paul K. Ward and Kenneth-Leigh Enterprises Third Edition copyright 1995 by Paul K. Ward and Francis G. Swygert Third Edition published in 1995 by FARNA Systems with permission DISCLAIMER The author, editor, Kenneth-Leigh Enterprises, nor FARNA Systems guarantee the suitability or accuracy of this book or its accompanying disk software. There are no warranties, expressed or implied, including those of merchantability or fitness for a particular purpose. The software is copyrighted and rights are reserved. Reproduction of disk or book contents, except for archival purposes, is forbidden by law. Utilities specifically designated as shareware or public domain may be copied in their entirety per instructions in the documentation files. Please register shareware— provide the authors with an incentive to write more programs! For questions and suggestions, please contact: FARNA Systems Box 321 Warner Robins, GA 31099-0321 or FARNA Systems c/o F.
    [Show full text]
  • OS-9 Operating System User's Guide
    OS-9 Operating System User's Guide For Use with OS-9 Level One and OS-9 Level Two OS-9 Operating System User's Guide: For Use with OS-9 Level One and OS-9 Level Two Copyright © 1980, 1983 Microware Systems Corporation All Rights Reserved. Introduction .................................................................................................................. v 1. Getting Started... ....................................................................................................... 1 1.1. What You Need to Run OS-9 ........................................................................... 1 1.1.1. Starting the System ............................................................................... 1 1.1.2. In Case You Have Problems Starting OS-9 ............................................... 1 1.1.3. A Quick Introduction to the Use of the Keyboard and Disks ......................... 2 1.1.4. Initial Explorations ............................................................................... 2 1.2. Making a Backup of the System Disk ................................................................. 3 1.2.1. Formatting Blank Disks ......................................................................... 3 1.2.2. Running the Backup Program ................................................................. 4 2. Basic Interactive Functions .......................................................................................... 5 2.1. Running Commands and Basic Shell Operation .................................................... 5 2.1.1.
    [Show full text]
  • Microware C Compiler User's Guide for OS-9 Microware C Compiler User's Guide: for OS-9 Copyright © 1983 Microware Systems Corporation
    Microware C Compiler User's Guide for OS-9 Microware C Compiler User's Guide: for OS-9 Copyright © 1983 Microware Systems Corporation. All rights reserved. Reproduction of this document, in part or whole, by any means, electrical or otherwise, is prohibited, except by written permission from Microware Systems Corporation. The information contained herein is believed to be accurate as of the date of publication, however, Microware will not be liable for any damages, including indirect or consequential, from use of the OS-9 operating system or reliance on the accuracy of this documentation. The information contained herein is subject to change without notice. Acknowledgements ...................................................................................................... vii Differences between Versions 1.1 and 1.0 ........................................................................ ix 1. The C Compiler System ............................................................................................. 1 1.1. Introduction .................................................................................................... 1 1.2. The Language Implementation ........................................................................... 1 1.3. Differences from the K & R Specification ........................................................... 1 1.4. Enhancements and Extensions ........................................................................... 1 1.4.1. The “Direct” Storage Class ...................................................................
    [Show full text]
  • X·L2• a SERIOUS COMPUTER
    A SERIOUS COMPUTER X·l2• IN A DESKTOP PACKAGE Multiprocessor Technology - Combination of 8, 16 and 32 bit types 1.0 Megabyte Memory- Insures no limitation on programs "Winchester" Disk System- Fast response, large storage capacity UniFiex · Operating System- The standard of comparison Hardware Floating Point - Unmatched speed in a small system Up to Three Terminals - Instant expansion • T r�demark uf Technical Synems c:;onsultanu SOUTHWEST TECHNICAL PRODUCTS CORPORATION 219 W. RHAPSODY SAN ANTONIO, TEXAS 78216 (512) 344-0241 Only Microware's OS-9 Operating System Covers the Entire 68000 Spectrum MICROWARE'S OS-9 UNIX ROM·BASED fi.OPPY..OISK BASED DID-lASED CONTROL PERSONAL INDUSTRIAL SYSTEMS COMPUTERS smEMS HAND-HELD HARDWAREiSOFT'MRE ..,._SCALE COMPUTERS DEVELOPMENT SYSTEMS ._....... IYIIIMI SMALL SYSTEMS LARIE SYSTEMS Is complicated software and expensive hardware VAX an d PDP-II mal-.c lt>ordinJtcd UnaxOS·l) ..ottw.tn• d w ptn keeping you back from Unix? Look mto 0$-ll the c Jo ent J rfc.J�Uft! orc.·rating �y�tcm fl'(lm Macr<w.arcthat giii('So8000 �y:.tt·m' SUPPORT FOR MODULAR SOFTWARE .a Unax-�tvlt• envan>nnwnt walh mulh ll"i� overhead .md - AN OS-9 EXCLUSIVE c<,mplt•\aiy. Ct,mprd,cn�I\C 'urp"rt 1<)1moduiM .,oilware put<. os.o •� wr�Jhlt•, delivers outstanding J .JheJd of II mulliplit� 0�-1.? anexpt'n'l\'t' anJ t-wncrJti.m otht•r upt•t.lhng.,y,ft'm!>. p<>rlormo�nl�' on .111y o,tzt• )y�ll'll1 1h(' OS-" £'Xt'tu llw b progrJtntTWr pnlliudt\'&lyand tnl'tnoryC'tial&Cn• y.
    [Show full text]
  • Newsletter Volume 40 : Issue 3
    Products, Services, and Content https://boysontech.com/marketplace http://cloud9tech.com/ COCOMAN.BIZ maker of the switch-a-roo http://cocoman.biz http://cocovga.com/ The Zippster Zone http://store.go4retro.com/ https://thezippsterzone.com/ http://cococrew.org/ http://cocotalk.live/ http://www.tindie.com/stores/fiscap0768/ http://lcurtisboyle.com/nitros9/nitros9.html Volume 40, Number 3 2 Winter 2020 Glenside Color Computer Club, Inc. Chicago, Illinois Volume 40, Number 3 Winter 2020 Memory Map PRODUCTS, SERVICES, AND CONTENT 2 G.C.C.C. MEETINGS 3 G.C.C.C. OFFICERS 3 COCO~123 INFORMATION 4 COCO~123 CONTRIBUTORS 4 TREA$URY NOTE$ 4 GCCC MEETINGS 4 THE COCO~123 DREAM TEAM 4 FROM THE EDITOR’S CLIPBOARD 4 FROM THE PRESIDENT’S PLATEN 5 SECRETARY'S SCROLL 6 2020 WEBMASTER UPDATE 6 EXPLORING THE COCO JOYSTICKS 8 RICK ADAMS - RAIDERS OF THE LOST TEMPLE 22 GETTING TO KNOW YOUR MULTIPACK INTERFACE 31 MAME RECAP 32 ADVENTURES IN RECAPPING 33 COCO NEWS 2020 YEAR-END REVIEW! 37 CALENDAR OF EVENTS 64 THE YEAR IN COCO MEDIA 65 COCO COMMUNITY CORNER 67 (CLOSED PARENTHESES) 67 G.C.C.C. Meetings GCCC meetings are the 3rd Thursday of each month and are being held virtually via Blue Jeans until further notice. Upcoming meetings: December 17th 2020, January 21st 2021, February 18th 2021. G.C.C.C. OFFICERS If you have questions about the association, contact one of the officers for the answers. POSITION NAME E-MAIL PRIMARY FUNCTION President Jim Brain [email protected] The buck stops here... Vice-President Terry Steege [email protected] Meeting planning, etc.
    [Show full text]
  • Volume 21 : Issue 3
    Glensidc Color Computer Club. Inc. Carpentersvi Il e. Illinois Volume 2 1. Number 3 December, 200 I Coco - 123 HighligMs GCCC Officers ........................ ................................................ 1 CoCo - 123 In formation ......... ................................................... 2 CoCo ~ 123 Contributions .... .......................................... .... .. ... 2 Contributors to this Issue ...... ........................................... ...... ... 2 GCCC Meetings .... ............ ....................... ...... ........................... 2 From the President's Disk ........ ........... ........ .... ..... ..................... 2 Secretary's Notebook ... ........................................................ ..... 3 Articles: Danger; Off Topic DOCTOR! DOCTOR! The Digiwiper DATA STREAMS FROM THE WEB: T he CoCo And Your Life In My Opinion: Ten Top Games G.C.C . C. Inc . OFFICERS Here is the :ist of 2001- 2002 club o fficers and how t o contact them. If you have questions about our club, call one of the officers for Lhe answers . POSITI ON NAME PHONE PRIMARY FUNCTION --------------- --------------------- ------------ Presidenl : Howard Luckey 708- 748-5320 The buck stops here V. Pres.: Justin Wagner 630- 393- 7072 Co-ordinal ion V. Pres .: Scott Montgome ry 773- 282- 6044 Navigation V. Pres . : Brian Goers 708-754- 4921 Special EvenLs Treasurer: George Schneeweiss 815-832-5571 Dues and Purchasing Secretary : Tony Podraza 847- 428- 3576 Recordi ng/reporting !h- i' ,p, \ :· ~\ ~~ ,,. Justin Wagner Scott Montgomery
    [Show full text]
  • OS-9 BASIC User Manual
    OS-9 BASIC User Manual Copyright and Revision Copyright 1991 Microware Systems Corporation. All Rights Reserved. History Reproduction of this document, in part or whole, by any means, electrical, mechanical, magnetic, optical, chemical, manual or otherwise is prohib- ited, without written permission from Microware Systems Corporation. This manual reflects Version 2.4 of Microware BASIC. Version 2.4 of Microware BASIC is to be used with Version 2.4 or greater of the OS-9 operating system. Revision G Publication Date: January, 1991 Publication Editor: Walden Miller, Ellen Grant Product Number: BAS-68-NA-68-MO Disclaimer The information contained herein is believed to be accurate as of the date of publication. However, Microware will not be liable for any damages, including indirect or consequential, from use of the OS-9 operating system, Microware-provided software or reliance on the accuracy of this documentation. The information contained herein is subject to change without notice. Reproduction Notice The software described in this document is intended to be used on a single computer system. Microware expressly prohibits any reproduction of the software on tape, disk or any other medium except for backup purposes. Distribution of this software, in part or whole, to any other party or on any other system may constitute copyright infringements and misappropriation of trade secrets and confidential processes which are the property of Microware and/or other parties. Unauthorized distribution of software may cause damages far in excess of the value of the copies involved. For additional copies of this software and/or documentation, or if you have questions concerning the above notice, the documentation and/or software, please contact your OS-9 supplier.
    [Show full text]
  • OS-9 System Extension Modules Boisy G
    OS-9 System Extension Modules Boisy G. Pitre The technical information, especially in the OS-9 Level Two manuals, is brimming with details and information that can unlock a wealth of understanding about how OS-9 works. Unfortunately, some of this information can be hard to digest without proper background and some help along the way. This series of articles is intended to take a close look at the internals of OS-9/6809, both Level One and Level Two. So along with this article, grab your OS-9 Technical Manual, sit down in a comfortable chair or recliner, grab a beverage, relax and let’s delve into the deep waters! Assemble Your Gear For successful comprehension of the topics presented in this and future articles, I recommend that you have the following items handy: • OS-9 Level Two Technical Reference Manual OR • OS-9 Level One Technical Information Manual (light blue book) and the OS-9 Addendum Upgrade to Version 02.00.00 Manual • A printout of the os9defs file for your respective operating system. This file can be found in the DEFS directory of the OS-9 Level One Version 02.00.00 System Master (OS-9 Level One) or the DEFS directory of the OS-9 Development System (OS-9 Level Two). In this article, we will look at a rarely explored, yet intriguing OS-9 topic: system extensions, a.k.a. P2 modules. When performing an mdir command, you have no doubt seen modules with names like OS9p1 and OS9p2 in OS-9 Level Two (or OS9 and OS9p2 in OS-9 Level One).
    [Show full text]
  • OS-9 Level One Operating System User's Guide
    OS-9 Level One Operating System User’s Guide Version 02.01.01 BETA1 OS-9 Level One Operating System User’s Guide: Version 02.01.01 BETA1 Copyright © 2003 by The CoCo Community All Rights Reserved. Revision History Revision Org. 1983 Original OS-9 Level One Guide Revision A March 2003 Updated with the changes made by Boisy Pitre Table of Contents Welcome to OS-9!........................................................................................................... i 1. Getting Started... ........................................................................................................1 1.1. What You Need to Run OS-9 ........................................................................1 1.1.1. Starting the System............................................................................1 1.1.2. In Case You Have Problems Starting OS-9 ....................................1 1.1.3. A Quick Introduction to the Use of the Keyboard and Disks .....1 1.1.4. Initial Explorations ............................................................................2 1.2. Making a Backup of the System Disk..........................................................3 1.2.1. Formatting Blank Disks ....................................................................3 1.2.2. Running the Backup Program .........................................................3 2. Basic Interactive Functions ......................................................................................5 2.1. Running Commands and Basic Shell Operation .......................................5
    [Show full text]