Monitor commands – Remote Processing RPC-220 User Manual
Page 14
WRITING, DEBUGGING, AND SAVING PROGRAMS
SECTION 3
Page 3-3
Monitor source code and hex file are under the MON 220
directory.
Some internal registers and ports are initialized upon
power up and program break. These include registers
associated with CO M0, RAM segment, and timers.
A p a rt ia l l is t o f m od if ie d r eg is te r s i nc l ud e : S0 C O N ,
TM OD, TCO N, TL1, TH1 and all of the r egisters in
b a nk 0 . R ev ie w th e so u r ce c od e , u nd e r th e pr o g ra m s
"M AIN220. ASM" and "STA RT220. ASM" to determine
which registers are used and how they might affect your
code.
External RAM from address 0x7fc0 to 0x7fff are used
by the monitor to store break points and registers. M ake
sure your progr am does not write in this area if you
intend to use these.
Effects of the Monitor on a Program
T h e m o ni to r pr o gr a m m in im a ll y m o di fi es R AM a n d I / O
p o r ts d ur i ng it s n o r ma l o p er a ti on . T h er e a re s om e
modifica tions the mon itor does to op erate. These ef fects
are most noticea ble during brea ks.
RAM segment is reset to 0 upon entry. The RAM
examine comm and (DX) tempor arily modifies the
segment during access only.
I/O mode is reset to RAM.
Interrupts are turned off via the IEN. 7 bit in the
interrupt register.
The monitor sets its stack to address 0x60.
' register ' or inter nal RAM variables at or abov e this
address may get c orru pted or oth erwise not reliable
using the DI command.
After a reset, the 8051 stack is automatica lly set to
internal address 7. ' register' or internal RAM from
0x08 to 0x0c get modified. The only time this is a
problem is when you reset the card and wa nt to look
a t d a ta in th is a re a . T o s o lv e th is p ro b le m in C ,
simply declare 4 'dummy' integer registers before
the others.
Ports and registers are r estored for Goto comm ands
except P4.1. This bit controls the development mode and
is always set low on GOTO.
MONITOR COMMANDS
The following describe command function and operation
in greater detail. The m onitor displays a summary when
' H' or ' ?' is entered.
All num eric data is entered a s HEX . A n addre ss is up to
4 bytes long. Any address less than this assumes leading
0' s.
Pressing the < esc> key at any time aborts a command.
Comm ands with parameters in [brackets] are optional. If
nothing entered, 0 is assumed for that and any rem aining
parameters. For example, if an address and segment are
parameters of a com mand but nothing is entered for
either, then 0 is assumed for both.
Comm ands with multiple parameters are separated by a
comma (, ).
An Enter (< cr> ) executes a comm and in most cases.
Some commands, such as DI and H, execute as soon as
the key is hit.
Display Commands
There a re 5 display com mands:
D X
Display eXternal memory
D I
Display Internal memory
D P
Display P ort or I/O d ata
D R
Display Registers
D S
D i sp la y Sp e ci a l f u nc t io n r eg is te r s ( 8 0H -
F F H )
Data is displayed 16 lines at a time (except for registers).
The segm ent, if applicable, followed by the addr ess
starts off a line. Up to 16 bytes of data are displayed,
followed by printable A SCII cha racter s. P rintable
c h ar a c te r s a r e th o se f ro m 2 0H - F F H .
DX D isplay external memory
External mem ory is RAM on the RPC-220 card. It
is accessed using a segment:memory type scheme.
Comm and form at is:
DX [address[,segment]]
If DX is simply en tered, the monitor assum es address
and segm ent 0. If an addr ess is entere d but no segm ent,
then segment 0 is assumed.
DI Display internal memor y
Internal m emor y is RAM internal to the CPU . It is
fixed at 256 bytes. Comm and form at is: