⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userman.htm

📁 This a basic compiler for MSP430
💻 HTM
字号:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Butterfly Basic</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
<h2>Your first BASIC program </h2>
<p>While it抯 entertaining to display messages on the LCD using immediate mode,
  it抯 much more useful to write programs that can control the LCD. Type in the
  following: </p>
<blockquote> <tt> &gt;NEW <br />
&gt;10 FOR I = 1 TO 1000 <br />
&gt;20 &nbsp;&nbsp;PRINT #3, &quot;I=&quot;; I <br />
&gt;30 NEXT <br />
&gt;40 END <br />
  &gt;_</tt></blockquote>
<p>The <b>NEW</b> command clears out any program already in memory and prepares
  for you to enter a new one. Individual program instructions are entered using
  a line number. The interpreter uses line numbers to sort the program instructions.
  When you run the program, the instructions execute in line number order. Now
  let's run the program:</p>
<blockquote>
  <p><tt> &gt;RUN</tt></p>
</blockquote>
<p>There抯 a blur of activity on the display and it finally shows:</p>
<blockquote>
  <p><tt> I=1000</tt></p>
</blockquote>
<p>The problem is the program has executed so quickly that all the intermediate
  display commands, which show values counting from 1 to 1000, are almost instantaneously
  overwritten with new contents.&nbsp; So, we抣l alter the program to slow it
  down so we can see it running:</p>
<blockquote>
  <p><tt>&gt;25 FOR J = 1 TO 100: NEXT<br />
&gt;LIST <br />
    10 FOR I = 1 TO 1000 <br />
    20&nbsp;&nbsp;&nbsp;PRINT #3, &quot;I=&quot;; I <br />
    25 &nbsp;&nbsp;FOR J = 1 TO 100: NEXT<br />
    30 NEXT <br />
    40 END <br />
&gt;</tt></p>
</blockquote>
<p>The <b>LIST</b> command instructs the interpreter to list the program. Notice
  the interpreter has sorted the program instructions and that line 25 that is
  shown between lines 20 and 30, not after line 40. Because you抣l need to edit
  your program during development and debugging, it抯 a good idea to enter line
  numbers in steps of ten which leaves space for new lines to be inserted. </p>
<p>The new line we entered causes the program to pause for a short time before
  continuing&#8212;it's a do-nothing loop that just delays for a little while.
  When you run the program a second time, again using <b>RUN</b>, you抣l see
  the display change much more slowly, allowing you to read the intermediate
  values. </p>
<p>Now there抯 a new problem: the display is easily read, but it抯 taking too
  long to run through all 1,000 values. You can stop the program at any time
  by typing Ctrl+C (that is, holding the Ctrl button while pressing C), and if
  you try it now the interpreter responds with: </p>
<blockquote> <tt>
  <p>&gt;RUN<br />
    BREAK IN LINE 25<br />
&gt;</p>
</tt> </blockquote>
<p>The line number in the message will be 10, 20, 25, or 30, depending on which
  line was executing when you interrupted, or 揵roke into,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -