070 3970 00_68000_Emulator_Specifics_Users_Manual_Feb82 00 68000 Emulator Specifics Users Manual Feb82

070-3970-00_68000_Emulator_Specifics_Users_Manual_Feb82 manual pdf -FilePursuit

070-3970-00_68000_Emulator_Specifics_Users_Manual_Feb82 070-3970-00_68000_Emulator_Specifics_Users_Manual_Feb82

User Manual: 070-3970-00_68000_Emulator_Specifics_Users_Manual_Feb82

Open the PDF directly: View PDF PDF.
Page Count: 128

Download070-3970-00_68000_Emulator_Specifics_Users_Manual_Feb82 070-3970-00 68000 Emulator Specifics Users Manual Feb82
Open PDF In BrowserView PDF
COMMITTED TO EXCELLENCE

This manual supports the
following TEKTRONIX products:
8550
Options

8540
Options

Products

2P
3U

2P
3U

8300E26
8300P26

This manual supports a software/firmware
module that is compatible with:

005/50 Version 2 (8550)
05/40 Version 1 (8540)

PLEASE CHECK FOR CHANGE INFORMATION
AT THE REAR OF THIS MANUAL.

8500
MODULAR MOL SERIES

68000
EMULATOR SPECIFICS
USERS MANUAL

Tektronix, Inc.
P.O. Box 500
Beaverton, Oregon

97077

Serial Number - - - - - - - -

070-3970-00
Product Group 61

First Printing FEB 1982

LIMITED RIGHTS LEGEND
Software License No. _ _ _ _ _ _ _ _ _ _ _ _ __
Contractor: Tektronix, Inc.
Explanation of Limited Rights Data Identification Method
Used: .Entire document subject to limited rights.
Those portions of this technical data indicated as limited rights data shall not,
without the written permission of the above Tektronix, be either (a) used,
released or disclosed in whole or in part outside the Customer, (b) used in whole
or in part by the Customer for manufacture or, in the case of computer software
documentation, for preparing the same or similar computer software, or (c) used
by a party other than the Customer, except for: (i) emergency repair or overhaul
work only, by or for the Customer, where the item or process concerned is not
otherwise reasonably available to enable timely performance of the work,
provided that the release or disclosure hereof outside the Customer shall be
made subject to a prohibition against further use, release or disclosure; or (ii)
release to a foreign government, as the interest of the United States may
require, only for information or evaluation within such government or for
emergency repair or overhaul work by or for such government under the
conditions of (i) above. This legend, together with the indications ofthe portions
of this data which are subject to such limitations shall be included on any
reproduction hereof which includes any part of the portions subject to such
limitations.

RESTRICTED RIGHTS IN SOFTWARE
The software described in this document is licensed software and subject to
restricted rights. The software may be used with the computer for which orwith
which it was acquired. The software may be used with a backup computer ifthe
computer for which or with which it was acquired is inoperative. The software
may be copied for archive or backup purposes. The software may be modified or
combined with other software, subject to the provision that those portions of the
derivative software incorporating restricted rights software are subject to the
same restricted rights.
Copyright © 1982 Tektronix, Inc. All rights reserved. Contents of this publication
may not be reproduced in any form without the written permission of Tektronix,
Inc.
Products of Tektronix, Inc. and its subsidiaries are covered by U.S. and foreign
patents and/or pending patents.

~

TEKTRONIX, TEK, SCOPE-MOBILE, and
are registered trademarks of
Tektronix, Inc. TELEQUIPMENT is a registered trademark of Tektronix U.K.
Limited.
Printed in U.S.A. Specification and price change privileges are reserved.

Section 1L
68000 EMULATOR SPECIFICS
Page
Introduction

7L-1

................................................

General Information
Emulator Hardware Configuration ••••••••••••••.•••••••••••••••••••.
Microprocessors Supported •••••..•••.•••••••••••••••••••••••••••.
Emulation Modes ••.••••••••.
Clock Rates
Symbolic Debug

1L-1
1L-1
1L-1
7L-1
7L-2
1L-2

Emulator-Specific Parameters, Commands, and Displays ••••••••••••••
Byte/Word Parameter
Register Designators
The 68000 Status Register
DOS/50 and OS/40 Commands
AL---Allocate Memory to Logical Memory Map ••••••••••••••••••••••
BK---Sets or Displays Breakpoint Conditions •••••••.••••••••••••.
D---Dump; Displays Memory Contents
DI---Disassembles Object Code into Mnemonics ••••••••••••••••••.•
DS---Display Contents of Emulator Processor Registers •••••••••••
EX---Displays or Alters Memory Contents ••••••••••••••••••••.••••
F---Fills Program/Prototype Memory with Data ••••••••••••••••••••
G---Begins Program Execution
MAP---Sets or Displays Memory Map Assignments •••••••••••••••••••
MEMSP---Defines Default Memory Space ••••••••••••••••••••••••••••
MOV---Moves Data Between Program and Prototype Memory •••••••••••
P---Alters Memory Contents
RD---Reads from Emulator Port
RESET---Reinitializes Emulator
S---Assigns Value to Register or Symbol •••••••••••••••••••••••••
SEA---Searches Memory for Value or String •••••••••••••••••••••••
SEL---Selects the Emulator
TRA---Controls Display of Executed Instructions ••••••••••••••••••••
WRT---Writes to Emulator I/O Port
Real-Time Prototype Analyzer
Trigger Trace Analyzer (TTA) Commands and Parameters
EVE and BUS Command Parameters
CONS---Set Consecutive Ev"ents
DISP---Display Contents of Acquisition Memory
TS---Display Status of TTA Triggers

7L-2
7L-2
1L-2
1L-4
7L-5
7L-5
1L-5
7L-6
1L-1
1L-9
1L-9
1L-9
1L-9
1L-10
1L-11
1L-11
1L-11
1L-11
1L-11
1L-13
1L-13
7L-14
1L-14
1L-15
1L-16
1L-16
1L-16
1L-11
1L-11
1L-18

Service Calls ••••.••••••.••
SVC Address Range •.••••••
SRB Format
SVC Demonstration

7L-19
1L-19
1L-21
1L-21

@

1L-i

b~OOO

Emulator Specifics Users

Special Considerations
Fetching and the Prefetch Pipeline
Interrupts
Memory Spaces
Memory Space Partitioning
The 68000 STOP Instruction

7L-25
7L-25
7L-26
7L-33
7L-34
7L-44

.........................................................

Jumpers
EMU 1 Board
P1080---Emulator Halt Control Selector
EMU 2 Board
J2144---Break Cycle Control Selector
Interface Buffer Board
P1---Data Transfer ACKnowledge (DTACK) Delay ••••••••••••••••••••.••
P2 and P3---Prototype Bus Arbitration Control
P6---Address Strobe Control •••••••••••••••••.
P7---DTACK Timeout Control
P8---Internal Generation of DTACK in Mode
Interface Control Board
J4011---Save Non-Maskable Interrupts
J6021---Save Prototype Interrupts
Mobile Microprocessor Board
J1045 and J2045---Delay of DTACK Assertion •••••••••••••••••••••••••

.........................................
...............................
..........................................
•

••••••••••••••••••••••••••••••••

0

7L-45
7L-45
7L-45
7L-45
7L-45
7L-46
7L-46
7L-46
7L-47
7L-47
7L-48
7L-48
7L-48
7L-49
7L-49
7L-49

Emulator Timing ••••••••••••••••••••.••••••••••••••••••••.•••••••••••• 7L-51
Probe/Prototype Interface Diagram •••••••••••••••••••••••••••••••••••• 7L-54
Installing Your 68000 Emulator Software
8540 Software Installation Procedure ••••••
8550 Software Installation Procedure

7L-55
7L-55
7L-55

68000 Demonstration Run
Introduction
Examine the Demonstration Program
Assemble and Load the Demonstration Program •••••••••••.••••••••••••
Case 1: Assemble and Load on the 8550
Case 2: Assemble on the 8560; Download to the 8540 ••••••••••••••••••
Case 3: Download from Your Host to the 8540 •••••••••••••••••••••••••
Case 4: Patch the Program into Memory
Run the Demonstration Program
Monitor Program Execution
Summary of 68000 Emulator Demonstration Run

7L-59
7L-59
7L-62
7L-63
7L-63
7L-70
7L-76
7L-80
7L-83
7L-87
7L-96

·.............. ·...........
..........·...... ·.............. ·...........
..............·...........

. .....·...... ·.............. ·...........

Error Messages ••••••••••••••••••••••••••••••••••••••••••••••••••••••• 7L-98
7L-99
Reprints
Microprogrammed Implementation of a Single Chip Microprocessor •••••• 7L-101
Design and Implementation of System Features for the MC68000 •••••••• 7L-110
7L-118
Instruction Prefetch on the MC68000

7L-ii

68000 Emulator Specifics Users
TABLES
Table
No.
7L-1 68000 Registers and Flags •••••••••••••••••••••••••••••••••••••••• 7L-3
7L-2 Register Symbols Accepted by S Command •••.•••••••••••••••..••..• 7L-13
7L-3 EVE/BUS Signal Symbols •••••••••••••••••••••••••••••••••••••.•••• 7L-16
7L-4 68000 Service Calls ••••••••.••••••••••••••.•••••••.••••••.••.•.• 7L-20
7L-5 Encoding of the Memory. Space Byte •••••••••••••••••••.••••••••••• 7L-21
7L-6 Classification of Memory Space References ••••••••••••••••••••••• 7L-33
7L-7 68000 Exception Vector Assignment ••••••••••••••••••••••••••••••• 7L-40
7L-8 J1045 and J2045 Configurations •.••••••••••••••••.••••••••••••••• 7L-50
7L-9 68000 Emulator/Microprocessor Timing Differences •••••••••••••••• 7L-51
7L-10 Basic 8560 Editing Commands ••••.•••••••••••••••••••••••••••.••• 7L-72
ILLUSTRATIONS
Fig.
No.
7L-1 Status Register ••••••••••.•••.••••••••••••••••••••.•••.•••.•.•••. 7L-4
7L-2 Sample disassembly •••••••••.••••••••••••••••••••••••••.•••••••••• 7L-8
7L-3 Sample DISP display ••••••.••••••••••••••••.•••.•.•••••.••••••••• 7L-17
7L-4 A 68000 SRB pointer located at CO--C3 •••••••••.••••••.•••••••••• 7L-21
7L-5 68000 SVC demonstration program listing ••••••••••••••••••••••••• 7L-22
7L-6 Alternate executable code for SVC demonstration program ••••••••• 7L-24
7L-7 68000 instruction pipeline block diagram •••••••••••••••••••••••• 7L-25
7L-8 Program example ••••••••••••••••••••.•••.•••••••••••••••••••••••• 7L-27
7L-9 Example program run with TRA OFF •••••••••••••••••••••••••••••••• 7L-28
7L-10 Example program run with TRA ON •••••••••••••••••••••.•••••••••• 7L-30
7L-11 Memory partitioning example program •••.•••••••••••••••••••••••• 7L-35
7L-12 68000 timing diagram, read cycle •.••••••••••••••••••••••••••••• 7L-52
7L-13 68000 timing diagram, write cycle •••••.•••••••••••••••.•••••••• 7L-53
7L-14 68000 Prototype Control Probe interface •••••••••••••••••••••••• 7L-54
7L-15 68000 demonstration run program ••••••••••••••••••••.••••.••••.. 7L-60
7L-16 68000 demonstration program: Extended Tekhex format ••••••••••• 7L-61
7L-17 Symbol table listing .•••••••••••••••••.•••••••••••••••••••••••• 7L-66
7L-18 Host computer commands for preparing demonstration program ••••• 7L-76

7L-iii

Section 7L
68000 EMULATOR SPECIFICS

INTRODUCTION
This supplement is designed to be inserted into Section 7 of the 8550 System
Users Manual (DOS/50 Version 2) or the 8540 System Users Manual. This
Emulator Specifics section explains the features of the 8550 and 8540 that
are unique to the 68000 emulator. Throughout this section, "your System
Users Manual" refers to the 8550 System Users Manual or 8540 System Users
Manual.
The 68000 demonstration run is designed to be used with Section 1, the
Learning Guide of your System Users Manual; the rest of this section
contains reference material.
As a user of the 68000 emulator, you should be familiar with the material in
the MC68000 16-Bit Microprocessor User's Manual, by Motorola. In addition,
you should be familiar with the internal operation of
the
68000.
Information is available in the booklet MC68000 Article Reprints, by
Motorola. Three of the more pertinent articles from that booklet have been
reprinted here in the subsection "Reprints". Some of the effects of the
68000's design on the behavior of the emulator are discussed under the
topic, "Special Considerations".
GENERAL INFORMATION

EMULATOR HARDWARE CONFIGURATION
Throughout this Emulator Specifics section, the term "68000 emulator" refers
to a 68000 Emulator Processor board configured with a 68000 Prototype
Control Probe. In emulation mode 0, the prototype control probe must be
connected to the main emulator boards. In modes 1 and 2, the prototype
control probe must be connected to both the emulator and your prototype.
For instructions on installing your emulator boards and probe, refer to your
68000 Emulator Processor and Prototype Control Probe Installation Service
Manual.
MICROPROCESSORS SUPPORTED
The 68000 emulator emulates the Motorola MC68000 microprocessor.
EMULATION MODES
The 68000 supports emulation modes 0, 1, and
Emulation section of your System Users Manual.

2,

as

described

in

the

7L-1

General Information

68000 Emulator Specifics Users

CLOCK RATES
In emulation mode 0, the emulator clock rate is 8MHz. In emulation modes
and 2, the prototype clock rate may range from 2MHz to 8MHz.
SYMBOLIC DEBUG
The 68000 emulator supports the use of symbolic debug.
in this manual include symbolic debug information.

Most of the displays

EMULATOR-SPECIFIC PARAMETERS, COMMANDS, AND DISPLAYS

BYTE/WORD PARAMETER
Several commands allow you to operate on memory on a byte-oriented or
word-oriented basis. This choice is represented by the -B or -W parameter.
For the 68000 emulator, the default setting is -W, except for the MOV, RD
and WRT commands, where the default is -B.
REGISTER DESIGNATORS
Table 7L-1 alphabetically lists the symbols used by
designate the registers and flags used by the 68000.
following information for each symbol:

7L-2

DOS/50 and OS/40 to
The table provides the

•

a description of the register or flag that the symbol represents

•

the size of the register or flag

•

the value assigned to the register or flag by the RESET command

•

whether the register or flag can be assigned a value by the S (Set)
command.

Parameters, l"ommanUl:),

68000 Emulator Specifics Users

U.l.i;)~.l.Cl'y~

Table 7L-1
68000 Registers and Flags
I

I

Symbol : Description

: Size I Value After I Altered by
I(Bits)1
RESET
I S Command?

------------------------------------------------------------------------

AO--A6 I seven address registers

: unchanged

yes

I unchanged

yes

5

I unchanged

yes

00--07 I eight data registers

32

: unchanged

yes

I

: Interrupt mask of SR

3

I 7

yes

N

: Negative bit of CCR

I unchanged

yes

PC

: Program Counter

S

: Supervisor/User bit of SR

SR

I Status Register

16

: 27XX

yes

SSP

: Supervisor Stack Pointer (A7):

32

: contents of :
: SP:OOOOOO * :

yes

T

: Trace bit of SR

I 0

yes

C

I Carry bit of CCR

CCR

: Condition Code portion of SR

32

24

: contents of :
: SP:000004 * :

I 1

(on)

(off)

no
yes

--------------------------------~---------------------------------------

: unchanged

yes

: oVerflow bit of CCR

I unchanged

yes

x

: eXtend bit of CCR

I unchanged

yes

Z

I Zero bit of CCR

: unchanged

yes

USP

I User Stack Pointer (A7Y

V

*

32

SP: is Supervisor Program space.

7L-3

Yarameters~

68000 Emulator Specifics Users

Commands, Displays

THE 68000 STATUS REGISTER (SR)
The 16-bit Status Register (SR) has a system byte (high order) and a user
byte (low order).
The system byte contains the Trace Mode and Supervisor
State bits, and contains the three bits used as the Interrupt Mask.
The
user byte contains five status flag bits, which are used primarily for
branch nontrol within a program, and for error detection. Figure 7L-1 shows
the Status Register.

System Byte

User Byte

1------------1\---------------\1--------------1\---------------\
15

14

13

12

11

10

9

8

7

6

4

5

3

o

2

+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

: T:

: S :

: 12: 11: 10:

: X : N : Z : V : C :

+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

\

- - -v

I

Trace +
Supervisor
IUser

---+

Interrupt
Mask

-------------------+
I Extend

------------------------------+

Negative --------------------------------+
Condition
Codes < Zero ----------------------------------------+

I

I

Overflow
\ Carry

----------------------------------------+

-----------------------------------------------+
Fig.

7L-4

7L-1.

Status Register.

Parameters, Commands, Displays

68000 Emulator Specifics Users
DOS/50 AND OS/40 COMMANDS

AL---Allocate Memory to Logical Memory Map
The AL command allocates 4K-bytes blocks of program memory to
the
processor's logical memory space. The MAC (Memory Allocation Controller)
option must be installed. For example, the command AL SP:UP:O allocates one
block of program memory for location O--OFFF of the two memory spaces SP and
UP. Thus, for the range O--OFFF, these two memory spaces will be in the
same physical memory.
References to either of those two memory spaces in
that range will access the same physical location. For example, the address
OA40 in the supervisor program space (SP) will be at the same physical
location as the address OA40 in the user program space (UP).
With the 68000 emulator, the AL command may be used only if the Memory
Allocation Controller (MAC) option is installed. The use of the AL command
does not follow that described by the Command Dictionary of your System
Users Manual.
Refer to the Emulation section of your System Users Manual
for a detailed description of the AL command when the MAC option is
installed.
BK---Sets or Displays Breakpoint Conditions
With the 68000 emulator, the BK command syntax and parameters are
described in the Command Dictionary of your System Users Manual.
following information instead.

not as
Use the

SYNTAX
bk
or
{1

}

{2 }
{3 }
bk (all}

clr

or
{1

[-a]}

{2" [-a]}
[rd] [.£¥.]
bk [-c] (~ - } [expression) [wt] [wd]

PARAMETERS

1, 2, and 3. The number specifies the desired breakpoint.

ALL. This specifies all breakpoints.
CLR. This parameter clears the specified breakpoint(s).
7L-5

Parameters, Commands, Displays

68000 Emulator Specifics Users

-C. This parameter causes execution to continue after each breakpoint
occurs. If -C is not specified (the default), the BK command stops
execution after a breakpoint occurs. To resume program execution, enter the
G command without parameters.
-A. This mode sets breakpoint 1 to arm breakpoint 2. When the mode is set,
breakpoint 2 will not occur unless breakpoint 1 has already happened.
Arming mode may be set when entering either breakpoint 1 or breakpoint 2,
but one of these two breakpoints must already be defined. When you redefine
either breakpoint 1 or 2 this setting is cancelled.
expression. This parameter is an expression that represents the address
where program execution is to be interrupted. The expression may include
don't-care bits and/or a memory space designator.
The address expression
may also be omitted.
For example, BK 1"BY WT will cause a break on the
first byte write.
RD and WT. These parameters designate that a breakpoint occurs when a memory
read (or write) occurs at the specified address. The default is any access
(read or write).
BY and WD. These parameters designates that a breakpoint occurs when a byte
(or word) operation occurs at the specified address. The default is any
access (byte or word).
NOTE
When you use TRA, and breakpoints are set, the break may occur
before the address where the breakpoint is set. This occurs
because the address has been identified going into the 68000
prefetch pipeline.
Be sure to check the display to see if the
last instruction executed was the one on which you wanted to
break. If it is not, enter G again, and the next instruction will
be executed. Check the display again, and repeat the G command,
if necessary.
It is recommended that you put NOP statements in
your program around the statements where you want to break.

D---Dump; Displays Memory Contents
The D command allows memory space designators in the address expressions.

7L-6

68000 Emulator Specifics Users

Parameters, Commands, Displays

DI---Disassembles Object Code into Mnemonics
The DI command translates object code in memory into
instructions.
It displays addresses, object code,
mnemonics, and operands.

assembly
assembly

language
language

DI Display Format. In general, the format of the disassembly follows the
conventions of both the Motorola cross-assembler and the TEKTRONIX 8500
Series B 68000 Assembler. An example of a disassembled instruction is:
000712

13CO

MOVE.B

DO,F00007H

In this example:
000712

is the memory location of the instruction being disassembled.

13CO

is the opcode.

MOVE

is the opcode mnemonic.

.B

is the size extension. In the DI display, the size extension
may be shown on some instructions where it may not be
required or allowed for assembly.

DO

is the source operand.

F00007H

is the destination operand.

Exceptions from the Assembler Format. The opcode variations ADDA,
ADDI,
ANDI, CMPA, CMPI, EORI, MOVEA, ORI, SUBA, and SUB I do not appear in the
disassembly. The assembler chooses the correct A or I opcode variation by
~xamining the operands in the instruction, rather than by the opcode suffix.
Thus, ADDI H035FH,DO and ADD H035FH,DO would both generate the same
opcode, and their disassembly will be displayed as ADD.W H035FH,DO.
The opcodes for BT and DBF are disassembled as the equivalent mnemonics, BRA
and DBRA, respectively.
The mnemonics EMT A and EMT_F are displayed whenever an attempt is made to
disassemble opcodes in the ranges AOOO--AFFF and FOOO--FFFF. These opcode
ranges are reserved by Motorola for future enhancements.
A line of asterisks (**1*1***) is displayed in the instruction field
attempt is made to disassemble an illegal opcode.

if

an

7L-7

68000 Emulator Specifics Users

Parameters, Commands, Displays
A sample disassembly is shown in Fig.

7L-2.

> D1 3000 3022 
ADDRESS
DATA MNEMONIC
DEMO+OOOOOO
003000
4280

CLR.L

DO

DEMO+000002
003002
323C

MOVE.W

113H,D1

DEMO+000006
003006
207c

MOVE.L

1I1000H,AO

DEMO+OOOOOC
00300C
227C

MOVE.L

112000H,A1

LOOP
003012

31FA

MOVE.W

3024H,3026H

DEMO+000018
22D8
003018

MOVE.L

(AO)+, (A 1)+

DEMO+00001A
00301A
51C9

DBF

D1,3012H

DEMO+00001E
00301E
4E71

Nap

DEMO+000020
003020
4E71

Nap

SELF
003022

BT

Fig.

60FE
7L-2.

3022H

Sample disassembly.

This display was generated when SYMD was ON.

7L-8

Parameters, Commands, Displays

68000 Emulator Specifics Users

DS---Display Contents of Emulator Processor Registers
The OS command displays the 68000 registers. The display contains PC(next),
the fifteen 32-bit general registers, the system and user stack pointers,
and the system status register.
The status register is displayed in
hexadecimal, and in binary with each bit labelled. Refer to the following
example:

> OS
PC=00132C
OO=OOOOOOOF
D4=00BC48FF
AO=OOFOOOOO
A4=00000004

01=0001FFOO
05=00000000
A1=00000000
A5=00000008

02=00000000 03=00000000
06=00000000 07=00000000
A2=00000000 A3=00001000
A6=00000000 SSP=000C1000 USP=00100000

T.S . • 111 ••• X NZVC
SR=850A ---> 1.0 • . 101 ••• 0 1010
The long and short forms of the OS display are the same: the -L modifier has
no effect.
EX---Oisplays or Alters Memory Contents
The EX (EXamine) command allows memory
expression.

space

designators

in

the

An error will occur if you attempt to examine memory that is not on
boundary while in word mode (-W).

address
a

word

F---Fills Program/Prototype Memory with Oata
The F command allows memory space designators in the address expression.
An error will occur if you attempt to fill memory that
boundary while in word mode (-W).

is

not

on

a

word

G---Begins Program Execution
The G (Go) command starts the emulator at the 24-bit address specified. The
processor examines the S bit of the 68000 stattis register to determine
whether to start in supervisor or user program space.
Memory' space
designators are not allowed; however, you may select the program space with
the Set command.
If breakpoints have been set, it may be necessary to invoke G more than once
to actually execute the instruction on which you wish the break to occur.
This is because the 68000 performs prefetching and does not have a fetch
signal.
Refer to the discussions under "Special Considerations" later in
this section. Also, refer to the BK command discussion.

7L-9

68000 Emulator Specifics Users

Parameters, Commands, Displays
MAP---Sets or Displays Memory Map Assignments

The MAP command enables you to assign blocks of , memory to either program or
prototype memory, and to designate blocks of memory as read-only. The 68000
MAP command differs from the description given in the Command Dictionary as
follows:
•

The -M modifier is not allowed.

Displays are in tabular form only.

•

Entering MAP with no parameters causes the display of the current
memory map assignments for the default memory spaces (MEMSP M).

•

Entering MAP -A displays the current memory map assignments for all
valid memory spaces.

•

Entering MAP followed by one or more memory space designators
displays the current mapping for the indicated memory space(s).

•

The block size default is 4K bytes.

•

Unlike most other emulators, the 68000 emulator supports write
protection for prototype memory through use of the URO parameter.

•

Multiple memory space designators are allowed as part of the loaddr
parameter.
They are not allowed in the hiaddr parameter. The
hiaddr parameter defaults to the same memory space(s) as loaddr.

If you attempt to change the program/prototype map assignments and are not
currently in emulation mode 1, a warning message is displayed indicating
that you are not in mode 1. The mapping of read-only and read/write is
valid in any emulation mode.
Here is a sample 68000 MAP assignment and display:
> MAP PRW 000000 70FFFF 
> MAP URW SD:710000 7FFFFF 
> MAP -A 
UD OOOOOO-FFFFFF

PRW

UP OOOOOO-FFFFFF

PRW

SD 000000-70FFFF
SD 710000-7FFFFF
SD 800000-FFFFFF

PRW
URW
PRW

SP OOOOOO-FFFFFF

PRW

7L-10

68000 Emulator Specifics Users

Parameters, Commands, Displays

---------------------------------------------------------------------~~~----

MEMSP---Defines Default Memory Space
The 68000 emulator's default MEMSP settings are as follows:
) MEMSP  OS 
PC=00132C
OO=OOOOOOOF
04=00BC48FF
AO=OOFOOOOO
A4=00000004

01=0001FFOO
05=00000000
A1=00000000
A5=00000008

02=00000000 03=00000000
06=00000000 07=00000000
A2=00000000 A3=00001000
A6=00000000 SSP=000C1000 USP=00100000

T.S . . III ••• x NZVC
SR=850A ---> 1.0 •• 101 ••• 0 1010
After RESET, the display changes. Assume for this example that the contents
of SP:OOOOOO is 000000, and that the contents of SP:000004 is 020000.
The
arrows show the altered registers and bits:
> RESET 
-> OS 

v

-----------

PC=020000
OO=OOOOOOOF
04=00BC48FF
AO=OOFOOOOO
A4=00000004

01=0001FFOO
05=00000000
A1=00000000
A5=00000008

02=00000000 03=00000000
06=00000000 07=00000000
A2=00000000 A3=00001000
A6=00000000 SSP=OOOOOOOO USP=00100000

T .S •• III ••. X NZVC
SR=270A ---> 0.1 . . 111 ... 0 1010

==

7L-12

---------------

68000 Emulator Specifics Users

Parameters, Commands, Displays

S---Assigns Value to Register or Symbol
The S (Set) command changes the values of the 68000's registers.
The
symbols allowed and the registers they represent are shown in Table 1L-2.

Table 1L-2
Register Symbols Accepted by S Command

------------+-----------------------------------------Symbol
I Register
============+==========================================
I the eight 32-bit data registers

DO--D1

------------+-----------------------------------------AO--A6
I the seven 32-bit address registers
------------+-----------------------------------------SR (*a)
the 16-bit Status Register
T
S
I
CCR

the
the
the
the

Trace bit of the SR
Supervisor bit of the SR
three Interrupt level bits of the SR
5-bit Condition Code part of the SR

------------+-----------------------------------------X
the eXtend bit of the CCR
N
Z
V
C

the
the
the
the

Negative bit of the CCR
Zero bit of the CCR
oVerflow bit of the CCR
Carry bit of the CCR

------------+-----------------------------------------*a---The emulator does not check whether you have specified
values for the unused bits in the Status Register.
SEA---Searches Memory for Value or String
Try to limit your value and string searches to the smallest portion of
memory necessary.
The hiaddr parameter of the SEA command defaults to the
end of memory. Therefore, it is strongly recommended that you specify the
hiaddr parameter of the SEA command.
Otherwise, you may experience
extremely lengthy search times, due to the 68000's large memory capability.

1L-13

Parameters, Commands, Displays

68000 Emulator Specifics Users

SEL---Selects the Emulator
The following command selects the 68000 emulator:
> SEL 68000 
The system responds with the software version number and version date.
emulator hardware need not be in the system when you SELect it.

The

NOTE
The 68000 emulator cannot be selected while you are programming
PROM.

a

TRA---Controls Display of Executed Instructions
The TRA command sets the conditions for displaying trace lines during
program execution.
Memory space designators may be used when defining the
loaddr parameter. However, they may not be used in hiaddr. If a memory
space is not designated, the default is to all memory spaces. Here is a
sample 68000 TRA display:
> SYMD -SL ON 
> TRA ALL 
> G MAIN 
MAIN
UP:001000 227C MOVE.L HFOOOOOH,A1
PC=001006
DO=OOOOOOOF
D1=0000FFFF
D2=00000000
D4=00000000
D5=00000000
D6=00000000
A1=00FOOOOO
A2=00000000
AO=00000505
A5=00000000
A4=00000000
A6=00000000
SSP=OOOOOOOO USP=OOOOOOOO SR=OOOO
PROG+000006
UP:001006 207C MOVE.L H500H,AO
PC=00100C
DO=OOOOOOOF
D1=0000FFFF
D2=00000000
D4=00000000
D5=00000000
D6=00000000
A1=00FOOOOO
AO=00000500
A2=00000000
A5=00000000
A4=00000000
A6=00000000
SSP=OOOOOOOO USP=OOOOOOOO SR=OOOO
PROG+OOOOOC
UP:00100C 323C MOVE.W H4H,D1
PC=001010
DO=OOOOOOOF
D1=00000004
D4=00000000
D5=00000000
A1=00FOOOOO
AO=00000500
A5=00000000
A4=00000000
SSP=OOOOOOOO USP=OOOOOOOO

7L-14

D2=00000000
D6=OOOOOOOO
A2=00000000
A6=00000000
SR=OOOO

D3=00000000
D7=00000000
A3=00000000

D3=00000000
D7=00000000
A3=00000000

D3=00000000
D7=00000000
A3=00000000

68000 Emulator Specifics Users

Parameters,

PROG+000010
UP:001010 4280 CLR.L
DO
PC=001012
DO=OOOOOOOO
D1=00000004
D4=00000000
D5=00000000
A1=00FOOOOO
AO=00000500
A5=00000000
A4=00000000
SSP=OOOOOOOO USP=OOOOOOOO

D2=00000000
D6=00000000
A2=00000000
A6=00000000
SR=0004

PROG+000012
(AO)+,DO
UP:001012 D018 ADD.B
PC=001014
DO=00000001
D1=00000004
D2=00000000
D4=00000000
D5=00000000
D6=00000000
A1=00FOOOOO
AO=00000501
A2=00000000
A4=00000000
A5=00000000
A6=00000000
SSP=OOOOOOOO USP=OOOOOOOO SR=OOOO
(BREAK
TRACE,ESC)

~ommanQs,

Ul~piay~

D3=00000000
D7=00000000
A3=00000000

D3=00000000
D7=00000000
A3=00000000

The lines below each assembly language instruction show the program counter,
the data and address registers, the stack pointers and the status register.
The line above the instruction shows the program label or "section +
offset."
Notes and Exceptions. When any TRA
executes at much less than normal
that are not traced. If execution
through part of a program, you can

selections are in effect, your program
speed, even in those parts of the program
speed is important, but you want to step
use the following TTA command:

) EVE 1 A=loaddr hiaddr -C (CR)
This makes the 68000 emulator pause and print the register contents after
executing each instruction in the specified range. Instructions outside the
range will be executed at full speed if TRA is OFF.
When TRA ALL is set and execution of the user program comes within 10 bytes
of a non-allocated or NOMEMed section of memory, instruction disassembly is
no longer performed. This occurs because the disassembler tries to read
enough words to disassemble the longest possible instruction. Instruction
execution proceeds normally and breaks if the memory boundary is reached.
The emulator does not use the 68000 status register trace bit (T).
has full use of this bit.

The user

If your program contains only absolute sections, the trace display will not
show the "section + offset" line, even if SYMD -SL is ON. However,. labels
are still displayed.
WRT---Writes to Emulator I/O Port
The WRT command allows you to write to a memory location as an I/O port. It
has the same function as the P command, except that WRT always writes to
prototype memory, and does not do a read-back check. A word write to an odd
boundary causes an error.

@

7L-15

Parameters, Commands, Displays

68000 Emulator Specifics Users

REAL-TIME PROTOTYPE ANALYZER
You may not use the Real-Time Prototype Analyzer (RPTA) with the 68000
emulator.
An error message is issued if you attempt to use the RTPA while
you are using the 68000 emulator.
TRIGGER TRACE ANALYZER (TTA) COMMANDS AND PARAMETERS
The Trigger Trace Analyzer provides real-time tracing and
for the 68000 emulator running at up to 8MHz.

break

conditions

Memory space designators are allowed as part of the address expression, but
are ignored in the actual programming of the TTA. To reference a particular
memory space, you must use the BUS command.
!malyzer Users Manual describes the TTA and its commands.

1'.h~"Tr.igger_TraGe

EVE and BUS Command Parameters
Table 7L-3 shows the bus signal symbols which may be used as parameters for
the BUS command, and for the B parameter of the EVE command. The DISP
command also uses these symbol in its display.

Table 7L-3
EVE/BUS Signal Symbols

------------+-------------------------------------------Symbol
: Description
============+============================================

UP
UD
SP
SD

(*a)
(*a)
(*a)
(*a)

I

User Program
User Data
Supervisor Program
Supervisor Data

U (*a)
S (*a)
P (*a)
D (*a)

any
any
any
any

operation occurring in User mode
operation occurring in Supervisor mode
operation occurring in Program memory
Data operation

INTA
IPLO - IPL7

INTerrupt Acknowledge
Interrupt Levels

BY
WD

BYte operation
WorD operation

RD
WT

ReaD operation
WriTe operation

VPA
BERR
HLT

Valid Peripheral Address
Bus ERRor
Halt

------------+-------------------------------------------(*a)---The DISP command displays these symbols as part of
the address field instead of the bus signal field.

7L-16

Parameters, Commands, Displays

68000 Emulator Specifics Users
CONS---Set Consecutive Events
The EMU and FET parameters are not supported.
DISP---Display Contents of Acquisition Memory

The DISP command displays the contents of the TTA Acquisition Memory.
This
memory acquires a record of bus activity that occurred while your program
was running.
Because the 68000 has a prefetch pipeline, and no fetch signal as discussed
under "Special Considerations", the DISP command attempts to disassemble
every word as an instruction, unless it is obviously not code. This ensures
that every word that really is an instruction is disassembled. However, it
also generates superfluous disassembly lines, which should be ignored.
The DISP command also displays the signal symbols shown in Table 7L-3 as
part of its ADDRESS and BUS fields. When an INTA (interrupt acknowledge)
cycle occurs, the notation **: will be displayed in place of an memory space
designator, since the function code lines (FCx) do not show a valid memory
space.
Figure 7L-3 shows a sample display of the following program lines
program was run with TRA OFF:
CLR.L
MOVE.W
MOVE.L

when

the

DO
1I1H,D1
1I1000H,AO

> DISP 
ADDRESS

DATA

7-PROBE-0

BUS

PROG+OOOOOO
SP:003000 4280

CLR.L

DO

0000 0000

WD IPLO RD

PROG+000002
SP:003002 323C

MOVE.W

1I1H,D1

0000 0000

WD IPLO RD

PROG+000004
SP:003004 0001

OR.B-

117CH,D1

0000 0000

WD IPLO RD

PROG+000006
SP:003006 207C

MOVE.L

1I1000H,AO

0000 0000

WD IPLO RD

PROG+000008
SP:003008 0000

OR.B

IIOH, DO

0000 0000

WD IPLO RD

00,00

0000 0000

WD IPLO RD

c,··-----"

PROG+OOOOOA
SP:00300A 1000

.~gYE.B

Fig.

7L-3.

Sample DISP di splay.

Note that the third, fifth, and sixth lines are superfluous. They
result from disassembly on the oper~nds of the other instructions.

7L-17

Parameters, Commands, Displays

68000 Emulator Specifics Users

TS---Display Status of TTA Triggers
In a TS display, the "bus" signals may not be identical to the parameters
you enter with a BUS command or the B parameter of the EVE command.
However, the signals displayed are functionally equivalent to the parameters
you specified.
The format of the display is as described in the 8500
Trigger Trace Analyzer Users Manual.
When an INTA (interrupt acknowledge) cycle occurs, the notation **: will be
displayed in place of a memory space designator, since the function code
lines (FCx) do not show a valid memory space.
Supervisor mode (S) will be
is shown.

7L-18

indi~ated

any time interrupt acknowledge

(INTA)

68000 Emulator Specifics Users

68000 Service

~allS

-------------------~------------------------------------------------~~~~~~--

SERVICE CALLS

Service calls (SVCs) allow your program to use many system capabilities of
your 8540, 8550, or 8560. The 68000 emulator supports service calls in all
three modes.
An SVC is invoked with any byte instruction which writes to the address
range specified by the SVC command. The operand of the instruction directs
the system to a specified memory address called the SRB pointer.
(The
pointer points to the SRB, the Service Request Block.) The SRB pointer
tells the system where to find the data (stored in the SRB) that informs the
system which service to perform. The SRB pointer and the SRB may be located
in any of the four memory spaces.
Table 7L-4 shows the default addresses for the eight SRB pointers. You can
use the SVC command to alter these addresses and their associated port
values to suit your program requirements.
The memory space of the SRB vector can be specified with a memory space
designator in the address parameter of the SVC command. The default memory
space is the value of MEMSP S. If you do not use the SVC command to specify
the SRB vector, the vector defaults to supervisor data space (SO).
Refer to the Command Dictionary of your System Users Manual for
use of the SVC command.

syntax

and

SVC Address Range
The 68000 uses memory-mapped 1/0. In order for a byte-write instruction to
invoke a Service Call, its address operand (the "port") must be in the
proper SVC address range. This range may be anywhere in memory; however, it
is recommended that the range used be above address 400H. The default
address range is FOOOOO--F00007. You can change this range with the SVC
command.
Mul tiple memory spaces are allowed for the "port" parameter in the SVC
command.
If memory space designators are omitted, the value of MEMSP M at
the time the SVC command is executed is used. In the SVC command, the least
significant digit of the "port" range will be set to 0 (i.e., OFFF7 will be
rounded to OFFFO).
Example. The following co·mmand changes the SVC address range to 1000--1007
and causes the SRB vector to start at location FOO in Supervisor Data space.
) SVC"SD:FOO 1000 .
;LAS pointer to 'CONI' + .
;End of SRB1.

BYTE
BYTE
BLOCK
BLOCK
BLOCK
WORD
LONG

10H
01H
01H
01H
02H
04H
LPT

;SRB2 = Assign 'LPT' to Channel 1.
;Assign
to Channel 1.
;Status reserved here.
; Reserved.
;Reserved.
;Length of 'LPT' + .
;LAS pointer to 'LPT' + .
;End of SRB2.

BYTE
BYTE
BLOCK
BLOCK
BLOCK
WORD
LONG

01H
OOH
01H
01H
02H
100H
BUFFER

;SRB3 = Read ASCII line from CONI (Channel 0).
;Read ASCII
from Channel O.
;Status returned here.
;Reserved.
;Byte count returned here.
;256 bytes in our buffer.
;LAS pointer to our buffer.
;End of SRB3.

BYTE
BYTE
BLOCK
BLOCK
BLOCK
WORD
LONG

02H
01H
01H
01H
02H
100H
BUFFER

;SRB4 = Write ASCII line to LPT (Channel 1).
;Write ASCII
to Channel 1.
;Status returned here.
; Reserved.
;Byte count returned here.
;256 bytes in our buffer.
;LAS pointer to our buffer.
;End of SRB4.

7L-5.

68000 SVC demonstration program listing (part 1 of 2).

68000 Service Calls

68000 Emulator Specifics Users

---------------------------------------------------------------------------SRB5FN

BYTE
BLOCK

1FH
OBH

BUFFER
CONI

BLOCK
ASCII
BYTE
ASCII
BYTE

100H
'CONI'
OOH
'LPT'
OOH

LPT

;SRB5 = Abort (Close all channels and terminate).
;Abort.
;Reserved.
;End of SRB5.
;Our I/O area.
;ASCII of 'CONI'
+ .
;ASCII of 'LPT'
+ .
;End of data definitions.

Beginning of executable code.
ORG
MOVE.B
NOP
NOP
TST.B
BNE
MOVE.B
NOP
NOP
TST.B
BNE
MOVE.B
NOP
NOP
TST.B
BNE
MOVE.B
NOP
NOP
TST.B
BEQ

START

LOOP

ABORT

MOVE.B
NOP
NOP
END

Fig.

7L-5.

1000H
DO,(GEN.L)OF00007H
SRB1ST
ABORT
OO,(GEN.L)OF00006H
SRB2ST
ABORT
OO,(GEN.L)OF00005H
SRB3ST
ABORT
OO,(GEN.L)OF00004H
SRB4ST
LOOP
OO,(GEN.L)OF00003H
START

;Entry point into program.
;Call SVC1 to
assign 'CONI'
to Channel O.
;Check status to see if all went well.
;No? Stop everything.
;Call SVC2 to
assign 'LPT'
to Channel 1.
;Check status to see if all went well.
;No? Stop everything.
;Call SVC3 to read
a line from 'CONI'
into the buffer.
;Check status to see if all went well.
;No? Stop everything.
;Call SVC4 to write
a line to 'LPT'
, from the buffer.
;Check status to see if all went well.
;Yes? Go back to read another line.
;No? Fall through to termination.
;Call SVC5
to do the abort.
;End of the program.

68000 SVC "demonstration program listing (part 2 of 2).

This program shows the use of four service calls.
The program's
algorithm is explained in the Service Calls section of your System
Users Manual. The program accepts a line of ASCII characters from
the system terminal. Then, when it receives a RETURN character,
the program writes the line to the line printer and accepts
another line.
(On the 8550, output to the line printer is
buffered. No text is printed until the 8550's line printer buffer
is full or the program ends.) To terminate the program, enter a
CTRL-Z while the program is waiting for input.

7L-23

68000 Service Calls

68000 Emulator Specifics Users

Figure 7L-6 shows another way to code the executable portion of the program.
By inserting the statement MOVE.L HOFOOOOO,A1 at the beginning of the code,
and the block of EQU statements at the end, you can save object code space
and reference the SVCs symbolically.

Beginning of executable code.
START

LOOP

ORG
1000H
MOVE. L HOFOOOOO,A1
MOVE.B
NOP
NOP
TST.B
BNE
MOVE.B
NOP
NOP
TST.B
BNE
MOVE.B
NOP
NOP
TST.B
BNE
MOVE.B
NOP
NOP
TST.B
BEQ

DO,SVC1(A1)
SRB1ST
ABORT
DO,SVC2(A1)
SRB2ST
ABORT
DO,SVC3(A1)
SRB3ST
ABORT
DO,SVC4(A1)
SRB4ST
LOOP

ABORT

MOVE. B DO ,SVC5 (A 1 )
NOP
NOP

SVC1
SVC2
SVC3
SVC4
SVC5

EQU
EQU
EQU
EQU
EQU

7
6
5
4
3

END

START

;Entry point into program.
;Set a register to the SVC
trigger location.
;Call SVC1 to
assign 'CONI'
to Channel O.
;Check status to see if all went well.
;No? Stop everything.
;Call SVC2 to
assign 'LPT'
to Channel 1.
;Check status to see if all went well.
;No? Stop everything.
;Call SVC3 to read
a line from 'CONI'
into the buffer.
;Check status to see if all went well.
;No? Stop everything.
;Call SVC4 to write
a line to 'LPT'
from the buffer.
;Check status to see if all went well.
;Yes? Go back to read another line.
;No? Fall through to termination.
;Call SVC5
to do the abort.
;Define SVC symbols.

Fig.

7L-24

7L-6.

;End of the program.

Alternate executable code for SVC demonstration program.

@

68000 Special Considerations

68000 Emulator Specifics Users
SPECIAL CONSIDERATIONS

Some of the characteristics of the 68000 microprocessor greatly affect the
behavior and appearance of several commands; in particular, BK, TRA, and
DISP. These characteristics are discussed in the following paragraphs, and
in much greater detail in the reprints at the back of this section.
Fetching and the Prefetch Pipeline
The 68000 microprocessor has a prefetch pipeline which speeds up the
instruction fetch-decode-execute process. The processor does not, however,
These two factors combine to cause
have a fetch signal available.
differences in many of the emulator's displays.
Figure 7L-7 shows a simplified diagram of the pipeline.

Instruction
Register

---------+--------v
: Address
Instruction

:

+--------->:
I

I

I

I

:<---------+

Decode

Micro and Nano
Control Stores

Branch
Select

--+--+-----------------ALU
Function
& Register
Selection
v

----+-+----------------Timing & Switch
Control Signals

Conditionals
\ /

v

v

--------------------+------------------------------------Execution Unit

Fig.

7L-7.

68000 instruction pipeline block diagram.

The pipeline consists of an Instruction Register, an Instruction Decoder,
and an Execution Unit.
The Instruction Register holds the most recently
fetched instruction word. The Instruction Decoder, using the Micro and Nano
Control Stores, decodes the instruction. When the instruction reaches the
Execution Unit, it is executed.

7L-25

68000 Special Considerations

68000 Emulator Specifics Users

It is the responsibility of the instruction that is executing to ensure
things before it finishes its execution:

two

1.

that the next instruction word is accessed with sufficient time
for complete decoding by the end of the current instruction;
and

2.

that the instruction word following the next instruction is
fetched by the end of the current instruction

Since there is no instruction fetch signal, the only time the emulator knows
that an instruction has been fetched into the instruction pipeline is when
it sees the appropriate values on the bus.
The emulator doesn't know
whether the instruction is actually executing from this information.
Interrupts
The 68000 has seven interrupt levels.
Higher-numbered interrupts have
higher priority. The level 7 interrupt is a non-maskable interrupt (NMI).
Interrupts are controlled by the three interrupt mask bits (12--10)
Status Register.

in

the

When an interrupt request is made, the 68000 compares the level of the
interrupt with the interrupt mask. If the new interrupt has a level higher
than the mask setting, the interrupt is recognized. When this occurs, the
68000 has to stack its Program Counter and Status Register so that it can
return to the interrupted task after the interrupt has been processed.
This stacking is done in the following time sequence: First, PC(L) is
stacked, then the interrupt is acknowledged. Next, the status register is
stacked, and last, PC(H). Because PC(L) is stacked before the emulator
knows that an interrupt has occurred, this Supervisor Data write always
appears on a DISP display of your program run.

7L-26

68000 Emulator Specifics Users
Program example. The program example in Fig. 7L-8 is used to illustrate the
effects of the 68000 characteristics previously described.
The program was loaded beginning at address 3000H. After moving values into
three registers, the program enters the LOOP and executes it twice. The two
Naps are then executed, followed by the branch to SELF. Execution of this
instruction would continue indefinitely, but breakpoint 1 was set at SELF
before the program was executed.

SELF
A
B

CLR.L
MOVE.W
MOVE.L
MOVE. L
MOVE.W
MOVE. L
DBF
Nap
Nap
BT
BLOCK
BLOCK

Fig.

7L-8.

LOOP

DO
1I1H,D1
1I1000H,AO
112000H,A1
A,B
(AO)+,(A1)+
D1 ,LOOP
SELF
02H
02H

Program example.

Figures 7L-9 and 7L-10 use the DISP command to show the contents of the TTA
acquisition
memory
for
this program run with TRA OFF and TRA ON,
respectively.
Refer to the following comments while examining these two figures:
Each of the superfluous disassembly lines is crossed out.
These lines
resulted from disassembly of the operand(s) in the preceding instruction.
Boxes are drawn around the operands in the object code field, and arrows
show where they came from in the preceding instruction.
Data reads and data writes from A, B, and the MOVE.L (AO)+,(A1)+ instruction
are interleaved with fetches from the instruction stream.
The effects of prefetching appear in the figures.
Notes in each figure
indicate where the instfuctions start, and which ones were actually
executed.
At the end of both figures, you can see the next PC(L) stacked in SD- space
before the interrupt acknowledge to the break interrupt occurred. In Figure
7L-10, where TRA is ON, the display shows that PC(L) was also stacked each
time an interrupt to print a trace line occurred.
The run with TRA ON terminated two instructions before the run with TRA OFF,
because of the decrease in execution speed with TRA ON. When TRA was OFF,
the two additional instructions reached the Execution Unit before the break
interrupt occurred.
Note that with TRA ON, the instruction on which the
breakpoint was set was not executed.

@

7L-27

68000 Special Considerations

68000 Emulator Specifics Users

> DISP
DATA

ADDRESS

7-PROBE-0

BUS

DEHO+OOOOOO
SP:003000 4280

CLR.L

DO

0000 0000

WD IPLO RD -

instruction
starts

DEMO+000002
SP:003002 323C

MOVE.W

H1H,D1

0000 0000

WD IPLO RD-

instruction
starts

0000 0000

WD IPLO RD

~

DEMO+000004
SP:003004 ~R-;-D-IJ'j'GH,D1

prefetch of operand. not an instruction
one prefetch because this is a 2-word instruction

DEMO+000006
SP:003006 207C

HOVE. L

0000 0000

WD IPLO RD -

0000 0000

WD IPLO RD

:-OJ'~~~~!C~~-!~~~~~~truction
0000 0000

WD IPLO RD

IJ1000H,AO

DEHO+000008_ _
SP: 003008 0000 +tH-~-""""itH¥O*II""""+TDA-O}
DEMO+OOOOO
SP: 00300A

-

prefetch of operand

1000

HOVE. B

DO, DO

DEMO+OOOOOC
SP:00300C 227C

MOVE.L

IJ2000H,A1

DEMO+OOOOOE
SP:00300E 0000
-

instruction
starts

0000 0000

WD IPLO RD- instruction

0000 0000

\rIO IPLO RD

0000 0000

WD IPLO RD

starts

prefetch of operand

DENO+00001
SP:003010 2000

MOVg.L

DO,DO

LOOP

Beginning of LOOP execution

0000 0000

iVD IPLO RD -

0000 0000

WD IPLO RD

0000 0000

~JD

0000 0000

WD IPLO RD

0000 0000

WD IPLO RD- instruction

0000 0000

WD IPLO WI

instruction
starts

IPLO RD

absolute
destination

A

SP:003024

0000 }

DEHO+000018
SP:003018 22D8
B

SD:003026

data read of operand

MOVE.L

OOOO}

(AO)+,(A1)+

data write - - - -

