📄 internals.htm
字号:
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<title>Butterfly BASIC Internals Manual</title>
</head>
<body>
<h1 align="center">Using and Porting Butterfly BASIC</h1>
<p>Butterfly BASIC is a BASIC interpreter specially written to run on the Texas
Instruments MSP430 family. It is designed to be small, efficient, simple to
use, yet flexible enough for prototype or simple production use.Butterfly BASIC
takes inspiration from many different BASIC implementations, adds support for
the special features for the MSP430, and provides a great means to get started
with the MSP430 processor. </p>
<p>This manual is both a small tutorial and reference for Butterfly BASIC. If
you can抰 find what you抮e looking for within this manual you can always contact
us杝ee the Contacts section below. </p>
<h2>About BASIC</h2>
<p>The BASIC programming language is simple to understand. With a BASIC interpreter
you can experiment with programs on the hardware and try things out immediately.
All you need to construct programs for Butterfly BASIC is an MSP430 board,
a serial cable, and a terminal emulator. In contrast, a compiler is somewhat
removed from the hardware and needs a more sophisticated development environment. </p>
<p>Although compilers are more complex, they do offer advantages over an interpreter.
A program written and run on an interpreter will be slower than an equivalent
program compiled by a compiler. If you need the fastest possible execution
speed using a high level language, choose a compiler. If you need a simple
development environment to experiment with the MSP430, choose an interpreter.</p>
<h2>Building and porting Butterfly BASIC </h2>
<p>Butterfly BASIC is written in assembly code for speed and compactness. It
takes advantage of the extensive features of the MSP430 to offer rapid application
development and swift program execution. The complete source code of Butterfly
BASIC is released under the GNU Public License version 2. This means
that you are free to modify and use Butterfly BASIC yourself.</p>
<p>Butterfly BASIC is available off-the-shelf for the SoftBaugh ES449 and HPA449
boards. If you would like to have Butterfly BASIC ported to your board, you
can always <a href="mailto:plc@rowley.co.uk?subject=Butterfly BASIC">contact
me</a> to see what I can do. If you port the interpreter to some other hardware
yourself, please drop me a line so I can add a reference to your port.</p>
<p>Bug fixes and enhancements are always welcome. I maintain the source code
for Butterfly BASIC in my own time, and I'll upgrade rovide the reference code
for the interpreter at irregular intervals. Don't despair if your modifications
don't make it into the Butterfly BASIC reference code, you can always re-integrate
your changes when I release a new version of Butterfly BASIC.</p>
<p>If, after evaluating Butterfly BASIC, you decide that you do need a compiler,
I recommend CrossWorks for MSP430 from <a href="http://www.rowley.co.uk">Rowley
Associates</a> in the United Kingdom. The CrossWorks development environment
supports all variants of the MSP430 and has example programs for the ES449.
I have to come clean here, I wrote the MSP430 CrossWorks C and BASIC compilers
and the MSP430 optimizer, and I'm the founder of Rowley Associates, so I am
more than biased.</p>
<h1>Using Butterfly BASIC</h1>
<h2>Getting started</h2>
<p>This section will get you started with the Butterfly BASIC interpreter for
the MSP430. Even if you抮e familiar with BASIC, it抯 a good idea to go through
this section because there are a number of differences between Butterfly BASIC
and other dialects that are worth pointing out. We'll be using the standard
distribution for the SoftBaugh ES449; if you have some other version, you should
be able to adjust fairly quickly, but the parts that are specific to the ES449
will obviously be inappropriate, but entertaining, reading.</p>
<h3>Connecting the ES449 </h3>
<p>You should first build and flash your ES449 with Butterfly BASIC. Once you've
done this, connect a serial cable from the ES449 to the PC and run HyperTerminal.
Set the connection to 38400 baud, no stop bits, and no flow control. </p>
<p>Reset the ES449 and you will be greeted by the standard Butterfly BASIC sign-on
message: </p>
<blockquote>
<p><tt> Butterfly BASIC Interpreter v1.0 for the SoftBaugh ES449<br>
Copyright (c) Paul Curtis 2003, 2004. All rights reserved.<br>
<br>
1892 RAM bytes free, 48124 FLASH bytes free<br>
>_</tt></p>
</blockquote>
<p>If nothing appears in HyperTerminal, check the cable, your communications
setting, and that HyperTerminal is connected. If you still have problems after
checking these, you can use CrossWorks to figure out where the problem might
lay. </p>
<h3>Conversational BASIC </h3>
<p>Now that the interpreter is ready, you can start to use it. When the interpreter
is ready for input, it prompts a greater than sign
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -