Mbasic Vt180, Vs.21 Basic-80 Reference Manual Aa-P226a
Total Page:16
File Type:pdf, Size:1020Kb
MBASIC VT180, VS.21 BASIC-80 REFERENCE MANUAL AA-P226A-TV MBASIC VT180, VS.21 BASIC-80 REFERENCE MANUAL AA-P226A-TV developed by MICROSOFT CORPORATION Bellevue, Washing ton DIGITAL EQUIPMENT CORPORATION Maynard, Massachusetts The information in this document is subject to change without notice and should not be construed as a com mitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any errors that may appear in this document. The software described in this document is furnished under a license and may only be used or copied in accordance with the terms of such license. No responsibility is assumed for the use or reliability of software by DIGITAL or its affiliated companies. Copyright G 1979, MICROSOFT CORPORATION Licensed to DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts. The following are trademarks of Digital Equipment Corporation: ASSIST DIGITAL RSTS COMPUTER LABS EDUsystem RSX COMTEX FLIP CHIP RTS-8 DATATRIEVE FOCAL SBI DDT lAS TMS-II DEC INDAC TRAX . DECCOMM ITPS-IO TYPESET-8 DECmate LAB-8 TYPESET-II DECnet MASSBUS UNIBUS DECSYSTEM-IO OMNIBUS VAX DECSYSTEM-20 OS/8 VMS DECtape PDP VT DECUS PDT Work Processor DECwriter PHA VTl80 DIBOL CP/M is a trademark of Digital Research PRODUCT EXCEPTION REPORTING SERVICE: If, prior to SEPTEMBER 1, 1983, the customer encounters a problem wi th the software. as orig inally furnished a Product Exception Report may be sub~itted to: Digital Equipment Corporation BOX A 146 Main Street Maynard, MA 01754 Throug h the software authors, DIGITAL wi 11, wi thout add i tional charg e, respond to the reported error in the current unaltered release of the software by issuing any known correction informa tion to the customer reporting the problem and/or issuing notice of the availability of corrected code. However, DIGITAL makes no representations or guarantees that such a response will be forth coming and DIGITAL assumes no responsibility or liability for such a response or the accuracy thereof. WARRANTY: NONE. THIS SOFTWARE PRODUCT IS PROVIDED "AS IS". IDmDomo EXTERNAL APPLICATION SOFTWARE LIBRARY PAGE OF _EASE TYPE PRODUCT EXCEPTION REPORT (PER) -- -- ROGRAM OR DOCUMENT TITLE lOA NUMBER 10PERATING SYSTEM IVERSION IDATE AN THE PROBLEM BE REPRODUCED AT WILL? YES 0 NO 0 PU TYPE \MEMORY SIZE IDISTRIBUTION MEDIUM \SYS DEVICE I ATTACHMENTS I IMAGTAPE 0 FLOPPY DISKS 0 LISTING 0 DECTAPE II 0 ALL SUBMISSIONS BECOME THE PROPERTY OF DIGITAL EQUIPMENT CORPORATION Mail To: NAME: Digital Equipment Corporation FIRM: Box A 146 Main Street Maynard, MA 01754 "If received prior to the PER expiration date of the product, Digital will, thru the product author(s). respond to a reported error in the current ADDRESS: unaltered release of the software by issuing any known correction information to the customer reporting the problem and/or issuing CUST. NO: notice of the availability of corrected code. However, Digital makes no representations or guarantees that such a response will be forthcoming and Digital assumes no responsibility or liability for such a response U!3MITTED BY: PHONE: or the accuracy thereof. Except as specified in this paragraph, Digital does not support or maintain the software." lATE RECEIVED (MAIL) \ DATE TO AUTHOR \ DATE RECEIVED FROM AUTHOR \ DATE ANSWERED I-01613-07-0000(3E9) basic-80 reference manual This manual is a reference for Microsoft's BASIC-80 language, release 5.0 and later. There are significant differences between the 5.0 release of BASIC-80 and the previous releases (release 4.51 and earlier). If you have programs written under a previous release of BASIC-80, check Appendix A for new features in 5.0 that may affect execution. Information in this document is subject to change without notice and does not represent a commitment on the part of Microsoft. The software described in this document is furnished under a license agreement or non-disclosure agreement. The software may be used or copied only in accordance with the terms of the agreement. (C) Microsoft, 1979 8101-520-06 BASIC-80 Reference Manual CONTENTS INTRODUCTION PAGE CHAPTER 1 General Information about BASIC-80 1-1 CHAPTER 2 BASIC-80 Commands and Statements 2-1 CHAPTER 3 BASIC-80 Functions 3-1 APPENDIX A New Features in BASIC-80. Release 5.0 A-I APPENDIX B BASIC-80 Disk I/O B-1 APPENDIX C Assembly Language Subroutines C-l APPENDIX D BASIC-80 with the CP/M Operating System D-l APPENDIX E Converting Programs to BASIC-80 E-l APPENDIX F Summary of Error Codes and Error Messages F-l APPENDIX G Mathematical Functions G-l APPENDIX H ASCII Character Codes H-l INDEX I-I Introduction BASIC-80 is the most extensive implementation of BASIC available for the 8080 and Z80 microprocessors. In its fifth major release (Release 5.0), BASIC-80 meets the ANSI qualifications for BASIC, as set forth in document BSRX3.60-1978. Each release of BASIC-80 consists of three upward compatible versions: 8K, Extended and Disk. This manual is a reference for all three versions of BASIC-80, release 5.0 and later. This manual is also a reference for Microsoft BASIC-86 and the Microsoft BASIC Compiler. BASIC-86 is currently available in Extended and Disk Standalone versions, which are comparable to the BASIC-80 Extended and Disk Standalone versions. There are significant differences between the 5.0 release of BASIC-80 and the previous releases (release 4.51 and earlier). If you have programs written under a previous release of BASIC-80, check Appendix A for new features in 5.0 that may affect execution. The manual is divided into three large chapters plus a number of appendices. Chapter 1 covers a variety of topics, largely pertaining to information representation when using BASIC-80. Chapter 2 contains the syntax and semantics of every command and statement in BASIC-80, ordered alphabetically. Chapter 3 describes all of BASIC-80~s intrinsic functions, also ordered alphabetically. The appendices contain information pertaining to individual operating systems: plus lists of error messages, ASCII codes, and math functions: and helpful information on assembly language subroutines and disk I/O. Page 1-1 CHAPTER 1 GENERAL INFORMATION ABOUT BASIC-SO 1.1 INITIALIZATION The procedure for initialization will vary with different implementations of BASIC-SO. Check the appropriate appendix at the back of this manual to determine how BASIC-SO is initialized with your operating system. 1.2 MODES OF OPERATION When BASIC-SO is initialized, it types the prompt "Ok". "Ok" means BASIC-SO is at command level, that is, it is ready to accept commands. At this point, BASIC-SO may be used in either of two modes: the direct mode or the indirect mode. In the direct mode, BASIC statements and commands are not preceded by line numbers. They are executed as they are entered. Results of arithmetic and logical operations may be displayed immediately and stored for later use, but the instructions themselves are lost after execution. This mode is useful for debugging and for using BASIC as a "calculator" for quick computations that do not require a complete program. The indirect mode is the mode used for entering programs. Program lines are preceded by line numbers and are stored in memory. The program stored in memory is executed by entering the RUN command. 1.3 LINE FORMAT Program lines in a BASIC program have the following format (square brackets indicate optional) : nnnnn BASIC statement[:BASIC statement .•. ] <carriage return> GENERAL INFORMATION ABOUT BASIC-80 Page 1-2 At the proqrammer"'s option, more than one BASIC statement may be placed on a line, but each statement on a line must be separated from the last by a colon. A BASIC program line always begins with a line number, ends with a carriage return, and may contain a maximum of: 72 characters in 8K BASIC-80 255 characters in Extended and Disk BASIC-80. In Extended and Disk versions, it is possible to extend a logical line over more than one physical line by use of the terminal"'s <line feed> key. <Line feed> lets you continue typing a logical line on the next physical line without entering a <carriage return>. (In the 8K version, <line feed> has no effect.) 1.3.1 Line Numbers Every BASIC program line begins with a line number. Line numbers indicate the order in which the program lines are stored in memory and are' also used as references when branching and editing. Line numbers must be in the range a to 65529. In the Extendedi and Disk versions, a per iod (.) may be used in EDIT, LIST, AUTO and DELETE commands to refer to the current line. GENERAL INFORMATION ABOUT BASIC-SO Page 1-3 1.4 CHARACTER SET The BASIC-SO character set is comprised of alphabetic characters, numeric characters and special characters. The alphabetic characters in BASIC-SO are the upper case and lower case letters of the alphabet. The numeric characters in BASIC-SO are the digits 0 through 9. The following special characters and terminal keys are recognized by BASIC-SO: Character -Name Blank = Equal sign or assignment symbol + Plus sign Minus sign * Asterisk or multiplication symbol /,. Slash or division symbol Up arrow or exponentiation symbol ( Left parenthesis ) Right parenthesis % Percent i Number (or pound) sign $ Dollar sign Exclamation point [ Left bracket ] Right bracket , Comma . Period or decimal point ~ Single quotation mark (apostrophe) Semicolon Colon & Ampersand ? Question mark < Less than > Greater than \ Backs1ash or integer division symbol @ At-sign Underscore <rubout> Deletes last character typed. <escape> Escapes Edit Mode subcommands. See Section 2.16. <tab> Moves print position to next tab stop. Tab stops are every eight columns.