Rpbasic-52 programming guide – Remote Processing BASIC 52 User Manual
Page 9

RPBASIC-52 PROGRAMMING GUIDE
1-6
OPERATING MODES
Command and Run M odes
RPBAS IC-52 operates in two modes, Command and
Run. Comm and mode is the direct, interactive mode
accessed when RPBA SIC-52 is not running a
program. The Basic console prompt ">" indicates
that B asic is r eady for Co mm and m ode in put.
Run m ode 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 co mma nd mode . Most Ba sic
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 progra m to exec ute. Within a B asic
program, the EXECUT E instruction is used to allow
the currently running program to call another stored
program. A number o f programs m ay be availab le
t o ru n d ep e n di n g u p o n t h e c a rd a n d f l as h E PR O M
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 o n power up or reset. Program s are
chained using the EXECUTE command.
Stopping Program Execution
t h e p r oc e s so r in t o C o m m a n d m o d e (u n le s s < C t rl - 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
DBY(38) = DBY(38) .OR. 1
X-ON and X-Off Flow Control
Serial output can be stopped w ith
which halts o utput to the conso le serial port only;
feature to prevent screens of output data from
scrolling by too quickly to read. After you type a
encountered during a PR INT com mand un til it
receives a
port baud rate or use the NULL com mand to slow
down the output of console data. Be careful of the
NUL L com mand. So me term inal program s print a
space character instead.
Cha racters are bu ffered fr om th e seria l port.
Therefore an additional 256 characters may continue
to print after a
WARNING:
Program execution halts during a
PRINT when an X -OFF is
receiv ed unt il a X-O N is re ceive d.
This me ans no other B asic
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 PRIN T 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
r e ce i ve d ) a n d th e p ro g ra m b ra n c he s to l in e 2 00 . O f
c o u rs e , i f X- O F F is r ec e iv e d du r in g a PR I N T
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
RPB ASIC-5 2 progra ms are store d in non-vo latile
flash type EP ROM . The SA VE co mmand 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.