• Aucun résultat trouvé

MC68302 Emulator Terminal Interface

N/A
N/A
Protected

Academic year: 2022

Partager "MC68302 Emulator Terminal Interface"

Copied!
192
0
0

Texte intégral

(1)

HP 64746

MC68302 Emulator Terminal Interface

User’s Guide

HP Part No. 64746-97007 Printed in U.S.A.

July 1996 Edition 4

(2)
(3)

Notice

Hewlett-Packard makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose.

Hewlett-Packard shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this material.

Hewlett-Packard assumes no responsibility for the use or reliability of its software on equipment that is not furnished by Hewlett-Packard.

© Copyright Hewlett-Packard Company 1990, 1991, 1996

This document contains proprietary information, which is protected by copyright. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language without the prior written consent of Hewlett-Packard Company. The information contained in this document is subject to change without notice.

UNIX ® is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Limited.

Hewlett-Packard Company P.O. Box 2197

1900 Garden of the Gods Road

Colorado Springs, CO 80901-2197, U.S.A.

RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the U.S. Government is subject to restrictions set forth in

subparagraph (C) (1) (ii) of the Rights in Technical Data and Computer Software Clause at DFARS 252.227-7013. Hewlett-Packard Company, 3000 Hanover Street, Palo Alto, CA 94304 U.S.A. Rights for

non-DOD U.S. Government Departments and Agencies are as set forth in FAR 52.227-19(c)(1,2).

(4)

Printing History

New editions are complete revisions of the manual. The date on the title page changes only when a new edition is published.

A software code may be printed before the date; this indicates the version level of the software product at the time the manual was issued.

Many product updates and fixes do not require manual changes, and manual corrections may be done without accompanying product changes. Therefore, do not expect a one-to-one correspondence between product updates and manual revisions.

Edition 1 Edition 2 Edition 3 Edition 4

64746-97000, August 1990 64746-97005, December 1990 64746-97006, July 1991 64746-97007, July 1996

(5)

Certification and Warranty

Certification

Hewlett-Packard Company certifies that this product met its published specifications at the time of shipment from the factory.

Hewlett-Packard further certifies that its calibration measurements are traceable to the United States National Bureau of Standards, to the extent allowed by the Bureau’s calibration facility, and to the calibration facilities of other International Standards Organization members.

Warranty

This Hewlett-Packard system product is warranted against defects in materials and workmanship for a period of 90 days from date of installation. During the warranty period, HP will, at its option, either repair or replace products which prove to be defective.

Warranty service of this product will be performed at Buyer’s facility at no charge within HP service travel areas. Outside HP service travel areas, warranty service will be performed at Buyer’s facility only upon HP’s prior agreement and Buyer shall pay HP’s round trip travel expenses. In all other cases, products must be returned to a service facility designated by HP.

For products returned to HP for warranty service, Buyer shall prepay shipping charges to HP and HP shall pay shipping charges to return the product to Buyer. However, Buyer shall pay all shipping charges, duties, and taxes for products returned to HP from another country. HP warrants that its software and firmware designated by HP for use with an instrument will execute its programming instructions when properly installed on that instrument. HP does not warrant that the operation of the instrument, or software, or firmware will be uninterrupted or error free.

Limitation of Warranty

The foregoing warranty shall not apply to defects resulting from improper or inadequate maintenance by Buyer, Buyer-supplied software or interfacing, unauthorized modification or misuse, operation outside of the environment specifications for the product, or improper site preparation or maintenance.

(6)

No other warranty is expressed or implied. HP specifically disclaims the implied warranties of merchantability and fitness for a particular purpose.

Exclusive Remedies

The remedies provided herein are buyer’s sole and exclusive remedies.

HP shall not be liable for any direct, indirect, special, incidental, or consequential damages, whether based on contract, tort, or any other legal theory.

Product maintenance agreements and other customer assistance agreements are available for Hewlett-Packard products.

For any assistance, contact your nearest Hewlett-Packard Sales and Service Office.

(7)

Using this Manual

This manual has two main purposes:

It describes the HP 64746 MC68302 emulator.

It gives an introduction to using the emulator’s Terminal Interface.

This manual also describes specific MC68302 emulator commands which do not appear in the Terminal Interface Reference.

This manual does not tell you how to use all of the emulator and analyzer commands. Refer to the Terminal Interface Reference.

Conventions Used

Examples in this manual use the following format and conventions:

M>cf clk=ext <RETURN>

M> This represents one of the prompts shown on screen.

cf clk=ext This represents an entry that you make.

<RETURN> This instructs you to press <RETURN>.

bold Bold type highlights commands and options.

(8)

<RETURN> versus

<ENTER>

This manual instructs you to press the <RETURN> key to execute commands. Depending on whether you are using a terminal or personal computer (PC), you will use either the <RETURN> or

<ENTER> key to execute the commands. The <RETURN> key on a terminal and the <ENTER> key on a PC both perform a carriage return, which is necessary to execute most of the HP 64700-Series commands.

(9)

Contents

1 Introducing the MC68302 Emulator

Introduction . . . 1-1 Function of the MC68302 Emulator . . . 1-1 Versions of the HP 64746 . . . 1-2 Features of the MC68302 Emulator . . . 1-3 Supported Microprocessors . . . 1-3 Clock Speeds . . . 1-3 Emulation Memory . . . 1-3 Analysis . . . 1-3 Registers . . . 1-3 Single-Step . . . 1-3 Breakpoints . . . 1-4 Reset Support . . . 1-4 Real-Time Operation . . . 1-4 Limitations . . . 1-4 How the Components Communicate . . . 1-5 Knowledge of the MC68302 . . . 1-5 Tips for Operating the Emulator . . . 1-6 Don’t Write to Low Memory . . . 1-6 Commands Which Stop the Processor . . . 1-6 MC68302 Vector Table . . . 1-6 Memory Access Mode . . . 1-7 Pin Protector . . . 1-7 Chip Selects . . . 1-7 DTACK Interlock . . . 1-8 SCR Register . . . 1-8 Connecting the emulator to the target system . . . 1-8 Connecting the probe to a PGA socket . . . 1-8 Connecting using a QFP Probe Adapter Assembly . . . 1-10 Connecting using the HP Wedge Probing System . . . 1-13 Other Sources of Information . . . 1-16

(10)

2 Getting Started

Before Using the HP 64746 . . . 2-1 Things to Know Before You Begin . . . 2-1 Apply Power . . . 2-2 About the Prompts . . . 2-2 If No Prompt is Displayed . . . 2-3 Description of the Prompts . . . 2-3 Initialize the Emulator . . . 2-5 Other Initialization Options . . . 2-6 Using the Help Facility . . . 2-6 Configure the Emulator . . . 2-7 Software . . . 2-8 Supported Absolute Files . . . 2-8 Assembler/Linker . . . 2-8 C Compiler . . . 2-8 Branch Validator . . . 2-8 About the Other Interfaces . . . 2-8 Example Program . . . 2-9 A Look at the Sample Program . . . 2-9 Initialize the Emulator to a Known State . . . 2-13 Set Up the Proper Emulation Configuration . . . 2-13 Set Up Emulation Conditions . . . 2-13 Map Memory . . . 2-16 Set Up the Stack Pointer . . . 2-16 Transfer Code into Memory . . . 2-17 From a Terminal in Standalone Configuration . . . 2-17 From a Host in Transparent Configuration . . . 2-19 Looking at Your Code . . . 2-22 Familiarize Yourself with the System Prompts . . . 2-23 Running the Sample Program . . . 2-25 Tracing Program Execution . . . 2-26 For More Information . . . 2-30 3 Advanced Example

The Sample Programs . . . 3-1 Supervisor Program . . . 3-2 User Program . . . 3-4 Mapping Memory . . . 3-7 Loading the Sample Program . . . 3-9 Assembly and Linking . . . 3-9 Loading the Code . . . 3-9

(11)

Building a Command File . . . 3-11 Set Mode and Stack Pointer . . . 3-14 Complex Configuration Trace Example . . . 3-14 Defining Equates . . . 3-17 Set the Analyzer to Complex Configuration . . . 3-18 Define a New Analyzer Signal Label . . . 3-18 Assign Analyzer Patterns to Expressions . . . 3-18 Set the Primary Branch Qualifiers . . . 3-19 Specifying What to Store . . . 3-19 Counting the Output Writes . . . 3-20 Set the Trace Display Format . . . 3-20 Make the Measurement . . . 3-21 Setting up an Automatic Break to Monitor . . . 3-28 Break on Measurement Complete . . . 3-28 Setting a Software Breakpoint . . . 3-29 Write to ROM . . . 3-30 Prefetching and Effect on Break Conditions . . . 3-30 Step, Register Display, and Memory Display Example . . . 3-30 Defining Macros . . . 3-31 Using Echo to Send Escape Sequences to a Terminal . . . 3-31 Using the Step Command . . . 3-32 Displaying Memory . . . 3-32 Displaying Registers . . . 3-32 Searching Memory for Strings or Numeric Expressions . . . 3-34 What Next? . . . 3-35 4 Configuring the Emulator

Emulation Commands . . . 4-1 Configuration Commands . . . 4-1 Commands Used to Make a Measurement . . . 4-1 Coordinated Measurement Commands . . . 4-3 Analyzer Commands . . . 4-3 System Commands . . . 4-3 Displaying MC68302 Configuration Items . . . 4-3 Using the Built-in Help Facility . . . 4-4 Bus Arbitration (cf ba) . . . 4-5 Background Block

(cf bbk) . . . 4-6 Bus Error (cf be) . . . 4-6 Background Function Codes (cf bfc) . . . 4-7 Clock Selection (cf clk) . . . 4-8

(12)

Chip Selects (cf cs[0-3]_dtk) . . . 4-9 Drive Background Cycles (cf dbc) . . . 4-9 /DTACK Interlock (cf dti) . . . 4-10 PB0/IACK7 Configuration (cf iack7) . . . 4-11 Interrupt Mode (cf im) . . . 4-11 IRQ7 Mode (cf int7) . . . 4-12 Load Function Codes (cf lfc) . . . 4-12 Monitor Selection (cf mon) . . . 4-13 Bus Width (cf pdw) . . . 4-15 Restrict to Real-Time (cf rrt) . . . 4-15 Supervisor Stack Pointer on Reset (cf rssp) . . . 4-16 Software Breakpoint Trap (cf swtp) . . . 4-17 Target System Interrupts (cf ti) . . . 4-18 DMA Tracing (cf trc_dma) . . . 4-19 Where to Find More Information . . . 4-19 Configuring Other Features . . . 4-20 5 Concepts

Topics Covered . . . 5-1 MC68302 Vector Table . . . 5-2 Access and Display Modes . . . 5-2 Target System Memory Access . . . 5-3 Break Conditions . . . 5-4 Software Breakpoints . . . 5-4 Break on Trigger Signals . . . 5-5 Macros . . . 5-5 Coordinated Measurement Bus Operation . . . 5-7 Software Products . . . 5-8 Assembler/Linker . . . 5-8 C Cross Compiler . . . 5-8 HP Branch Validator . . . 5-8 User Interfaces . . . 5-8 Protecting the Emulator Probe . . . 5-9 Pin Protector . . . 5-9 Conductive Pin Guard . . . 5-9 Using the Analyzer . . . 5-10 Analyzer Clock Speed . . . 5-10 Equates . . . 5-12 Symbols . . . 5-15 Emulator Firmware . . . 5-16 Monitor Description . . . 5-17

(13)

Comparison of Foreground and Background Monitors . . . 5-17 Using a Foreground Monitor . . . 5-19 Sample Foreground Monitor Listing . . . 5-20 A Syntax for the MC68302 Emulator

Notes . . . . A-2 ADDRESS . . . . A-3 Notes . . . . A-6 CONFIG_ITEMS . . . . A-7 MODE . . . . A-9 REGISTERS . . . A-11 ANALYZER INPUTS . . . A-13 Notes . . . A-16 B Messages

C MC68302 Specifications and Characteristics

General Specifications . . . . C-1 Processor Compatibility . . . C-1 Electrical . . . . C-1 Physical . . . C-2 Environmental . . . C-2 Regulatory Compliance . . . . C-3 BNC (labeled TRIGGER IN/OUT) . . . C-3 Communications . . . . C-3 Emulator Probe Characteristics . . . C-4 Unbuffered Signals . . . C-4 Data Inputs . . . C-4 Address and Function Codes . . . C-4 Clocks . . . . C-4 Chip Selects . . . . C-4 Interrupts . . . C-4 Other Signals . . . . C-4

(14)

Illustrations

Figure 1-1. HP 64746 Emulator for the MC68302 . . . 1-2 Figure 1-2. How the Components Communicate . . . 1-5 Figure 1-3. Connecting the Probe to a PGA socket. . . 1-9 Figure 1-4. Connecting Using a QFP Probe Adapter Assembly. . . 1-9 Figure 1-5. Connecting Using the HP Wedge Probing System . . . 1-9 Figure 2-1. Listing of newprog.s. . . . 2-10 Figure 2-2. Listing of newprog.s (continued). . . 2-11 Figure3-1. Supervisor program listing. . . . 3-2 Figure3-2. User program listing. . . 3-4 Figure 3-3. Sequencer diagram. . . 3-16

Tables

Table 1-1. Other Sources of Information . . . 1-11 Table 4-1. Command Groups . . . 4-2

(15)

1

Introducing the MC68302 Emulator

Introduction

The topics in this chapter include:

Function of the MC68302 Emulator Features of the MC68302 Emulator How the Components Communicate Tips for Operating the Emulator

Connecting the emulator to the target system – Connecting the probe to a PGA socket

– Connecting using a 132-pin QFP Probe Adapter Assembly – Connecting using the 144-pin HP Wedge Probing System Other Sources of Information

Function of the MC68302 Emulator

The MC68302 emulator is designed to replace the MC68302 microprocessor in your target system so you can control operation of the microprocessor in your application hardware (usually referred to as the target system). The emulator performs just like the MC68302 microprocessor, but is a device that allows you to control the MC68302 directly. The MC68302 emulator features allow you to easily debug software before any hardware is available, and ease the process of integrating hardware and software.

(16)

Versions of the HP 64746

Previous versions of the MC68302 emulator (HP 64746A/AL, HP 64746B/BL, HP 64746G, and HP 64746H) came with fixed amounts of memory. The HP 64746J emulator uses the HP 64170 memory board, which supports up to 2 Mbytes of emulation memory.

When you use the HP 64170 memory board, you will notice changes in the memory block size, memory mapping resolution, and the

elimination of coverage measurements.

Figure 1-1. HP 64746 Emulator for the MC68302

(17)

Features of the MC68302 Emulator

Supported Microprocessors

The HP 64746 emulator contains a Motorola 68302 microprocessor revision B or greater.

Clock Speeds

The internal clock speed of the HP 64746 emulator is at least 16.67 MHz. Your emulator may use a faster clock speed.

Emulation Memory

The HP 64170 memory board provides 256 Kbytes, 512 Kbytes, 1 Mbyte, or 2 Mbytes of emulation memory. The emulator operates with no wait states to emulation or target memory.

Up to seven ranges of memory may be configured as emulation RAM, emulation ROM, target system RAM, target system ROM, or guarded memory.

Analysis

The analyzer (HP 64704A) supplied with the MC68302 emulator monitors the emulation processor using an emulation analysis bus.

This analyzer performs only state analysis, and is referred to as the emulation analyzer.

The optional external analyzer (HP 64703A) allows you to probe 16 individual lines in your target system. Thus you will have a total of 64 analysis channels (or 48 channels if you have upgraded from a HP 64742 M68000 emulator). The external analyzer lets you, for example, to watch the chip select lines, and to distinguish internal from external direct memory accesses. You can configure the external analyzer to perform state or timing analysis measurements. Refer to the Analyzer Terminal Interface User’s Guide for a complete list of analyzer features.

Registers

You can display or modify the MC68302 internal register contents.

This includes the ability to modify the program counter (PC) value so you can control where the emulator starts a program run.

Single-Step

You can direct the emulation processor to execute a single instruction or a specified number of instructions.

(18)

Breakpoints

You can set the emulator/analyzer interaction so the emulator will break to the monitor program when the analyzer finds a specific state or states, allowing you to perform post-mortem analysis of the program execution.

You can also set software breakpoints in your program. With the MC68302 emulator, setting a software breakpoint inserts a TRAP instruction into your program at the desired location.

Reset Support

The emulator can be reset from the emulation system under your control, or your target system can reset the emulation processor.

Real-Time Operation

Real-time signifies continuous execution of your program at full rated processor speed without interference from the emulator. (Such interference occurs when the emulator needs to break to the monitor to perform an action you requested, such as displaying target system memory.) Emulator features performed in real-time include running and analyzer tracing.

Emulator features not performed in real-time include displaying or modifying target system memory, loading or dumping any memory, and displaying or modifying registers.

Limitations

The emulator does not support the CPU disable mode.

Direct memory access (DMA) to emulation memory is not permitted.

Memory coverage measurements are not supported by the HP 64746J emulator.

(19)

How the Components Communicate

The MC68302 emulation components communicate with each other as shown in figure 1-2. The arrows show the direction of communication.

Refer to the HP 64700-Series Emulators Hardware Installation And Configuration manual for details on components that make up an HP 64700-Series emulation and analysis system.

Knowledge of the MC68302

If you are designing an MC68302 target system, you probably understand how the MC68302 microprocessor works. If you do not have a working knowledge of this processor, you should become familiar with this processor before continuing.

Figure 1-2. How the Components Communicate

(20)

Tips for Operating the Emulator

Note

To operate the MC68302 emulator efficiently, read this section!

Don’t Write to Low Memory

Remember that addresses $0 through $FF in the supervisor space are reserved for the MC68302 vector table.

In particular, address $0F2 is the BAR (base address) register and $0F4 is the SCR (system control) register. If you map these addresses as part of a data area, they may get overwritten, causing unpredictable

processor behavior.

Be especially careful not to place the stack where it could grow into this area. For example, never place the stack at 100 hex.

Commands Which Stop the Processor

If your target system circuitry is dependent on constant execution of program code, you should set cf rrt=en. This will help insure that target system damage doesn’t occur. You may also use cf dbc=en to drive the address, data, and control strobes while the background monitor is executing. However, remember that you can still execute the rst, b and s commands. You should use caution in executing these commands.

MC68302 Vector Table

All MC68302 emulation systems require a vector table to process system conditions, such as divide by zero or trace traps. You need to provide such a vector table to manage these conditions. Exception processing attempted without a vector table will cause unpredictable results. Most of the examples shown in this manual were created without a vector table to simplify the examples.

Remember not to map internal memory space to 0, thus overwriting the vector table. The internal space must be mapped as target RAM (tram).

The BAR and SCR may be mapped as emulation RAM (eram), but you

(21)

should use the reg (not m) command to modify or examine these locations.

Refer to the Motorola documentation for the MC68302 microprocessor for additional information about vector tables and exception processing.

Memory Access Mode

When in 8-bit mode, byte access is always used. In 16-bit mode, either byte or word access can be used. Use byte access mode (the default) unless a larger size is needed. See chapter 5, "Concepts," for a discussion of target system memory access.

Pin Protector

Do not use the probe without a pin protector installed. See chapter 5,

"Concepts," for more information on protecting the emulator probe.

Chip Selects

The MC68302 chip selects can be configured either to generate the DTACK signal interally or to use an externally supplied DTACK. The emulator looks at two things to decide which source of the DTACK it should look for when a given chip select is active:

The chip select lines (programmed using registers BR0-BR3).

The source of DTACK for the chip select lines is determined by the corresponding DTACK field bits (programmed using OR0-OR3). The order in which you write these registers is significant.

The emulator configuration (set using cf cs0_dtk through cf cs3_dtk). The effects of the emulator configuration are described in chapter 4.

Note

Be sure that the emulator configuration and the configuration of the chip select lines are consistent. Remember that the order in which you write the chip select registers BR0-BR3 and OR0-OR3 is significant.

Registers OR0-OR3 contain, among other things, a base address mask field. The base address mask is used to set the block size of the corresponding chip select line. The emulator assumes that this register will be programmed to map one contiguous block for the chip select

(22)

line. The MC68302 processor does not enforce this rule, so you should be careful not to map several ranges for a specific chip select.

DTACK Interlock

Use the cf dti configuration item to select whether the emulator will look for or generate the DTACK signal. See chapter 4 for details.

SCR Register

The emulator does not set any bits in the System Control Register (SCR). You should set the FRZW bit in the SCR to avoid problems when breaking into the monitor via a watchdog timer RESET.

Connecting the emulator to the target system

The emulator supports connections to PGA sockets, 132-pin PQFP, and 144-pin TQFP package types for the Motorola MC68302.

Connecting the probe to a PGA socket

To avoid having to replace the entire probe because of a bent or broken pin, use a pin protector (that is, an extra PGA socket) between the probe and the target.

PGA sockets are available from Hewlett-Packard as HP part number 1200-1318. A MacKenzie Technology PGA-100M-003B1-1324 socket should also be suitable.

See chapter 5 for some important suggestions about using the emulator in-circuit.

Note

The emulator probe requires a PGA (pin grid array) socket. Be sure to use a PGA socket in your target system.

Follow these steps to install the probe in your target system:

1. Turn off power to the emulator and the target system.

(23)

2. Take any necessary precautions to avoid static discharge.

3. Remove the MC68302 processor from the target system PGA socket.

4. Plug the probe into a pin protector, if you have not already done so.

5. Plug the probe into your target system.

Be sure to orient the probe correctly. Pin A1 of the PGA matrix is at the notched corner of the probe. (Note that pin

"A1" of the PGA matrix is signal "A14." Pin numbers do not correspond to signal numbers for the MC68302.)

Figure 1-3. Connecting the Probe to a PGA Socket.

(24)

6. Turn on the emulator.

7. Turn on power to the target system.

Turning on the emulator before the target system will prevent damage to sensitive components in the target system.

Connecting using a 132-pin QFP Probe Adapter Assembly

If your target system uses the MC68302FE surface mount (CQFP) or the MC68302FC surface mount (PQFP) package, you should order the following parts:

HP E3408A PQFP/CQFP Adapter Kit which includes:

– One HP E2414A QFP Probe Adapter Assembly (includes an HP E2414-63201 transition socket)

– Two HP 64748-87608 Motorola MC22901PQFP132 dummy parts. Additional dummy parts can be ordered.

Caution

Equipment damage. The connections between the emulator probe, probe adapter assembly, and microprocessor (dummy part) on the target board are delicate and must be done with care. Refer to the Operating Note supplied with the probe adapter assembly for specific instructions when making the connection.

1. Install the "dummy" part in place of the microprocessor on your target system. The QFP Probe Adapter Assembly connects the dummy part to the emulator’s PGA probe.

Before connecting the emulator, a 132-pin PQFP "dummy part" (a mechanical sample with no internal connections) must be soldered onto the target system in place of the

microprocessor. This is necessary because the MC68302 has no facility to three-state all of its signals. It is best to solder the dummy part onto the target system using automated surface mounting equipment to give more reliable probing.

Hand soldering may result in solder wicking up the leads,

(25)

which can prevent the probe adapter cable assembly from making good contact.

2. Select an orientation using the following illustration.

A QFP Probe Adapter can be installed in one of four

orientations as shown in the following illustration. This allows flexibility in attaching the emulator probe when target system components interfere. Select the orientation that best suits your target system, and note the position of Pin 1 on the microprocessor (dummy part) on your target board.

There are two labels with color coding and bar coding on the QFP Probe Adapter; use these to ensure correct orientation when the probe adapter is connected to the emulator. Note the color or count the bars on the edge of the probe adapter that is placed over the Pin 1 side of the dummy part. (For example, Pin 1 of the dummy part may be along the side that is color coded yellow, or along the side that has three bars.) There is a corresponding edge on the PGA end of the probe adapter; it has the same color code and bar code. Connect the PIN 1 SIDE of the emulator probe into the PGA end of the probe adapter that has the same color code/bar code as is on the Pin 1 side of the microprocessor (dummy part).

3. Follow the instructions in the QFP Probe Adapter Assembly Operating Note to install the adapter assembly.

(26)

Figure 1-4. Connecting Using a QFP Adapter Assembly.

(27)

Connecting using the 144-pin HP Wedge Probing System

If your target system uses a 144-pin TQFP (thin quad flat pack) surface-mounted integrated circuit, you should order:

HP E3438A Wedge Adapter Kit – HP E3435A Wedge

– HP E3441A General-purpose Flexible Adapter – HP E5347-87601 Male-to-male Header – HP E3439A Transition Socket

– HP E3435-97001 HP Wedge Probing System User’s Guide – Two HPE3435-87601 144-pin TQFP dummy parts

Caution

Equipment damage. Ensure that the emulator probe is aligned with the proper pins when connecting to the general-purpose flexible adapter. Serious equipment damage can result from improper connection. Refer to the User’s Guide supplied with the HP Wedge Probing System for instructions on installing the 144-pin HP Wedge probe adapter, male-to-male header, general-purpose flexible adapter, and transition socket.

1. Install the "dummy" part in place of the microprocessor on your target system. The QFP Probe Adapter Assembly connects the dummy part to the emulator’s PGA probe.

Before connecting the emulator, a 144-pin TQFP "dummy part" (a mechanical sample with no internal connections) must be soldered onto the target system in place of the

microprocessor. This is necessary because the MC68302 has no facility to three-state all of its signals. It is best to solder the dummy part onto the target system using automated surface mounting equipment to give more reliable probing.

Hand soldering may result in solder wicking up the leads,

(28)

which can prevent the probe adapter cable assembly from making good contact.

2. Select an orientation using the following illustration.

The HP Wedge Probing System can be installed in one of four orientations as shown in the following illustration. This allows flexibility in attaching the emulator probe when target system components interfere. Select the orientation that best suits your target system, and note the position of Pin 1 on the microprocessor (dummy part) on your target board.

There are two labels with color coding and bar coding on the general-purpose flexible adapter; use these to ensure correct orientation when the flexible adapter is connected to the emulator. Note the color or count the bars on the edge of the general-purpose flexible adapter that is placed over the Pin 1 side of the dummy part. (For example, Pin 1 of the dummy part may be along the side that is color coded yellow, or along the side that has three bars.) There is a corresponding edge on the other end of the general-purpose flexible adapter; it has the same color code and bar code. Connect the PIN 1 SIDE of the emulator probe into the end of the general-purpsoe flexible adapter that has the same color code/bar code as is on the Pin 1 side of the microprocessor (dummy part).

3. Follow the instructions in the HP Wedge Probing System User’s Guide to install the probing system.

(29)

Figure 1-5. Connecting Using the HP Wedge Probing Sys.

(30)

Other Sources of Information

If you need other references while operating the emulator, refer to the manuals listed in table 1-1. Note that several manuals may appear in one binder.

Manual Description

HP 64700-Series Emulators Terminal Interface Reference

Terminal Interface emulation, analysis, and CMB commands used to control the emulator.

Analyzer Terminal Interface User’s Guide How to use the emulation and external analyzers.

Analysis commands are described in the Terminal Interface Reference.

CMB User’s Guide How to use the M68302 emulator with the CMB.

M68302 Assembler/Linker User’s Guide How to assemble and link programs using the HP 64870 Cross Assembler/Linker/Librarian.

M68302 PC Interface User’s Guide How to use the emulator with a PC.

M68302 Softkey Interface User’s Guide How to use the M68302 emulator with the Softkey Interface on a Sun or HP workstation.

Graphical User Interface User’s Guide How to use the Graphical User Interface on a Sun or HP workstation.

MC68302 Integraged Multi-Protocol Processor User’s Manual

Describes the M68302 microprocessor. (Motorola part MC68302UM/AD).

HP 64700-Series Emulators Support Services If all else fails, refer to this manual to locate information about support for your product.

Table 1-1. Other Sources of Information

(31)

2

Getting Started

Before Using the HP 64746

If you haven’t already done so, connect the emulator to the host computer. If necessary, refer to the HP 64700-Series Emulators Hardware Installation And Configuration manual for details. Then return here.

Things to Know Before You Begin

Before working the examples in this chapter, be sure you know the following:

Know Your System Configuration

Determine which system configuration you will use (either standalone, transparent, or remote). Refer to the HP 64700-Series Emulators Hardware Installation And Configuration manual for additional information.

If you are using the Remote Configuration, you must have completed installation and configuration of a terminal emulator program which will allow your host to act as a terminal connected to the emulator. In addition, you must start the terminal emulator program before you can work the examples in this chapter. Refer to the HP 64700-Series Emulators Hardware Installation And Configuration manual and the appropriate terminal emulator software manual (such as that for HP AdvanceLink).

Know the Basic Concepts of Emulation

You should read and understand the concepts of emulation presented in the HP 64700-Series Emulators System Overview manual. A brief understanding of these concepts may help avoid questions later.

(32)

Apply Power

Caution

POSSIBLE DAMAGE TO TARGET SYSTEM!

The emulator power must be turned on before the target system power.

An excess amount of current may be drawn out of the target system and the target system may be damaged if the order is reversed. Likewise, the target system should be turned off first and then the emulator.

Apply power to the emulator if you haven’t already done so. After power is applied, the following information should be displayed.

Copyright (c) Hewlett-Packard Co. 1987

All Rights Reserved. Reproduction, adaptation, or translation without prior written permission is prohibited, except as allowed under copyright laws.

HP64700 Series Emulation System Version: A.03.00 13Dec90

HP64746A (PPN: 64746A) Motorola 68302 Emulator Version: A.00.03 24Jun91

Control: HP64170A Memory Control Board

You will also see information about the amount of memory installed in each bank on the memory control board.

If a message like the one above is not displayed, refer to the Support Services manual.

About the Prompts

Press <RETURN> to display one of these prompts:

U> (emulator is running user code)

R> (emulation processor is reset - in normal mode) M> (emulator is running in monitor)

Upon powerup the prompt should be R>.

(33)

If No Prompt is Displayed

If one of the prompts (U>, R>, or M>) is not displayed, cycle power on the emulator. The prompt character should be an R> at this point.

If the emulator still doesn’t respond, toggle data communication switch 4 (refer to the HP 64700-Series Emulators Installation And Configuration manual). Cycle power on the emulator. Then press

<RETURN> again.

If one of the prompts still does not appear after you have done this, refer to the HP 64700-Series Emulators Support Services manual for information about how to resolve this problem. The Support Services manual contains a list of Hewlett-Packard Sales and Service Offices that you can use to contact your HP Representative.

Note

One of these prompts must appear before you can continue.

Note

All HP 64700-Series commands must be entered using lower case letters. Follow each of the commands by pressing <RETURN> on your terminal (or <ENTER> on your personal computer) unless instructed otherwise.

Do not place spaces before or after ".." and "="; doing so will result in an "Invalid option or operand" error.

Description of the Prompts

The prompts for the emulator are:

c> The c> prompt means that the emulator is in external clock mode (set using cf clk=ext) and is waiting for a clock signal from the target system. If the target power has not been

(34)

applied do so now. Then press <RETURN>.

The R> prompt should be present now.

R> The processor is being held reset from the emulator.

r> The processor is being held reset, but not from the emulator.

h> The processor is halted.

g> The bus has been granted for direct memory access (DMA).

w> A memory cycle has started but has not completed. This is caused when no device has issued a termination signal (DTACK or BERR) to the processor.

W> This indicates the emulator is waiting for the CMB ready signal.

M> The emulator is executing in the monitor.

b> No external bus cycles are occurring. Usually the emulator can determine why this is the case and will display the prompt such as w>, c>, or r> to indicate the cause of no bus cycles. If no reason can be determined, the b> prompt will be displayed. One possibility is that a STOP instruction was executed.

(35)

Initialize the Emulator

If you plan to use the MC68302 emulator to follow the exercises in this chapter, verify that no one else is using the emulator.

Caution

POSSIBLE LOSS OF INFORMATION!

It is important that you verify that no one else is using the emulator at this time. If you or someone else is operating the MC68302 emulator in a standalone configuration controlled by a data terminal, and have entered a program into memory by manually modifying the memory locations, this information will be lost during the initialization process.

To display the available initialization options, enter:

M>help init

init - reinitialize system

init - limited initialization; resets emulation and analysis products but not environment (macros, equates, date & time, etc.)

init -c - complete initialization; does not run system memory integrity tests

init -p - powerup initialization; run from reset with complete system verification tests

Notice that the init command performs the following:

Resets the emulation configuration items.

Resets the break conditions.

Clears software breakpoints.

The init command does not clear macros or equates (logical expressions).

To initialize the emulator, enter:

M>init

#Limited initialization completed

(36)

Other Initialization Options

The -c and -p options to the init command allow you to perform a more complete initialization of the emulator. The init -c command performs a cold-start initialization, except that performance verification tests are not executed. The init -p command performs a powerup initialization, which is also referred to as a cold-start initialization. This process includes emulator, analyzer, system controller, communications port, and performance verification initialization.

Using the Help Facility

If you need quick reference information about a command or a set of commands, you can use the built-in help facilities. For example, to display the help menu, enter:

R>help

help - display help information

help <group> - print help for desired group help -s <group> - print short help for desired group help <command> - print help for desired command help - print this help screen

--- VALID <group> NAMES --- gram - system grammar

proc - processor specific grammar sys - system commands

emul - emulation commands trc - analyzer trace commands

xtrc - external trace analysis commands * - all command groups

You can enter the ? symbol in place of the word "help." If you want to display information about the emulation command group, enter:

R>? emul

emul - emulation commands

--- b...break to monitor cp...copy memory mo...modes

bc...break condition dump...dump memory r...run user code bp...breakpoints es...emulation status reg....registers cf...configuration io...input/output rst....reset

cim....copy target image load...load memory rx...run at CMB execute cmb....CMB interaction m...memory s...step

map....memory mapper ser....search memory

To display information for a single command, type help (or ?) and the command name. For example:

(37)

R>help load

load - download absolute file into processor memory space load -i - download intel hex format

load -m - download motorola S-record format load -t - download extended tek hex format load -S - download symbol file

load -h - download hp format (requires transfer protocol) load -a - reserved for internal hp use

load -e - write only to emulation memory load -u - write only to target memory

load -o - data received from the non-command source port load -s - send a character string out the other port load -b - data sent in binary (valid with -h option) load -x - data sent in hex ascii (valid with -h option) load -q - quiet mode

load -p - record ACK/NAK protocol (valid with -imt options) load -c <file> - data is received from the 64000. file name format is:

<filename>:<userid>:absolute

Configure the Emulator

You may want to change the default emulator configuration items before proceeding. To do this, refer to chapter 4 for detailed information. When you are finished, return here.

(38)

Software

Supported Absolute Files

Supported absolute file formats that you can download into the target system include, HP, Intel hex, Motorola S-records, and Tektronix hex.

To download executable code in HP format you must use the HP 64700-Series MC68302 Emulator PC Interface or Softkey Interface.

Assembler/Linker

Assembly language support for the MC68302 includes:

HP 64870 HP 9000-based M68000

Assembler/Linker/Librarian . (This assembler generates code for the M68000, M68008, M68010, MC68302, M68332, and M68020 processors. The product number for Apollo computers is HP B1423 .)

