Page 1
HP 64793 H8/338/329 Emulator Softkey Interface User’s Guide HP Part No. 64793-97002 Printed in U.S.A. October 1992 Edition 1...
Page 2
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.
Page 3
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.
Page 4
Using This Manual This manual introduces you to the following emulators as used with the Softkey Interface. HP 64793A H8/338 emulator HP 64793B H8/329 emulator Throughout this documentation, the following names are used to denote the microprocessors listed in the following table of supported microprocessors.
Page 5
differs from H8/338 emulator, it will be described as the "H8/329 emulator". This manual: Shows you how to use emulation commands by executing them on a sample program and describing their results. Shows you how to use the emulator in-circuit (connected to a target system).
Page 6
Organization Chapter 1 Introduction. This chapter lists the H8/338 emulator features and describes how they can help you in developing new hardware and software. Chapter 2 Getting Started. This chapter shows you how to use emulation commands by executing them on a sample program. This chapter describes the sample program and how to: load programs into the emulator, map memory, display and modify memory, display registers, step through programs, run programs, set software breakpoints, search...
Page 7
Commands, options, and parts of command syntax which may be entered by pressing softkeys. User specified parts of a command. normal Represents the HP-UX prompt. Commands which follow the "$" are entered at the HP-UX prompt. The carriage return key. <RETURN>...
Introduction to the H8/338 Emulator Introduction The topics in this chapter include: Purpose of the H8/338 emulator. Features of the H8/338 emulator. Purpose of the The H8/338 emulator is designed to replace the H8/338 microprocessor in your target system so you can control operation of the H8/338 Emulator microprocessor in your application hardware (usually referred to as the target system).
Features of the H8/338 Emulator Supported The HP 64793A H8/338 emulator and HP 64793B H8/329 emulators support the microprocesors listed in the following table. Microprocessors Model Supported Microprocessor HP 64793A (H8/338 emulator) HD6473388CP (H8/338) HD6433388CP (H8/338) HD6413388CP (H8/338) HD6473378CP (H8/337)
The HP64793 H8/338 emulator is used with the following Emulation Memory Card. HP 64725A 128K byte Emulation Memory Card The emulation memory can be configured into 128 byte blocks. A maximum of 16 ranges can be configured as emulation RAM(eram), emulation ROM(erom), target system RAM(tram), target system ROM(trom), or guarded memory(grd).
Single-Step You can direct the emulation processor to execute a single instruction or a specified number of instructions. Breakpoints You can set the emulator/analyzer interaction so the emulator will break to the monitor program when the analyzer finds a specific state, allowing you to perform post-mortem analysis of the program execution.
Limitations, Restrictions Foreground Monitor Foreground Monitor is not supported for the H8/338 emulator. Monitor Break at When the emulator breaks into the emulation monitor, sleep or software standby mode is released. Sleep/Standby Mode Store Condition and Disassembling of program execution in the trace list may not be accurate when the emulation analyzer is used with store condition.
Getting Started Introduction This chapter will lead you through a basic, step by step tutorial designed to familiarize you with the use of the H8/338 emulator with the Softkey Interface. This chapter will: Tell you what must be done before you can use the emulator as shown in the tutorial examples.
Before beginning the tutorial presented in this chapter, you must have completed the following tasks: 1. Connected the emulator to your computer. The HP 64700 Series Installation/Service manual show you how to do this. 2. Installed the Softkey Interface software on your computer.
.GLOBAL Init,Msgs,Cmd_Input .GLOBAL Msg_Dest .SECTION Table,DATA Msgs Msg_A .SDATA "THIS IS MESSAGE A" Msg_B .SDATA "THIS IS MESSAGE B" Msg_I .SDATA "INVALID COMMAND" End_Msgs .SECTION Prog,CODE ;**************************************************** Set up the Stack Pointer ;**************************************************** Init MOV.W #Stack,R7 ;**************************************************** ;* Clear previous command ;**************************************************** Clear MOV.B...
Page 21
;**************************************************** ;* The destination area is cleared. ;**************************************************** Write_Msg MOV.W #Msg_Dest,R5 Clear_Old MOV.B #h’20,R6L Clear_Loop MOV.B R0L,@R5 ADDS.W #1,R5 DEC.B Clear_Loop ;**************************************************** ;* Message is written to the destination. ;**************************************************** MOV.W #Msg_Dest,R5 Write_Loop MOV.B @R4+,R6L MOV.B R6L,@R5 ADDS.W #1,R5 DEC.B Write_Loop ;**************************************************** ;* Go back and scan for next command.
Page 22
Processing Commands When a command is entered, the instructions from Exe_Cmd to Cmd_A determine whether the command was "A", "B", or an invalid command. If the command input byte is "A" (ASCII 41 hex), execution is transferred to the instructions at Cmd_A. If the command input byte is "B"...
Figure 2-2. Linkage Editor Subcommoand File Generate HP To generate HP Absolute file for the Softkey Interface, you need to use "h83cnvhp" absolute file format converter program. The h8cnvhp Absolute file converter is provided with HP 64876 H8/300 Assembler/Linkage Editor.
Entering the If you have installed your emulator and Softkey Interface software as directed in the HP 64700 Series Emulators Softkey Interface Softkey Interface Installation Notice, you are ready to enter the interface. The Softkey Interface can be entered through the pmon User Interface Software or from the HP-UX shell.
Softkey Interface with the following command. $ emul700 <emul_name> <RETURN> The "emul_name" in the command above is the logical emulator name given in the HP 64700 emulator device table (/usr/hp64000/etc/64700tab). HP64793-19031 A.04.00 25Oct92 H8/338 EMULATION SERIES 64700 A Hewlett-Packard Software Product Copyright Hewlett-Packard Co.
<RETURN> key to see the next line, just as you do with the HP-UX more command. After all the information on the particular topic has been displayed (or after you press "q" to quit scrolling through information), you are prompted to press <RETURN>...
---SYSTEM COMMANDS--- displays the possible help files help displays the possible help files fork a shell (specified by shell variable SH) !<shell cmd> fork a shell and execute a shell command cd <directory> change the working directory print the working directory cws <SYMB>...
Pod Commands Time Command 10:00:00 help m m - display or modify processor memory space m <addr> - display memory at address m -d<dtype> <addr> - display memory at address with display option m <addr>..<addr> - display memory in specified address range m -dm <addr>..<addr>...
Displaying When you load an absolute file into memory (unless you use the "nosymbols" option), symbol information is loaded. Both global Symbols symbols and symbols that are local to a source file can be displayed. Global To display global symbols, enter the following command. display global_symbols <RETURN>...
Displaying You can display memory locations repetitively so that the information on the screen is constantly updated. For example, to display the Memory Msg_Dest locations of the sample program repetitively (in blocked Repetitively byte format), enter the following command. display memory Msg_Dest repetitively blocked bytes <RETURN>...
modify memory Cmd_Input string to ’A’ <RETURN> After the memory location is modified, the repetitive memory display shows that the "Command A entered" message is written to the destination locations. Breaking into the The "break" command allows you to divert emulator execution from the user program to the monitor.
Note Because software breakpoints are implemented by replacing opcodes with the special code, you cannot define software breakpoints in target ROM. When software breakpoints are enabled and emulator detects a fetching the special code (5770 hexadecimal), it generates a break to background request which as with the "processor break"...
Page 36
modify software_breakpoints set Cmd_A <RETURN> Notice that when using local symbols in expressions, the source file in which the local symbol is defined must be included. After the software breakpoint has been set, enter the following command to display memory and see if the software breakpoint was correctly inserted.
inverse-video. The inverse-video shows that the Program Counter is now at the address. A message on the status line shows that the software breakpoint has been hit. The status line also shows that the emulator is now executing in the monitor. When software breakpoints are hit, they become inactivated.
Displaying Enter the following command to display registers. You can display the basic registers class, or an individual register. Registers display registers <RETURN> Registers Next_PC 1022 PC 1022 SP FF80 CCR 80 <i > MDCR E7 R0 0000 R1 0000 R2 0041 R3 0011 R4 1100...
<RETURN> Using the Analyzer HP 64700 emulators contain an emulation analyzer. The emulation analyzer monitors the internal emulation lines (address, data, and status). Optionally, you may have an additional 16 trace signals which monitor external input lines.
The message "Emulation trace started" will appear on the status line. Now, modify the command input byte to "B" with the following command. modify memory Cmd_Input bytes to 42h <RETURN> The status line now shows "Emulation trace complete". Displaying the Trace The trace listings which follow are of program execution on the H8/338 emulator.
Trace Analysis There are some points to be noticed when you use the emulation analyzer. Considerations How to Specify You need to be careful to specify the condition on which the emulation analyzer should start the trace. Suppose that you would like to start the Trigger Condition trace when the program begins executing Exe_Cmd routine: trace after cmd_rds.src:Exe_Cmd...
trace after cmd_rds.src:Exe_Cmd+2 <RETURN> (Since the instruction at Exe_Cmd label is two bytes instruction, the next instruction starts from Exe_Cmd+2.) modify memory Cmd_Input bytes to 41h <RETURN> Trace List Offset=0 Label: Address Data Opcode or Status time count Base: symbols mnemonic w/symbols absolute after...
Page 46
Trace List Offset=0 Label: Address Data Opcode or Status time count Base: symbols mnemonic w/symbols absolute after cmd_rds.:Exe_Cmd AA41 AA41 fetch mem ------------ +001 cmd_rds.src:Scan 6A0A MOV.B @:Cmd_Input,R2L + 200 +002 :cmd_rds.s:+000C FC00 FC00 fetch mem + 400 +003 :cmd_rds.s:+000E AA00 CMP.B #00,R2L + 600...
As you can see the execution of CMP.B instructions are not disassembled. This occurs when the analyzer cannot get necessary information for disassembling because of the store condition. Be careful when you use the trace only command. Triggering the You may want to trigger the emulation analyzer when specific data appears on the data bus.
Be careful to trigger the analyzer by data. For a Complete For a complete description of using the HP 64700 Series analyzer with the Softkey Interface, refer to the Analyzer Softkey Interface User’s Description Guide.
emul700 command. When you enter the Softkey Interface via pmon and MEAS_SYS, only one window is permitted. Refer to the Softkey Interface Reference manual for more information on using the Softkey Interface with window systems. Selecting the When you enter the Softkey Interface via pmon and MEAS_SYS, you have the option to select the measurement system display or another Measurement System module in the measurement system when exiting the Softkey Interface.
Using the H8/338 Emulator In-Circuit When you are ready to use the H8/338 Emulator in conjunction with actual target system hardware, there are some special considerations you should keep in mind. installing the emulator probe properly configure the emulator We will cover the first topic in this chapter. For complete details on in-circuit emulation configuration, refer to Chapter 4.
Pin Guard The HP 64793 emulator is shipped with a pin guard to prevent impact damage to the target system probe pins. The guard should be left in place while you are not using the emulator.
H8/329 Emulator HP 64793B H8/329 emulator is shipped with a conductive plastic pin guard over the target system probe pins. When you do use the emulator, either for normal emulation tasks, or to run performance...
Note When you are using the H8/338 emulator, we recommend that you use ITT CANNON "LCS-84" series 84 pin PLCC socket to make sure the contact between emulator probe and target system microprocessor socket. Figure 3-1. Installing the Probe (H8/338 emulator) 3-4 In-Circuit Emulation...
Figure 3-2. Installing the Probe (H8/329 emulator) Pin State in While the emulator is running the background monitor, probe pins are in the following state. Background Address Bus Same as foreground Data Bus Always high impedance otherwise you direct the emulator to modify target memory.
Target System Interface (H8/338) MD1 MD0 These signals are connected to 74HCT14 RES NMI through 51 ohm series resistor and 10K ohm STBY pull-up resistor. P1(7:0) P5(2:0) These signals are connected to H8/338 P2(7:0) P6(7:0) emulation processor through 51 ohm series P3(7:0) P8(6:0) resistor and 10K ohm pull-up resistor.
Page 56
This signal are connected to H8/338 emulation processor and GAL20V8 through 51 ohm series resistor. P7(7:0) These signals are connected to H8/338 emulation processor through 51 ohm series resister 3-7 In-Circuit Emulation...
Target System Interface (H8/329) MD1 MD0 These signals are connected to 74HCT14 RES NMI through 51 ohm series resistor and 10K ohm STBY pull-up resistor. P1(7:0) P4(6:0) These signals are connected to H8/329 P2(7:0) P5(2:0) emulation processor through 51 ohm series P3(7:0) P6(7:0) resistor and 10K ohm pull-up resistor.
Page 58
This signal are connected to H8/329 emulation processor and GAL20V8 through 51 ohm series resistor. P7(7:0) These signals are connected to H8/329 emulation processor through 51 ohm series resister 3-9 In-Circuit Emulation...
In-Circuit The H8/338 emulator provides configuration options for the following in-circuit emulation issues. Configuration Refer to the "Configuring the Emulator" for more information on these Options configuration options. Using the Target System Clock Source You can configure the emulator to use the external target system clock source.
The emulator is a flexible instrument and may be configured to suit your needs at any stage of the development process. This chapter describes the options available when configuring the HP 64793 emulator. The configuration options are accessed with the following command.
Page 61
Memory Configuration: Mapping memory. Emulator Pod Configuration: Selecting the microprocessor to be emulated. Selecting the processor operation mode. Enabling /NMI input from the target system. Enabling /RES input from the target system. Setting up the reset value for the stack pointer. Debug/Trace Configuration: Enabling breaks on writes to ROM.
General Emulator The configuration questions described in this section involve general emulator operation. Configuration Micro-processor This configuration question allows you to select whether the emulator will be clocked by the internal clock source or by a target system clock clock source? source.
When reset to monitor is selected, the emulator will be running in the monitor after configuration is complete. If the reset to monitor fails, the previous configuration will be restored. After the configuration is complete, the emulator will be held in the reset state. Restrict to real-time The "restrict to real-time"...
Memory The memory configuration questions allow you to select the monitor type and to map memory. To access the memory configuration Configuration questions, you must answer "yes" to the following question. Modify memory configuration? Mapping memory The emulation memory consists of 64K bytes, mappable in 128 byte blocks.
Page 65
Blocks of memory can also be characterized as guarded memory. Guarded memory accesses will generate "break to monitor" requests. Writes to ROM will generate "break to monitor" requests if the "Enable breaks on writes to ROM?" configuration item is enabled (see the "Debug/Trace Configuration"...
Emulator Pod To access the emulator pod configuration questions, you must answer "yes" to the following question. Configuration Modify emulator pod configuration? Processor type? This configuration defines the microprocessor to be emulated. H8/338 Emulator When you are going to emulate H8/336 microprocessor, select this item.
Processor operation This configuration defines operation mode in which the emulator works. mode? external The emulator will work using the mode setting by the target system. The target system must supply appropriate input to MD0 and MD1. If you are using the emulator out of circuit when "external"...
Enable /NMI input This configuration allows you to specify whether or not the emulator responds to /NMI (non-maskable interrupt request) signal from the from the target target system during foreground operation. system? The emulator will respond to the /NMI request from the target system.
Debug/Trace The debug/trace configuration questions allows you to specify breaks on writes to ROM, and specify that the analyzer trace Configuration foreground/background execution, and bus release cycles. To access the trace/debug configuration questions, you must answer "yes" to the following question. Modify debug/trace options? Break processor on This question allows you to specify that the emulator break to the...
foreground Specifies that the analyzer trace only foreground cycles. This option is specified by the default emulator configuration. background Specifies that the analyzer trace only background cycles. (This is rarely a useful setting.) both Specifies that the analyzer trace both foreground and background cycles.
Saving a The last configuration question allows you to save the previous configuration specifications in a file which can be loaded back into the Configuration emulator at a later time. Configuration file name? <FILE> The name of the last configuration file is shown, or no filename is shown if you are modifying the default emulator configuration.
Using the Emulator Introduction In the "Getting Started" chapter, you learned how to load code into the emulator, how to modify memory and view a register, and how to perform a simple analyzer measurement. In this chapter, we will discuss in more detail other features of the emulator. This chapter discusses: Features available via "pod_command".
Note and the configuration files in particular, assume that the configuration of the HP 64700 pod is NOT changed except by the Softkey Interface. Be aware that what you see in "modify configuration" will NOT reflect the HP 64700 pod’s configuration if you change the pod’s configuration with this...
Using a Command You can use a command file to perform many functions for you, without having to manually type each function. For example, you File might want to create a command file that loads configuration, loads program into memory and displays memory. To create such a command file, type "log"...
Debugging C Softkey Interface has following functions to debug C programs. Programs Including C source lines in memory mnemonic display Including C source lines in trace listing Stepping C sources The following section describes such features. Displaying Memory You can display memory in mnemonic format with C source lines. For example, to display memory in mnemonic format from address _main with C Sources with source lines, enter the following commands.
set source on inverse_video on <RETURN> Stepping C Sources You can direct the emulator to execute a line or a number of lines at a time. For example, to step one line from address _main, enter the following command. step source from _main <RETURN> To step 1 line from the current line, enter the following command.
Step Command and Step execution cannot be performed in the following cases. Interrupts When the emulator is in the monitor and a suspended interrupt is existed. When the emulator is in the monitor and a level sensed interrupt is existed (including interrupts from internal I/O device).
Storing Memory The "Getting Started" chapter shows you how to load absolute files into emulation or target system memory. You can also store emulation Contents to an or target system memory to an absolute file with the following Absolute File command.
Register Classes The following register classes and names are used with the display/modify registers commands in H8/338 emulator. and Names (H8/338 Emulator) BASIC (*) class Register name Description Program counter Condition code register Register 0 Register 1 Register 2 Register 3 Register 4 Register 5 Register 6...
Page 80
PORT class (I/O port) Register name Description P1DDR Port 1 data direction register P2DDR Port 2 data direction register P3DDR Port 3 data direction register P4DDR Port 4 data direction register P5DDR Port 5 data direction register P6DDR Port 6 data direction register P8DDR Port 8 data direction register P9DDR...
Page 81
TMR0 class (8 bit timer 0) Register name Description TCR0 Timer control register TCSR0 Timer control/status register TCORA0 Timer constant register A TCORB0 Timer constant register B TCNT0 Timer counter TMR1 class (8 bit timer 1) Regsiter name Description TCR1 Timer control register TCSR1 Timer control/status register...
Page 82
SCI0 class (Serial communication interface 0) Register name Description SMR0 Serial mode register BRR0 Bit rate register SCR0 Serial control register TDR0 Transmit data register SSR0 Serial status register RDR0 Receive data register SCI1 class (Serial communication interface 1) Register name Description SMR1 Serial mode register...
Page 83
DAC class (D/A converter) Register name Description DADR0 D/A data register 0 DADR1 D/A data register 1 DACR D/A control register No class The following register names are not included in any register class. Register name Description Register 0 H Register 0 L Register 1 H Register 1 L...
Register Classes The following register classes and names are used with the display/modify registers commands in H8/329 emulator. and Names (H8/329 Emulator) BASIC (*) class Register name Description Program counter Condition code register Register 0 Register 1 Register 2 Register 3 Register 4 Register 5 Register 6...
Page 85
Port class (I/O port) Register name Description P1DDR Port 1 data direction register P2DDR Port 2 data direction register P3DDR Port 3 data direction register P4DDR Port 4 data direction register P5DDR Port 5 data direction register Port 6 data direction register P6DDR P7DDR Port 7 data direction register...
Page 86
TMR0 class (8 bit timer 0) Register name Description TCR0 Timer control register TCSR0 Timer control/status register TCORA0 Timer constant register A TCORB0 Timer constant register B TCNT0 Timer counter TMR1 class (8 bit timer 1) Register name Description TCR1 Timer control register TCSR1 Timer control/status register...
Page 87
ADC class (A/D converter) Register name Description ADDRA A/D data register A ADDRB A/D data register B ADDRC A/D data register C ADDRD A/D data register D ADCSR A/D control/status regieter ADCR A/D control register No Class The following register names are not included in any register class. Register name Description Register 0 H...
Page 88
Index absolute file, loading, 2-11 absolute files storing, 5-7 analyzer configuring the external, 4-11 features of, 1-4 H8/338 status qualifiers, 2-26 triggering by data, 2-30 using the, 2-22 assembling the getting started sample program, 2-6 background cycles tracing, 4-10 blocked byte memory display, 2-16 breaks, 1-5 break command, 2-17 guarded memory accesses, 4-6...