Remote-processing BASIC 52 Uživatelský manuál Strana 9

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 163
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 8
RPBASIC-52 PROGRAMMING GUIDE
1-6
OPERATING MODES
Command and Run M odes
RPBASIC-52 operates in two modes, Command and
Run. Command mode is the direct, interactive mode
accessed when RPBASIC-52 is not running a
program. The Basic console prompt ">" indicates
that Basic is ready for Comm and m ode input.
Run mode is when the processor is activ ely
executing a Basic program. Some commands (such
as SAVE, LIST, LOAD) can only be executed when
the processor is in command mode. Most Basic
instructions can be executed in either Command or
Run mode.
In Command mode, LOAD selects a Basic program
from the flash. The RUN command then causes the
selected program to execute. Within a B asic
program, the EXECUTE instruction is used to allow
the currently running program to call another stored
program. A number of programs m ay be available
to run depending upon the card and flash EPROM
size installed. Refer to your hardware manual for
more information.
Autorunning Programs
Programs may automatically load and run on
powerup or reset when a specific jumper is removed
on the card. Refer to your card's hardware manual
for more information on jumper location.
When autorun is enabled, a LOAD 0, RUN sequence
is performed on power up or reset. Programs are
chained using the EXECUTE command.
Stopping Program Execution
<Ctrl-C> halts the execution of a program and forces
the processor into Command mode (unless <Ctrl-C>
has been disabled). Operation can be resumed by
typing the CONT comm and. The STOP instruction
stops a running program; execution resumes with a
CONT command.
Sometimes it is desirable to not stop program
execution. To disable <Ctrl-C>, execute:
DBY(38) = DBY(38) .OR. 1
X-ON and X-Off Flow Control
Serial output can be stopped w ith <Ctr-S> (X-OFF),
which halts output to the console serial port only;
<Ctrl-Q> (X-ON) restarts it. You can use this
feature to prevent screens of output data from
scrolling by too quickly to read. After you type a
<Ctrl-S>, Basic halts program execution if it is
encountered during a PRINT com mand until it
receives a <Ctrl-Q>. You can also reduce the serial
port baud rate or use the NULL com mand to slow
down the output of console data. Be careful of the
NULL command. Some term inal programs print a
space character instead.
Characters are buffered from th e serial port.
Therefore an additional 256 characters may continue
to print after a <Ctrl-S> is sent.
WARNING: Program execution halts during a
PRINT when an X -OFF is
received until a X-O N is re ceived.
This means no other Basic
comm ands are exe cuted. Multi-
tasking interrupts are recognized
but not executed until after the
PRINT statement is finished.
To determine if X-OFF is active (printing halted)
before executing a PRINT statement, check address
38, bit 5. If high, X-OFF is active.
100 IF (DBY(38) .AND. 32) = 0 THEN 200
Normally the result of the above test is 0 (no X-OFF
received) and the program branches to line 200. Of
course, if X-OFF is received during a PRINT
command, program execution is suspended until an
X-ON is received. To clear X-OFF (due to a
protocol you are using), put the following line in:
120 DBY(38) = DBY(38) .AND. 0DFH
STORING PROGRAMS
RPBASIC-52 programs are stored in non-volatile
flash type EPROM . The SAVE command is used to
write programs from RAM while LOAD retrieves
them into RAM. Depending upon the card and the
EPROM type installed, up to 8 programs can be
saved and loaded. Refer to your card's hardware
manual for specific programming information.
Zobrazit stránku 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 162 163

Komentáře k této Příručce

Žádné komentáře