C Compiler

High-level language support for the MC68302 includes:

HP 64902 HP 9000-based M68000 C Compiler (Product number B1421 for Apollo computers)

Branch Validator

Branch analysis support includes:

HP B1419 HP Branch Validator

About the Other Interfaces

HP provides easy-to-use emulator interfaces for the following host computers:

Personal computers

HP 9000 Series 300 workstations HP 9000 Series 700 workstations Sun workstations

These interfaces provide menu-driven access to emulator commands, disassembly, high-level source code debugging, and many other features to make your job easier.

(39)

Example Program

The rest of this chapter will lead you through a basic, step by step tutorial designed to familiarize you with the use of the HP 64700 emulator for the 68302 microprocessor. When you have completed this chapter, you will be able to perform these tasks:

Set up an emulation configuration for out of circuit emulation use.

Map memory.

Transfer a small program into emulation memory.

Use run/stop controls to control operation of your program.

Use memory manipulation features to alter the program’s operation.

Use analyzer commands to view the real time execution of your program.

A Look at the Sample Program

The sample program "COMMAND_READER" used in this chapter is shown in figure 2-1. The program is a primitive command interpreter.

Data Declarations

INPUT_POINTER and OUTPUT_POINTER define the address locations of an input area and an output area to be used by the program.

MESSAGE_A, MESSAGE_B and INVALID_INPUT are the messages used by the program to respond to various command inputs.

Initialization

The locations of the input and output areas are moved into address registers for use by the program. Next, the CLEAR routine clears the command byte (the first byte location pointed to by the input area address - 3000 hex).

(40)

Command line: as68k -Lh newprog.s Line Address

1 CHIP 68000 2

3 SECTION DATA,,D 4

5 00000000 0000 3000 INPUT_POINTER DC.L 00003000H 6 00000004 0000 4000 OUTPUT_POINTER DC.L 00004000H 7

8 00000008 5448 4953 2049 MESSAGE_A DC.B ’THIS IS MESSAGE A’

5320 4D45 5353 4147 4520 41

9 00000019 5448 4953 2049 MESSAGE_B DC.B ’THIS IS MESSAGE B’

5320 4D45 5353 4147 4520 42 10

11 0000002A 494E 5641 4C49 INVALID_INPUT DC.B ’INVALID COMMAND’

4420 434F 4D4D 414E 44 12 13

14 SECTION PROG,,C,P 15

16 00000000 2479 0000 0000 R INIT MOVE.L INPUT_POINTER,A2 17 00000006 2679 0000 0004 R MOVE.L OUTPUT_POINTER,A3 18

19

20 0000000C 14BC 0000 CLEAR MOVE.B #00H,(A2) 21

22 00000010 1012 READ_INPUT MOVE.B (A2),D0 23 00000012 0C00 0000 CMP.B #00h,D0 24 00000016 67F8 BEQ READ_INPUT 25

26 00000018 0C00 0041 PROCESS_COMM CMP.B #41H,D0 27 0000001C 6700 000E BEQ COMMAND_A 28 00000020 0C00 0042 CMP.B #42H,D0 29 00000024 6700 0014 BEQ COMMAND_B 30 00000028 6000 001E BRA UNRECOGNIZED 31

32 0000002C 103C 0011 COMMAND_A MOVE.B #11H,D0

33 00000030 207C 0000 0008 R MOVE.L #MESSAGE_A,A0 34

35 00000036 6000 001A BRA OUTPUT 36 0000003A 103C 0011 COMMAND_B MOVE.B #11H,D0 37 0000003E 207C 0000 0019 R MOVE.L #MESSAGE_B,A0 38

39 00000044 6000 000C BRA OUTPUT 40 00000048 103C 000F UNRECOGNIZED MOVE.B #0FH,D0

41 0000004C 207C 0000 002A R MOVE.L #INVALID_INPUT,A0 42

43 00000052 224B OUTPUT MOVE.L A3,A1 44

Figure 2-1. Listing of newprog.s.

(41)

Read_Input

This routine continuously reads the byte at location 3000 hex until it is something other than a null character (00 hex); when this occurs, the PROCESS_COMM routine is executed.

Process_Comm

Compares the input byte (now something other than a null) to the possible command bytes of "A" (ASCII 41 hex) and "B" (ASCII 42 hex), then jumps to the appropriate set up routine for the command message. If the input byte does not match either of these values, a branch to a set up routine for an error message is executed.

Command_A, Command_B, Unrecognized

These routines set up the proper parameters for writing the output message: the number of bytes in the message is moved to the D0 register and the base address of the message in the data area is moved to address register A0.

Output

First the base address of the output area is copied to A1 (this preserves A3 for use in later program passes). Then the CLEAR_OLD routine

Line Address

45 00000054 123C 0020 CLEAR_OLD MOVE.B #20H,D1 46

47 00000058 2A4B MOVE.L A3,A5 48 0000005A 1AFC 0000 CLEAR_LOOP MOVE.B #00H,(A5)+

49 0000005E 0441 0001 SUBI #01H,D1 50 00000062 66F6 BNE CLEAR_LOOP 51

52 00000064 12D8 LOOP MOVE.B (A0)+,(A1)+

53 00000066 0440 0001 SUBI #01H,D0 54 0000006A 66F8 BNE LOOP 55 0000006C 4EFA FF9E JMP CLEAR 56

57

58 END

Figure 2-2. Listing of newprog.s (continued).

(42)

writes nulls to 32 bytes of the output area (this serves both to initialize the area and to clear old messages written during previous program passes).

Finally, the proper message is written to the output area by the LOOP routine. When done, LOOP jumps back to CLEAR and the command monitoring process begins again.

Using the various features of the emulator, we will show you how to load this program into emulation memory, execute it, monitor the program’s operation with the analyzer, and simulate entry of different commands utilizing the memory access commands provided y the HP 64700 command set.

(43)

Initialize the Emulator to a Known State

To initialize the emulator to a known state for this tutorial:

Note

It is especially important that you perform the following step if the emulator is being operated in a standalone mode controlled by only a data terminal. The only program entry available in this mode is through memory modification; consequently, if the emulator is reinitialized, emulation memory will be cleared and a great deal of tedious work could be lost.

1. Verify that no one else is using the emulator or will have need of configuration items programmed into the emulator.

2. Initialize the emulator by typing the command:

R> init -p

Set Up the Proper Emulation

Configuration

Set Up Emulation Conditions

To set the emulator’s configuration values to the proper state for this tutorial, do this:

1. Type:

R> cf

You should see the following configuration items displayed:

R>cf cf ba=en cf trc_dma=dis cf bbk=0

(44)

cf bfc=sp cf be=dis cf clk=int cf dbc=en cf dti=dis cf lfc=x cf mon=bg cf rrt=dis cf rssp=9 cf swtp=0 cf ti=dis cf im=nor cf int7=lev cf iack7=pb0 cf pdw=16 cf cs0_dtk=int cf cs1_dtk=ext cf cs2_dtk=ext cf cs3_dtk=ext

Note

The individual configuration items won’t be explained in this example;

refer to chapter 4 of this manual and the Reference manual for details.

2. If the configuration items displayed on your screen don’t match the ones listed above, here is how to make them agree:

