Mbasic Manual

Total Page:16

File Type:pdf, Size:1020Kb

Mbasic Manual User’sUser’s GuideGuide Learn to Program PIC Micrcontrollers in easy to use Basic Revision 5.2 Warranty Basic Micro warranties its products against defects in material and workmanship for a period of 90 days. If a defect is discovered, Basic Micro will at our discretion repair, replace, or refund the purchase price of the product in question. Contact us at [email protected] No returns will be accepted without the proper authorization. Copyrights and Trademarks Copyright© 2001-2002 by Basic Micro, Inc. All rights reserved. PICmicro® is a trademark of Microchip Technology, Inc. Basic Stamp I/II and Parallax are registered trademarks of Parallax Inc. MBasic, The Atom and Basic Micro are registered trademarks of Basic Micro Inc. Other trademarks mentioned are registered trademarks of their respective holders. Disclaimer Basic Micro cannot be held responsible for any incidental, or consequential damages resulting from use of products manufactured or sold by Basic Micro or its distributors. No products from Basic Micro should be used in any medical devices and/or medical situations. No product should be used in a life support situation. Contacts Email: [email protected] Tech support: [email protected] Web: http://www.basicmicro.com Discussion List A web based discussion board is maintained at http://www.basicmicro.com Updates In our continuing effort to provide the best and most innovative products, software updates are made available by contacting us at [email protected] Table of Contents 5 Table of Contents Contents Introduction ................................................12 What is MBasic ?.............................................................................. 12 This Manual .................................................................................... 12 On-line Discussion Forums ................................................................ 12 Updates .......................................................................................... 12 Technical Support ............................................................................ 12 Basic PICmicro Setup ..................................13 Which PICmicro should I use ? ........................................................... 14 Basic PICmicro Schematic ................................................................. 14 What Next ? .................................................................................... 15 Getting Started ............................................17 Software Installation ........................................................................ 18 Configuring MBasic ........................................................................... 18 What is an IDE ? .............................................................................. 19 Getting Familiar with the IDE ............................................................. 19 Terminal Window Selection ............................................................... 21 Control Characters ........................................................................... 21 User Tool Bar .................................................................................. 22 Config Setup Menu ........................................................................... 24 First Program .................................................................................. 26 Error Reporting................................................................................ 28 Conclusion ...................................................................................... 29 In Circuit Debugger .....................................31 ICD Setup ....................................................................................... 32 USB To Serial Adapter ...................................................................... 32 What is an ICD ? .............................................................................. 33 Getting Familiar with the ICD Controls................................................. 33 Using the ICD .................................................................................. 35 Exercise .......................................................................................... 36 Debug Mode .................................................................................... 37 Variable Watch Window .................................................................... 37 Trouble Shooting ............................................................................. 38 The Basic’s ...................................................41 Bits, Bytes, Words, Longs .................................................................. 42 MSBs and LSBs ................................................................................ 42 6 RAM, EEPROM and Program Memory.................................................. 42 Built-in Hardware ............................................................................. 42 Hexadecimal 101 ............................................................................. 43 ASCII ............................................................................................. 43 Programming Practices ..................................................................... 44 Optimizing ...................................................................................... 46 Line Labels ...................................................................................... 47 Variables ........................................................................................ 47 Arrays ............................................................................................ 48 Tables ............................................................................................ 49 Aliases ........................................................................................... 49 Variable Modifiers ............................................................................ 49 Command Modifiers ......................................................................... 53 Constants ....................................................................................... 56 Pins................................................................................................ 57 Pin Variables ................................................................................... 59 MBasic Specific’s .........................................61 Stack.............................................................................................. 62 Oscillator Settings ............................................................................ 62 Internal RC Calibration ..................................................................... 62 Memory .......................................................................................... 62 Compiling ....................................................................................... 62 Reserved Symbols ........................................................................... 63 Device Specific Issues ...................................................................... 63 MBasic and Assembly ..................................65 What is Assembly ? .......................................................................... 66 Mixing Assembly and MBasic ............................................................. 66 In-line Assembly .............................................................................. 66 Assembly and Variables .................................................................... 67 Math .............................................................69 Numerical Types .............................................................................. 70 Adding and Subtracting .................................................................... 70 Multiplication ................................................................................... 70 Division ........................................................................................... 72 Integer Math in general .................................................................... 72 General Math Functions .................................................................... 73 Bitwise Operators ............................................................................ 73 Comparison Operators ..................................................................... 74 Logical Operators............................................................................. 74 Floating Point Math .......................................................................... 75 Floating Point Format ....................................................................... 75 Floating Point Example Program ........................................................ 75 7 Syntax ..........................................................79 ADin ............................................................................................... 80 ASM {...} ........................................................................................ 82 Branch ............................................................................................ 83 Button ............................................................................................ 85 Clear .............................................................................................. 88 Count ............................................................................................. 89 Data (EEPROM) ..............................................................................
Recommended publications
  • Hacker's Handbook for Ringzer0 Training, by Steve Lord
    Hacker’s Handbook For Ringzer0 Training, by Steve Lord This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Copyright ©2021 Raw Hex Ltd. All Rights Reserved. Retro Zer0 is a trademark of Ring Zer0 Training. Raw Hex is a trademark of Raw Hex Ltd. All other trademarks are the property of their respective owners. Raw Hex Ltd reserve the right to make changes or improvements to equipment, software and documentation herein described at any time and without notice. Notice: Please be advised that your Retro Zer0 has no warranty, and that tampering with the internal hardware and software of your Ring Zer0 is widely encouraged as long as you do so with appropriate regard to safety. Contents 1 Preface 5 1.1 Safety ........................... 6 1.2 Understanding This Document ............ 6 2 Before You Start 7 2.1 Check You Have Everything .............. 7 2.2 Back Up The SD Card ................. 8 2.3 Connecting Up Your Retro Zer0 ............ 8 2.4 Powering Up ....................... 10 2.5 Resetting Your Retro Zer0 . 10 2.6 Powering Down ..................... 10 3 First Steps 11 3 4 CONTENTS 3.1 Testing The Keyboard . 11 3.2 Using CP/M ....................... 12 3.3 Would You Like To Play A Game? . 14 3.4 MultiCPM Extras ..................... 17 3.5 Useful Tools ....................... 19 3.6 What’s On The Card? . 20 3.7 Putting It All Together . 23 3.8 Where To Read More . 25 4 Being Productive With Retro Zer0 27 4.1 WordStar .........................27 4.2 Supercalc .........................30 4.3 DBase ...........................32 4.4 Microsoft BASIC .....................32 4.5 Turbo Pascal .......................34 4.6 Forth 83 .........................36 4.7 ZDE ............................38 4.8 Z80 Assembler .....................39 4.9 Hi-Tech C .........................43 4.10 XLisp ...........................46 CONTENTS 5 4.11 Installing New Software .
    [Show full text]
  • A Beginner's Guide to Freebasic
    A Beginner’s Guide to FreeBasic Richard D. Clark Ebben Feagan A Clark Productions / HMCsoft Book Copyright (c) Ebben Feagan and Richard Clark. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". The source code was compiled under version .17b of the FreeBasic compiler and tested under Windows 2000 Professional and Ubuntu Linux 6.06. Later compiler versions may require changes to the source code to compile successfully and results may differ under different operating systems. All source code is released under version 2 of the Gnu Public License (http://www.gnu.org/copyleft/gpl.html). The source code is provided AS IS, WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Microsoft Windows®, Visual Basic® and QuickBasic® are registered trademarks and are copyright © Microsoft Corporation. Ubuntu is a registered trademark of Canonical Limited. 2 To all the members of the FreeBasic community, especially the developers. 3 Acknowledgments Writing a book is difficult business, especially a book on programming. It is impossible to know how to do everything in a particular language, and everyone learns something from the programming community. I have learned a multitude of things from the FreeBasic community and I want to send my thanks to all of those who have taken the time to post answers and examples to questions.
    [Show full text]
  • Basicatom Syntax Manual Basicatom Syntax Manual
    BasicATOMBasicATOM SyntaxSyntax ManualManual Unleash The Power Of The Basic Atom Version 2.2.1.3 Warranty Basic Micro warranties its products against defects in material and workmanship for a period of 90 days. If a defect is discovered, Basic Micro will, at our discretion repair, replace, or refund the purchase price of the product in question. Contact us through the support system at http://www.basicmicro.com No returns will be accepted without the proper authorization. Copyrights and Trademarks Copyright© 1999-2004 by Basic Micro, Inc. All rights reserved. PICmicro® is a trademark of Microchip Technology, Inc. MBasic, The Atom and Basic Micro are registered trademarks of Basic Micro Inc. Other trademarks mentioned are registered trademarks of their respec- tive holders. Disclaimer Basic Micro cannot be held responsible for any incidental, or consequential damages resulting from use of products manufactured or sold by Basic Micro or its distributors. No products from Basic Micro should be used in any medical devices and/or medical situations. No product should be used in a life support situation. Contacts Web: http://www.basicmicro.com Discussion List A web based discussion board is maintained at http://www.basicmicro.com Updates In our continuing effort to provide the best and most innovative products, software updates are made available by contacting us at http://www.basicmicro.com Table of Contents 5 Table of Contents Contents Introduction .................................................12 What is the BasicATOM ? ...............................................................
    [Show full text]
  • BASIC Programs for Computing Displacements, Strains, and Tilts from Quadrilateral Measurements
    DEPARTMENT OF THE INTERIOR U.S. GEOLOGICAL SURVEY BASIC programs for computing displacements, strains, and tilts from quadrilateral measurements by Arvid M. Johnson and r> Rex L. Baum Open-File Report 87-3^3 Any use of trade names in this report is for descriptive purposes only and does not imply endorsement by the U.S. Geological Survey. This report is preliminary and has not been reviewed for conformity with U.S. Geological Survey editorial standards. University of Cincinnati (M.L. 13) U.S. Geological Survey Cincinnati, Ohio M5221 Box 250H6, MS 966 Denver, CO 80225 1987 INTRODUCTION Since 1983, we have been using quadrilaterals defined by survey stakes (fig. 1) to measure displacements, strains, and tilts at the surfaces of landslides. A companion paper will describe the use of quadrilaterals and give derivations of the equations needed to compute displacements, strains, and tilts. This report provides user instructions for, and listings of, BASIC programs that perform the computations. It is assumed that the reader is familiar with MBASIC and CP/M. However, we have tried to make the user instructions complete and step by step so that the average user can run the programs successfully. B (a) (b) Figure 1. Quadrilateral, (a) Isometric view showing survey stakes on a hillside, (b) Plan view. By convention, stake A has the highest elevation and the other stakes are named B, C, and D in clockwise rotation from A. In the field, the slope distance between each pair of stakes and the elevation of each stake is measured. The azimuth of line AC is used to orient the data.
    [Show full text]
  • Pet Pointers
    RANDOM REMARKS Concerning RND(X): Memory locations 218-222 store previous random number, in usual PET notation: R = ((((PEEK(222)/256 + PEEK) (221))/256 + PEEK(220))/256 + PEEK(219))/256 + .5)*2t (PEEK(218)— 128) To “randomize,” try a statement like “X=RND(—TI).” Don’t use the re­ SPOT sulting X, but call RND(l) thereafter. The Society of PET Owners and Trainers (RND(negative # ) fills memory loca­ tions 218-222 with a scrambled-bytes version of the argument.) Mark Zimmermann Pasadena, CA PET VANCOUVER PETS The Vancouver PET Users Group recently POINTERS held their second meeting. The success of the PET has caught us all by surprise. The attendance at our second meeting • • • was over double the first, with some 40 owners and 15 PETs. The Commodore PET LISTING CONVENTIONS dealers indicate that there are many more PETters who are not aware of our group. PET Program listings in People’s Com­ Interested persons should phone Rick puters employ the following conventionsLeon at: (home: (604) 734-2060); to represent characters that are difficult (work: (604) 324-0505). They can also to print on a standard printer: Whenever write to: square brackets appear in the listing, neither the brackets nor the text they Vancouver PET Users Group enclose should be typed literally. Instead, Box 35353 Station E the text between the brackets should be Vancouver, BC translated to keystrokes. For example, Canada [CLR] means type the CLR key, [3 DOWN] means [DOWN, DOWN, DOWN] The club format includes a short presen­ i.e., press the first CRSR key three times.
    [Show full text]
  • Hp-71 Basic Made Easy
    –Page 1 – HP-71 BASIC MADE EASY by Joseph Horn Copyright 1985, SYNTHETIX P.O. Box 1080 Berkeley, CA 94701-1080 U.S.A. Printed in the United States of America –Page 2 – HP-71 BASIC MADE EASY by Joseph Horn Published by: SYNTHETIX All rights reserved. This book, either in whole or in part, may not be reproduced or transmitted in any form or by any means, electronic or mechanical without the written consent of the publisher. The programs contained herein may be reproduced for personal use. Permission is hereby given to reproduce short portions of this book for the purposes of review. Library of Congress Card Catalog Number: 84-51753 ISBN: 0-9612174-3-X This electronic form of the book was last edited by the author on 9 February 2019. Please inform him of typos and errors so that they can be corrected: [email protected] – Page 3 – TABLE OF CONTENTS Introduction ................................................................. 5 Chapter 1: The Three Modes ......................................................... 8 Chapter 2: CALC Mode................................................................... 12 Chapter 3: Keyboard BASIC Mode .............................................. 44 Chapter 4: BASIC Vocabulary....................................................... 50 Chapter 5: Variables ........................................................................ 53 Chapter 6: Files................................................................................. 79 Chapter 7: The Clock and Calendar ..............................................102
    [Show full text]
  • PDQ Manual.Pdf
    CRESCENT SOFTWARE, INC. P.D.Q. A New Concept in High-Level Programming Languages Version 3.13 Entire contents Copyright © 1888-1983 by Ethan Winer and Crescent Software. P.D.Q. was conceived and written by Ethan Winer, with substantial contributions [that is, the really hard parts) by Robert L. Hummel. The example programs were written by Ethan Winer, Don Malin, and Nash Bly, with additional contributions by Crescent and Full Moon customers. The floating point math package was written by Paul Passarelli. This manual was written by Ethan Winer. The section that describes how to use P.O.Q. with assembly language was written by Hardin Brothers. Full Moon Software 34 Cedar Vale Drive New Milford, CT 06776 Sales: 860-350-6120 Support: 860-350-8188 (voice); 860-350-6130 [fax) Sixth printing. LICENSE AGREEMENT Crescent Software grants a license to use the enclosed software and printed documentation to the original purchaser. Copies may be made for back-up purposes only. Copies made for any other purpose are expressly prohibited, and adherence to this requirement is the sole responsibility of the purchaser. However, the purchaser does retain the right to sell or distribute programs that contain P.D.Q. routines, so long as the primary purpose of the included routines is to augment the software being sold or distributed. Source code and libraries for any component of the P.D.Q. program may not be distributed under any circumstances. This license may be transferred to a third party only if all existing copies of the software and documentation are also transferred.
    [Show full text]
  • Mbasic Vt180, Vs.21 Getting Started with Mbasic Vt180
    MBASIC VT180, VS.21 GETTING STARTED WITH MBASIC VT180 AA-P22SA-TV MBASIC VTlS0, VS.21 GETTING STARTED WITH MBASIC VT180 AA-P22SA-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. Copyr ig ht @ 1981, 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-ll 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 VT180 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 submitted to: Digital Equipment Corporation BOX A 146 Main Street Maynard, MA 01754 Through the software authors, DIGITAL will, wi thout addi 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.
    [Show full text]
  • {PDF EPUB} Learning IBM Basic: for the Personal Computer by David A
    Read Ebook {PDF EPUB} Learning IBM Basic: For the Personal Computer by David A. Lien Learning IBM Basic: For the Personal Computer [Lien, David A.] on Amazon.com. *FREE* shipping on qualifying offers. Learning IBM Basic: For the Personal Computer5/5(1)Format: PaperbackAuthor: David A. LienLearning IBM BASIC for the personal computer : Lien, David ...https://archive.org/details/learningibmbasic00lienLearning IBM BASIC for the personal computer Item Preview remove-circle Share or Embed This Item. ... Learning IBM BASIC for the personal computer by Lien, David A. (David Alvin), 1934-Publication date 1984 Topics IBM Personal Computer, BASIC (Computer program language), ComputersPages: 520Learning IBM BASIC for the personal computer (Book, 1985 ...https://www.worldcat.org/title/learning-ibm-basic...Get this from a library! Learning IBM BASIC for the personal computer. [David A Lien] Learning IBM BASIC For The Personal Computer: ISBN: 0-932760-13-9: Author: David A. Lien: Publisher: Compusoft Publishing: Price: $19.95: First Printing: 1984: Number of Pages: 496 Learning IBM BASIC for the Personal Computer by David A. Lien A copy that has been read, but remains in clean condition. All pages are intact, and the cover is intact. The spine may show signs of wear. Pages can include limited notes and highlighting, and the copy … Learning IBM Basic: For the Personal Computer Nov 1, 1983. by David A. Lien Paperback. $23.99. Only 1 left in stock - order soon. ... by David Lien Paperback. $3.76. More Buying Choices $3.76 ... Aug 22, 2008 · Author of MS-DOS, The BASIC handbook, an encyclopedia of the BASIC computer language, The BASIC handbook, Learning BASIC for Tandy computers, Learning Apple II BASIC, The IBM BASIC handbook, The Tandy 200 portable computer, Learning Microsoft BASIC for the MacintoshWritten works: Learning IBM Basic: For the Personal ComputerBooks by David A.
    [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]
  • Learn Visual Basic 6.0
    Learn Visual Basic 6.0 Beginners All Purpose Symbolic Instruction Code MBasic GW Basic Q Basic Basic VB 32 Years It is a text based language Definition of Visual Basic Visual Basic is a powerful windows programming language that has been developed by Microsoft Corporation . Visual Basic is a powerful language to develop windows application very quickly . It is one of the rapid application development tools that lets the programmer develop windows application very easily . Visual basic is a originally developed from a computer language called basic. The basic was a text based language , means there was no graphical facility as it is in windows. Some Features of Visual Basic Þ Full set of objects - you 'draw' the application Þ Lots of icons and pictures for your use Þ Response to mouse and keyboard actions Þ Clipboard and printer access Þ Full array of mathematical, string handling, and graphics functions Þ Can handle fixed and dynamic variable and control arrays Þ Sequential and random access file support Þ Useful debugger and error-handling facilities Þ Powerful database access tools Þ ActiveX support Þ Package & Deployment Wizard makes distributing your applications simple Visual Basic 6.0 versus Other Versions of Visual Basic The original Visual Basic for DOS and Visual Basic For Windows were introduced in 1991. · Visual Basic 3.0 (a vast improvement over previous versions) was released in 1993. · Visual Basic 4.0 released in late 1995 (added 32 bit application support). · Visual Basic 5.0 released in late 1996. New environment, supported creation of ActiveX controls, deleted 16 bit application support.
    [Show full text]
  • Commodore Enters in the Play “Business Is War, I Don't Believe in Compromising, I Believe in Winning” - Jack Tramiel
    Commodore enters in the play “Business is war, I don't believe in compromising, I believe in winning” - Jack_Tramiel Commodore_International Logo Commodore International was an American home computer and electronics manufacturer founded by Jack Tramiel. Commodore International (CI), along with its subsidiary Commodore Business Machines (CBM), participated in the development of the home personal computer industry in the 1970s and 1980s. CBM developed and marketed the world's best-selling desktop computer, the Commodore 64 (1982), and released its Amiga computer line in July 1985. With quarterly sales ending 1983 of $49 million (equivalent to $106 million in 2018), Commodore was one of the world's largest personal computer manufacturers. Commodore: the beginnings The company that would become Commodore Business Machines, Inc. was founded in 1954 in Toronto as the Commodore Portable Typewriter Company by Polish-Jewish immigrant and Auschwitz survivor Jack Tramiel. By the late 1950s a wave of Japanese machines forced most North American typewriter companies to cease business, but Tramiel instead turned to adding machines. In 1955, the company was formally incorporated as Commodore Business Machines, Inc. (CBM) in Canada. In 1962 Commodore went public on the New York Stock Exchange (NYSE), under the name of Commodore International Limited. Commodore soon had a profitable calculator line and was one of the more popular brands in the early 1970s, producing both consumer as well as scientific/programmable calculators. However, in 1975, Texas Instruments, the main supplier of calculator parts, entered the market directly and put out a line of machines priced at less than Commodore's cost for the parts.
    [Show full text]