Microsoft BASIC Decoded & Other Mysteries

Total Page:16

File Type:pdf, Size:1020Kb

Microsoft BASIC Decoded & Other Mysteries Written by James Farvour Microsoft BASIC Decoded & Other Mysteries Foreword by Harvard Pennington Edited by Jim Perry Graphics by John Teal Cover by Harvard Pennington TRS-80 Information Series Volume 2 Contents Foreword .............................................................................4 Single Precision Routines..............................................21 Chapter 1: Introduction .......................................................5 SP Addition ...............................................................22 Overview.........................................................................6 SP Subtraction...........................................................22 Memory Utilization .........................................................6 SP Multiply ...............................................................22 Communications Region .................................................8 SP Divide ..................................................................22 Level II Operation ...........................................................8 SP Comparison..........................................................22 Input Phase ......................................................................8 Double Precision Routines ............................................22 Interpretation & Execution..............................................9 DP Addition...............................................................22 Verb Action...................................................................11 DP Subtraction ..........................................................23 Arithmetic & Math ........................................................11 DP Multiply...............................................................23 I/O Drivers.....................................................................12 DP Divide..................................................................23 System Utilities .............................................................13 DP Comparison .........................................................23 IPL.................................................................................13 Math Routines ...............................................................23 Reset Processing (non disk)...........................................13 Absolute Value..........................................................23 Reset Processing (disk) .................................................14 Return Integer............................................................23 Disk BASIC...................................................................14 Arctangent .................................................................24 Cosine........................................................................24 Chapter 2: Subroutines ......................................................15 Raise Natural Base ....................................................24 I/O Calling Sequences...................................................15 Raise X To Power Of Y ............................................24 Keyboard Input..............................................................15 Natural Log ...............................................................25 Scan Keyboard ..........................................................15 FP To Integer.............................................................25 Wait For Keyboard....................................................16 Reseed Random Number...........................................25 Wait For Line ............................................................16 Random Number .......................................................25 Video Output.................................................................16 Sine............................................................................25 Video Display............................................................16 Square Root...............................................................25 Clear Screen ..............................................................17 Tangent......................................................................26 Blink Asterisk............................................................17 Function Derivation.......................................................26 Printer Output................................................................17 System Functions ..........................................................27 Print Character...........................................................17 Compare Symbol.......................................................27 Get Printer Status ......................................................17 Examine Next Symbol...............................................27 Cassette I/O ...................................................................18 Compare DE:HL .......................................................27 Select & Turn On Motor ...........................................18 Test Data Mode .........................................................27 Write Leader..............................................................18 DOS Function Call....................................................28 Read Leader...............................................................18 Load DEBUG............................................................28 Read One Byte ..........................................................18 Interrupt Entry Point..................................................28 Write One Byte..........................................................18 SP In BC:DE To WRA1............................................28 Conversion Routines .....................................................19 SP Pointed To By HL To WRA1 ..............................28 Data Type Conversions .................................................19 SP Into BC:DE ..........................................................29 FP To Integer.............................................................19 SP From WRA1 Into BC:DE ....................................29 Integer To SP.............................................................19 WRA1 To Stack ........................................................29 Integer to DP .............................................................19 General Purpose Move ..............................................29 ASCII to Numeric .........................................................19 Variable Move...........................................................29 ASCII To Integer.......................................................19 String Move...............................................................30 ASCII To Binary .......................................................19 BASIC Functions ..........................................................30 ASCII To DP.............................................................20 Search For Line Number ...........................................30 Binary To ASCII ...........................................................20 Find Address Of Variable..........................................30 HL To ASCII & Display ...........................................20 GOSUB .....................................................................31 Integer To ASCII.......................................................20 TRON........................................................................31 FP To ASCII..............................................................20 TROFF ......................................................................31 Arithmetic Routines ......................................................21 RETURN...................................................................31 Integer Routines ............................................................21 Write Message...........................................................31 Integer Addition ........................................................21 Amount Of Free Memory..........................................31 Integer Subtraction ....................................................21 Print Message ............................................................32 Integer Multiplication................................................21 Number Representation.............................................32 Integer Division.........................................................21 Integer Comparison ...................................................21 Chapter 3: Cassette & Disk ...............................................33 2 Microsoft BASIC Decoded & Other Mysteries Acknowledgments Cassette I/O....................................................................33 Cassette Format .............................................................34 This book has been a long time in its creation, without the SYSTEM Format...........................................................34 help, advice and support of many people it would not have Disk I/O .........................................................................35 been possible. In particular thanks are due to Rosemary Disk Controller Commands ...........................................35 Montoya for her days of keyboarding, David Moore for Disk Programming Details.............................................37 hours of example testing, Jerry De Diemar, Mary and MG DOS Exits......................................................................37 at Helens place for turning the Electric Pencil files into type Disk BASIC Exits..........................................................38 and Al Krug for his
Recommended publications
  • 0. Versã…O Final
    Câmpus de São José do Rio Preto Fernando Henrique Crepaldi Cordeiro O romance policial contemporâneo pelos caminhos da paródia: uma vertente metalinguística São José do Rio Preto 2014 Fernando Henrique Crepaldi Cordeiro O romance policial contemporâneo pelos caminhos da paródia: uma vertente metalinguística Tese apresentada como parte dos requisitos para obtenção do título de Doutor em Letras, junto ao Programa de Pós-Graduação em Letras, Área de Concentração – Teoria da Literatura, do Instituto de Biociências, Letras e Ciências Exatas da Universidade Estadual Paulista “Júlio de Mesquita Filho”, Câmpus de São José do Rio Preto. Orientador: Profª Drª Sônia Helena de Oliveira Raymundo Piteri São José do Rio Preto 2014 Fernando Henrique Crepaldi Cordeiro O romance policial contemporâneo pelos caminhos da paródia: uma vertente metalinguística Tese apresentada como parte dos requisitos para obtenção do título de Doutor em Letras, junto ao Programa de Pós-Graduação em Letras, Área de Concentração – Teoria da Literatura, do Instituto de Biociências, Letras e Ciências Exatas da Universidade Estadual Paulista “Júlio de Mesquita Filho”, Câmpus de São José do Rio Preto. Comissão Examinadora Profª Drª Sônia Helena de Oliveira Raymundo Piteri UNESP – São José do Rio Preto Orientador Profª Drª Marisa Corrêa Silva Universidade Estadual de Maringá Profª Drª Márcia Valéria Zamboni Gobbi UNESP – Araraquara Profª Drª Maria Heloísa Martins Dias UNESP – São José do Rio Preto Prof. Dr. Arnaldo Franco Júnior UNESP – São José do Rio Preto São José do Rio Preto
    [Show full text]
  • MIC5161 Win 2003 Launch V6
    Microsoft Windows Server 2003 and Microsoft Visual Studio .NET 2003 Launch Guide Do more with less. 1 Contents Introduction 2 Introducing Microsoft® Windows® Server 2003 4 Windows Server 2003 Case Studies 10 Introducing Microsoft® Visual Studio® .NET 2003 26 Visual Studio .NET 2003 Case Studies 41 Australian .NET Connected Partners 47 Microsoft® SQL Server™ 52 Microsoft Exchange Server 53 Windows Server 2003 and Visual Studio .NET 2003 Launch Sponsors 55 Platform Partner 56 Platinum Sponsors 61 Gold Sponsors 81 Silver Sponsors 96 Australian Windows Server 2003 JDP 100 Microsoft Gold Certified Partners 102 2 3 Welcome to the launch of Windows Server 2003! This is an exciting time for In my ten or more years in the Australian developer community, the combination Microsoft, our partners and customers, as this is unquestionably the most of Microsoft Windows Server 2003 and Microsoft Visual Studio® .NET 2003 is customer-focused Windows Server release yet. The reality of today’s IT environment the most exciting launch I have ever been involved with. Last February, Microsoft is the demand to do more with technology and, at the same time, do it with reset the bar for innovation and productivity with a new development paradigm for less cost. Over the last two years, we have spent time with customers using building Web Services and applications – Visual Studio .NET. This year, we build Microsoft® Windows® 2000 Server and Windows NT® Server 4.0 to really on that momentum by offering an entire development platform for the building understand what it would take to enable them do a lot more with Windows Server and execution of those applications.
    [Show full text]
  • Scanned Document
    OJ )> Vl () 0 ,0 ,m' I 1-V II&JS mm&Radio4 I nederlandse ornroep stichting I THE CHIP SHOP BASICODE2 mmmRadio4 - Broadcasting Support Services CONTENTS ©NOS nederlandse omroep stichting, Hilversum, Netherland 1. INTRODUCTION 5 ISBN 0-906965-14-4 2. HOW TO USE BASICODE-2 7 This edition first published by Broadcasting Support Services January 1984 3. BASICODE- THE SPECIFICATIONS 9 THE CHIP SHOP BBC Radio4 4. BASICODE-2 PROTOCOL 12 British Broadcasting Corporation Portland Place 5. APPLE II & lie 26 London W1A 1AA 6. BBC (A& B) 29 All rights reserved. This handbook and the accompanying computer programs are copyright. No part of this handbook or 7. COMMODORE COMPUTERS 31 the accompanying computer programs may be reproduced, 8. SHARP MZSOA 36 translated, copied or transmitted by any means whatsoever without the prior written permission of the copyright owners. 9. SINCLAIR ZX81 37 The publisher assumes no responsibility for errors, nor liability 10. TANDY TRS-80 & VIDEOGENIE 41 for loss or damage, however caused, arising from the use of the Basicode 2 kit. 11. THE FUTURE 47 The BASICODE-2 kit is available for £3.95 frorr:: Broadcasting Support Services P.O. Box? London W3 6XJ Please make cheques or postal orders payable to Broadcasting Support Services. Published for The Chip Shop, Radio 4, by Broadcasting Support Services- an independent educational charity providing follow­ up services for viewers and listeners. Introduction Chapter One BASICODE-2 INTRODUCTION BASICODE has been developed by the radio programme Hobbyscoop This book and the accompanying cassette contain the details of NOS­ which is broadcast weekly by Nederlanse Omroep Stichting (NOS), BASICODE.
    [Show full text]
  • TRS-80 Software
    REGISTRATION NUMBER 00000001 NEWDOS 8O FOR THE TRS-80 MODEL I / III / 4 MICRO COMPUTER Apparat Incorporated takes pleasure in presenting NEWDOS/80, Version 2.5. Above is the registration number of your NEWDOS/80. This registration number must be the same as the registration number you find on your diskette label and the enclosed registration card. If they are not, return them to the dealer from whom you purchased your NEWDOS/80 to be reissued. This registration Number is your assurance of receiving any corrections or minor revisions to NEWDOS/80 that may be released. The registration card should be completed and returned to Apparat at your earliest convenience. PLEASE RETURN THE CARD IT IS IMPORTANT! It our only method of determining who has purchased this copy of the system. This number should be included in all correspondence with Apparat. Apparat, Inc 4401 So. Tamarac Parkway • Denver, Colorado 80237 HELPFUL HINTS IN USING YOUR NEWDOS/80 VERSION 2.5 We suggest using the following checklist as a guide to setting up software on your Hard Disk System: 1. Carefully read through all related documentation. 2. Make hardware installation as directed by instructions supplied with your Hard Drive Unit. 3. Boot on your NEWDOS/80 Version 2.5 original master diskette and make backup copy or copies. Refer to Chapter 1, Section 1.4 of the NEWDOS/80 Version 2.0 manual for details if unfamiliar with the procedure. 4. Designate one of your backups as a working copy an d boot (or reset) on it. Use this diskette for the remainder of this procedure.
    [Show full text]
  • Sun City Summerlin Computer Club Seminar Beginning Programming with Visual Basic Script Edition
    Sun City Summerlin Computer Club Seminar Beginning Programming With Visual Basic Script Edition Tom Burt August 31, 2006 This seminar is an experiment. It will present a quick overview of the fundamentals of computer programming, including two “real world” examples. The audience is experienced computer users who can think logically and translate a procedure or other activity into a sequence of steps. For this introduction, we will mainly use the VBScript language, which is a dialect of Microsoft BASIC. It is very similar to Visual Basic for Applications (VBA), which is built into most MS Office applications. It is also similar to the Visual Basic 6 programming language. The VBScript language runtime executive and programming documentation are available free from Microsoft’s Windows Scripting web site. (See the web links at the end of the presentation). If time permits, we’ll also look briefly at Microsoft’s FREE VB.Net 2005 Express Edition. 1 Where to Find the Materials Sun City Summer Computer Club Website Seminars: • http://www.scscc.com/smnr Acrobat file of these slides and Notes: • http://www.scscc.com/smnr/VBScript_Beginning_Programming.pdf ZIP file of the Examples: • http://www.scscc.com/smnr/Programming_Examples.zip TNB August 31, 2006 Intro - Programming VBScript 2 Seminar Agenda Visual Basic Versions and Reference Basic Programming Concepts VBSCRIPT Language -- Bio Break (~10 min) Program 1 – Ticket Draw Program 2 – Clean out Temp folders Web Site Links Open Q and A TNB August 31, 2006 Intro - Programming VBScript We’ll spend the first half of the seminar covering the key programming concepts of the VBScript language.
    [Show full text]
  • Table of Contents
    ^9/08/89 11:43 U206 883 8101 MICROSOFT CORP.. 12)002 Table of Contents m-^mm Table of Contaits 09/08/89 11:44 'Q206 883 8101 MICROSOFT CORP _ _ [ 1003 The Story Begins JAN The story of MS-DOS_begins ..in a hotel in Albuquerque, New Mexico. 1975 In 1975, Albuquerque was the home of Micro Instrumentation'Telemetry MiTS introduces the 8080-baseci Systems, better known as MITS- In January of that year, MITS had intro- Altair computer. duced a kit computer called the Altair. When it was first snipped, the Altair consisted of a metal box with, a panel of switches for input and output, a power supply, and-two boards. One board was the CPU.. At its heart was the 8-bit 8080 microprocessor chip from InteL The other board provided 256 bytes of memory. The Altair had no keyboard, no monitor, and no permanent storage. But it had a revolutionary price tag. It cost $397. For the first time, the term "personal computer" acquired a real-world meaning. The real world of the Altair was not, however, the world of business computing. It was-primarily the world of the computer hobbyist These first users of the microcomputer were not as interested in using spreadsheets and word processors as they were in programming. Accordingly, the first soft- ware for the Altair was a programming language. And the company that developed it was a two-man firm, in Albuquerque, called Microsoft FEB The two men at MiCTosof^ej^PailjAJten^and Bffl Gates-Allen and 1975 Gates-had met when-they were both students at Lakeside High School in Microsoft sails first BASIC to Seattle, where they began their computer-science education oa the school's MITS lor Altair time-sharing terminal By the time Gates had graduated, me two of them had computer.
    [Show full text]
  • Windows in Concurrent PC
    Using Concurrent PC DOS OTHER BOOKS BY THE AUTHOR Microcomputer Operating Systems (1982) The Byte Guide to CP/M-86 (1984) Using Concurrent PC DOS Mark Dahmke McGraw-Hili Book Company New York St. Louis San Francisco Auckland Bogota Hamburg Johannesburg London Madrid Mexico Montreal New Delhi Panama Paris Sao Paulo Singapore Sydney Tokyo Toronto Library of Congress Cataloging-in-Publication Data Dahmke, Mark. U sing Concurrent PC DOS. Bibliography: p. Includes index. 1. Concurrent PC DOS (Computer operation system) 1. Title. QA76.76.063D34 1986 005.4' 469 85-15473 ISBN 0-07-015073-7 Copyright © 1986 by McGraw-Hili, Inc. All rights reserved. Printed in the United States of America. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a data base or retrieval system, without the prior written permission of the publisher. 1234567890 DOC/DOC 893210876 ISBN 0-07-015073-7 The editors for this book were Steven Guty and Vivian Koenig, the designer was Naomi Auerbach, and the production supervisor was Teresa F. Leaden. It was set in Century Schoolbook by Byrd Data Imaging. Printed and bound by R. R. Donnelley & Sons Company. To my sister Patricia Contents Chapter 1. Introduction 1 What Is Concurrent PC DOS? 1 What Is an Operating System? 1 The DOS Family Tree 3 The Scope of This Book 5 Chapter 2. Concurrent PC DOS Compatibility 6 Concurrent PC DOS Compatibility 6 PC·DOS, TopView, and the IBM PC AT 7 Concurrent CP/M·86 9 Chapter 3.
    [Show full text]
  • Version Information Product Name Microsoft® Basic Keyboard Product
    Version Information Product Name Microsoft® Basic Keyboard Product Version Microsoft Basic Keyboard 1.0a Keyboard Version Microsoft Basic Keyboard 1.0a Product Dimensions Keyboard Length 17.6 inches (446 millimeters) Keyboard Width 7.09 inches (180 millimeters) includes palm rest Keyboard Depth/Height 1.26 inches (32.0 millimeters) with tilt legs folded Keyboard Weight 26.1 ounces (739 grams) Cable Length 78.7 inches (2000 millimeters) Compatibility and Localization Interface PS/2 Compatible Operating Systems Microsoft Windows® Vista™, Windows XP Home and Professional Edition, Windows 2000, and Windows Millennium Top-line System Requirements • Microsoft Windows Vista, Windows XP Home and Professional Edition, Windows 2000, or Windows Millennium Edition • PS/2 port Compatibility Logos Certified for Microsoft Windows Vista Software Version No software required Keyboard Localization Available language sets will vary by product and sales channel 104 key configuration: Chinese (Traditional), International English (ROW), and English (North America) 105 key configuration: English (UK), French (France), German (Germany), and Spanish (Latin America) 106 key configuration: Korean 107 key configuration: Portuguese (Brazil) 109 key configuration: Chinese (Simplified) and Japanese Product Feature Performance QWERTY Key Life 1,000,000 actuations per key Hot Key Features Web, Mail, and Search Hot Key Life 500,000 actuations per key Typing Speed 1000 characters per minute Storage Temperature & Humidity -40 °F (-40 °C) to 158 °F (70 °C) at 0% to 90% relative
    [Show full text]
  • BASIC Programming with Unix Introduction
    LinuxFocus article number 277 http://linuxfocus.org BASIC programming with Unix by John Perr <johnperr(at)Linuxfocus.org> Abstract: About the author: Developing with Linux or another Unix system in BASIC ? Why not ? Linux user since 1994, he is Various free solutions allows us to use the BASIC language to develop one of the French editors of interpreted or compiled applications. LinuxFocus. _________________ _________________ _________________ Translated to English by: Georges Tarbouriech <gt(at)Linuxfocus.org> Introduction Even if it appeared later than other languages on the computing scene, BASIC quickly became widespread on many non Unix systems as a replacement for the scripting languages natively found on Unix. This is probably the main reason why this language is rarely used by Unix people. Unix had a more powerful scripting language from the first day on. Like other scripting languages, BASIC is mostly an interpreted one and uses a rather simple syntax, without data types, apart from a distinction between strings and numbers. Historically, the name of the language comes from its simplicity and from the fact it allows to easily teach programming to students. Unfortunately, the lack of standardization lead to many different versions mostly incompatible with each other. We can even say there are as many versions as interpreters what makes BASIC hardly portable. Despite these drawbacks and many others that the "true programmers" will remind us, BASIC stays an option to be taken into account to quickly develop small programs. This has been especially true for many years because of the Integrated Development Environment found in Windows versions allowing graphical interface design in a few mouse clicks.
    [Show full text]
  • GWBASIC User's Manual
    GWBASIC User's Manual User's Guide GW-BASIC User's Guide Chapters 1. Welcome Microsoft Corporation 2. Getting Started Information in this document is subject to change without 3. Reviewing and Practicing notice and does not represent a commitment on the part of 4. The Screen Editor Microsoft Corporation. The software described in this 5. Creating and Using Files document is furnished under a license agreement or 6. Constants, Variables, nondisclosure agreement. It is against the law to copy this Expressions and Operators software on magnetic tape, disk, or any other medium for any Appendicies purpose other than the purchaser's personal use. A. Error Codes and Messages © Copyright Microsoft Corporation, 1986, 1987. All rights B. Mathematical Functions reserved. C. ASCII Character Codes D. Assembly Language Portions copyright COMPAQ Computer Corporation, 1985 E. Converting Programs Simultaneously published in the United States and Canada. F. Communications G. Hexadecimal Equivalents Microsoft®, MS-DOS®, GW-BASIC® and the Microsoft logo H. Key Scan Codes are registered trademarks of Microsoft Corporation. I. Characters Recognized Compaq® is a registered trademark of COMPAQ Computer Glossary Corporation. DEC® is a registered trademark of Digital Equipment Corporation. User's Reference Document Number 410130001-330-R02-078 ABS Function ASC Function ATN Function GW-BASIC User's Reference AUTO Command Microsoft Corporation BEEP Statement BLOAD Command Information in this document is subject to change without BSAVE Command notice and does not represent a commitment on the part of Microsoft Corporation. The software described in this CALL Statement document is furnished under a license agreement or CDBL Function nondisclosure agreement.
    [Show full text]
  • Part 2 / Software
    Part 2 / Software 1/ Disk Organization 1 Single Density Floppy Diskette 1 Double Density Floppy Diskette 1 5" 5-Meg Hard Disk 2 Disk Space Available to the User 2 Unit of Allocation 2 2l Disk Files 3 Methods of File Allocation 3 Dynamic Allocation 3 Pre-Allocation 3 Record Length 3 Record Processing Capabilities 4 Record Numbers 4 3/ TRSDOS File Descriptions 5 System Files (/SYS) 5 Utility Programs 7 Device Driver Programs 7 Filter Programs 7 Creating a Minimum Configuration Disk 7 4/ Device Access 9 Device Control Block (DCB) 9 Memory Header 10 5/ Drive Access 11 Drive Code Table (DCT) 11 ^v Disk I/O Table 13 Directory Records 13 Granule Allocation Table (GAT) 16 Hash Index Table (HIT) 18 6/ File Control 23 File Control Block (FCB) 23 7/ TRSDOS Version 6 Programming Guidelines 27 Converting to TRSDOS Version 6 27 Programming With Restart Vectors 29 KFLAG$ (BREAK)( (PAUSE), and (ENTER) Interfacing 29 Interfacing to (SPICNFG 32 Interfacing to @KITSK 33 Interfacing to the Task Processor 34 Interfacing RAM Banks 1 and 2 36 Device Driver and Filter Templates 40 @CTL Interfacing to Device Drivers 42 8/ Using the Supervisor Calls 45 Calling Procedure 45 Program Entry and Return Conditions 45 Supervisor Calls 46 Numerical List of SVCs 49 Alphabetical List of SVCs 52 Sample Programs 54 9/ Technical Information on TRSDOS Commands and Utilities 189 Appendix A/ TRSDOS Error Messages 193 Appendix B/ Memory Map 199 Appendix C/ Character Codes 201 Appendix D/ Keyboard Code Map 211 Appendix E/ Programmable SVCs 213 Appendix F/ Using SYS 13/SYS 215 Index 217 1/Disk Organization TRSOOS Version 6 can be used with 51/4" single-sided floppy diskettes and with hard disk.
    [Show full text]
  • Personal Computing
    Personal Computing Thomas J. Bergin ©Computer History Museum American University Recap: Context • By 1977, there was a fairly robust but fragmented hobbyist-oriented microcomputer industry: – Micro Instrumentation Telemetry Systems (MITS) – Processor Technology – Cromemco – MicroStuf – Kentucky Fried Computers • Two things were needed for the personal computer revolution: 1) a way to store and retrieve data, and 2) a programming language in which to write applications. Homebrew Computer Club • March 5, 1975: the Amateur Computer Users Group (Lee Felsenstein, Bob Marsh, Steve Dompier, BobAlbrecht and 27 others) met in Gordon French’s garage, Menlo Park, CA • 3rd meeting drew several hundred people and was moved to the Coleman mansion • Stanford Linear Accelerator Center’s auditorium – Steve Wozniak shows off his single board computer – Steve Jobs attends meetings Homebrew-ed • 21 companies formed: – Apcose Apple – Cromemco Morrow – North Star Osborne • West Coast Computer Faire • Byte magazine, September 1975 • Byte Shop Both: images.google.com And then there was Traf-O-Data • October 28, 1955: William H. Gates III born – father: attorney mother: schoolteacher • Lakeside School: Lakeside Programming Group – Mothers Club: access to time-shared system at GE – Students hired by local firm to debug software – First computer program: Tic-Tac-Toe (age 13) – Traf-O-Data to sell traffic mgt. software (age 16) • 1973, Bill Gates enrolls at Harvard in pre-law. • Paul Allen is in his second year. January 1975, Popular Electronics: Altair • Allen shows
    [Show full text]