For each configuration item that does not match, type:

R> cf <config_item>=<value>

For example, if you have the following configuration items displayed (those in bold indicate items different from the list above):

cf ba=en cf bat=dis cf bbk=0 cf be=dis cf bfc=sp cf clk=ext cf dbc=dis . . .

To make these configuration values agree with the desired values, type:

R> cf clk=int R> cf dbc=en

3. Let’s go ahead and set up the proper break conditions.

(45)

Type:

R> bc

You will see:

bc -d bp #disable bc -d rom #disable bc -d bnct #disable bc -d cmbt #disable bc -d trig1 #disable bc -d trig2 #disable

For each break condition that does not match the one listed, use one of the following commands:

To enable break conditions that are currently disabled, type:

R> bc -e <breakpoint type>

To disable break conditions that are currently enabled, type:

R> bc -d <breakpoint type>

For example, if typing bc gives the following list of break conditions:

(items in bold indicate improper values for this example)

bc -d bp #disable bc -d rom #disable bc -d bnct #disable bc -d cmbt #disable bc -e trig1 #enable bc -e trig2 #enable

Type the following commands to set the break conditions correctly for this example:

R> bc -e rom

(this enables the write to ROM break) R> bc -d trig1 trig2

(this disables break on triggers from the analyzer) 4. To avoid problems later while modifying and displaying

memory locations, type:

R> mo -ab -db

This sets the access and display modes for memory operation to byte. (If they are left at the default mode of word, the memory modification and display examples will not function correctly.)

(46)

Map Memory

The high-speed emulation memory can be mapped at a resolution of 1 kilobyte.

Emulation memory allows you to store programs and data used in development before target system memory is available. For this example, you will need to map some of the memory blocks to various type designators. Do the following:

Type:

R> map 1000..1fff eram R> map 2000..2fff erom R> map 3000..5fff eram

R> map 0fff000..0ffffff tram

Set Up the Stack Pointer

After emulator initialization, the "reset supervisor stack pointer"

configuration item (cf rssp) and the supervisor stack pointer are set to an odd value. Since you cannot run the emulator when the supervisor stack pointer is odd, you must set up the supervisor stack pointer register to contain an even value. You can do this by using the reg command to modify the supervisor stack pointer, or you can change the reset supervisor stack pointer configuration item (as shown below).

The value you assign to the rssp configuration item is placed into the supervisor stack pointer on the entrance to the emulation monitor from an emulation initiated RESET state (the R> prompt).

For this example, we will define the stack pointer within one of the areas mapped earlier.

(47)

Type:

R>cf rssp=5000 R>b

This defines register A7 (the supervisor stack pointer) as 5000 hex.

The stack will grow downward in memory from this location; for purposes of our example, it will not grow far enough to interfere with the output area for the program defined at 4000 hex. (The 68302 emulator does not provide stack checking hardware or software to guard against program destruction from an overgrown stack; your program must provide such protection.)

To get the "M>" prompt shown in the next section, type:

R>b M>

Transfer Code into Memory

From a Terminal in Standalone Configuration

To transfer code into memory from a data terminal running in

standalone mode, you must use the modify memory commands. This is necessary because you have no host computer transfer facilities to automatically download the code for you (as you would if you were using the transparent configuration or the remote configuration.) To minimize the effects of typing errors, you will modify only one row of memory at a time in this example. Do the following:

(48)

Note

Make sure that you have modified the memory access mode default to byte as instructed earlier, before you proceed with memory

modification. If you are in doubt, type mo at the prompt. If you see mo -ab -db, your setup is fine. Otherwise, type mo -ab -db at the prompt to set the memory display and modification modes.

1. Enter the data information for the program by typing the following commands:

M> m 1000..100f=00,00,30,00,00,00,40,00,54,48,49,53,20,49,53,20 M> m 1010..101f=4d,45,53,53,41,47,45,20,41,54,48,49,53,20,49,53 M> m 1020..102f=20,4d,45,53,53,41,47,45,20,42,49,4e,56,41,4c,49 M> m 1030..1038=44,20,43,4f,4d,4d,41,4e,44

If you make a mistake, enable command line editing by typing:

M> cl -e

The commands for command line editing are described in the

"Command Entry" chapter of the Terminal Interface Reference. You can see a summary of the editing commands by typing:

M> help cl

1. You should now verify that the data area of the program is correct by typing:

M> m 1000..1038 You should see:

001000..00100f 00 00 30 00 00 00 40 00 54 48 49 53 20 49 53 20 001010..00101f 4d 45 53 53 41 47 45 20 41 54 48 49 53 20 49 53 001020..00102f 20 4d 45 53 53 41 47 45 20 42 49 4e 56 41 4c 49 001030..001038 44 20 43 4f 4d 4d 41 4e 44

If this is not correct, you can correct the errors by re-entering only the modify memory commands for the particular rows of memory that are wrong.

For example, if row 1000..100f shows these values:

001000..00100f 00 30 00 00 00 40 00 54 48 49 53 20 49 53 20 20

you can correct this row of memory by typing:

M> m 1000..100f=00,00,30,00,00,00,40,00,54,48,49,53,20,49,53,20

Or, you might need to modify only one location, as in the instance where address 100f equals 32 hex rather than 20 hex.

Type:

M> m 100f=20

(49)

2. Enter the program information by typing the following commands:

M> m 2000..200f=24,79,00,00,10,00,26,79,00,00,10,04,14,0bc,00,00

(note the third from last term -- hex letters must be preceded by a digit)

M> m 2010..201f=10,12,0c,00,00,00,67,0f8,0c,00,00,41,67,00,00,0e M> m 2020..202f=0c,00,00,42,67,00,00,14,60,00,00,1e,10,3c,00,11 M> m 2030..203f=20,7c,00,00,10,08,60,00,00,1a,10,3c,00,11,20,7c M> m 2040..204f=00,00,10,19,60,00,00,0c,10,3c,00,0f,20,7c,00,00 M> m 2050..205f=00,2a,22,4b,12,3c,00,20,2a,4b,1a,0fc,00,00,04,41 M> m 2060..206f=00,01,66,0f6,12,0d8,04,40,00,01,66,0f8,4e,0f9,00,00- M> m 2070..2071=20,0c

You should now verify that the program area is correct by typing:

M> m 2000..2071 You should see:

002000..00200f 24 79 00 00 10 00 26 79 00 00 10 04 14 bc 00 00 002010..00201f 10 12 0c 00 00 00 67 f8 0c 00 00 41 67 00 00 0e 002020..00202f 0c 00 00 42 67 00 00 14 60 00 00 1e 10 3c 00 11 002030..00203f 20 7c 00 00 10 08 60 00 00 1a 10 3c 00 11 20 7c 002040..00204f 00 00 10 19 60 00 00 0c 10 3c 00 0f 20 7c 00 00 002050..00205f 00 2a 22 4b 12 3c 00 20 2a 4b 1a fc 00 00 04 41 002060..00206f 00 01 66 f6 12 d8 04 40 00 01 66 f8 4e f9 00 00 002070..002071 20 0c

If this is not correct, you can correct the errors by re-entering only the modify memory commands for the particular rows of memory that are wrong.