DEHO+00001A
D1,3012H
SP:00301A 51 cg DBF
SD:001000
}
SD:001002 21772
B73 data resulting
1772
from MOVE.L
SD:002000
{
SD:002002 2B73

starts

IPLO
IPLO
IPLO
IPLO
IPLO

RD RD
RD

0000
0000
0000
0000
0000

0000
0000
0000
0000
0000

WD
WD
WD
WD
WD

oooe

0000

WD IPLO RD

Instruction
starts

WI

\H

3970-1

Fig.

7L-28

7L-9.

Example program run with TRA OFF (part '-of 2).

@

68000 Emulator Specifics Users

ADDRESS

DATA

LOOP
SP:003012

31FA

68000 Special Considerations

7-PROBE-0

BUS

MOVE.W

3024H,3026H

0000 0000

instruction
WD IPLO RD"""- starts

DEMO+000014
SP:003014 0010

OR.D

112GIl, (AO)

0000 0000

WD IPLO RD

DEMO+000016
SP:003016 3026

~10VE

(AG),DO

0000 0000

WD IPLO RD

0000 0000

WD IPLO RD

A
SP:003024

0000

DHlO+0000 18
SP:003018 22D8
B
SD:003026

MOVE.L

(AO)+,(A1)+

0000

DEMO+00001A
SP:00301A 51Cg
SD:001004 2B70
SD:001006 2B71
SD:002004 2B70
SD:002006 2B71

DBF

DEMO+00001C
SP:00301C FFF6
LOOP
SP:003012

.',.

D1,30 12H

~

31 FA -

DEMO+00001E
SP:00301E 4E71

prefetch of LOOP.
not executed. or
disassembled; flushed
NOP

DEMO+000020
SP:003020 4E71

J.

NOP--thisNOPcauses
this prefetch
SELF breakpoint was set here (BK 1 SELF)
SP:003022 60FE BT
3022H
A
SP: 003024
SELF
SP:003022
A

SP:003024
SD:FFFFFE

WD IPLO RD ......- instruction
0000 0000
starts
repeat of LOOP. as above
0000 0000

WD IPLO WT

0000
0000
0000
0000
0000

WD
WD
WD
WD
WD

0000
0000
0000
0000
0000

IPLO
IPLO
IPLO
IPLO
IPLO

RD RD
RD
WT
WT

0000 0000

WD IPLO RD

0000 0000

WD IPLO RD

0000 0000

WD IPLO RD

0000 0000

WD IPLO' RD

instruction
starts

7

0000 0000

this fetch triggers this interrupt
bot bythe
 DISP
ADDRESS

DATA

7-PROBE-0

BUS

0000 0000

WD IPLO RD- executed

0000 0000

WD IPL7 RD

0000 0000
0000 0000

WD IPL7 RD
WD VPA IPL7 WT

0000 0000

WD IPLO RD- executed

0000 0000

WD IPL7 RD

0000 0000

WD IPL7 RD

0000 0000
0000 0000

WD IPL7 RD
WD VPA IPL7 WT

0000 0000

WD IPLO RD-- executed

0000 0000

WD IPL7 RD

0000 0000

WD IPL7 RD

0000 0000

WD IPL7 RD

0000 0000
0000 0000

WD IPL7 RD
WD VPA IPL7 WT

82000H,A1

0000 0000

WD IPLO RD- executed

(lOII,DO

0000 0000

WD IPL7 RD

90, 90

0000 0000

WD IPL7 RD

0000 0000

WD IPL7 RD

0000 0000
0000 0000

WD IPL7 RD
WD VPA IPL7 WT

DEMO+OOOOOO
SP:003000 4280

CLR.L

DO

DEMO+000002
SP:003002 323C

MOVE.W

81H'D1}

DEMO+000004
operand
SP:003004 0001
SD: FFFFFE 3002 - - stack
of.PC(next) caused
by TRA Interrupt

DEMO+OOOOO~ .,,,,,;on ...um..

SP:003002

323C

MOVE.W

not executed

81H,D1

DEMO+000004
SP:003004 0001
DEMO+000006
SP: 003006 207C}
flushed by interrupt

DEMO+000008
SP:003008 0000
SD: FFFFFE 3006 -- stack PC (next)

DEMO+OOOOO~ ....

SP:003006

207C

utlon ...

u~.

MOVE.L

81000H,AO

DEMO+000008 __~
SP: 00 3a08 00 aa -+HT~--llTH+--A-HDEMO+OOOOO
SP:00300A 1000

- - prefetch of operand

HOYE.B

DO,DO

DEMO+OOOOOC
SP:00300C 227C}
DEMO+OOOOOE
SP:00300E 0000
SD: FFFFFE 300C -

DEMO+OOOO~
227C

SP:00300C

flushed by interrupt

stack of PC(next)

MOVE.L

DEMO+OOOOOE
SP:00300E
DEMO+000010
SP:003010
LOOP
SP: 0030 12

t10'lE. L

31FA}
flushed by interrupt

DEMO+000014
SP:003014 0010
SD: FFFFFE 30 12-- stack PC (next)

3970-3

Fig.

7L-30

7L-10.

Example program run with TRA ON (part 1 of 4).

68000 Emulator Specifics Users

,

ADDRESS

DATA

LOOP
SP:003012

31FA

68000 Special Considerations

7-PROBE-0

BUS

Beginning of LOOP execution

0000 0000

WD IPLO RD-- executed

DEMO+000014
._
SP : 0030 14 00 10 -HI+..,.....H----ii-()2~6"r+-1+-:-1,+(*AI+O)~

0000 0000

WD IPL7 RD

DHI 0+ 0 0 0 0 1 6.-----.,--_
SP: 003016 3026 ~H.{40~VEj.:..,.,..v.',/I---+-J(t1Wo.6'14)...,..,~ElI+O

0000 0000

WD IPL7 RD

0000 0000

WD.IPL7 RD

0000 0000

WD IPL7 RD

0000 0000

WD IPL7 WT

DEMO+00001A
SP:00301A 5 1C9- - flushed
SD:FFFFFE 3018- stack PC (next)

0000 0000
0000 0000

WD IPL7 RD
WD VPA IPL7 WT

DEMO+000018
SP:003018 22D8

0000 0000

WD IPLO RD -

A

SP:003024

0000 }

DEMO+000018
SP:003018 22D8

MOVE.W

3024H,3026H

data from
(read)

MOVE.L

(AO)+,(A1)+

interleaved prefetch. flushed

B

SD:003026

0000 }

data from
(write)

MOVE.L

(AO)+,(A1)+

executed

DEMO+00001A
SP:00301A 51C9 DBF
D1,3012H
SD:001000 1772}
\
SD: 00 1002 2B73 transfer
data
SD:002000 1772 from
inter.leaVed
SD:002002 2B73 -EMT--¥ ~prefetChes

0000
0000
0000
0000
0000

DEMO+00001C
SP:00301C IFFF6/
SD :FFFFFE 301 A-sta~ PC(next)

0000 0000
0000 0000

WD IPL7 RD
WD VPA IPL7 WT

0000 0000

WD IPLO RD __ executed

0000 0000

WD IPL7 RD

0000 0000

WD IPL7 RD

0000 0000
0000 0000

WD IPL7 RD
WD VPA IPL7 WT

0000
0000
0000
0000
0000

WD
WD
WD
WD
WD

IPL7
IPL7
IPL7
IPL7
IPL7

RD
RD
RD
WT
WT

DEMO+OOOO l' /

SP:00301A~1C9

DBF

____
FFF6 -EMT-F-

DEMO+00001C~

SP:00301C

LOOP
SP:003012 31FA}
DEMO+OOOO 14
SP:003014 0010
SD: FFFFFE 30 12 -

prefetch. not executed

stack PC(next)

3970-4

Fig.

7L-10.

Example program run 'with TRA ON (part 2 of 4).

7L-31

68000 Special Considerations

ADDRESS

DATA

LOOP
SP:003012

31FA

68000 Emulator Specifics Users

7-PROBE-0

BUS

MOVE.W

3024H,3026H

0000 0000

WD IPLO RD -

DEMO+000014
SP:003014 0010

OR.B

{J2611, (AO)

0000 0000

WD IPL7 RD

DEMO+OOO016
SP:003016 3026

tlOVE .',;

(:'6),DO

0000 0000

WD IPL7 RD

0000 0000

WD IPL7 RD

0000 0000

WD IPL7 RD

0000

0000 0000

WD IPL7 WT

DEMO+00001A
SP:00301A 51C9
SD:FFFFFE 3018

0000 0000
0000 0000

WD IPL7 RD
WD VPA IPL7 WT

A
SP:003024

0000

DEMO+000018
SP:003018 22D8
B
SD:003026

MOVE.L

(AO)+, (A 1)+

repeat of LOOP

DEMO+000018
SP:003018 22D8
DEMO+00001A
SP:00301A 51C9
SD:001004 2B70
SD:001006 2B71
SD:002004 2B70
SD:002006 2B71

MOVE.L

(AO)+,(A1)+

0000 0000

WD IPLO RD- executed

DBF

D1,3012H

0000
0000
0000'
0000
0000

WD
WD
WD
WD
WD

DEMO+00001C
SP:00301C FFF6 -eff---FSD:FFFFFE 301A
DEMO+00001A
SP:00301A 51C9

DBF

DEMO+00001C
SP:00301C FFF6

EHT F

LOOP
SP:003012

executed

D1,3012H

} prefetch of target of
branch OBF. flushed
because branch not taken

31 FA

0000
0000
0000
0000
0000

IPL7
IPL7
IPL7
IPL7
IPL7

RD
RD
RD
WT
WT

0000 0000
0000 0000

WD IPL7 RD
WD VPA IPL7 WT

0000 0000

WD IPLO RD- executed

0000 0000

WD IPL7 RD

0000 0000

WD IPL7 RD

3970-5

Fig.

7L-32

7L-10.

Example program run with TRA ON (part 3 of 4).

@

68000 Special Considerations

68000 Emulator Specifics Users

ADDRESS

DATA

7-PROBE-0

BUS

0000 0000

WD IPL7 RD

DEMO+000020
SP:003020 4E71 NOP
SD:FFFFFE 301E- stackPC(next)

0000 0000
0000 0000

WD IPL7 RD
WD VPA IPL7 WT

DEMO+00001E /
SP: 0030 1E ~E71

NOP

this one executed

0000 0000

WD IPLO RD- executed

DEMO+000020
SP: 003020 4E71

NOP

prefetch

0000 0000

WD IPL7 RD

DEMO+00001E
SP:00301E 4E71

SELF
SP:003022
SD:FFFFFE

NOP}

prefetch of next
two words,
not executed

60FE BT
3022H prefetch of
0000 0000
of
branch. This
0000 0000
3020 - stack
PC(next) which
triggers breakpoint set
would have been
taken if break
had not occurred.

WD IPL7 RD
WD VPA IPL7 WT

at SELF, so execution
is not resumed after
the trace is finished.

3970-6

Fig.

7L-10.

Example program run with TRA ON (part 4 of 4).

Memory Spaces
The 68000 supports four memory spaces: User Data (UD), User Program (UP),
Supervisor Data (SD) and Supervisor Program (SP). You may partition memory,
using the MAP command, so that certain address blocks are accessed only for
a particular type of reference.
The default is for all of memory to be
acc~ssible by all four types of memory spaces.
The processor determines the type of reference by examining the three
Function Code pins (FC2--FCO). The reference made based on the encoding of
these three pins is shown in Table 7L-6.
Table 7L-6
Classification of Memory Space References

---------------+-----------------------

Function 'Code
FC2 FC' FCO

Type of Reference

---------------------------------------

,, 0,
0
0
,
0
, , 0,

0
0
0
0

1
1
1

0
0

0

1

1

(Reserved)
User Data
User Program
(Reserved)
(Reserved)
Supervisor Data
Supervisor Program
Interrupt Acknowledge

---------------+-----------------------

7L-33

68000 Special Considerations

68000 Emulator Specifics Users

Memory Space Partitioning
The 68000 emulator supports memory space partitioning. You must have the
Memory Allocation Controller (MAC) option installed in your system in order
to use memory partitioning in program memory. If your prototype supports
memory partitioning, you do not need the MAC option to access memory
partitions.
This discussion includes an example program that shows the kind of
statements you need to include in your program to use partitioned memory
spaces. The example program shows you how to define the 68000 interrupt
vectors and interrupt handlers, how to start a User program, and how to
return to the Supervisor from the User's routine.
After the program has been linked and loaded as described in
it uses the four memory spaces:

7L-34

this

example,

•

Supervisor Program (SP) space contains the reset vector and
interrupt handlers, starts the User job, and exits when the User
job is finished.

•

Supervisor Data (SD) space contains the interrupt vectors, the SHB
used by the exit SVC in the Supervisor Program, and the Supervisor
stack.

•

User Program (UP) space contains a program that opens
writes to it, and returns to Supervisor control.

•

User Data (UD) space contain the SHBs and other data used by
SVCs in the User Program. It also contains the User stack.

•

The example program ends with the SVC trigger defitiitions which are
available to all memory spaces (non-partitioned).

a

channel,
the

68000 Emulator SpeCifics Users

----------------------------.-------------.-..

. 68000 Special Considerations
-------- ---~-~-----------~----

The Example Program. A listing of the example program source, called
MEMPAR.SRC, is shown in Figure 7L-11. There are many 6ther" ways to cod~
routines that perform these tasks;. but this example will help you understand
what must be included. Comments within the code explain what the program is
doing.

;-------------------------------------------------------------------------This example program shows the use of memory partitioning.

;-------------------------------------------------------------------------LIST
GEN.L

DBG

;Pass symbols to. the linker
;Default to long addresses

------Define the vectors. The locations of the reset apd interrupt
vectors in memory are shown in Table 7L-7.
-----Define the reset vector.
(The reset vector is in Supervisor Program space.)
SECTION RESET.VEC
ADDRESS STACK
ADDRESS START

;Initial SSP
;Initial PC

------Define the interrupt vectors.
(The rest of the vector table is in Supervisor Data space.)
SECTION INTERRUPT.VEC
V.BUS.ERR
V.ADDRESS.ERR
V.ILLEGAL.INS
V.ZDIVIDE
V.CHK.INS
V.TRAPV.INS
V.PRIVILEGE
V.TRACE.BIT
V.EMT.A
V.EMT.F

V.TRAP.INS

V.SVC1
V.SVC2
V.SVC3
Fig.

ORG
ADDRESS
ADDRESS
ADDRESS
ADDRESS
ADDRESS
ADDRESS
ADDRESS
ADDRESS
ADDRESS
ADDRESS

08H
BUS.ERR
ADDRESS. ERR
ILLEGAL. INS
ZDIVIDE
CHK.INS
TRAPV.INS
PRIVILEGE
TRACE. BIT
EMT.A
EMT.F

;This is where the Bus Error vector
starts.

BLOCK

50H

BLOCK

04H

;Reserve space for vectors between
V.EMT.F and V.TRAP.INS.
;Trap 0 set by Supervisor Program.

BLOCK

3CH

;Reserve space for other vectors.

ADDRESS OPEN.SRB
ADDRESS PRINT.SRB
ADDRESS EXIT.SRB
7L-11.

;Define the SRB vectors.

Memory partitioning eiample program (part 1 of 5).

7L-35

68000 Emulator Specifics Users

68000 Special Considerations

~~~~~~-~-~~~---~~---------~--~-~-~--~--~-----~------~~----~--~----~---------

;~~--~~---~--~~-~~--~--~~---~---~~--------~-~--------------------~---------

following section will be linked to run
in Supervisor Program memory.

~----The

SECTION SUPER.PROG
------Define the interrupt handlers.
BUS.ERR
ADDRESS. ERR
ILLEGAL. INS
ZDIVIDE
CHK.INS
TRAPV.INS
PRIVILEGE
TRACE. BIT
EMT.A
EMT.F

Fig.

7L-36

EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
NOP
RTE
7L-11.

$
$
$
$
$
$
$
$
$
$

;>
;>
;>
;>
;>
;>
;>
;>
;>
;>

Normally,
these statements
would reference
the appropriate
interrupt handlers.
Since this is just
an example of
how they are set up,
we just do the
dummy NOP which follows.
;Dummy routine for this example.

Memory partitioning example program (part 2 of 5).

68000 Special Considerations

68000 Emulator Specifics Users

------Start of executable code.
(Note: SSP and Supervisor mode must have been set by Reset.)
EQU

START

$

------Prepare to start User job.
Since this program will be linked to run in partitioned
memory spaces, the addresses will have eight additional
high-order bits (two hex digits) appended:
UD:
UP:
SD:
SP:

space
space
space
space

starts
starts
starts
starts

at
at
at
at

01000000H
02000000H
04000000H
08000000H

The assembler will be able to strip off these extra bits when
the operand is an address field, but it does not know whether
an immediate value should be 24 or 32 bits. So you must use
the BITS assembler directive to explicitly remove the extra bits.

------ ««
SUSPEND

MOVE.L

HBITS(SUSPEND,O,24),V.TRAP.INS

;Put return address
in TRAP vector,
taking low 24 bits.
;Define User stack.
;Here, the assembler knows it's
looking at an address.

LEA

f/USER.STACK,A 1

MOVE

A1, USP

PEA
MOVE.W
RTE

USER. JOB
fI0700H,-(A7)

;Push User start address on stack.
;Push User SR on stack.
;Start User job.

A TRAP 0 instruction by user causes a return to this point.»»
EQU
MOVE.B
NOP
NOP

$

DO,SVC3

;Invoke the Exit SVC.

------End of Supervisor Program execution.

;----------------------------------------------------------------------------------Supervisor Data memory space definition.
SECTION SUPER. DATA
EXIT.SRB

STACK

EQU
BYTE

$

1AH

;1A is the Exit SVC function code.

ORG
BLOCK
EQU

12
400H

;Start the stack on an even address.
;Reserve supervisor stack space.

$

;---------------------------------------------------------------------------Fig.

7L-11.

Memory partitioning example program (part 3 of 5).
7L-37

68000 Special Considerations

68000 Emulator Specifics Users

------User Program section.
SECTION USER.PROG
USER.JOB

MOVE.B

DO,SVC1

;Invoke SVC1 to open channel.

DO,SVC2

;Invoke SVC2 to write to channel.

110

;Trap back to Supervisor state.

Nap
Nap

MOVE.B
Nap
Nap

TRAP

;--------------------------------------------------------------------------------User Data section.
SECTION USER. DATA
OPEN.SRB

PRINT.SRB

OPEN.STRNG
PRINT.STRNG

USER.STACK

Fig.

7L-38

EQU
BYTE
BYTE
BYTE
BYTE
WORD
WORD
LONG

$

EQU
BYTE
BYTE
BYTE
BYTE
WORD
WORD
LONG

$

ASCII
BYTE
ASCII
BYTE

'CONO'
;ASCII of 'CONO', plus
ODH
a carriage return.
'MEMORY PARTITIONING EXAMPLE'
;ASCII of the printed
ODH
string, plus carriage return.

ORG
BLOCK
EQU

400H

7L~11.

50H
01H
OOH
OOH
OOOOH
OOOOH
OPEN.STRNG
02H
01H
OOH
OOH
OOOOH
80H
PRINT.STRNG

/2

;Open for write to
Channel 1.
;Status.
;Reserved.
;Not used.
;Not used.
;Pointer to 'CONO' string.
;Write ASCII and wait
;
on Channel 1.
;Status.
;Reserved.
;Not used.
;Buffer length.
;Pointer to string.

;Start User stack on an even byte.
;Reserve User stack space.

$

Memory partitioning example program (part 4 of 5).

68000 Emulator Specifics Users

68000 Special Copsideratlons

;---------------------------------------------------------------------------------SVC trigger definitions.
We'll want these to be in all memory spaces (non-partitioned).
SECTION SVCTRIG
SVC8
SVC7
SVC6
SVC5
SVC4
SVC3
SVC2
SVC1

Fig.

BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK
BLOCK

1

END

START

7L-11.

1
1
1
1

1
1

1

Memory partitioning example program (part 5 of 5).

7L-39

68000 Emulator Specifics Users

68000 Special Considerations

The memory location assigned to each exception vector by the 68000 is listed
in Table 7L-7.
Table 7L-7
68000 Exception Vector Assignment
Vector Number I Address (Hex) I Memory Space I Vector Assignment
~----------------------------------------------------- ----------------------­
-----------------------------------------------------------------------------

000

I

I

SP

I Reset: Initial SSP (*a)

+---------------+--------------+------------------------------004
SP
I Reset: Initial PC (*a)
--------------+---------------+--------------+------------------------------2
008
SD
I Bus Error
--------------+---------------+--------------+------------------------------3
OOC
SD
I Address Error
--------------+---------------+--------------+------------------------------4
010
S D : Illegal Instruction
--------------+---------------+--------------+------------------------------5
I
014
SD
I Zero Divide
--------------+---------------+--------------+------------------------------6
018
SD
I CHK Instruction
--------------+---------------+--------------+------------------------------7
01C
SD
I TRAPV Instruction
. --------------+---------------+--------------+------------------------------8
020
S D : Privilege Violation
o

--------------+---------------+--------------+----------~--------------------

9

024

S D : Trace

--------------+---------------+--------------+------------------------------10
028
S D : Line 1010 Emulator
--------------+---------------+--------------+------------------------------11
02C
SD
I Line 1111 Emulator
--------------+---------------+--------------+------------------------------12 (*b)
030
SD
I (Unassigned, Reserved)
--------------+---------------+--------------+------------------------------13 (*b)
034
SD
I (Unassigned, Reserved)
--------------+---------------+--------------+------------------------------14 (*b)
038
S D : (Unassigned, Reserved)
--------------+---------------+--------------+------------------------------15
03C
SD
I Unini tialized Interrupt Vector
--------------+---------------+--------------+------------------------------I
040
I
16--23 (*b) +---------------+
SD
I (Unassigned, Reserved)
05F
--------------+---------------+--------------+------------------------------24
060
SD
I Spurious Interrupt (*c)
--------------+---------------+--------------+-------------------------------

7L-40

@

68000 Emulator Specifics Users

68000 Special Considerations

Table 7L-7 (con't)
Vector Number : Address (Hex) : Memory Space : Vector Assignment

----------------------------------------------------------------------------064

25

SD

: Level 1 Interrupt Autovector

--------------+---------------+--------------+------------------------------26

068

S D : Level 2 Interrupt Autovector

--------------+---------------+--------------+------------------------------27

06C

S D : Level 3 Interrupt Autovector

--------------+---------------+--------------+------------------------------28

070

S D : Level 4 Interrupt Autovector

--------------+---------------+--------------+------------------------------29

074

S D : Level 5 Interrupt Autovector

--------------+---------------+--------------+------------------------------30

078

S D : Level 6 Interrupt Autovector

--------------+---------------+--------------+------------------------------31

07C

S D : Level 7 Interrupt Autovector

--------------+---------------+--------------+------------------------------080

32--47

+---------------+

I

I

SD

: TRAP Instruction Vectors (*d)

OBF

--------------+---------------+--------------+------------------------------:

48--63 (*b)

OCO

+---------------+

I

I

SD

: (Unassigned, Reserved)

OFF

--------------+---------------+--------------+------------------------------100

64--255

+---------------+

1

I

SD

: User Interrupt Vectors

3FF

--------------+---------------+--------------+------------------------------(*a)
(*b)
(*c)
(*d)

The reset vector (0) requires four words, unlike other vectors which
only require two words. It is located in Supervisor Program (SP) space.
Vectors 12, 13, 14, 16--23, and 48--63 are reserved by Motorola for
future enhancements. No user peripheral devices should be assigned
to these numbers.
The spurious interrupt vector is taken when a bus error is indicated
during interrupt processing.
TRAP #n uses vector number 32+n.

7L-41

68000 Special Considerations

68000 Emulator Specifics Users

The remainder of this discussion steps you through the procedure you follow
to assemble, link, allocate memory, load and run the example program.
Assembling and Linking the Program. Assemble
command:

MEMPAR.SRC

with the following

> ASM MEMPAR.OBJ"MEMPAR.SRC 
Assume that you have a linker command file called MEMPAR.LNK which
the following linker command options:

contains

-1 f

-d

-0 MEMPAR.OBJ
MEMPAR.LOA
-m RVEC=08000000-08000007
-m IVEC=04000000-040003FF
-m SVCTRAP=00FOOOOO-00F00007
-m UD=01000000-0100FFFF
-m UP=02000000-0200FFFF
-m SD=04000400-0400FFFF
-m SP=08000008-0800FFFF
-L SEC=RESET.VEC BASE RVEC
-L SEC=INTERRUPT.VEC BASE IVEC
-L SEC=SVCTRIG BASE SVCTRAP
-L SEC=SUPER.CODE BASE SP
-L SEC=SUPER.DATA BASE SD
-L SEC=USER.CODE BASE UP
-L SEC=USER.DATA BASE UD
-0

Link using this command:
> LINK -C MEMPAR.LNK 
The linker options are explained in the following paragraphs:
The -1 f option gives you a full linker listing, and -d puts symbol
information
for symbolic debug in the load module.
MEMPAR.OBJ and
MEMPAR.LOA are the names of the object module from the assembler, and the
load module output by the linker, respectively.
The -m option assigns logical memory names to blocks of program memory.
Here, RVEC is the block in Supervisor Program space for the reset vector;
IVEC is the block in Supervisor Data space for the exception vectors; and
SVCTRAP is the block for the SVC trigger locations. When the program is
loaded, SVCTRAP will be in the default memory space as selected by the
MEMSP S command.
The names UD and UP are assigned to two 64K blocks of memory. The first is
in User Data space and the second in User Program space. SD is the block
starting after the IVEC block in Supervisor Data space. SP starts after the
RVEC block in Supervisor Program space.

7L-42

68000 Emulator Specifics Users
The -L option locates the program sections in the memory blocks just
defined.
Since there is only one section in each memory block, you can use
the BASE parameter. This causes each section to be located at the beginning
of its memory block. If there was more than one section in a memory block,
you would used the RANGE parameter to locate those sections somewhere within
the desired block.
Allocate Memory. You must allocate memory to load and execute the program in
mode O. Enter the following command line:
> AL UD:O 1FFF

AL UP:O 1FFF ; AL SD:O 1FFF ; AL SP:O 1FFF ; AL OFOOOOO (CR>

You can check
parameters:

the

memory

allocations by entering the AL command with no

> AL (CR>
00000000
OOOOOFFF
00000000
OOOOOFFF
00000000
OOOOOFFF
00000000
OOOOOFFF
00001000
00001FFF
00001000
00001FFF
00001000
00001FFF
00001000
00001FFF
OOFOOOOO
OOFOOFFF
9 BLOCK(S) ALLOCATED

UD:
UP:
SD:
SP:
UD:
UP:
SD:
SP:
UD: UP: SD: SP:
23 BLOCK(S) FREE

Each of the four memory spaces has two blocks allocated to it exclusively.
The block used for the SVC trigger locations has been allocated to all four
memory spaces.
Now you can load the program:
> LO MEMPAR.LOA (CR>
The processor must be in Supervisor mode to start running the program.
Use
the RESET command to set Supervisor mode and put the start address in the
reset vector.
> RESET (CR>
Start program execution with the G command:
> G (CR>
MEMORY PARTITIONING EXAMPLE

>
Program execution begins at the label START in the Supervisor Program.
The
Supervisor starts the User job. The User job opens a channel to the system
terminal and prints the string "MEMORY PARTITIONING EXAMPLE." The User then
returns control to the Supervisor, which exits, and control returns to the
operating system.

7L-43

68000 Emulator Specifics Users

68000 Special Considerations
The 68000 STOP Instruction

In Mode O. A break is always generated when a STOP instruction is executed
in mode O.
The  6.4MHz) (*c)

--------------------------+-------------+-------------+-----------------(*a)---Jumper configurations listed are for < 8 MHz operation.
(*b)---Jumper configurations not listed are for future use.
(*c)---One wait state is equivalent to one extra clock cycle per
memory cycle.

7L-50

@

68000 Emulator Specifics Users

~mulator

btlOUU

llIDlng

EMULATOR TIMING
The signals between the prototype and the emulating microprocessor are
buffered.
Therefore, some timing differences exist between the 68000
emulator and a 68000 microprocessor inserted directly into the prototype.
Table 7L-9 lists the emulator/microprocessor timing differences for the
68000. Figures 7L-12 and 7L-13 are timing diagrams that correspond to the
signals listed in Table 7L-9.
Table 7L-9
68000 Emulator/Microprocessor Timing Differences
Processor
Number
1
2
3
4
5
6
6A
7A
7B
8
1
9
10
112
11A2
121
13 2
142.5
14A2
152
16
172
18 1
19
1
20
212
21A2
222
23
25 2
26 2
27 6
28 2
29
30
26
31
32
33
34
7
35
7
36
37
38
39
46
47 66
48
53
55
56

Characteristic
Clock Period
Clock Width Low
Clock Width High
Clock Fall Time
Clock Rise Time
Clock Low to Address
Clock High to FC(H) Valid
Clock High to Address High Impedance (Max.)
Clock High to Data High Impedance (Max.)
Clock High to Address/FC(H) Invalid (Min.)
Clock High to AS(L), DS(L) Low (Max.)
Clock High to AS(L), DS(L) Low (Min.)
Address to AS(L), DS(L) (Read) Low/ AS(L) Write
FC(H) Valid to AS(L), DS(L) (Read) Low/AS(L) Write
Clock Low to AS(L), DS(L) High
AS(L), DS(L) High to Address/FC(H) Invalid
AS(L), DS(L) Width Low (Read)/AS(L) Write
DS(L) Width Low (Write)
AS(L), DS(L) Width High
Clock High to AS(L), DS(L) High Impedance
AS(L), DS(L) High to R(H)/W(L) High
Clock High to R(H)/W(L) High (Max.)
Clock High to R(H)/W(L) High (Min.)
Clock High to R(H)/W(L) Low
Address Valid to R(H)/W(L) Low
FC(H) Valid to R(H)/W(L) Low
R(H)/W(L) Low to DS(L) Low (Write)
Clock Low to Data Out(H) Valid
DS(L) High to Data Out(H) Invalid
Data Out(H) Valid to DS(L) Low (Write)
Data In to Clock Low (Setup Time)
AS(L), DS(L) High to DTACK(L) High
DS(L) High to Data Invalid (Hold Time)
AS(L), DS(L) High to BERR(L) High
DTACK(L) Low to Data In (Setup Time)
HALT(L) and RESET(L) Input Transition Time
Clock High to BG(L) Low
Clock High to BG(H) High
BR(L) Low to BG(L) Low
BR(L) High to BG(L) High
BGACK(L) Low to BG(L) High
BG(L) Low to Bus High Impedance (With AS(L) High)
BG(L) Width High
BGACK(L) Width
Asynchronous Input Setup Time
BERR(L) Low to OT ACK(L) Low 3
Data Hold from Clock High
R(H)/W(L) to Data Bus Impedance Change
HALT(H)/RESET(L) Pulse Width 4

Emulator

Symbol

Min

Max

Min

Max

Unit

'cyc
'CL
'CH
'Cf
'Cr
'CLAV
'CHFCV
'CHAZx
'CHDZx
'CHAZn
'CHSLx
'CHSLn
'AVSL
'FCVSL
'CLSH
'SHAZ
'SL

125
55
55

125
55
55

-

500
250
250
10
10
70
70
80
80

0

-

14

-

60

500
250
250
10
10
92
92
114
130
86

0
30
60

-

-

70

ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
Clk Per
Clk Per
Clk Per
ns
Clk Per
Clk Per
ns
ns
ns
ns
Clk Per

'SH
'CHSZ
'SHRH
'CHRHx
'CHRHn
'CHRL
'AVRL
'FCVRL
'RLSL
'CLDO
'SHOO
'DOSL
'DICL
'SHOAH
'SHDI
'SHBEH
'DALDI
'RHrf
'CHGL
'CHGH
'BRLGL
'BRHGH
'GALGH
'GLZ
'GH
'BGL
'ASI
'BELOAL
'CHOO
'RLOO
'HRPW

-

-

30
240
115
150

-

-

-

-

-

-

14
24
44
20
240
115
150

-

96

-

-

-

80

-

40
0

-

40

-

70

-

96

-

14

-

-

70

-

96

20
60
80

-

14
54

-

80

-

-

70

-

95

30
30
15

-

20
20
17
0
0
0

-

-

0
0
0

120

-

90
200
70
70

0

1.5
15
1.5

15
15
20
50
0
30
10

-

3
3
3
80
-

-

-

-

0
-

1.5
1.5
1.5
1.5
1.5
20
50
0
20
10

93

-

94

-

88
200
93
93
3
3
3
148

-

-

-

1 For a loading capacitance of less than or equal to 50 picofarads. subtract 5 nanoseconds from the values given in these columns.

2 Actual value depends on clock period.
3 If #47 is satisfied for both DTACK(L) and BERR(L). #48 may be 0 ns.

4 After Vcc has been applied for 100 ms.
5 For T6E. BF4. and R9M mask sets #14 and #14A are one clock period less than the given number.
6 If the asynchronous setup time (#47) requirements are satisfied. the DTACK(L)low-to-data setup time (#31) requirement can be ignored. The data must
only satisfy the data-in to clock-low setup time (#27) for the following cycle.
.
7 For the Probe-tip add 20 nanoseconds to the clock periods listed.
8 VPA

=50 nanoseconds for the Probe-tip.

7L-51

68000 Emulator Timing

68000 Emulator Specifics Users

----------------------------------------------------------------------------

ClK

A1-A23

AS(l)

lDS(l)/UDS(l)

R(H)/W(l)

FC9'-FC2

Asynchronous
Inputs
(Note 1)

HAlT(l)/RESET(l)

BERR(l)/BR(l)
(NOTE 2)

DTACK(l)

Data In

12609-14

Fig.

7L-12.

68000 timing diagram, read cycle.

Notes and circled numbers refer to Table 7L-9.
7L-52

68000 Emulator Timing

68000 Emulator Specifics Users

51

52

53

54

55

56

57

50

ClK

A1-A23

A5(l)

lD5(l)/UD5(l)

R(H)/W(l)

Data Out

FCIl-FC2
Asynchronous
Inputs

HAlT(l)/RE5ET(l)

BERR(L)/BR(L)

DTACK(l)

12609-13

Fig.

7L-13.

68000 timing diagram, write cycle.

Circled numbers refer to Table 7L-9.
7L-53

b~OOO

Probe/Prototype Interface

68000 Emulator Specifics Users

PROBE/PROTOTYPE INTERFACE DIAGRAM
Figure 7L-14 is a block diagram of the interface between the
the 68000 Prototype Control Probe.

prototype

and

(12609-2)3970-7

Fig.

7L-14.

68000 Prototype/Control Probe interface.

This figure provides a functional overview of signal buffering
between the prototype and the emulating microprocessor.
A more
detailed circuit description can be found in the 68000 Emulator
Processor and Prototype Control Probe Service Manual.

7L-54

@

68000 Emulator Specifics Users

68000 Software InstallatIon

INSTALLING YOUR 68000 EMULATOR SOFTWARE

8540 SOFTWARE INSTALLATION PROCEDURE
The ROMs that contain the control software for your 68000 emulator must be
installed in your 8540's System ROM Board. Refer to your 8540 Installation
Guide for instructions on how to install these ROMs.
8550 SOFTWARE INSTALLATION PROCEDURE
Your emulator software installation disk contains two types of software:
•

emulator control software, which you install onto your DOS/50
system disk so that DOS/50 can control your emulator hardware;

•

emulator diagnostic software, which you install onto your 8550
system diagnostic disk so that diagnostic tests can be run on your
emulator as well as on other 8550 system hardware.

This subsection describes how to install the control software and diagnostic
software for your 68000 emulator.
To complete these installation procedures you need the following items:
•

an 8550 system (with or without a 68000 emulator)

•

a DOS/50 system disk with a write-enable tab over the write-protect
slot

•

a 68000 emulator software installation disk
tab

•

(for installation of diagnostic software) an 8550 system diagnostic
disk with a write-enable tab over the write-protect slot.

with

no

write-enable

Each installation procedure takes about five minutes.
Start Up and Set the Date
Turn on your 8550 system. (For start-up instructions, refer to the Learning
Guide of your System Users Manual.) Place your system disk in drive 0 and
shut the drive 0 door. When you see the> prompt on your system terminal,
place your installation disk in drive 1 and shut the drive 1 door.
Use the DAT command to set the date and time.
am on October 12, 1982, type:

For example, if it

is

11:05

> DAT 12-0CT-82/11:05 
The system uses this information when it sets the CREATION time attribute of
each file copied from your installation disk.

7L-55

68000 Software Installation

68000 Emulator Specifics Users

---------------------------------------------------------------------------Install the Emulator Control Software

The command file INSTALL2, which installs the emulator control software,
resides on the installation disk. To execute the command file, simply type
its filespec:
) /VOL/EMU.68000/INSTALL2  ATT /VOL/* WHERE 
sysvol
WHERE=FLXO
8550DIAGx.x
WHERE=FLX1
Note the name of
"8550DIAG2.0".)

your

<-- DOS/50 system disk
<-- 8550 system diagnostic disk

diagnostic

disk.

(It

should

be

something

like

Insert Your Emulator Installation Disk into Drive 1. INSTALLDIAGS,
the
command file that installs the diagnostics, resides on the installation
disk. Remove your diagnostic disk from drive 1 and insert your installation
disk.
Invoke the INSTALLDIAGS command file and pass it the name of your
diagnostic disk, which you just noted:
> /VOL/EMU.68000/INSTALLDIAGS 8550DIAGx.x 
DOS/50 responds with the following messages:

*

*********************************************
*
DIAGNOSTIC INSTALLATION PROCEDURE
*
*********************************************

*

*
*

*
*
*
*
*
*
*
*
*
T,OFF

During this installation procedure, the following error
message will appear once. IGNORE THIS MESSAGE:
Error 2A Parameter required
If any OTHER error message appears or this appears more
than once, see your Users Manual for further instructions.
If no other error message appears, you'll receive a message
when the installation is complete.

COP:

Error 2A Parameter required

*

*-----> Remove the DOS/50 System Disc
*-----> Insert the 8550 System Diagnostic Disc
*-----> Type CO -A

*

SUSP,-A

»

@

7L-57

68000 Emulator Specifics Users

68000 Software Installation

Insert Your Diagnostic Disk into Drive O. Remove your DOS/50 system disk
from drive 0 and insert your 8550 system diagnostic disk.
Then enter the
command CO -A to continue execution of the command file:

»

CO -A 

After a few

minu~es,

the following message is displayed:

COP,-BN,/VOL/EMU.68000/DIAGS/68000TST.SAV,/VOL/8550DIAGx.x/68000TST.SAV

**----->

Remove 8550 System Diagnostic Disc
*-----> Insert DOS/50 System Disc
*-----> Type CO -A

*

SUSP,-A
Insert Your DOS/50 System Disk into Drive O. Remove
your diagnostic disk
from drive 0 and insert your DOS/50 system disk. Then type CTRL-C and enter
the CO -A command again:

»

CO -A 

The command file finishes with the following message:
USER"NO.NAME
********************************************
*
DIAGNOSTIC INSTALLATION COMPLETE
*
********************************************

>
In this installation procedure, error message 2A should appear once. If any
other error message appears, check your disks and begin the diagnostic
installation pro~edure again. If the installation procedure fails again,
copy
down
the
error
message
and contact your Tektronix service
representative.
Once your software is installed, you can:
o

remove your disks and turn off your 8550 system, or

o

install more software, or

o

continue with the 68000 Emulator Demonstration Run that follows in
this section. If you do this, you do not have to restart the
system or reset the date and time.
NOTE

At this point, "NONAME" is the current user.
To change
current user back to "yourname," enter USER"yourname.

7L-58

the

@

68000 Emulator Specifics Users

68000 Demo -- Introduction

68000 DEMONSTRATION RUN

INTRODUCTION
This demonstration run shows you how to load, execute, and monitor a simple
68000 assembly language program on your 8540 or 8550. To perform this
demonstration, your 68000 emulator hardware and control software must be
installed in your 8540 or 8550. Throughout this demonstration run, the term
"68000 assembler" refers to a B Series 68000 Assembler.
Figure 7L-15 shows the source and object code for the demonstration program.
This demonstration
configurations:

run

includes

procedures

for

four

different

system

Case 1:

Case 1: If you have an 8550, the source
code
and
object
code
for
the
demonstration program are provided on
the installation disk that contains your
68000 emulator control software.
This
demonstration shows you how to assemble
the program on your 8550.
(If your
system
disk does not have a 68000
assembler, you must skip that part of
the demonstration.)

must have 68000
assembler

Case 2:

Case 2: If you have an 8540/8560 system,
and your 8560 has a 68000 assembler, you
can create and assemble the program on
the 8560 and download it to the 8540.
This demonstration shows how.
Case 3: If you have an 8540 that is
connected to a host computer other than
an 8560, we cannot give you a specific
list
of
commands for creating and
assembling the program on your host.
However, Fig.
7L-16 gives the program
object code in Extended Tekhex format.
You can create the Tekhex file using
your host's assembler or text editor,
and then download the file to the 8540
via the 8540's optional COM interface.

Case 3:

?•
8540 + other host

Case 4: If none of the other cases
applies
to you, you can patch the
program into memory using the P command.
This demonstration shows how.
Once the program is loaded or patched
program on your emulator.

into

Case 4:
any other configuration
(3964-5)3970-8

memory,

you

can

execute

the

7L-59

68000 Demo -- Introduction

68000 Emulator Specifics Users
NOTE

The 8540 commands shown in this demonstration can also be used
an 8550 that is connected to an 8560 or another host computer.

ASM
Xnn.nn-nn

68000
(8550)

Page
dd-rnmm-yy/hh:mm:ss
LIST

1

2
3

4
700
5 00000700 207COOOO
0500
6 00000706 323C0004
7 0000070A 4280
8
9 0000070C D018
10 0000070E 51C9FFFC
11
12 00000712 13COOOFO
0007
13 00000718 4E71
14 0000071A 4E71
15
16 0000071C 1A
17
18
CO
19 OOOOOOCO 0000071C
20
21
5
500
22
23 00000500
5
24
25
700

--

--------------I

I

address
+--

on

R

DBG

;Turn on symbolic debug
option.

SECTION DEMO
ORG
700H
START MOVEA.L #TABLE,AO

;Begin summing routine.
;Set the table pointer.

R
MOVE.W
CLR.L
LOOP

ADD.B
DBRA
MOVE.B

#TSIZE-1 , D1
DO

;Set the pass counter.
;Clear the register to be
used for summation.
(AO)+,DO
;Add byte from table to DO
D1,LOOP
;Decrement, and branch
;
if not 5 passes yet.
DO,(GEN.L)OF00007H ;Else exit, trigger SVC 1.

NOP
Nap
EXIT
R
R
R

;Two Naps for SVC.
;End of summing routine.

BYTE

1AH

ORG
LONG

OCOH
EXIT

= function code
for the exit SVC.
;Define SHB vector space.
;Define the SRB pointer.

5
500H
TSIZE

;Set table size = 5.
;Put TABLE at 500H.
;Space for TABLE.

TSIZE EQU
ORG
TABLE BLOCK
END

;1AH

START

---------- -------------------------------- --------------------------I

I

I

I

I

object code

I

source code

comments

source code line number
Fig.

7L-15.

68000 demonstration run program.

This display appears on the first page
Assembler listing using an 8550.

7L-60

of

your

68000

Series

B

@

68000 Emulator Specifics Users

68000 Demo -- Introduction

---------------------------------------------------------------------------(A)

%43 62,63700207C00000500323C00044280DO 1851 C9FFFC 13COOOF00007 4E71 4E711 A
%106292C00000071C
%443DB4DEM0010371D14LOOP370C15START370015TABLE350025TSIZE1514EXIT371C
%0981B3700
(B)

FIRST DATA BLOCK: object code for addresses 700--71B
header
: load address

object code

======----==========================================================
%436263700207C00000500323C00044280D01851C9FFFC13COOOFO00074E714E711A
SECOND DATA BLOCK: object code for addresses CO--C4
header
:
load object
: address code

======---========
%106292C00000071C
SYMBOL BLOCK
header
section
section definition
name
field
symbol definition fields

======-----=======---------------------------------------------------

%443DB4DEM0010371D14LOOP370C15START370015TABLE350025TSIZE1514EXIT371C
TERMINATION BLOCK
header
transfer
address

======---%0981B3700
Fig.

7L-16.

68000 demonstration program:

Extended Tekhex format.

Figure 7L-16A lists an Extended Tekhex load module that contains
the ob ject code and program symbols for the demonstration program.
Figure 7L-16B gives the meanings of the different fields in the
message blocks. If you have a host computer other than an 8560,
you can create this load module and download it to your 8540 or
8550.

7L-61

68000 Demo -- Examine Program

68000 Emulator Specifics Users

EXAMINE THE DEMONSTRATION PROGRAM
The demonstration program adds five numbers from a table stored in locations
500--504 in program memory, and puts the sum in register DO. (You will
place values in the table later in this demonstration.) The 8085A Emulator
Demonstration Run in the Learning Guide of your System Users Manual contains
a flowchart that illustrates the steps of the program.
The source code contains two kinds of statements: assembler directives (like
ORG, WORD, BYTE, and GEN.L), and 68000 assembly language instructions. Most
assembler directives are microprocessor-independent and are explained in the
8085A Emulator Demonstration Run.
The only assembler directive that is
68000-specific is the GEN.L directive. This causes a long word address to
be encoded.
The 68000 assembly language instructions are discussed in the
following paragraphs.
Set Table Pointer. The MOVEA.L #TABLE,AO instruction moves the address of
the table (500) into register AO. As a result, AO points to the first
element of the table.
The label START is used by the END directive to
specify that the MOVEA.L #TABLE,AO instruction is the first to be executed.
Set Pass Counter. Register D1 is used as the pass counter. The MOVE.W
. #TSIZE-1,D1 instruction moves the value 5-1:4 into register D1. This causes
the number of passes to be 5, since the DBRA instruction used for the branch
will loop until the value in D1 is -1. Each time a number is taken from the
table and added to register DO, register D1 is decremented.
Clear Summation Register. The CLR.L DO instruction zeros register DO so that
you can start adding numbers from the table.
Add Byte from Table and Point to Next Byte. The next
instruction,
ADD.B
(AO)+,DO, adds the byte addressed by AO to register DO. After the byte is
added, AO is incremented to point to the next byte in the table.
For
example, AO is initialized to contain 500. After the add is performed, the
+ part of the instruction causes AO to be incremented to 501, the address of
the second byte in the table. The label LOOP represents the address of the
ADD.B instruction; this label is used by the DBRA D1,LOOP instruction.
Decrement Pass Counter and Loop If Not Yet Five Passes. The
DBRA
D1,LOOP
instruction decrements register D1, the pass counter. Then it jumps to the
LOOP label if D1 does not contain -1. If D1 does contain -1, the program
proceeds to the next instruction, MOVE.B DO, (GEN.L)OF00007H.
Exit. The MOVE.B DO,(GEN.L)OF00007H and two NOP instructions constitute a
service call (SVC) that causes an exit from the program.
Any byte-write
instruction to the address F00007 would cause an SVC, and the contents of DO
are not affected. For more information on SVCs, refer to the Service Calls
section of your System Users Manual.

7L-62

@

68000 Demo -- prepare

68000 Emulator Specifics Users

~rogram

ASSEMBLE AND LOAD THE DEMONSTRATION PROGRAM
Now it's time to create the program so you can run it on your emulator. One
of the following discussions describes the set of steps that is appropriate
for your hardware configuration:
•

For 8550 users

Case 1: Assemble and Load on the 8550

•

For 8560 users
to the 8540

Case 2: Assemble and Load on the 8560;

•

For 8540 users with host computers other than the 8560 --Download from Your Host to the 8540

Case 3:

•

For other hardware configurations --into Memory

Program

Case 4:

Patch

the

Download

Work through the discussion that is appropriate for you. Once you have put
the program into program memory, turn to the heading, "Run the Demonstration
Program", later in this section.
CASE 1:

ASSEMBLE AND LOAD ON THE 8550

This discussion shows you how to copy the demonstration program from your
68000 emulator software installation disk, assemble the program, and load it
into 8550 program memory.
Start Up and Log On
Turn on your 8550 system.
(For start-up instructions, refer to the
paragraph, "Start Up the 8550 and Its Peripherals", in the Learning Guide of
your System Users Manual.) Place your system disk in drive 0 and shut the
drive 0 door.
When your system displays the ">,, prompt, place your 68000
emulator software installation disk in drive 1 and shut the drive 1 door.
Use the DAT command to set the current date and time. For example, if it
were 2:30 pm on October 12, 1982, you would enter the following command
line:
> DAT 12-0CT-82/2:30 PM 
Use the SEL command to tell DOS/50
software designed for the 68000:

to

use

the

emulator

and

assembler

> SEL 68000 (CR>
The system responds with the current version number:
68000 emulator V n.nn

mm/dd/yy

The SEL command automatically sets the emulation mode to O.

7L-63

68000 Demo -- Prepare Program

68000 Emulator Specifics Users

CoPY the Demonstration Run Program from the Installation Disk
Enter the following command lines to create an empty directory called DEMO
on your system disk, and to make DEMO the current directory. The BR command
creates a brief name, ROOT, to mark the old current directory. At the end
of this demonstration, you will return to this ROOT directory and delete the
DEMO directory and its contents.
) BR ROOT IUSR  CON ASM 
LIST

START

LOOP

EXIT

TSIZE
TABLE

SECTION
ORG
MOVEA.L
MOVE.W
CLR.L

DBG

file,

ASM,

the

;Turn on symbolic debug
option.

DEMO
700H
IITABLE,AO
IITSIZE-1,D1
DO

MOVE.B
NOP
NOP

;Begin summing routine.
;Set the table pointer.
;Set the pass counter.
;Clear the register to be
used for summation.
(AO)+,DO
;Add byte from table to DO.
D1,LOOP
;Decrement, and branch
if not 5 passes yet.
DO,(GEN.L)OF00007H ;Else exit, trigger SVC 1.
;Two NOPs for SVC.
;End of summing routine.

BYTE

1AH

ORG
LONG

OCOH
EXIT

EQU
ORG
BLOCK

5

500H
TSIZE

END

START

ADD.B
DBRA

on

= function code
for the exit SVC.
;Define SRB vector space.
;Define the SRB pointer.
;1AH

;Set table size = 5.
;Put TABLE at 500H.
;Space for TABLE.

Assemble the Source Code
If you do not have a 68000 assembler on your system disk, you cannot perform
this step, so skip the next four commands (ASM, COP, LINK, and L).
The ASM (assemble) command translates assembly language (source code) into
binary machine language (object code).
The ASM command also creates an
assembler listing that correlates the object code with the source code.
Enter the following command line to assemble the source code in the file
ASM, and to create the listing and object files, ASML and OBJ:

1L-65

68000 Demo -- Prepare Program

68000 Emulator Specifics Users

> ASM OBJ ASML ASM 
+--

+------+-----------

source file
assembler listing file

I

I

object file

ASM 68000 Xnn.nn-nn Copyright (C) 19nn Tektronix, Inc.
*****Pass 2
25 Lines Read
25 Lines Processed
o Errors
Make sure the printer is turned on and properly connected. Then,
assembler listing to the line printer with the following command.

copy

the

> COP ASML LPT 
The fields of the assembler listing are shown in Fig. 7L-15. The entries in
the symbol table are also displayed, as shown in Fig. 7L-17. For a detailed
'explanation of assembler listings, consult your Assembler Users Manual.

ASM
Xnn.nn-nn

Page
2
dd-mmm-yy/hh:mm:ss

68000 SYMBOL TABLE
(8550)

Scalars
TSIZE---------00000005
Section

= DEMO,

Aligned to 00000000, Size

EXIT----------0000071C

= 00000710

LOOP----------0000070C

START---------00000700

TABtE---------00000500
Section

= $OBJ,

Aligned to 00000000, Size

= EMPTY

25 Lines Read
25 Lines Processed
o Errors
Fig.

7L-66

7L-17.

Symbol table listing.

68000 Emulator Specifics Users

68000 Demo --

~repare

rrogram

----~-----------------------------------------------------------------------

Link the Object Code

The linker creates an executable load file from one or more object files.
Enter the following linker command to create a load file called LOAD from
your object file, OBJ:
> LINK -0 OBJ

-0

LOAD -d 

The system responds with the version number, listing
address:

status,

and

transfer

Tektronix Linker Vnn.nn-nn (8550)
Copyright (C) 19nn Tektronix, Inc.
Listing file not generated
Transfer address:
700
If you wish to get a full linker listing written to your system terminal,
include the -1 f option in the LINK command line. The linker command
options -0 and -0 specify the object file and load file, respectively.
The
-d command option causes the linker to pass the program symbols from the
object file to the load file for use in program debugging.
The files generated by the ASM and LINK commands should now be on your disk.
Enter this command to list the files in your current directory:
> L 
FILENAME
ASM
LOAD
OBJ
ASML
Files used
Free files
Free blocks
Bad blocks

126
130
811
0

Notice that there are now four files listed in your directory. OBJ and ASML
were created by the assembler, and LOAD was created by the linker.
Load the Program into Memory
Now it's time to load the object code from the load file LOAD
memory.

@

into

program

7L-67

68000 Emulator Specifics Users

68000 Demo -- Prepare Program

Allocate Memory. If you have the Memory Allocation Controller (MAC) option
installed, you need to allocate memory for the program. (If you do not have
the MAC option, do not enter the AL command that follows.) The AL command
allocates memory space to program memory. The default condition at start-up
is zero blocks allocated to program memory. Enter the following command
line:
> AL a ; AL'OFOOOOO ; AL OFFFFFF
1 BLOCK(S) ALLOCATED 000000
1 BLOCK(S) ALLOCATED FOOOOO
1 BLOCK(S) ALLOCATED FFFOOO


OOOFFF
FOOFFF
FFFFFF

These commands allocate 12K bytes (3 blocks) of program memory for the
logical addresses used by the demonstration program. The first block is
used by the program and the SRB pointer; the second block will contain the
SRB (Service Request Block) used by the SVC (Service Call); and the third
block is used by the 68000 system stack. For more information on memory
allocation and use of the AL command, refer to the Emulation section of your
System Users Manual.
Zero Out Memory. Before you load the code, use the F (Fill) command to fill
program memory with zeros. Later, when you examine memory, the zeros will
make it easy to identify the beginning and'end of your code. (Zeroing out
'memory has no effect on how the program is loaded.)
Enter the following
command line to fill memory at addresses CO--7FF with zeros:
> F OCO 7FF 0000 
Check that Memory Was Filled with Zeros. Check the contents of memory with
the D (Dump) command. The display shows the data in hexadecimal format, as
well as the corresponding ASCII characters. Display the contents of memory
addresses CO--CF and 700--7FF with the following commands:
> D OCO 

a

2
0000

4
0000

6
0000

8
0000

A
0000

C
0000

E
0000

> D 700 7FF 
a
2
000700 0000 0000
000710 0000 0000
000720 0000 0000
000730 0000 0000
000740 0000 0000
000750 0000 0000
000760 0000 0000
000770 0000 0000
000780 0000 0000
000790 0000 0000
0007AO 0000 0000
0007BO 0000 0000
0007CO 0000 0000
0007DO 0000 0000
0007EO 0000 0000
0007FO 0000 0000

4
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

6
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

8
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

A
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

C
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

E
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

OOOOCO 0000

7L-68

................
................

68000 Emulator Specifics Users

68900 Demo -- Prepare Program

---------------------------------------------------------------------------Load the Object Code into Memory. Load the objec~tcode for the demonstration
program into program memory with the following command:
,
~

) LO 
column
9

column
17

v

v

LIST

DBG

;Turn on symbolic debug 
option. 

SECTION DEMO 
ORG
700H
MOVEA.L UTABLE,AO
MOVE.W
HTSIZE-1,D1
CLR.L
DO

START

LOOP

MOVE.B
Nap
Nap

;Begin summing routine. 
;Set the table pointer. 
;Set the pass counter. 
;Clear the register to be 
used for summation. 
(AO)+,DO
;Add byte from table to DO. 
D1 ,LOOP
;Decrement, and branch 
;
if not 5 passes yet. 
DO,(GEN.L)OF00007H ;Else exit, trigger SVC 1. 
;Two Naps for SVC. 
;End of summing routine. 

BYTE

1AH

ORG
LONG

OCOH
EXIT

EQU
ORG
BLOCK

5

500H
TSIZE

END

START 

ADD.B
DBRA


EXIT

..!..


TSIZE

..!..

TABLE
..i.. 

= function code 
for the exit SVC. 
;Define SRB vector space. 
;Define the SRB pointer. 
;1AH

;Set table size = 5. 
;Put TABLE at 500H. 
;Space for TABLE. 
At the end of your text, enter a period on a line by itself.
will now accept new commands.

The editor

Check for Errors. Type the following editor command to display the text you
have entered. Check for typing mistakes.

1dE



I I

I I

:+-- print command: displays the lines
in the designated range
+---

designates last line in file

+----- designates first line in file
If you made any mistakes, you can correct them now. If you're not familiar
with the editor, Table 7L-10 lists the commands you need to add, delete, and
replace lines. For more information on the TNIX editor, refer to your 8560
System Users Manual.

@

7L-71

68000 Demo -- Prepare Program

68000 Emulator Specifics Users

Table 7L-10
Basic 8560 Editing Commands

------------------+----------------------------------Command
: Function
------------------------------------------------------

mm,nnp 

: Displays lines mm through nn

------------------+----------------------------------nn 
: Makes line nn the current line
------------------+----------------------------------d 
: Deletes the current line
------------------+----------------------------------a 
l Adds text below the current line
 :
• 

------------------+----------------------------------c 
: Replaces the current line with the
 l
• 

text you type in

------------------+----------------------------------Once your text is correct, enter the w command to
source file, asm:

write

the

text

to

the

w 
760

The editor responds with the number of characters it wrote to the file.
Finally, enter the S command to quit the editor and return to TNIX:
~



$ <--- TNIX prompt

Assemble the Source Code
The TNIX asm (assemble) command translates assembly language (source code)
into binary machine language (object code). The asm command also creates an
assembler listing that you use to correlate the object code with the source
code.
Enter the following command line to assemble the source code in the
file asm and create the listing and object files asml and obj:'
$ asm obj asml asm 

+--

+-------

+-----------

source file
assembler listing file
object file

ASH 68000 Xnn.nn-nn Copyright (C) 19nn Tektronix, Inc.
*****Pass 2
25 Lines Read
25 Lines Processed
o Errors
7L-72

68000 Demo -- Prepare Program

68000 Emulator Specifics Users

Print the assembler listing on the 8560's line printer
command:

with

the

following

$ lp1r asml  al 0 ; al Of 00000 ; al Offffff
1 BLOCK(S) ALLOCATED 000000
1 BLOCK(S) ALLOCATED FFFOOO
1 BLOCK(S) ALLOCATED FOOOOO

(CR>
OOOFFF
FFFFFF
FOOFFF

This command allocates 12K bytes (3 blocks) of program memory for the
logical addresses used by the demonstration program. The first block is
used by the program and the pointer to the SRB (Service Request Block); the
second block will contain the SRB used by the Service Call; and the third
block is used by the 68000 system stack. For more information on memory
allocation and use of the AL command, refer to the Emulation section of your
'System Users Manual.
Zero Out Memory. Before you download any code, use the OS/40 F (Fill)
command to fill 8540 program memory with zeros.
Later, when you examine
memory, the zeros make it easy to identify the beginning and end of your
code. (Zeroing out memory has no effect on how the program is loaded.)
Enter the following command line to fill memory addresses CO--7FF with
zeros:
$ f OcO 7ff 0000 (CR>

Check that Memory Was Filled with Zeros. Check the contents of memory with
the OS/40 D (Dump) command.
The display shows the data in hexadecimal
format, as well as the corresponding ASCII characters. Display the contents
of memory addresses CO--CF and 700--7FF with the. following commands:

7L-74

68000 Emulator Specifics Users

6~000

Vemo -- t'repare

rTU~Idlll

---------------------------------------------------------------------------) d OcO  F OCO 7FF 0000 

Check that Memory Was Filled with Zeros. Check the contents of memory with
the OS/40 0 (Dump) command. The display shows the data in hexadecimal
format, as well as the corresponding ASCII characters. Display the contents
of memory addresses CO--CF and 700--7FF with the following commands:
> 0 OCO 
024
OOOOCO 0000 0000 0000
> 0 700 7FF 
a
2
000700 0000 0000
000710 0000 0000
000720 0000 0000
'000730 0000 0000
000740 0000 0000
000750 0000 0000
000760 0000 0000
000770 0000 0000
000780 0000 0000
000790 0000 0000
0007AO 0000 0000
0007BO 0000 0000
0007CO 0000 0000
000700 0000 0000
0007EO 0000 0000
0007FO 0000 0000

7L-78

4
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

6
0000

8
0000

ACE
0000 0000 0000

6
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

8

A

C

0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

E
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

68000 Emulator Specifics Users

68000 Demo -- l"'repare t'rogram

Download the Load Module to the 8540
Be sure that your 8540 and your host computer are connected via an
RS-232-C-compatible communications link. Then perform the following steps
to download the Tekhex load module to 8540 program memory.
(Refer to the
Intersystem Communication section of your System Users Manual to determine
the commands and parameters that are appropriate for your host computer.)
a.

Enter the 8540 COM command to establish communication. (The
parameters of the COM command are host-specific.)
Log on to
your
host and execute any necessary host initialization
commands.

b.

Enter the command line that downloads the Tekhex load module to
the 8540. This command line consists of a host computer
command
that performs the download, followed by a null
character (CTRL-@ on most terminals) and a carriage return.
COM places the object code in 8540 program memory, and puts the
program symbols into the symbol table in 8540 system memory.

c.

Log off your host, then terminate COM command execution by
entering the null character, and then pressing the ESC key.

Once you've downloaded the program to the 8540, skip forward to the heading,
"Run the Demonstration Program."

@

7L-79

68000 Demo -- Prepare Program
CASE 4:

68000 Emulator Specifics Users

PATCH THE PROGRAM INTO MEMORY

This discussion shows you how to patch the demonstration program into 8540
(or 8550) program memory using the P command, and then add the program
symbols into the symbol table using the ADDS command.
Ordinarily, you would load the object code and symbols from a binary or
hexadecimal load file, as illustrated for Cases 1, 2, and 3. The procedure
presented here is not normally used for preparing a program for execution.
Use this procedure only if you have no standard means for preparing the
program, but would still like to tryout your emulator.
Start Up the 8540
Start up your 8540 and enter the
emulator:

following

command

to

select

the

68000

> SEL 68000 
The SEL command automatically sets the emUlation mode to O.
Allocate Memory. If you have the Memory Allocation Controller (MAC) option
. installed, you need to allocate memory for the program. (If you do not have
the MAC option, do not enter the AL command that follows.) The AL command
allocates memory space to program memory. The default condition at start-up
is zero blocks allocated to program memory. Enter the following command:
> AL 0 ; AL OFOOOOO ; AL OFFFFFF
BLOCK(S) ALLOCATED 000000
BLOCK(S) ALLOCATED FFFOOO
BLOCK(S) ALLOCATED FOOOOO


OOOFFF
FFFFFF
FOOFFF

This command allocates 12K bytes (3 blocks) of program memory for the
logical addresses used by the demonstration program. The first block is
used by the program and the pointer to the SRB (Service Request Block); the
second block will contain the SRB used by the SVC (Service Call); and the
third block is used by the 68000 system stack.
For more information on
memory allocation and use of the AL command, refer to the Emulation section
of your System Users Manual.
Zero Out Memory. Before you download any code, use the OS/40 F (Fill)
command to fill 8540 program memory with zeros.
Later, when you examine
memory, the zeros make it easy to identify the beginning and end of your
code. (Zeroing out memory has no effect on how the program is loaded.)
Enter the following command line to fill memory addresses CO--7FF with
zeros:
> F

7L-80

oeo

7FF 0000 

68000 Emulator Specifics Users

68000 Demo -- Prepare Program

Check that Memory Was Filled with Zeros. Check the contents of memory with
the OS/40 D (Dump) command. The display shows the data in hexadecimal
format, as well as the corresponding ASCII characters. Display the contents
of memory addresses CO--CF and 700--7FF with the following commands:
> 0 OCO 

a

2
0000

4
0000

6
0000

8
0000

A
0000

C
0000

E
0000

> D 700 7FF 
a
2
000700 0000 0000
000710 0000 0000
000720 0000 0000
000730 0000 0000
000740 0000 0000
000750 0000 0000
000760 0000 0000
000770 0000 0000
000780 0000 0000
000790 0000 0000
0007AO 0000 0000
0007BO 0000 0000
0007cO 0000 0000
000700 0000 0000
0007EO 0000 0000
0007FO 0000 0000

4
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

6
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

8
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

A
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

C
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

E
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

OOOOCO 0000

Patch the Object Code into Memor:!:
The OS/40 P (Patch) command stores a sequence of bytes into memory,
replacing the previous memory contents.
Enter the following command to
store the object code for the first three instructions in the program
(MOVEA, MOVE, and CLR) starting at location 700:
> P 700 207C00000500 323C0004 4280 

------------------------------ --------

CLR.L DO
MOVE.W HTSIZE-1,D1
MOVEA.L HTABLE,AO
patch address
Now patch in the next five instructions (ADD, DBRA, MOVE, and two Naps), and
the Exit SVC function code
> P 70E 0018 51C9FFFC 13COOOF00007 4E71 4E11 1A 

@

1L-81

68000 Demo -- Prepare Program

68000 Emulator Specifics Users

Finally, patch in the SRB information for the Exit SVC at address CO:
) POCO 0000071C ".
Now that you've loaded the program into memory, you need to:
•

verify that the program was loaded correctly; and

•

put

~alues

into the table in memory, for the program to add.

Check Memory Contents Again. Before you loaded the program, you filled
memory locations CO--7FF with zeros. Look again at the memory areas used by
the program with the following command lines:
> d OcO 
0
2
OOOOCO 0000 071C

4
0000

6
0000

8
0000

A
0000

C
0000

E
0000

................

> d 700 71f 
0
2
000700 207C 0000
000710 FFFC. 13CO

4
0500
OOFO

6
323C
0007

8
0004
4E71

A
4280
4E71

C
0018
1AOO

E
51C9
0000

: •••• 2< •• B••• Q.
•••••••• NqNq ••••

The object code is loaded in two different blocks:
•

The 68000 machine instructions are loaded at address 700 (specified
by the first ORG directive).

•

Information for the Exit SVC is loaded at address CO (specified by
the second ORG directive).

The contents of the table at address 500 are still undefined, but you will
put some values into the table in just a few minutes.
Turn Symbolic Debug On. Enter the following command to turn on symbolic
debug. This causes symbols from your code to be displayed when disassembly
is performed. (The -S and -L options are already set by default.)
> SYMD ON 
Disassemble the Object Code. The 01 (DIsassemble) command displays memory
contents both in hexadecimal notation and in assembly language mnemonics.
You can use the 01 command to verify that the object code in memory
corresponds to your source code. Enter the following command to disassemble
the area of memory occupied by the executable part of your program:

7L-83

68000 Demo -- Run Program

68000 Emulator Specifics Users

---------------------------------------------------------------------------> di 700 71a 
ADDRESS

DATA

MNEMONIC

START
000700

207C

MOVE.L

11500H,AO

DEMO+000706
000706
323C

MOVE.W

114H, D1

DEMO+00070A
00070A
4280

CLR.L

DO

LOOP
00070C

ADD.B

(AO)+,DO

DEMO+00070E
00070E
51C9

DBRA

D1 ,70CH

DEMO+000712
000712
13CO

MOVE.B

DO,FOOO07H

DEMO+000718
000718
4E71

Nap

DEMO+00071A
00071A
4E71

Nap

D018

Compare the DI display with the assembler listing you generated earlier,
refer back to Fig. 7L-15.

or

The DI display contains two lines for each disassembled instruction.
The
second line contains the absolute location of the instruction (ADDRESS), the
machine language instruction itself (DATA), the instruction
mnemonic
(MNEMONIC), and the instruction operands. The first line contains symbolic
representations for the location. The symbolic location enables you to
correlate the display with your assembler listing. The symbols START and
LOOP correspond to the labels START and LOOP in the source code.
For those lines of the display where the location does not correspond to a
label in the symbol table, D1 substitutes the section name plus the address
of the instruction relative to the beginning of the section as shown in the
location counter field of your assembler listing. (Since section DEMO
begins at address 0, the offset is 0, and the relative address is the same
as the absolute address in this display. This offset feature is much more
useful for sections that don't start at address 0.)
If you didn't load the pertinent symbols and related information into the
symbol table (using a command such as SYMLO), the DI command cannot supply
this symbolic information.

7L-84

68000 Demo -- Run Program

68000 Emulator Specifics Users

Now, you've seen that your system can use the symbol table to translate
numbers into symbols, to make a display easier to read. Your system can
also translate a symbol in a command line into an address.
For example,
since your system knows that the symbol START is equivalent to the address
700, you could have entered the DI command in any of the following ways:
di
di
di
di

700 71A
START 71A
start start+1a
700 START+1a

Notice that a symbol can be entered in either lowercase or uppercase.
The feature that enables DOS/50 and OS/40 to correlate symbols from
program with the numbers they represent is termed symbolic debug.

your

Put Values into the Table in Memory. The demonstration program sums five
numbers from a table in memory. Use the P (Patch) command to store the
numbers 1, 2, 3, 4, and 5 in the table. Do you remember what the address of
the table is?
It doesn't matter, as long as you remember that the symbol
TABLE represents that address.

> P -b table 0102030405 

~

the



The program executes, and when the Exit SVC occurs, the program breaks
(stops). Register DO contains the sum of the numbers in the memory table:
1+2+3+4+5=OF. You can use the DS command to examine the register contents:
> ds 
PC=00071C
DO=OOOOOOOF
D4=00000000
AO=00000505
A4=00000000

D1=0000FFFF
D5=00000000
A1=00FOOOOO
A5=00000000

D2=00000000 D3=00000000
D6=00000000 D7=00000000
A2=00000000 A3=00000000
A6=00000000 SSP=OOOOOOOO USP=OOOOOOOO

T.S •• 111 ••• X NZVC
SR=OOOO ---> 0.0 •• 000 ••• 0 0000

7L-86

@

68000 Emulator Specifics Users

68000 Oemo -- Monl r,or

rTo~r·dll1

MONITOR PROGRAM EXECUTION
You have assembled, loaded, and executed the demonstration program.
The
rest of this demonstration shows you some commands for monitoring program
execution. You can watch the changes in the emulator's registers and
observe the effect of each instruction as the program proceeds.
Trace All Instructions. The TRA (TRAce) command lets you observe the changes
in the 68000 registers as the program proceeds. When you enter a TRA
command and then start execution with the G command, display lines are sent
to the system terminal.
As each instruction executes, the display line
shows the instruction (as in the 01 display) and the contents of the
registers after that instruction has executed. Enter the following command
to trace all of the program's instructions:
) tra all 

03=00000000
07=00000000
A3=00000000

After register 00 is cleared, it begins to store the sum of the numbers
being added.
The AOO.B instruction adds a number from the table into 00.
At the end of the program, 00 contains the sum of the numbers you put into
the table.
Register 01, the pass counter, is set to contain 4 (TSIZE-1) at the
beginning of the program.
It decreases by one (because of the OBRA
instruction) each time a number is added to 00.
The program ends after
register 01 reaches minus one (FFFF).

7L-89

68000 Emulator Specifics Users

68000 Demo -- Monitor Program

Register AO, set to contain 500 (TABLE) at the start of the program,
increases by one each time a number is added to the accumulator. At the end
of the program, register AO has been incremented five times and contains
505.
Trace to the Line Printer. By adding the parameter >LPT to a command, you
can direct that command's output to the line printer instead of to the
system terminal. First verify that your line printer is properly connected
and powered up.
Then enter the following command to execute the program
with trace output directed to the line printer:

------~----------------

> g start >LPT 
NOTE
If you're operating in TERM mode with an 8560, use
following commands in place of the command shown:

•

g start
printer.

•

g start \>LPT sends the display to the
the 8540 or 8550.

I

I

lp1r

sends

the

display

to

the
line

one

of

8560
printer

the
line
on

Trace Jump Instructions Only. Another way to monitor the program's execution
is to look only at the jump instructions. By tracing the jump instructions,
you can still observe the changes in the registers, but you save time and
space by not tracing the instructions within the loop. Enter the following
command to trace only the jump instructions when the loop is being executed:
> tra jmp 100E 70E 

----

---

+-- upper address } Within this range,

+------ lower address
(70C)

}
}

only jump instructions
are traced.

Check the Status of the Trace. The TRA command without
any
parameters
displays the trace conditions that are currently set. Because you can have
up to three trace selections in effect at the same time, it is useful to be
able to see which selections are active. Check your trace status with the
following command line:
> tra 
TRACE
ALL,DEMO+OOOOOO,FFFFFF
TRACE
JMP, LOOP , DEMO+00070E
As you've specified, TRA ALL is in effect for addresses 0--70B, TRA JMP is
in effect for addresses 70C--70E, and TRA ALL is again in effect for
addresses 70F--FFFFFF.
7L-90

68000 Demo -- Monltor rrogram

68000 Emulator Specifics Users
Again, start your program with
displayed:

the

G command.

The

following

trace

is

) g start (CR)
START
UP:000700 207C MOVE.L #500H,AO
PC=000706
D2=00000000
D1=0000FFFF
DO=OOOOOOOF
D6=00000000
D5=000QOOOO
D4=00000000
A2=00000000
A1=00000000
AO=00000500
A6=00000000
A5=00000000
A4=00000000
SSP=OOOOOOOO USP=OOOOOOOO SR=OOOO

D3=OOOOOOOO
D7=OOOOOOOO
A3=00000000

DEMO+000706
UP: 000706 323C MO VE • W # 4H, D1
PC=00070A
D1=00000004
DO=OOOOOOOF
D5=00000000
D4=00000000
A1=00000000
AO=00000500
A5=00000000
A4=00000000
SSP=OOOOOOOO USP=OOOOOOOO

D2=00000000
D6=00000000
A2=00000000
A6=00000000
SR=OOOO

. D3=00000000
D7=00000000
A3=OOOOOOOO

DEMO+00070A
DO
UP:00070A 4280 CLR.L
PC=00070C
D1=00000004
DO=OOOOOOOO
D5=00000000
D4=00000000
A1=00000000
AO=00000500
A5=00000000
A4=00000000
SSP=OOOOOOOO USP=OOOOOOOO

D2=00000000
D6= 00000000
A2=00000000
A6=00000000
SR=0004

D3=OOOOOOOO
D7=00000000
A3=OOOOOOOO

DEHO+00070E
D1,70CH
UP:00070E 51C9 DBRA
PC=00070C
D2=00000000
D1=00000003
DO=00000001
D6= 00000000
D5=00000000
D4=00000000
A2=00000000
A1=00000000
AO=00000501
A6=00000000
A5=00000000
A4=00000000
SSP=OOOOOOOO USP=OOOOOOOO SR=OOOO
DEMO+00070E
D1,70CH
UP:00070E 51C9 DBRA
PC=00070C
D1=00000002
D2=00000000
DO=00000003
D5=00000000
D6=00000000
D4=00000000
A1=00000000
A2=00000000
AO=00000502
A5=00000000
A6=00000000
A4=00000000
SSP=OOOOOOOO USP=OOOOOOOO SR=OOOO
DEMO+00070E
D1,70CH
UP:00070E 51C9 DBRA
PC=00070C
D2=00000000
D1=00000001
DO=00000006
D6=OOOOOOOO
D5=00000000
D4=00000000
A2=OOOOOOOO
A1=OOOOOOOO
AO=00000503
A6=OOOOOOOO
A5=OOOOOOOO
A4=00000000
SSP=OOOOOOOO USP=OOOOOOOO SR=OOOO

D3=00000000
D7=00000000
A3=00000000

D3=00000000
D7=00000000
A3=00000000

D3=OOOOOOOO
D7=OOOOOOOO
A3=OOOOOOOO

7L-91

68000' Oemo -- Monitor Program

68000 Emulator Specifics Users

OEMO+00070E
01,70CH
UP:00070E 51C9 OBRA
PC=00070C
01=00000000
OO=OOOOOOOA
02=00000000
05=00000000
04=00000000
06=00000000
A1=00000000
AO=00000504
A2=00000000
A5=00000000
A4=00000000
A6= 000 00000
SSP=OOOOOOOO USP=OOOOOOOO SR=OOOO
OEMO+000712
UP:000712 13CO MOVE.B 00,F00007H
PC=000718
OO=OOOOOOOF
01=0000FFFF
02=00000000
06=00000000
04=00000000
05=00000000
A2=OOOOOOOO
AO=00000505
A1=00000000
A6=OOOOOOOO
A4=00000000
A5=00000000
SSP=OOOOOOOO USP=OOOOOOOO SR=OOOO
 bk

68000 Oemo -- Monitor Program

706 

= ---+--

breakpoint address

I

I

+----- breakpoint number

(can be 1, 2, or 3)
Check the breakpoint setting with the BK command:
> bk 
BK--1 OEMO+000706
BK 2 CLR
BK 3 CLR
Use the G command to start program execution:
> g start 
START
UP:000700 207C MOVE.L #500H,AO
PC=000706
OO=OOOOOOOF
01=0000FFFF
02=00000000
04=00000000
05=00000000
06=00000000
AO=00000500
A1=00000000
A2=00000000
A4=00000000
A5=00000000
A6=00000000
sSP=OOOOOOOO USP=OOOOOOOO SR=OOOO


03=00000000
07=00000000
A3=00000000

All instructions up to and including the instruction last executed are
displayed. The break occurred when the emulator detected the breakpoint
address going into the 68000 prefetch pipeline. However, by eXamining the
trace, you can see that the instruction on which you want to break has not
yet executed. So, enter the G command again.
>

~



OEMO+000706
UP:000706 323C MOVE.W #4H,01
PC=00070A
OO=OOOOOOOF
01=00000004
04=00000000
05=00000000
AO=00000500
A1=00000000
A4=00000000
A5=00000000
SSP=OOOOOOOO USP=OOOOOOOO


02=00000000
06=00000000
A2=00000000
A6=00000000
SR=OOOO

03=00000000
07=00000000
A3=OOOOOOOO

This time, the trace shows that the MOVE.W instruction was executed. The
number of times you must enter the G command before the instruction at the
breakpoint address is executed depends on the number of words in the
instructions and the TRA mode settings.

7L-93

68000 Demo -- Monitor Program

68000 Emulator Specifics Users

Set New Values in Pass Counter and Table Pointer; Check Results. Now
that
you've reached the breakpoint, you can change the contents of the registers
while execution is stopped. The break display shows that register D1 (the
pass counter) contains 4, and register AO (the table pointer) contains the
address 500. Use the S (Set) command to set the number of passes to two and
set the table pointer to 502:
) s d1=1 aO=502 

Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.3
Linearized                      : No
XMP Toolkit                     : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37
Create Date                     : 2012:05:14 12:42:24-08:00
Modify Date                     : 2012:05:14 12:31:54-07:00
Metadata Date                   : 2012:05:14 12:31:54-07:00
Producer                        : Adobe Acrobat 9.51 Paper Capture Plug-in
Format                          : application/pdf
Document ID                     : uuid:226c3b45-5a2b-49d4-87a8-3419e3f28a78
Instance ID                     : uuid:7682fb18-e2be-43cf-9b60-9a888fc82249
Page Layout                     : SinglePage
Page Mode                       : UseOutlines
Page Count                      : 128
EXIF Metadata provided by EXIF.tools

Navigation menu