User manual

Table Of Contents
DEBUG MONITOR DESCRIPTION
M68CPU32BUG/D REV 1 2-6
EXAMPLE A portion of the listing file of a re-locatable module assembled with the
MC68300 Family DOS resident assembler is shown below:
1
2*
3 * MOVE STRING SUBROUTINE
4*
5 0 00000000 48E78080 MOVESTR MOVEM.L D0/A0,-(A7)
6 0 00000004 4280 CLR.L D0
7 0 00000006 1018 MOVE.B (A0)+,D0
8 0 00000008 5340 SUBQ.W #1,D0
9 0 0000000A 12D8 LOOP MOVE.B (A0)+,(A1)+
10 0 0000000C 51 C8FFFC MOVS DBRA D0,LOOP
11 0 00000010 4CDF0101 MOVEM.L (A7)+,D0/A0
12 0 00000014 RTS
13
14 END
****** TOTAL ERRORS 0-
****** TOTAL WARNINGS 0-
The above program was loaded at address 0000427C. The disassembled code is:
CPU32Bug>MD 427C;DI<CR>
0000427C 48E78080 MOVEM.L D0/A0,-(A7)
00004280 4280 CLR.L D0
00004282 1018 MOVE.B (A0)+,D0
00004284 5340 SUBQ.W #1,D0
00004286 12D8 MOVE.B (A0)+,(A1)+
00004288 51C8FFFC DBF D0,$4286
0000428C 4CDF0101 MOVEM.L (A7)+,D0/Ao
00004290 4E75 RTS
By using one of the offset registers, the disassembled code address can be made to match the
listing file address as follows:
CPU32Bug>OF R0<CR>
R0 =00000000 00000000? 427C: 16.<CR>
CPU32Bug>MD 0+R0;DI<CR>
00000+R0 48E78080 MOVEM.L D0/A0,-(A7)
00004+R0 4280 CLR.L D0
00006+R0 1018 MOVE.B (A0)+,D0
00008+R0 5340 SUBQ.W #1,D0
0000A+R0 12D8 MOVE.B (A0)+,(A1)+
0000C+R0 51C8FFFC DBF D0,$A+R0
00010+R0 4CDF0101 MOVEM.L (A7)+,D0/A0
00014+R0 4E75 RTS
CPU32Bug>
For Additional information about the offset registers, see the OF command description.
DEBUG MONITOR DESCRIPTION
M68CPU32BUG/D REV 1 2-7
2.2.2 Port Numbers
Some CPU32Bug commands allow the user to decide which port is the input or output port.
Valid port numbers are:
0 - MCU SCI Port (RS-232C communication port; P4 on the BCC and P9 on the PFB)
Although CPU32Bug supports other ports (see PF command), there is no hardware present on
the BCC to support additional ports. Thus the commands which allow port numbers (DU, LO,
PF, VE) can only use port 0. Those commands requiring a second port (PA, TM) are not
functional without additional hardware.
2.3 ENTERING AND DEBUGGING PROGRAMS
There are various ways to enter a user program into system memory. One is to create the program
using the assembler/disassembler option and the MM (memory modify) command.
The user enters the program one source line at a time. After each source line is entered, it is
assembled and the object code is loaded into memory. Refer to Chapter 4 for complete details of
the CPU32Bug assembler/disassembler.
Another way to enter a program is to download an object file from a host system (i.e., a personal
computer). The program must be in S-record format (described in Appendix A) and may be
assembled or compiled on the host system. The file is downloaded from the host into BCC
memory via the debugger LO command. Alternately, the program may be created using the
CPU32Bug MM command as outlined above and stored to the host using the DU (dump)
command. A communication link must exist between the host system and the BCC’s serial port.
2.4 CALLING SYSTEM UTILITIES FROM USER PROGRAMS
A convenient method to input and output characters as well as many other useful operations is
provided by the TRAP #15 instructions. This frees the user from having to write these routines
into the target code. Refer to Chapter 5 for details on various TRAP #15 utilities and how to
execute them from a user program.
2.5 PRESERVING DEBUGGER OPERATING ENVIRONMENT
Avoiding contamination of the debugger operating environment is explained in the following
paragraphs. CPU32Bug uses certain MCU on-board resources and may also use off-board system
memory to store temporary variables, exception vectors, etc. If the user violates CPU32Bug
dependent memory space, then the debugger may not function.
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...