For example, if row 2000..200f shows the values

002000..00200f 24 79 00 10 00 26 79 00 00 10 04 14 bd 00 00 00

you can correct this row of memory by typing:

M> m 2000..200f=24,79,00,00,10,00,26,79,00,00,10,04,14,0bc,00,00

From a Host in Transparent Configuration

The method provided in this example assumes that you are using the Hewlett-Packard’s 68000 Cross Assembler/ Linker/Loader (HP product number 64870 if you are using an HP Series 9000 computer). In addition, you must have the HP 64000 transfer software running on your host.

If you are using another assembler, you may be able to adapt the methods below to load your code into the emulator (refer to the HP 64700 Terminal Interface User’s Reference manual for help).

(50)

If you are not able to transfer code from your host to the emulator using one of these methods, use the method described previously under

"From a Terminal in Standalone Mode", as it will work in all cases.

However, transferring code using host transfer facilities is easier and faster than modifying memory locations, especially for large programs.

1. First, you must establish communications with your host computer through the transparent mode link provided in the HP 64700. Enable the transparent mode link by typing:

M> xp -e

If you then press <RETURN> a few times, you should see:

login:

login:

login:

This is the login prompt for the host system. (Your prompt may differ depending on how your system manager has configured your system.)

2. Log in to your host system and start up an editor such as "vi".

You should now enter the source code for the sample program shown at the beginning of the chapter. When finished, save the program to filename "newprog.s".

Note

If you need help learning how to log in to your host system or use other features of the system, such as editors, refer to the host documentation (for an HP-UX host, read the HP-UX Concepts and Tutorials guides) or ask your system administrator.

3. Assemble your code with the 68000 Cross Assembler using the command:

$ as68k -Lh newprog.s newprog.lis

This will generate an expanded listing with cross reference table of all the symbols used. If any assembly errors were reported, re-edit your file and verify that the code was entered correctly (compare to the listing at the beginning of the chapter).

(51)

4. Link the program to the correct addresses.

Using your editor, create a linker command file called "newprog.cmd":

NAME newprog LIST C,D,O,P,S,T,X ORDER PROG,DATA SECT DATA=1000H SECT PROG=2000H LOAD newprog.o END

Now link using the command using the command:

$ ld68k -c newprog.cmd -Lh

Now it’s time to transfer your code into the emulator. Do the following:

1. Disable the transparent mode so that your terminal will talk directly to the emulator. Type:

$ <ESC>g xp -d

The "<ESC>g" sequence temporarily toggles the transparent mode so that the emulator will accept commands; "xp -d" then fully disables the transparent mode.

2. Load code into the emulator by typing:

M> load -hbo

transfer -tb newprog.X<ESC>g (NOTE: DO NOT TYPE CARRIAGE RETURN!)

The system will respond:

##

M>

load -hbo tells the emulator to load code expected in HP binary file format and to expect the data from the other port (the one connected to the host). It then puts you in

communication with the host; you then enter the transfer command to start the HP 64000 transfer utility. Typing

"<ESC>g" tells the system to return to the emulator after transferring the code. The "##" marks returned by the system indicates that the emulator loaded two records from the host.

3. At this point you should examine a portion of memory to verify that your code was loaded correctly. Type:

M> m 1000..1038 You should see:

(52)

001000..00100f 00 00 30 00 00 00 40 00 54 48 49 53 20 49 53 20 001010..00101f 4d 45 53 53 41 47 45 20 41 54 48 49 53 20 49 53 001020..00102f 20 4d 45 53 53 41 47 45 20 42 49 4e 56 41 4c 49 001030..001038 44 20 43 4f 4d 4d 41 4e 44

If your system does not match, verify that you entered the source code and linker command file correctly.

Looking at Your Code

Now that you have loaded your code into memory, you can display it in mnemonic format. Type:

M> sym start=2000 M> m -dm 2000..206d You will see:

0002000 start MOVEA.L 0001000,A2 0002006 - MOVEA.L 0001004,A3 000200c - MOVE.B #000,[A2]

0002010 - MOVE.B [A2],D0 0002012 - CMPI.B #000,D0 0002016 - BEQ.B 0002010 0002018 - CMPI.B #041,D0 000201c - BEQ.W 000202c 0002020 - CMPI.B #042,D0 0002024 - BEQ.W 000203a 0002028 - BRA.W 0002048 000202c - MOVE.B #011,D0 0002030 - MOVEA.L #000001008,A0 0002036 - BRA.W 0002052 000203a - MOVE.B #011,D0 000203e - MOVEA.L #000001019,A0 0002044 - BRA.W 0002052 0002048 - MOVE.B #00f,D0 000204c - MOVEA.L #00000102a,A0 0002052 - MOVEA.L A3,A1

0002054 - MOVE.B #020,D1 0002058 - MOVEA.L A3,A5 000205a - MOVE.B #000,[A5]+

000205e - SUBI.W #00001,D1 0002062 - BNE.B 000205a 0002064 - MOVE.B [A0]+,[A1]+

0002066 - SUBI.W #00001,D0 000206a - BNE.B 0002064 000206c - JMP 000200c[PC]

(53)

Familiarize

Yourself with the System Prompts

Note

The following steps are not intended to be complete explanations of each command; the information is only provided to give you some idea of the meanings of the various command prompts you may see and reasons why the prompt changes as you execute various commands.

You should gain some familiarity with the HP 64700 emulator command prompts by doing the following:

1. Ignore the current command prompt. Type:

M> rst

You will see:

R>

The rst command resets the emulation processor and holds it in the reset state. The "R>" prompt indicates that the processor is reset.

2. Type:

R> r 2000 You will see:

U>

The r (run) command causes the emulation processor to begin executing from the current program counter address or from the specified address.

The "U>" prompt indicates that the emulation processor is running in foreground, rather than in the monitor. When you have a program loaded into memory, this prompt indicates that the processor is running a user program.

(54)

Note

This prompt (U>) will be displayed if there is user code to run, or if you try to run the processor and no breaks occur.

3. To cause the emulator to begin executing in the monitor, enter:

U> b

You will see:

M>

The b (break) command causes the emulation processor to stop execution of whatever it is doing and begin executing in the emulation monitor. The newly displayed "M>" prompt indicates that the emulator is running in the monitor.

To view all of the possible emulator prompts (emulation status characters), enter:

M>help proc

Références

Documents relatifs

In addition, an optional network visualization tool displays the emulated nodes, the bridge node as well as the content of the messages sent and the physical topology.. The

The SUBGLACIOR probing system will include: (1) the drilling tool itself, including a built-in OF-CEAS laser system, and the associated electronics to control the device and

When you enter the DIVERT command, the host prompt does not reappear. Type the first command you would like diverted and press the Return key. The command is

It m ore than m atches the Televideo 925 with sophisticated features like 11 function keys, 12 editing functions, 25th sta tus line, a menu set-up mode, two full pages o f

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

Hence, one of the fi rst tasks of powering up SPAN-E is to load a set of sweep tables to control the analyzer high-voltage surfaces and also a set of product tables to sort the counts

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the

Moreover, the local properties (structure, soil material) in the probe volume of influence also influence the sensitivity of the capacitance probe signal to soil temperature. It is