Color Basic Unravelled Ii Foreword Origin: Spectral Assoc Revised:12/26/99 Walter K Zydhek
Total Page:16
File Type:pdf, Size:1020Kb
TABLE OF CONTENTS 1 FOREWORD……………………………………………………………………………………………………1 2 INTRODUCTION…………………………………………………………………………………………3 3 COLOR BASIC - AN INTERPRETER………………………………………………4 4 INTERPRETER MECHANICS…………………………………………………………………6 5 VARIABLES…………………………………………………………………………………………………10 6 CONSOLE INPUT/OUTPUT……………………………………………………………………13 APPENDICES A MEMORY MAP B DISASSEMBLY OF COLOR BASIC C BASIC ROUTINES AND ENTRY POINTS D FLOATING POINT ROUTINES E BASIC’S DATA/ASCII TABLES F MEMORY MAP DESCRIPTION G INTERRUPTS H OPERATOR PRECEDENCE I BASIC 1.0 DIFFERENCES J BASIC 1.1 DIFFERENCES K ASCII CHART COLOR BASIC UNRAVELLED II FOREWORD ORIGIN: SPECTRAL ASSOC REVISED:12/26/99 WALTER K ZYDHEK FOREWORD Due to the many requests for the Unravelled Series produced by Spectral Associates, and the fact that these books are rare and no longer in production, I have taken it upon myself to reproduce them in electronic .PDF (Adobe Acrobatâ) format. I have re-disassembled the ROMs listed in this book, and added all the comments from the Original Extended Basic Unravelled Book. Some changes were made to make the book a little easier to read. 1. The comments have been cleaned up some. In cases where a comments continued onto the next line, a * is placed in the Labels column, as well as a * at the beginning of each line of the comment. In cases where the previous comment used this format, a = was used. This was done in the original, but not all comments stuck to this format. 2. I have renumbered all the line numbers. Each Appendix (with code) starts at Line 0001. 3. Some spell checking, and context checking was done to verify accuracy. 4. I used the Letter Gothic MT Bold Font. This allows for display of Slashed Zeros. I thought it important to be able to distinguish between 0 and O. 5. All the Hex code now shows the Opcodes. There were other minor changes that were made to make viewing a little better. If any discrepancies arise, please let me know so that I may correct the errors. I can be contacted at: mailto:[email protected] Special Thanks to Jean-François Morin for pointing out those “Oops” to me. I’d like to also thank those who have either given me, or loaned me their copy of the original Unravelled Series. About Me My name is Walter K. Zydhek. I’ve been a Computer Hobbyist since 1984 when I received my 1st Tandy Color Computer 2 for Christmas. It had 32K of ram, Cassette, and one Cartridge. I quickly learned to program in Basic and then moved into Assembly. Over the next few years, I saved to purchase the Multi-Pak Interface, Disk Drives, Modem, OS-9, and various Odds and Ends. I moved to Tampa Florida and in the move, My CoCo was damaged. I then replaced it with the CoCo 3. WOW what a difference. I added the 512K Ram Upgrade, A CM-8 color monitor, and joined the Carolwood CoCo Club. (Thanks Jean-François for reminding me of the name.) I had a couple of close friends that helped me explore the world of CoCo and by this time, I knew that my CoCo would be my friend forever. I give special thanks to Steve Cohn, who helped me get started with ADOS. Two other people whose names I can’t remember were very beneficial to my mastering of the CoCo. Shortly after getting my CoCo 3, I started BBS’ing. Wow, a whole new world. My knowledge just kept growing. 1 COLOR BASIC UNRAVELLED II FOREWORD ORIGIN: SPECTRAL ASSOC REVISED:12/26/99 WALTER K ZYDHEK A few years later, I moved to Oregon, then to Phoenix, Arizona to attend school. I studied Electronics Technology at Phoenix Institute of Technology. In the second year, we studied Micro-processor Theory. For our labs, we just happen to use the Tandy Color Computer 3 (for studying 6809 Processors). I had it made. In this class I added an EPROM programmer/reader to my list of hardware. My favorite instructor, Gary Angle & I spent many hours sharing information on the CoCo. At one time, we shared a joint project to disassemble ROMs from industrial machinery, which used the 6809 Processor. Using the CoCo to read the ROMs to work with. I even had a BBS running under OS-9 at one time. RiBBS I think it was. Very similar to QuickBBS and RemoteAccess BBS for the PC. In 1991, I finally converted over to PC, but never forgetting my CoCo. About 5 years ago, My CoCo and all related material was stolen from me. And the CoCo world was just a memory. In the last 2 Years, my love for the CoCo has re-kindled. I have been partially content to use a CoCo Emulator for my PC. I tried the CoCo 2 Emulator by Jeff Vavasour. This was OK, but a lot was left out. I then purchased the CoCo 3 Emulator. Much better, but would not use “Double Sided Disks”. Although it did have a Virtual Hard Drive for use in OS-9. I then wanted to ‘better’ the CoCo Emulator, add use of PC hardware, Add Double Sided Disk functionality, and even make it Windows Native, instead of a Dos Box. Unfortunately I could not get the source code for the CoCo 3 Emulator. I then turned to Paul Burgin’s Dragon 2/Coco 2 Emulator. This had source code available and with a small $20.00 donation, was able to get the source code to additional portions of his program. I have tinkered with it, but came to understand that I needed more info on the CoCo. I have looked all over the net and found quite a lot of useful information, but what I really needed was the Unravelled Series. I was able to find someone that had Extended Basic Unravelled and Disk Basic Unravelled (He sent them to me for free). And a friend of mine had Super Extended Basic Unravelled (A copy I gave him years ago). Unfortunately, the books are not in the best of shape, and the type is hard to read, and with so many people looking for the books, I decided to re-do them in Electronic format. I ask everyone that obtains copies of this electronic document to PLEASE give freely. These books are for educational/informational use only. These books are no longer in publication and Spectral Associates no longer in business. Do not use these books for financial gain, as that would most certainly abuse the Copyright Laws that I have already bruised by re-producing them. Other than that, enjoy the books!! I’ll add more information to them as I get it. I plan on adding more Memory Map information, as well as hardware info in the coming months. But for now, take advantage of this fine resource. Walter K. Zydhek 2 COLOR BASIC UNRAVELLED II INTRODUCTION ORIGIN: SPECTRAL ASSOC REVISED:12/26/99 WALTER K ZYDHEK INTRODUCTION BASIC Unravelled is a book that has specifically been written in order to provide the Color Computer user with a detailed, commented source listing of Color BASIC. Many entry points and useful routines for doing functions, which are required in machine language, have been detailed. Information contained in the book is extremely valuable and useful for anyone attempting to use BASIC integrated with machine language routines of their own. If there are some functions or facets of BASIC, which are too slow or awkward for the user, he needs to have a good idea as to what is going on in Color BASIC in order to be able to merge his routine with the routines, which are in color BASIC. There are many times when a person wants to know exactly what is going on in BASIC for a certain function such as clearing the screen or outputting a character to the screen. The information provided in BASIC Unravelled will allow the user to determine exactly what BASIC is doing under these circumstances. He will get an extremely good, in depth, basic knowledge of BASIC and be able to use that in any application he has in mind. This book will not explain how to make the BASIC interpreter or give a detailed in depth knowledge of how a BASIC interpreter works. It assumes that the user is an experienced machine language programmer, understands 6809 assembly language inside and out, and will understand the nuances and programming terminology which is used in the comments included with each BASIC program line. Do not attempt to use BASIC Unravelled as a textbook in order to teach yourself how to write a BASIC interpreter. If you are a very good programmer you will be able to write your own BASIC interpreter following the in depth reading of the assembly listings and the comments included in this book, but it should not be taken as a text on how to write a BASIC interpreter. The book is primarily designed to explain Color BASIC so that somebody who has a fair knowledge of how an interpreter works will be able to determine exactly how Color BASIC works. BASIC Unravelled will explain major operating formats of the most useful routines in BASIC and will identify the tricks, which Microsoft has used in programming Color BASIC. If the reader has any questions concerning the hardware of the Color computer, he's referred to the FACTS book, published by Spectral Associates. This book contains detailed descriptions of the hardware of the Color Computer and how one uses software in order to enable or disable the various hardware functions of the computer. BASIC Unravelled will deal specifically with Color BASIC version 1.2 which is the version of Color BASIC released by Radio Shock, as of October 1983.