HP 64739
H8/536 Emulator
PC Interfa ce
User’s Guide
HP Part No. 64739-97004
Pri nted in U.S. A.
Febru ary 1994
Edition 2
Notice Hewl ett -P acka rd ma kes no war ranty of any ki nd with re gar d to
thi s mate rial , incl uding, but not lim ited to, the implie d warranti es
of m erchant abil it y and fit ness for a particular purpose .
Hewl ett- Pac kar d shal l not be l iabl e for e rro rs con taine d herei n or fo r
in cidenta l or consequential dam a ges i n connecti on wi th t he fu rni shin g,
performa nc e, or use of thi s mate ri al.
Hewl ett- Pac kar d assum e s no responsi bil it y for t he use or re liab il ity of
its soft ware on eq uip me nt t ha t is not fur nish ed by He wle tt-Packard.
© Cop yright 1 994, Hewlet t-Packard Company.
This do cum e nt cont ains prop rie ta ry infor ma ti on, which is protec ted by
co pyri ght . All rights are reserve d. No par t of this docum ent m ay b e
pho toc opi ed , re pro duc ed or tra nslated to anothe r langua ge without the
pri or wri tt en consent of Hewl et t-Pa ck ard Com pan y. T he informatio n
co nta in ed i n thi s doc um ent is subjec t to cha nge wit hout not ic e.
MS-DOS is a tradem ark of Micro soft Corpo ratio n.
UNIX is a regi ste re d tradema rk of AT& T .
Torx i s a reg ist ered tr ade m ark of Cam c ar Di visi on of Te xtr on, Inc .
Hewlett -Packa rd Company
P.O.Box 2197
190 0 G arden of the Gods Road
Col orado Spri ngs, CO 80901-2197, U.S.A .
RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure
by the U. S. Governm ent is subj ect to rest ri ct ion s set fo rth in
subp ara gra ph (C ) (1) (i i) of the Rig hts in Te ch nic al Dat a and Com puter
Soft war e Clause at DFARS 252. 227 -7013. Hewle tt -Pa ckard Co mp any ,
300 0 Hanover Stre et, Pa lo Alto, CA 943 04
Printing History New edit io ns are compl et e revisions o f the manua l. The date on the
titl e page cha nge s only wh en a n ew ed it ion is publ ished.
A soft ware cod e may be pri nte d be fore the dat e; thi s ind ic at es th e
versio n level of the soft war e produc t at the time the ma nua l was issue d.
Man y prod uct upda tes and fixe s do not requir e manual c ha nge s, a nd
manual correc ti ons may be done wit hout accompanying product
ch anges. There fore, do not exp ect a
one -t o-on e corre spond enc e betwe en product u pda tes and m an ual
revisions.
Edi tio n 1 647 39-9 7001 , Febr uar y 1990
Edi tio n 2 647 39-9 7004 , Febr uar y 1994
Using This Manual
This m an ual introduce s you t o the following emu la tors as used wi th the
PC Int er fac e.
HP 6473 9A H8/5 36 emul ator
HP 6473 9B H8/ 536S emu la tor
Throughou t this doc umen tati on, the fol lowi ng na m es ar e use d to
denot e th e micropr oce ssors listed in the followi ng t abl e of suppor te d
microprocessors.
Mode l Support ed Mic ropr oc essor s Re ffe red to a s
HP 6473 9A(H8/ 536 em ulato r) HD647 5368 CP
HD6435368CP
HD6475348CP
HD6435348CP
H8/536
H8/536
H8/534
H8/534
HP 64 739B (H8/ 536S emu lator ) HD647 5368 CP
HD6435368CP
HD6475348CP
HD6435348CP
HD6475368SCP
HD6435368SCP
HD6475348SCP
HD6435348SCP
H8/536
H8/536
H8/534
H8/534
H8/536S
H8/536S
H8/534S
H8/534S
For the most part , t he H8/536 and H8/53 6S em ul ators al l operate the
sam e wa y. Diffe rence s of be twe en t he e mu la tor s are desc ribed whe re
th ey exist . B oth the H8/53 6 and H8/536S emul at ors wil l be referred to
as the "H8/ 536 em ulato r". In the spec if ic instances whe re H8/53 6 S
emul at or di ffers fro m H8/536 e m ula to r, it wi ll be de scri be d as
"H8/ 536S emu lator".
This m an ual will:
Show yo u how to use emul at io n comm an ds by ex ec uting t hem
on a sam ple program and desc ri bing the ir r esul ts.
Show yo u how to conf igu re the emu la tor for your
de vel opm e nt need s. Topics in cl ude : re stri ct in g the em ul at or
to real-ti me exec ution , and selecting a target system clock
source.
Show yo u how to use the em ul at or i n-c irc ui t (c onne ct ed to a
targe t system ).
Desc ribe t he comma nd syn ta x which is spe cifi c to t he H8 /53 6
emulator.
This m an ual does not:
Show yo u how to use ev ery PC I nterfa ce comm an d and
opt io n; the PC In te rfa ce is desc ri bed in th e HP 64700
Emula tors P C Int erf ace: Use r’s Refe ren ce.
Organization
Chap ter 1 Intr oduct ion to t he H8/5 36 Emulat or. This chapter list s the H8/536
emul at or fe at ure s and desc ribes how they can h elp you i n dev el opi ng
new hardware and software.
Chap ter 2 Getting Starte d. This c hapte r shows you how to use emul atio n
co mm ands by e xecut ing the m on a sample progra m. This ch apter
de scri be s the sa mple program and how to use ba sic em ula ti on
commands.
Chap ter 3 In-Ci rcuit Em ula tio n. This chap te r shows you how to plug t he
emul ator i nto a targe t syst em, and ho w t o use t he "in-c ir cuit" e mu lati on
features.
Chap ter 4 Confi gur ing the Emulato r. You ca n con fig ure t he em ulato r to adapt
it to yo ur specific devel opm ent needs. Th is ch apt er describ es th e
opt io ns ava il ab le when confi guring the em ulato r and how to sa ve and
restor e parti cu lar con fig ura ti ons.
Chap ter 5 Using the Emulator . This ch apter d esc rib es em ul at ion top ic s wh ic h
ar e not cov ered in the "Gett ing Started" ch apt er (for e xam ple,
coordi na te d measu rem ents a nd sto rin g mem ory) .
Appendix A F ile Format Re ader s. T hi s a ppe ndi x de scri be s h ow to use the
HP 6486 9 Format Reade r from MS-DOS, load absolu te files into the
emulator, use g lob al and l oca l sym b o ls wit h th e PC Int er fac e.
Notes
Contents
1 Intro ducti on to the H8/53 6 Emul ato r
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Purp ose of the H8 /536 Emul ator . . . . . . . . . . . . . . . . . . . 1-1
Fea tures of the H8/536 Emulator . . . . . . . . . . . . . . . . . . . 1-3
Supp orted Mi croprocessors . . . . . . . . . . . . . . . . . . . . 1-3
Clock Speeds . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Emulation memory . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Ana lysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
Single-Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
Target System Interface . . . . . . . . . . . . . . . . . . . . . . 1-5
Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
Reset Suppor t . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
Real-Time Operation . . . . . . . . . . . . . . . . . . . . . . . 1-6
Limitations,
Re strictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
DMA Support . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
Sle ep and S o ftware Stand -by M ode . . . . . . . . . . . . . . . . 1-6
Watch Dog Time r in Background . . . . . . . . . . . . . . . . . 1-6
RAM E nable Bit . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
2 Getti ng Star te d
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Before You Be gin . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Pre requisite s . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
A Lo ok at the Sample Program . . . . . . . . . . . . . . . . . . 2-2
Sample Pro gra m Assembly . . . . . . . . . . . . . . . . . . . . 2-6
Linking the Sa mple Program . . . . . . . . . . . . . . . . . . . 2-6
Starting Up the PC Interface . . . . . . . . . . . . . . . . . . . . . 2-7
Selecting PC Interface Commands . . . . . . . . . . . . . . . . 2-8
Emulator Status . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
Modi fying Co nfiguration . . . . . . . . . . . . . . . . . . . . . . . 2-8
Defining the Reset Value for the Stack Pointer . . . . . . . . . . 2-8
Sel ecti ng your Processor . . . . . . . . . . . . . . . . . . . . . 2-8
Contents-11
Sav ing the Configur at ion . . . . . . . . . . . . . . . . . . . . . 2-9
Map ping Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Which Memory Locati ons Should Be Mapped? . . . . . . . . . 2-9
Loading Program s i nto Memory . . . . . . . . . . . . . . . . . . 2-12
Fil e For ma t . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Mem ory Type . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Forc e Abso lut e Fi le Rea d . . . . . . . . . . . . . . . . . . . . 2-13
Absol ut e File Na me . . . . . . . . . . . . . . . . . . . . . . . 2-13
Usin g Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Disp laying Global Sy mbols . . . . . . . . . . . . . . . . . . . 2-14
Disp la ying Lo ca l Symbols . . . . . . . . . . . . . . . . . . . 2-15
Transfer Sy mbols to the Em ulat or . . . . . . . . . . . . . . . 2-17
Disp la ying Memory in Mnemonic Format . . . . . . . . . . . . . 2-18
Ste pping Through t he Program . . . . . . . . . . . . . . . . . . . 2-19
Spe ci fying a St ep Count . . . . . . . . . . . . . . . . . . . . . 2-20
Modi fying Me mory . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
Run ning the Program . . . . . . . . . . . . . . . . . . . . . . . . 2-22
Sea rching Memory for Data . . . . . . . . . . . . . . . . . . . . 2-23
Bre aking int o the Monitor . . . . . . . . . . . . . . . . . . . . . 2-23
Usin g Software Breakpoints . . . . . . . . . . . . . . . . . . . . 2-24
Def ini ng a So ftware Brea kpoint . . . . . . . . . . . . . . . . 2-25
Disp la ying Software Breakpoin ts . . . . . . . . . . . . . . . . 2-26
Set ti ng a So ftware Brea kpoint . . . . . . . . . . . . . . . . . 2-26
Cl ea ring a Software Breakpoint . . . . . . . . . . . . . . . . . 2-26
Usin g the Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
Re setting the Analysis Specif ic ation . . . . . . . . . . . . . . 2-27
Spe ci fying a Si mple T rigger . . . . . . . . . . . . . . . . . . 2-27
Sta rting the Tra ce . . . . . . . . . . . . . . . . . . . . . . . . 2-31
Disp laying the Trac e . . . . . . . . . . . . . . . . . . . . . . 2-31
For a Complete Descripti on . . . . . . . . . . . . . . . . . . . 2-33
Usin g a Command File . . . . . . . . . . . . . . . . . . . . . . . 2-33
Resetting the E mula tor . . . . . . . . . . . . . . . . . . . . . . . 2-34
Exitin g the PC Interfac e . . . . . . . . . . . . . . . . . . . . . . 2-35
3 In-Circuit Emulat ion
Pre requisite s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Inst al li ng the T arget System Pr obe . . . . . . . . . . . . . . . . . . 3-2
Inst al li ng into a PLCC Ty pe Socket . . . . . . . . . . . . . . . . . 3-3
Running the Emulator from Target Reset . . . . . . . . . . . . . . 3-4
4 Confi guri ng the Emul ator
12-Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Acc essing the Emulator Configurat ion Options . . . . . . . . . . . 4-2
Internal Emulator Clock? . . . . . . . . . . . . . . . . . . . . . . . 4-3
Enable Rea l-T i me Mode? . . . . . . . . . . . . . . . . . . . . . . 4-3
Enable Brea ks on Writes to ROM? . . . . . . . . . . . . . . . . . . 4-5
Enable So ftware Brea kpoints? . . . . . . . . . . . . . . . . . . . . 4-6
Enable CMB Interaction? . . . . . . . . . . . . . . . . . . . . . . . 4-7
Enable Bus Arbitration? . . . . . . . . . . . . . . . . . . . . . . . 4-8
Dri ve Ba ckground Cycles to T arget? . . . . . . . . . . . . . . . . . 4-9
Enable NMI Input from T arget? . . . . . . . . . . . . . . . . . . 4-10
Enable /RE S Input fro m T arget ? . . . . . . . . . . . . . . . . . . 4-11
Dri ve E mula ti on Reset to T arget? . . . . . . . . . . . . . . . . . 4-12
Trac e Bus R el ea se Cycles? . . . . . . . . . . . . . . . . . . . . . 4-12
Proc essor type . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
Proc essor Operation Mode . . . . . . . . . . . . . . . . . . . . . 4-13
Moni to r Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
Fore ground Mon itor Address . . . . . . . . . . . . . . . . . . . . 4-15
Reset Valu e for St ac k Pointer? . . . . . . . . . . . . . . . . . . . 4-16
Sto ring an E m ula tor Configuration . . . . . . . . . . . . . . . . . 4-17
Loading an Emula tor Configur at ion . . . . . . . . . . . . . . . . 4-17
5 Using the Emul ato r
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Mak ing Coordina te d Measurem ent s . . . . . . . . . . . . . . . . . 5-2
Running the Emulator at /EXECUTE . . . . . . . . . . . . . . . 5-3
Bre aking o n the Anal yzer Trigger . . . . . . . . . . . . . . . . 5-3
Sto ring Memory C ontent s to a n Absolute Fil e . . . . . . . . . . . . 5-5
Acc essi ng Tar get System with E cloc k sync hron ous in stru ction . . 5-5
Register Names and Classes . . . . . . . . . . . . . . . . . . . . . 5-6
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
* (Basic) Class . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
sys Cl ass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
intc Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
dtc Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
port Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
frt1 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
frt2 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
frt3 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
tmr Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
pwm1 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
pwm 2 Cl ass . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
Contents-13
pwm 3 Cl ass . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
wdt Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
sci 1 Cl ass . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
sci 2 Cl ass . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11
adc Cl ass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11
A File Format Readers
Usin g the HP 64000 Reader . . . . . . . . . . . . . . . . . . . . . A-1
What the Reader Accomplishes . . . . . . . . . . . . . . . . . . A-1
Location of the HP 64000 Reader P r ogra m . . . . . . . . . . . . A-3
Using the Reader from MS-DOS . . . . . . . . . . . . . . . . . A-3
Usin g the Rea der from the PC Inter fac e . . . . . . . . . . . . . A-4
If the Reader Won’t Run . . . . . . . . . . . . . . . . . . . . . A-5
Inc luding RHP64000 in a Make File . . . . . . . . . . . . . . . A-5
Usin g the HP 64869 Reader . . . . . . . . . . . . . . . . . . . . . A-6
What the Reader Accomplishes . . . . . . . . . . . . . . . . . . A-6
Location of the HP 64869 Reader P r ogra m . . . . . . . . . . . . A-8
Using the HP 6 4869 Reader from MS-DOS . . . . . . . . . . . A-8
Usin g the HP 64869 Reader from the PC Interfac e . . . . . . . . A-8
If the Re ad er W on’t Run . . . . . . . . . . . . . . . . . . . . A-10
Inc luding RD64869 in a Make File . . . . . . . . . . . . . . . A-10
Illustrations
Fig ure 1-1. HP 64739 Emulat or for the H8/536 Processor . . . . . 1-2
Fig ure 2-1. Sample Prog ram Listing . . . . . . . . . . . . . . . . . 2-3
Fig ure 2-2. Linkage E ditor Subc ommand File . . . . . . . . . . . . 2-6
Fig ure 2-3. PC Int erfac e Disp lay . . . . . . . . . . . . . . . . . . . 2-7
Fig ure 2-4. Sam ple Prog ram Load Ma p Listing . . . . . . . . . . 2-10
Fig ure 2-5. Memory C onfigurat ion Di splay . . . . . . . . . . . . 2-11
Fig ure 2-6. Modifying th e T race Spe ci fica ti on . . . . . . . . . . 2-30
Fig ure 2-7. Modifying th e Pattern Specifi ca ti on . . . . . . . . . . 2-30
Fig ure 3-1. Installing into a PL CC type socket . . . . . . . . . . . 3-3
Fig ure 4-1. H8/536 General E mulato r Configurat ion . . . . . . . . 4-2
Fig ure 5-1. Cross Trigger Configurat ion . . . . . . . . . . . . . . . 5-4
14-Contents
Tables
Tabl e 1- 1. Supported Mic roprocessors . . . . . . . . . . . . . . . . 1-3
Table 1-2. Clock Speeds . . . . . . . . . . . . . . . . . . . . . . . 1-4
Contents-15
Notes
16-Contents
1
In troducti on t o th e H8/ 536 Emu lator
Introduction The topics in this chapter include:
Purp ose of the H8/53 6 emul at or.
Fea tu res of t he H8/53 6 emulator.
Purpose of the
H8/536 Emulator The H8/536 emula to r is design ed to rep lace the H8/53 6 microprocessor
in your t arget system to help you debu g/i ntegr ate target system
soft war e and hardware. T he emul ator pe rfor ms j ust l ike the proc esso r
whi ch i t replaces, but a t th e same t im e , it gives you information about
the bus cycl e operati on of the proc essor . The emu la tor give s you
co ntr ol ov er targ et syste m execut ion and a ll ows you t o view or m odify
the conte nt s of proc esso r registers, target system mem ory .
In tro ducti o n 1-1 7
Figu re 1-1. HP 64739 Emu lat or for the H8/536 Pro cesso r
1-18 Int rod ucti on
Feature s of t he
H8/536 Emulator This section i nt rodu ce s you to t he fea tur es of t he emulator . The
ch apt er s whic h fol low show y ou how to use t hese features.
Supported
Microprocessors The H8/536 emula to r supports t he microp roc essor s list ed in T able 1-1.
Table 1-1. Supported Microprocessors
Mode l Support ed Mic ropr oc essor s Re ffe red to a s
HP 6473 9A(H8/ 536 em ulato r) HD647 5368 CP
HD6435368CP
HD6475348CP
HD6435348CP
H8/536
H8/536
H8/534
H8/534
HP 64 739B (H8/ 536S emu lator ) HD647 5368 CP
HD6435368CP
HD6475348CP
HD6435348CP
HD6475368SCP
HD6435368SCP
HD6475348SCP
HD6435348SCP
H8/536
H8/536
H8/534
H8/534
H8/536S
H8/536S
H8/534S
H8/534S
Clock S peeds You can se le ct whet her the em ula to r wil l be clo cked by the interna l
cloc k sourc e or by the external clock sourc e on yo ur targe t syst em. You
must use a cl oc k input confo rm ing t o the speci ficat io n of Tabl e 1-2.
When you use a n ex ternal crysta l, you nee d to input con form i ng to t he
spe cificatio n of micropr ocessor.
In tro ducti o n 1-1 9
Table 1-2. Clock Speeds
Clo ck source Mode l Micropr ocessor Cloc k Spee d
Int ern al HP 647 39A
(H8/ 536 emu la tor ) H8/536
H8/534 10MHz
(Syst em clock)
HP 647 39B
(H 8/5 36S em u lat o r ) H8/536
H8/534
H8/536S
H8/534S
10MHz
(Syst em clock)
External HP 64739A
(H8/ 536 emu la tor ) H8/536
H8/534 Fro m 0.5 up to 1 0MH z
(Syst em clock)
HP 647 39B
(H 8/5 36S em u lat o r ) H8/536
H8/534 Fro m 0.5 up to 1 0MH z
(Syst em clock)
H8/536S
H8/534S From 0. 5 up to 16M Hz
(Syst em clock)
Emulation memory The H8/ 536 e m ula to r is use d wit h one of the fol lowi ng E m ula ti on
Mem or y Car ds.
HP 6472 6A 128K by te E mul at ion Mem ory Card
HP 6472 7A 512K by te E mul at ion Mem ory Card
HP 6472 8A 1M byt e Emu lati on Mem or y Car d
You can de fi ne up to 16 m emo r y ran ges (a t 256 byt e boundarie s and
least 256 byte in le ngt h. ) The em ul at or oc cu pie s 2K byte, whic h is
use d for moni to r prog ram, leaving 126K, 510K, 1022 K byte of
emulation mem ory whi ch you m ay use . You c an cha racterize m e mo ry
ra nge as em ul at ion RAM (era m ), em ula ti on ROM (e rom ), targe t
syst em RAM (tr am), ta rge t system ROM (tr om ), or guarde d mem ory
(gr d). The emul ator gener at es an erro r messag e when accesses ar e
made to guarded memory locations. You can also configure the
emulator so t hat writ es t o mem ory defi ned as ROM ca use e mu la tor
ex ecuti on t o bre ak out of target progr am execu ti on.
1-20 Int rod ucti on
Analysis The H8/ 536 e m ula to r is use d wit h one of the fol lowi ng a nal yz ers
whi ch allows you t o trace code exec ution a nd pro ce ssor acti vity.
HP 6470 4A 80-c ha nne l Emu lati on Bus Ana ly zer
HP 6470 3A 64-c ha nne l Emu lati on Bus Ana ly zer and
16 -chann el Stat e/Tim in g Anal y zer.
HP 6479 4x 80-cha nne l 8K/ 64K/ 256K Em ula tion Bus
Analyzer.
The Em ula tion Bus An alyze r moni tor s the em ula tion processor usi ng
an interna l analysis bus. The HP 64703A 64-channel Emula tion Bus
Ana lyz er and 16 -chann el Stat e/ Tim in g Anal yz er all ows you t o prob e
up to 16 diffe ren t line s in you r ta rge t system .
Registers You can di spl ay or mo d ify t he H8/53 6 int er nal reg ist er c ont ent s. Thi s
in cludes t he abi li ty to mo dify the prog ram co unt er (PC ) and c ode pag e
re gist er ( CP) so you can c ont rol wher e the emulator be gins exe cu ti ng a
targe t system pro gra m.
Single-Step You can dire ct the em ulati on pr ocessor t o execu te a single inst ruc ti on
or a specified number of instructions.
Target System
Interface You c an set the interfa ce to the targe t system to be active or passi ve
dur ing b ackground monito r operatio n. (See th e "Configuri ng th e
Emulat or" ch apter fo r further details.)
Breakpoints You can set up the emula tor /a nalyz er inte ra ction so t hat whe n the
an al yze r fi nds a spe cific state , em ula tor exe cu ti on wil l br eak to t he
backgroun d monit or.
You can also de fi ne softwa re br eakpoi nt s in you r prog ram. The
emul at or use s one of H8/5 36 und efi ne d opcode (1B he x) as sof twa re
bre akpoint interru pt instr uct io n. When you defi ne a software
bre ak poi nt, the emulator places t he br ea kpoint int errupt inst ruction (1B
hex) at the specifie d address; after t he b rea kpoint interrupt instructi on
cause s em ula tor exe cu tion to break out of you r prog ram, the emul at or
re places the ori ginal opcode. Refer t o the "Using Software
Bre ak poi nts" se ct ion of "Get ti ng Sta rt ed" c hap te r for more inf orm at io n.
In tro ducti o n 1-2 1
Reset Support The e mu lator can b e reset from the emul at ion system under your
contr ol; or you r targe t system can reset the emu la tion pro ce ssor.
Real-Time Operation Real -tim e signif ie s cont in uous e xecut ion of your progr am without
in terference from the emulator. (Such interference occur s wh en the
em ul at or t em p orari ly breaks into t he m oni tor so that it ca n ac ce s s
re gist er c ont en ts or t arg et system memo r y. )
Emu la tor fea tur es pe rformed in real ti me in cl ude : run nin g and ana lyz er
tracing.
Emu la tor fea tur es not per form e d in real time inclu de: displa y or modify
of target syste m m emory; load /du mp of any me mo ry, displa y or
modific at io n of re gist ers, and single ste p.
Limitati ons,
Restrictions
DMA Support Dir ec t memory a ccess t o H8/5 36 emul atio n mem ory i s not perm itte d.
Sleep and Software
Stand-by Mode When the emulator breaks into the emulation monitor , H8/536
mic ropr oce ssor sl eep or soft war e stand- by m ode is relea sed and c om es
to normal processor mode .
Wa tch Dog Timer in
Background Wat ch dog time r suspends c ount up whi le the emula to r is run nin g in
backgroun d monit or.
RAM Enable Bit T he internal RAM of H8/53 6 processor can be enab le d/d isa ble d by
RAME (RAM enable bit) . However , once you m ap the internal RAM
area to emul atio n RAM, the emula tor accesses em ulat ion RAM even if
the interna l RAM is disab led by RAME.
1-22 Int rod ucti on
2
Getti ng S tarted
Introduction This c hap ter leads you through a basi c, ste p by st ep tuto ria l that shows
how to use t he HP 64739 emul at or wi th the PC Inte rfa ce .
This c hap te r wil l:
Tel l you what must be done befor e you can use the emul ator
as shown in the t utoria l exampl es.
Desc ri be the samp le progr am used for th is ch apter ’s exa m ples.
Bri efly de scr ibe how PC Int er face com ma nds are ente re d and
how emu la tor stat us is di spl ayed.
This c hap te r will show yo u how to:
Sta rt up the PC Interf ace fro m the MS-DOS prom pt.
Def ine (map) emula tion a nd targe t system memory .
Load progr am s into em ul atio n and tar get system me mo ry.
E nte r em ul at ion com m ands to vi ew e xecut ion of the sam ple
program.
Getti n g Started 2-2 3
Before You Begin
Prerequisites Be fore beg inn ing t he tutori al prese nt ed i n thi s cha pt er, you must hav e
co mp le ted the fol lowi ng t asks:
1 . Connec ted th e emul ator t o your com put er . The HP 64700
Emulators: Hardware Installation and Configuration ma nual
shows yo u how to do this.
2 . Instal led th e PC Inter face sof twa re on your c omputer.
Soft war e insta llat ion instructi ons ar e shippe d wit h the medi a
containing the PC Interface software. Th e HP 64700
Emula tors P C Int erf ace: Use r’s Refe ren ce manual contains
ad dit ional inf orm at io n on the installat ion and setup o f the PC
Interface.
3 . In addi ti on, it i s recom m end ed, alth ough n ot requi re d, tha t you
re ad a nd und erst and the con ce pts of e m ula ti on pr ese nted in
the HP 64700 Emula tors: System Overview manual . T he
System Overview also co ver s HP 64700 Se rie s syste m
ar chi te ct ure . A brief unde rstandi ng of these co nce pt s ma y
he lp avoi d que sti ons la te r.
You sho uld rea d the HP 64 700 E mul ato rs PC In te rfac e:
User’s Reference man ual to lea rn how t o use the PC In terface
in g eneral. For the most part, th is manual contains
in form a tion specific to the H8/ 536 e mulato r.
A Look at the Sample
Program The samp le progr am used i n this ch apter i s liste d in Figure 2-1. The
program is a primit ive command interpreter.
Usin g the var iou s features of the emu la tor , we will show you how to
load this program into e mulation memory, execute it, monitor the
pro gra m’ s operation with the a na lyz er , and sim ulate e ntr y of di ffe ren t
co mma nds by usi ng t he " Memory Mo dif y" em ul at ion c om m and .
2-24 Getti n g Started
.GLOBAL Init,Msgs,Cmd_Input
.GLOBAL Msg_Dest
.SECTION Table,DATA
Msgs
Msg_A .SDATA "Command A entered "
Msg_B .SDATA "Entered B command "
Msg_I .SDATA "Invalid Command "
End_Msgs
.SECTION Prog,CODE
;***********************************************
;* Sets up the stack pointer.
;***********************************************
Init MOV:G.W #Stack,R7
;***********************************************
;* Clear previous command.
;***********************************************
Read_Cmd MOV:G.B #0,@Cmd_Input
;***********************************************
;* Read command input byte. If no command has
;* been entered, continue to scan for input.
;***********************************************
Scan MOV:G.B @Cmd_Input,R0
BEQ Scan
;***********************************************
;* A command has been entered. Check if it is
;* command A, command B, or invalid.
;***********************************************
Exe_Cmd CMP:E.B #H’41,R0
BEQ Cmd_A
CMP:E.B #H’42,R0
BEQ Cmd_B
BRA Cmd_I
;***********************************************
;* Command A is entered. R1 = the number of
;* bytes in message A. R4 = location of the
;* message. Jump to the routine which writes
;* the messages.
;***********************************************
Cmd_A MOV:I.W #Msg_B-Msg_A-1,R1
MOV:I.W #Msg_A,R4
BRA Write_Msg
;***********************************************
;* Command B is entered.
;***********************************************
Cmd_B MOV:I.W #Msg_I-Msg_B-1,R1
MOV:I.W #Msg_B,R4
BRA Write_Msg
Fi gure 2-2. Samp le Pro g ram List ing
Getti n g Started 2-2 5
Data Declaratio ns
The "T able " sectio n def ine s the messag es use d by the progra m to
respond to vario us com m and inp uts. These m essage s are label ed
Msg_A, Msg_B, and Msg_I.
;***********************************************
;* An invalid command is entered.
;***********************************************
Cmd_I MOV:I.W #End_Msgs-Msg_I-1,R1
MOV:I.W #Msg_I,R4
;***********************************************
;* Message is written to the destination.
;***********************************************
Write_Msg MOV:I.W #Msg_Dest,R5
Again MOV:G.B @R4+,R3
MOV:G.B R3,@R5+
SCB/EQ R1,Again
;***********************************************
;* The rest of the destination area is filled
;* with zeros.
;***********************************************
Fill_Dest MOV:G.B #0,@R5+
CMP:I.W #Msg_Dest+H’20,R5
BNE Fill_Dest
;***********************************************
;* Go back and scan for next command.
;***********************************************
BRA Read_Cmd
.SECTION Data,COMMON
;***********************************************
;* Command input byte.
;***********************************************
Cmd_Input .RES.B 1
.RES.B 1
;***********************************************
;* Destination of the command messages.
;***********************************************
Msg_Dest .RES.W H’3E
Stack .RES.W 1 ; Stack area.
Fi gure 2-1. Samp le Pro g ram List ing (Con t’d)
2-26 Getti n g Started
Initialization
The pr ogra m i nst ruc ti on at the Init l abe l initia lize s the stack p o int er.
Reading Input
The instr uctio n at the Read_Cmd la bel clea rs any r andom data or
pre vious co mm ands fro m the Cmd_Input byte. The Scan loop
co nti nually re ads t he Cmd_Input byte to see if a command is entered
(a v al ue ot her tha n 0 he x).
Processing Commands
When a com mand is ente red , the i nstr uct ions from Exe_Cmd to
Cmd_A d eterm i ne wheth er the com mand wa s "A", "B", or an inva li d
command.
If the c om mand i nput byt e is "A" (ASCII 41 he x), execu ti on is
transf erred to the instruc ti ons a t Cmd_A.
If the c om mand i nput byt e is "B" (ASC II 42 he x), exec uti on i s
transf erred to the instruc ti ons a t Cmd_B.
If the c om ma nd i nput byt e is neit he r "A" nor "B", an invalid com m an d
has b een enter ed, and exe cu tion is t ran sferred to th e instru ct ion s a t
Cmd_I.
The instr uct ions at Cmd_A, Cmd_B, a nd Cmd_I each load register R1
wit h th e le ngt h of the m essa ge t o be display ed and re gist er R4 wit h the
starting loca tion of the appropri ate message. Then, execution transfers
to Write_Msg which wri tes the appr opriate messa ge to the de sti natio n
loc ation, Msg_Dest.
Aft er the messa ge is writ te n, the inst ruc ti ons at Fill_Dest fill the
re maining d est ina ti on l oca ti ons wi th z ero s. (T he entire dest in at ion are a
is 20 hex by tes long .) The n, the p rogr am bra nch es ba ck to read th e
ne xt c om ma nd.
Getti n g Started 2-2 7
Sample Program
Assembly The sa mp le progr am is wri tt en for and assem bl ed with the HP 64 869
H8/ 500 Asse mble r/Li nka ge Edi tor . For exam ple, the follo wing
comm and was use d to assem bl e the samp le progr am.
C>h8asm cmd_rds.src /DEBUG <RETURN>
In addit ion to the assembler listing (cmd_rds.lis), t he "cmd_rds.obj"
re l ocat a b le f ile is c r eate d.
Linking the Sample
Program The samp le p rogr am can be linked wi th following comm an d and
ge ner at es an absolut e file . The cont ents of "cm d_ rds. k" li nka ge edi tor
subc omm and fil e is shown in Figure 2-2.
C>h8lnk /SUBCOMMAND=cmd_rds.k <RETURN>
In addition to the lin ker loa d ma p listi ng (cmd_rd s.map), the
"cm d_ rds. ab s" absol ut e file i s created .
Note You need to spe cify DEBUG comm an d line opti on to both a ssem bl er
an d linker com m an d to ge ne rate loca l sym bo l in form a ti on. The
DE BUG opt ion f or th e assem bler an d linke r dir ect to inc lud e local
sym bol inf orm atio n to the ob ject f ile.
debug
input cmd_rds
start Prog(1000),Table(1100),Data(0FC00)
print cmd_rds
output cmd_rds
exit
Figu re 2-2. Linkag e Ed itor Su bco mman d File
2-28 Getti n g Started
St arti ng Up th e PC
Interface If you hav e set up th e em ul at or devi ce tab le and t he HPTABLES shell
en vir onmen t variabl e as sho wn in t he HP 6470 0 Emulat ors PC
Int erf ace: Use r’s Refe ren ce , you can sta rt up t he H8/53 6 PC Int erf ace
by ente ri ng th e follo wing com m and f rom the MS-DOS prompt :
pch8536 <emulname>
In the c ommand a bove, pch8536 is the co mm a nd to start the PC
Int er face; "<e mulna m e> " i s the log ic al e m ula to r name g ive n in t he
emulator de vice t ab le . (To st art ver sion of the PC Int erf ac e th at
supports external timing analysys, substitute pth8536 for pch8536 in
th is co mm and.) If this c om mand i s successful, you wi ll see the di spl ay
shown in figure 2-3. If this co mma nd is no t suc cessful , yo u will be
given an error m essa ge and re tu rne d to the MS-DOS pr ompt.
Fi gure 2-3. PC Interface Disp l a y
Getti n g Started 2-2 9
Selecting PC
Interface Commands This m an ual wil l te ll you t o "sel ect" comma nds. You can sel ec t
comm a nds or com ma nd op ti ons by eit her using the lef t and rig ht arrow
ke ys to highl ig ht the op ti on and press the Enter key, or you ca n sim pl y
type t he first let te r of that option . If you sel ect th e wrong opt ion , you
can pre ss the ESC key to move back up the command tree.
When a comm an d or comm a nd opt io n is hi ghl igh te d, a short message
de scri bi ng th at opti on i s sh own on the bo tt om l in e of the di spl ay.
Em ulator Status The st atus of th e emulator i s shown on t he l ine abo ve the com ma nd
opt io ns. The PC Interfa ce periodical ly c hec ks th e sta tu s o f the
emulator a nd up d at es th e sta tu s lin e.
Modifying
Configuration You need to set up th e em ul at io n con fig ura ti on be fore using the sam pl e
pro gra m. To acc ess t he emu la ti on co nfi gura ti on di splay, en te r:
Config, General
Defining the Reset
Value for the Stack
Pointer
Even thou gh th e H8/ 536 emu la tor has a backgrou nd m oni tor , it
re qui res you to define a st ack poi nter.
Use the arrow ke ys to move the cursorto the "Reset value fo r Stack
Poi nter" fi el d, t ype 0fc80 and press Enter.
The st ack poi nte r value wil l be set to the sta ck po inter (SP) on en tranc e
to the e m ula ti on m onito r ini ti at ed R ESE T sta te (the "Emulation rese t"
status).
Selecting your
Processor You need to selec t the proce ssor yo u are going to e mula te. Use the
arrow ke ys to move the cur sor to t he "Proce ssor t ype ?" field. Use the
TAB key to sele ct the proc esso r you a re go ing to em ul at e.
2-30 Getti n g Started
Saving the
Configuration To save the config uration, use t he Enter k ey t o exi t t he fi el d in th e l ast
f ield. (The End key on Vec tra keyboa rds m ove s the cursor di rec tl y to
th e last fiel d. )
Mapping Me mory The H8/536 emula to r conta ins 12 6 kiloby tes of hig h-spe ed em ulation
mem ory (no wai t stat es re qui red ) tha t can be mappe d at a resolu ti on of
256 bytes.
The m em or y ma ppe r allows y ou to cha rac te ri ze m emory lo cati ons. I t
allo ws y ou spe ci fy whe the r a cert ai n ra nge o f mem ory i s prese nt in th e
targe t system or whe ther yo u wil l be using emula ti on mem or y for that
addre ss r ang e. You can also spec if y whethe r the targe t syst em mem ory
is ROM or RAM, a nd you can spec ify tha t emul at io n me mory be
trea ted as ROM or RAM. You ca n incl ude f unc tion co de infor ma ti on
with address ranges to further characteriz e the memory block.
Bl ock s of me m ory c an a lso be cha ra ct eri ze d as gu ard ed m em ory.
Gua rde d mem ory acc esse s will genera te "bre ak to monit or" reque sts.
Writes to ROM wil l ge ner at e "break to monitor " requ est s if th e "E nab le
bre ak s o n writes t o ROM?" confi guration ite m is ena bled (se e the
"Con fig uri ng the Emu lator" cha pter).
The memory mapper allows you to define up to 16 different map terms.
Note When you use t he H8/53 6 int er nal ROM and R AM, yo u mu st m ap
mem ory space whe re internal ROM and RAM are loca ted as each
emul atio n ROM and RAM.
Which Memory
Locations Should Be
Mapped?
Typicall y, a ssem bl ers g ene ra te rel oca ta bl e fi le s a nd l ink ers c om bin e
reloc at ab le files to form the abso lut e file. The lin ker loa d map li sti ng
wil l sho w what loc ation s your progra m will occ upy in m emory . A part
of link er l oad ma p listi ng for the sa mple prog ram (cmd _rds. m ap ) is
shown in Figure 2-4 .
Getti n g Started 2-3 1
From the load map l ist in g, you ca n see that the sa mp le progr am
oc cup ie s l oc ations in th ree add ress ra nge s. The code are a, whi ch
co nta in s the opco des a nd ope ra nds whi ch m ak e up the sa mp le program,
oc cup ie s l oc at ion s 1000 he x th roug h 1042 hex. The data a re a, whic h
co nta in s the ASC II va lue s of the messa ges t he pr ogra m display s, i s
oc cup ie s loc at ion s 1100 he x th rough 1133 hex. The de sti nat ion area,
whi ch cont ains the comm an d input by te and t he loca tions of the
messa ge de sti na ti on an d the sta ck, oc cup ies loc at ion s FC00 he x
throug h FC7F hex.
Two ma ppe r te rm s wil l be spec ifi ed for th e ex am pl e pro gra m. Sinc e
th e program write s to the de sti na ti on lo ca ti ons, the mappe r bl ock
conta in ing the dest inati on l ocati ons sho uld not be chara cteri zed as
ROM memory.
To ma p mem ory for th e sample progra m , sele ct :
Config, Map, Modify
*** LINKAGE EDITOR LINK MAP LIST ***
SECTION NAME START - END LENGTH
UNIT NAME MODULE NAME
ATTRIBUTE : CODE NOSHR
Prog H’0000:1000 - H’0000:1042 H’00000043
cmd_rds cmd_rds
* TOTAL ADDRESS * H’0000:1000 - H’0000:1042 H’00000043
ATTRIBUTE : DATA NOSHR
Table H’0000:1100 - H’0000:1133 H’00000034
cmd_rds cmd_rds
* TOTAL ADDRESS * H’0000:1100 - H’0000:1133 H’00000034
ATTRIBUTE : DATA SHR
Data H’0000:FC00 - H’0000:FC7F H’00000080
cmd_rds cmd_rds
* TOTAL ADDRESS * H’0000:FC00 - H’0000:FC7F H’00000080
Figure 2-4. Sample Program Load Map Listing
2-32 Getti n g Started
Usin g the arrow keys, move the cur sor to the "addr ess ra nge " fie ld of
te rm 1. Enter:
1000..1fff
Move the cursor to the "me mo ry ty pe" fi el d of t erm 1, and press t he
TAB key to sel ect the erom (emul at ion ROM) ty pe. Move the cursor
to t he "addr ess ra nge " field of ter m 2 and ente r:
0fc00..0fcff
Move the cursor to the "me mo ry ty pe" fi el d of t erm 2, and press t he
TAB key to sel ect the eram (emul at ion RAM) ty pe. To save your
memor y ma p, us e t he Enter key to exi t the fiel d in the lower righ t
corner. (The End key on Vec tra key boa rds moves the c urso r dir ectl y
to the l ast fie ld .) The me mo ry confi gura ti on di spl ay i s shown in Figure
2-5.
Figu re 2-5. Memo ry Con fi gurati o n Displ a y
Getti n g Started 2-3 3
When ma ppi ng m emory for you r ta rge t system programs, you may
wish to chara cter iz e emul at io n memory l oca tions c ont ai nin g prog rams
and con sta nts (l oc ations wh ich shoul d not be writt en to) a s ROM. This
wil l preve nt progr am s and const an ts fro m bein g writ ten ove r
acci de nta ll y, and will cause br ea ks when i nst ruc ti ons atte m pt to do so.
Note The m emo r y mappe r re -assigns bl oc ks of em ul at io n mem ory a fte r th e
in sert io n or de le ti on of m ap per t er ms. For exam pl e, if you mo dified
the conte nts of FC00 he x throug h FCFF hex abov e, delet ed t erm 1, and
displa ye d locatio ns FC00 he x throug h FCFF hex , you woul d notic e th e
co nte nt s o f tho se lo ca tions are not the sam e as the y were bef ore
de le ti ng th e m app er t erm .
Loading Programs
in t o Memo ry If yo u have alre ady assem bl ed and l ink ed the sa mp le progr am , you ca n
load the absol ute file by se lectin g:
Memory, Load
File Format Enter th e forma t of your absol ute file. The emul ator will acc ept
absolute fi les in the fol lowing formats:
HP 6486 9 absolute.
HP abso lute.
Raw HP64000 absolute.
Int el hexadecim al.
T ekt ro n ix he xadecim a l.
Mot orol a S-records.
The HP 648 69 ab solu te file is gene rat ed with HP 64 869 H8/ 300
Assem bler /L in kag e Editor. For this tu tor ia l, cho ose t he HP 64869
format.
2-34 Getti n g Started
HP 64869 F or mat : Whe n you loa d HP 64869 form at files, the PC
Int er fac e crea tes files (wh ose ba se na m es ar e th e same a s the abso lut e
file ) with the exten sion s ".HPA" an d ".HPS". The ".HPA" fil e is in a
binar y form a t that is compa ti ble wit h the HP 64736 fir mwa re . The
".HPS" fil e is an ASCII source file which cont ai ns th e symbol s to
address ma ppi ngs used by the PC Inter fac e. Refer to "Using HP 64869
Form at Re ader" sec ti on i n Appe ndi x A for m ore info rm ation.
HP64000 Fo rmat: Your lang uag e tool may genera te Raw HP640 00
for mat absol ute files (wi th ext ensi on . X, .L , .A). You can load these
file s by sel ecti ng "HP640 00" or "Ra w HP6400 0" as fi le form at . Whe n
you sele ct "HP6400 0", the PC I nterfa ce cre ates .HPA abso lut e file and
.HPS symb ol databa se. Whe n you se lect "Raw HP64 000", the PC
Int er face do esn’ t create the se fi le s.
Memory Type The secon d field all ows you to sel ecti ve ly load the port ion s of the
absolu te file whi ch resid e in em ulati on memor y, tar get system
mem ory , or both .
Sin ce e m ula ti on mem ory is mapp ed fo r sam pl e program loca ti ons, you
can en te r ei the r "em ul at io n" or "both".
Force Absolute File
Read This op ti on is on ly avai labl e for HP 64869 a nd HP640 00 for ma ts. It
for ces the fil e forma t read ers to reg ena ra te the e mula to r absolut e file
(.hpa ) an d symbol dat a base (.hps) befo re load ing t he code . Nor mall y,
th ese fil es ar e onl y re gen ara te d whe nev er t he file you spe ci fy (t he
out put of you r langua ge t ool s) is newer tha n the emul at or ab solute f ile
and symbol data base.
For more inf orm at ion, refer to the "Using t he HP 64869 Form a t
Re ade r" sec ti on i n Appe ndi x A.
Absolute File Name For most form ats, you en ter the name of your a bsol ut e fi le in th e last
fie ld. Type cmd_rds.abs, and press Enter to start the memory l oad.
Getti n g Started 2-3 5
Using Symbols The fo llowin g pag es show yo u how to displ ay glob al and loca l symbols
for the sample prog ram. For mo re infor ma tion on symb ol displ ay,
refer to the PC Int erface Refernce.
Displaying Global
Symbols When you load HP 64869 or HP64000 fo rm at absol ut e files int o the
emulator, th e co rre spond ing sy mb ol da ta ba se is a lso l oad ed.
The sym bo ls da ta base can also be loaded with the " System Symbols
Global Load" c om m and . This c om ma nd i s provi ded for situation s
whe re mul tiple absolut e files are loade d into the emul ator; it allo ws
you to lo ad the va ri ous set s of globa l symbol s corresp ondi ng t o the
va rio us abso lute file s. Whe n glo bal sym bol s are l oa ded into the
emulator, in form a ti on ab out previou s glob al symb ols i s lost (tha t i s,
onl y one set of glo bal symbols can be lo ade d at a tim e).
Aft er gl oba l sym bo ls are loade d, bot h glo bal and l oc al symb ols c an be
use d when e nteri ng e xpre ssio ns. Globa l symbols are enter ed as the y
ap pea r in t he sourc e fi le o r in the globa l symbols di spla y.
To disp lay glo bal symbol s, se le ct:
System, Symbols, Global, Display
The sym bo ls win dow au tom ati ca lly becom es t he act ive wind ow as a
re sult of th is co mm a nd. Yo u can pre ss <CT RL>z to z oom the
win dow. The result ing display follows.
2-36 Getti n g Started
The globa l symbols di spla y ha s two pa rts. Th e first part s list s al l the
modules that were linked to produc e this ob je ct fil e. T he se m odu le
name s are used by you when you want to refer to a loca l symbo l, and
are case- sensi ti ve . The secon d par t of the displ ay list s all glo bal
sym bol s in this m odu le. These name s can be used in measure m ent
spe cific atio ns, a nd are case -snesitive . For exa mp le, if you wi sh to
make a m ea surement using the sy mbol Cmd_Input, you must sp ec ify
Cmd_Input. The strings cmd_input or CMD_INPUT are not valid
sym bol names here.
Displaying Local
Symbols To disp lay local sym bol s, se lect:
System, Symbols, Local, Display
Enter th e name of th e modul e yo u want to spe ci fy (f rom the fir st pa rt of
the gl oba l symbol s disp la y; in this ca se, cmd_rds) and press Enter.
The re sul ti ng di splay follows.
Getti n g Started 2-3 7
Aft er you displa y local sym bol s with the System Symbols Local
Display command, you can enter local symbols as they appear in the
sour ce f ile or loca l symbo l displa y. When you disp lay local sym bol s
for a giv en m odule , that mo dul e be comes the defaul t lo ca l sym bol
module.
If yo u hav e not disp la yed loc al symb ols, you c an st ill e nte r a loca l
sym bol by in cl udi ng th e na me of th e module:
module_name:symbol
Re me mber tha t th e only va li d mo dule name s are tho se li ste d in the first
part of the glob al symbols di spl ay, and are case-se nsi tive for
comp atibili ty with othe r systems (such as HP-UX).
When you incl ude the name of an source fil e with a local sym bo l, that
module beco me s the default loca l sym bo l modul e, as wi th t he “System
Symbols Loca l Display” comm and.
Loca l symbo ls m ust be from assem bly mo d ules tha t form the absolute
whose symbol dat abase i s c urr ently l oaded. Ot her wise , no symb ols wi ll
be found (even if the nam ed assem bl er symb ol file exists a nd co nta ins
information).
2-38 Getti n g Started
One thi ng to note : It is possi ble for a sym bol to be loc al in one mo dul e
and glo bal in anot her , which ma y result in some confu sion . For
exam pl e, suppo se sym bol “XYZ ” is a global in modu le A and a loca l
in mo d ule B and tha t th ese m od ules link to form the abso lut e fi le . Af te r
you loa d the abso lute file (and the cor resp ondi ng symbol data base ),
en tering “XYZ” in an expre ssion refers t o the sym bol f rom mo dul e A.
Then , if you di spl ay local sym bo ls fro m modu le B, ente ring “XYZin
an expr essi on re fers to th e sym bol from modul e B, not the glo bal
symbol. Now, if you again want to en ter “XYZ ” to ref er to the glo bal
sym bol from module A, you must d isplay the loc al symbols from
module A (since the glo bal sym bol is al so loc al to that module).
Loading loc al symb ols fr om a thi rd module, if it was li nke d wit h
modul es A an d B and did not co ntain an“ XYZ” local sym bol , would
al so ca u se XY Z ” to refe r to the g lob al sy mb ol from m od ule A.
Transfer Symbols to
the Emulator You can use the emulat or’s sym bo l-h and li ng capa bil ity to improve
mea sure ment displ ay s. You do this by tr ansf err ing the sy mbol da taba se
information to the emulator . To transfer the global sym bol inform ation
to the emulator, use the com mand:
System, Symbols, Global, Transfer
Transfer the loc al symb ol i nfor mati on fo r al l modul es by e nt eri ng:
System, Symbols, Local, Transfer, All
You can fi nd m ore inf orm at io n on em ul at or sym bo l ha ndl ing
comm ands in the Emul at or PC Inte rface Re fe renc e .
Getti n g Started 2-3 9
Displaying
Memo ry in
Mn emo nic Fo rmat
Once you have loa ded a pro gram into t he e m ula tor, y ou ca n ve rify tha t
th e pro gram has indeed been lo ade d by displ aying mem o r y in
mnemon ic format. To do this, selec t:
Memory, Display, Mnemonic
Ente r the addre ss r ang e "1000. .1029". (You coul d also spec if y this
ad dre ss rang e usi ng sym bol s, for ex am pl e, "Init..Cmd_I" or
"Init..Init+29".) The em ulation window auto ma ti ca ll y be com e s t he
acti ve window as a re sult of th is co mm a nd. You can pre ss < CT RL > z
to z oom the emul atio n wind ow. The resul ti ng di spl ay foll ows.
If yo u wish to vie w the rest of th e sample progra m m emory
locat ions,you can select "Memory Display Mn emonic" comm and
agai n and ent er the range from "102a. .1042 ".
2-40 Getti n g Started
St eppin g Thro ugh
the Program The emu la tor all ows you t o exec ute one instruc tion or a n um ber of
in stru ct ion s with step com m and . To begin st epp ing t hro ugh t he sa mp le
pro gram, select:
Processor, Step, Address
Enter a step c ount of 1, ent er t he symb ol Init (de fined a s a global in the
source file), and press Enter to step from progr am ’s fi rst addre ss, 1000
hex. The execute d instruction , the progra m counter add ress, and the
result in g reg ist er cont ent s are disp layed as shown in the followi ng
listing.
Getti n g Started 2-4 1
Note You cann ot displ ay regi ste rs if the pr ocessor i s rese t. Use the
"Processor Break " co mm a nd to c au se th e em ul at or t o sta rt e xecut ing i n
th e moni tor.
You can displ ay re gisters whil e the emula tor is exe cu ting a user
progra m (i f ex ec ution is not re s tr icted to real -t im e); em ul at or e xecut ion
will temporarily break to the monitor.
To con ti nue step ping through the p rogr am, you can sel ec t:
Processor, Step, Pc
Aft er sele ct ing the com m and abov e, you ha ve an opp ort unity to cha nge
th e previ ous step count. If you wish t o ste p the same nu mb er of tim e s,
you can press Enter to start th e step.
To save time when single-steppi ng, you c an use the function key macro
<F1 >, whic h ex ec ute s the com m an d,
Processor, Step, Pc, 1
For more inform at io n, see t he E mul ato r PC In terface Refere nc e
manual.
To rep ea t the pre vi ous co mm a nd, you c an press <C TRL> r.
Specifying a Step
Count If yo u wish to con ti nue to ste p a numb er of tim e s from the cur ren t
pro gra m count er , select :
Processor, Step, Pc
The pr evious st ep count is di spla yed in the "numb er of i nst ruc tions"
fiel d. You can ent er a num ber from 1 through 99 to specify t he numb er
of tim es t o ste p. Type 5 int o th e fiel d, and press Enter. Th e re sulting
di spla y fol lo ws.
2-42 Getti n g Started
When you spe ci fy ste p co unts g rea te r th an 1, only th e last regi ste r
contents are displaye d.
M o di fyin g Me m o ry The prec eding step com mands sho w the sam ple program is executing
i n th e Scan loop, where it con ti nua ll y rea ds th e co mm and input b yte to
ch ec k if a command h as be en e ntere d. To simul at e the e ntry of a
sam pl e program c om m and , you can mo dify the com m an d inp ut byte by
selecting:
Memory, Modify, Byte
Now ente r the add ress of t he memo ry lo ca ti on to be modi fie d, an equa l
sig n, a nd new val ue o f that locati on, for exa mp le, "Cmd_ Input=41".
(The Cmd_Input labe l wa s defi ned as a globa l symbo l in the so urc e
file.)
To ver ify tha t 41 hex was i nde ed wri tten to Cmd_Input (FC00 hex),
select:
Memory, Display, Byte
Getti n g Started 2-4 3
Ty p e the s ym bol Cmd_Input, and press Enter. The re sul ti ng di spla y
is sho wn below.
You can cont inue to step through the pr ogra m as shown earl ie r in thi s
chapt er to view th e instru ct ion s which are execu te d when a n "A" (41
he x) co mm a nd is e ntere d.
Runnin g the
Program To sta rt the e mulator exe cut ing the sample progra m, sel ec t:
Processor, Go, Pc
The st atus li ne will show that the emu la tor is "Runn ing user pr ogra m ".
2-44 Getti n g Started
Searching
Memo ry fo r Data You can se arch th e messa ge desti na ti on loca ti ons to veri fy that the
sam ple pr ogra m writes th e approp ria te messages for the all owe d
co mm ands. T he com mand "A" (41 hex) was entered abo ve, so th e
"Com man d A e ntere d" m essa ge should have been wri tten to the
Msg_Dest loc ations. Beca use y ou m ust se arc h for hexa de ci ma l values,
you wi ll want to search for a sequ ence of cha racte rs whi ch un iqu ely
ident if y the messag e, for e xampl e, " A " or 20 hex , 41 hex, and 20 he x.
To sea rch the d est ina ti on m em or y loc at io n for t his se que nce of
charact e r s , s ele ct:
Memory, Find
Enter the ra nge of the mem ory l oca ti ons t o be se arc he d, FC02 he x
through FC21 hex, and ent er the da ta 20 he x, 41 hex , and 20 he x. The
result in g inf orm atio n in the memor y window shows you that the
messa ge wa s inde ed writte n as it was supposed to have been .
To ver ify tha t the sam ple pr ogra m works for the other allo wed
co mm ands, you can modify the c om ma nd i nput byt e to "B" and se arch
for " B " (20 hex, 42 he x, and 20 hex) , or y ou can m odi fy the
co mm a nd in put byte to "C" a nd sea rc h for "d C" (6 4 hex , 20 h ex, an d
43 he x).
Br e akin g in to the
Monitor To bre ak e mu la tor e xe cut ion from th e sam pl e pr ogra m to th e m oni tor
pro gram, select:
Processor, Break
The st at us line shows t ha t the emul at or i s "Running in mo nit or".
Whil e the break wil l occur as soon a s p ossib le, the actual stop pin g
poi nt m a y be many cyc les after the break re que st (de pende nt on t he
type of inst ruc ti on be ing exe cut ed and whe th er the pr ocessor i s in a
hol d sta te).
Getti n g Started 2-4 5
Using Software
Breakpoints Softwar e bre ak poi nts a re pr ovi ded with one of H8 /53 6 unde fi ned
opc ode (1B hex) as b reakpo int interrupt instruc ti on.
When y ou defin e or enable a software breakpoint, the emulat or will
repla ce the opc ode a t the softwa re brea kpoi nt addr ess wit h th e
bre akpoint interru pt instr uct io n.
When so ftwa re breakpo int s are ena bl ed a nd em ul at or detect s the
bre ak poi nt i nte rru pt i nstr uct io n (1B he x), it genera te s a bre ak to
backg round request whic h as wi th the "proce ssor br eak" com m and.
Sin ce the syste m cont roller knows the loca tions of defi ned soft ware
bre akpoi nts, it can determine whether the breakpo int int errupt
in stru ct ion (1B he x) is a softwa re breakpo int or opc ode in your ta rge t
program.
If it is a softwa re breakpo int , execut io n bre aks t o the mo nit or, and the
bre ak poi nt inte rru pt instr uct io n is repla ce d by the or igina l opc ode . A
subse que nt run or step comma nd wi ll exe cut e from thi s addr ess.
If it is a n opc ode o f your tar get prog ram, exe cu ti on sti ll bre aks t o the
moni tor, and an "Undef ine d soft war e break poi nt" st atus me ssag e is
displayed.
When so ftwa re breakpo int s are disa bl ed, the em ul at or re pl ac es the
bre ak poi nt i nte rru pt i nstr uct io n wit h the ori gin al o pco de. Up to 32
soft war e breakpoi nts may be de fin ed.
Note You must set softwa re br eakpoi nt s only a t memo r y locatio ns whic h
co nta in i nst ruc ti on opc ode s (not ope ran ds or data). If a soft ware
bre ak poi nt is set at a mem or y loc at io n whic h is no t an i nst ruc ti on
opcode, the software breakpoint instruction will never be executed and
th e bre ak will nev er oc cu r.
2-46 Getti n g Started
Note Beca use s of tware br eakpoint s are im plemented b y rep laci ng opc odes
wit h th e undefine d opc ode (1B he x), you cann ot de fine sof tware
bre akpoints in targe t ROM. You can, h owev er, use the Te rm inal
Interface cim com m and to co py ta rge t ROM into e m ula ti on m emo r y
(s ee th e Termi nal Interface: User’ s R eference m anual for infor ma ti on
on t he cim co mmand) .
Note Softwar e bre ak poi nts sho uld not be set, cle ared, enabl ed, or di sab led
whi le the emula to r is run nin g user code . If any of t hese co mm a nds ar e
en te red whil e the em ul at or i s runni ng use r co de, and the em ul at or is
ex ec uti ng c ode i n th e ar ea where the bre akp oint is being mo dif ie d,
progra m execut ion m a y be un relia bl e.
Defining a Software
Breakpoint To def ine a bre ak poi nt a t th e address of the Cmd_I labe l of t he sample
pro gra m (1029 hex), selec t:
Breakpoints, Add
Enter the lo ca l symbol "Cm d_I". Afte r th e break point is adde d, the
bre ak poi nt window be co me s acti ve and shows t hat the bre akp oin t is se t.
You can a dd m ult ip le brea kpoint s in a single com ma nd by sepa ratin g
each one with a semicolon. For example, you could type
"101 9;1 021; 102 9" to se t three bre akp oin ts.
Getti n g Started 2-4 7
Run the progra m by select ing:
Processor, Go, Pc
The st atus li ne sho ws tha t th e em ul ator i s runni ng t he use r pro gra m.
Modi fy t he com ma nd i nput byt e to an in val id com m and by sel ec ting:
Memory, Modify, Bytes
Ente r an inva lid co mma nd, such as "Cm d_Input=75". The fo llowin g
messa ges re sul t:
ALERT: Software breakpoint: 001029
STATUS: H8/536--Running in monitor
To continue program execution, select:
Processor, Go, Pc
Displaying Software
Breakpoints To view the status of t he brea kpo int, sele ct :
Breakpoints, Display
The resul ti ng di spla y wil l sh o w tha t th e bre ak poi nt has bee n clea re d.
Setting a Software
Breakpoint When a bre akp oin t is hi t, it bec om es disab le d. To re -en abl e t he
soft war e break poi nt, you c an sele ct :
Breakpoints, Set, Single
The addre ss of th e bre akpoint you just add ed is stil l in the add ress
fiel d; to set thi s brea kpo int again , press Enter. As with the
"Breakpoints Add"com m an d, the brea kpo int window bec om es a ctive
and shows th at t he brea kpo int is set .
Clearing a Software
Breakpoint If yo u wish to clea r a soft war e break poi nt that doe s n ot get hit durin g
pro gra m exec ut ion, you can sel ec t:
Breakpoints, Clear, Single
The a ddre ss of th e bre ak poi nt se t in t he previou s sect io n is sti ll in the
ad dre ss fie ld; to cle ar this br ea kpoi nt a ga in, pre ss Enter.
2-48 Getti n g Started
Using the Analyzer The H8/536 em ulation a nal yzer ha s 48 tr ac e signals whic h m oni tor
in ternal em ul at io n lines (a ddress, data, an d sta tus l ine s). Op ti ona ll y,
you ma y hav e an a ddi ti ona l 16 t ra ce signals whi ch monitor ex te rna l
in put l in es. The ana ly ze r col le ct s dat a a t each pulse of a cloc k sig nal,
an d save s the dat a (a trace sta te ) if i t mee ts a "storage qu al ifi ca ti on"
condition.
Note Emu la tors wh ic h hav e the opt io nal external ana ly ze r wil l display th e
Int erna/ E xternal options af te r the comm ands in the fo llowing
ex ampl es. Enter Internal to e x ecut e the exam ples.
Resetting the
Analysis
Specification
To be sure that the ana lyz er is in its de fau lt or powe r-up stat e, sel ect:
Analysis, Trace, Reset
Specifying a Simple
Trigger Supp ose yo u wish to trace the state s of the sam pl e progra m which
fol lo w the rea d of a "B" (42 hex ) com m an d from th e comm a nd in put
byt e. To do thi s, you m ust m odi fy t he de fa ult analy sis specific at ion by
selecting:
Analysis, Trace, Modify
The emu la tion an al ysis spe cifi cati on is sho wn. Use the righ t arrow ke y
to move the cursor t o the "Tr igg er on " fie ld. Type "a " and pr ess Enter.
You’ ll ent er the pa tter n exp ressi on men u. Press the up arrow ke y unt il
the addr f ield dire ctly opposi te t he pattern a= i s highlighted. Type the
address of the command input byte, using either the global symbol
Cmd_Input or addre ss 0 fc0 0, and pr ess Enter.
The "Da ta " f ield i s now hig hli ghted . Type 42xx a nd pre ss Enter. 42 is
th e value of the "B" co mm and and the "x"s spec if y "don’ t care" val ues.
Getti n g Started 2-4 9
Trig g erin g the Anal yzer by Data
You may want to tr igg er the e mu la ti on an al yze r whe n spec if ic dat a
ap pea rs on t he da ta bus. You can accompl ish thi s by spec if yin g "Dat a"
in the "Find State" fi el d of an alysis spe ci fi ca ti on di spla y.
T her e ar e som e point s to be not ic ed w he n y ou tri gger the ana ly ze r in
th is way . You alwa ys nee d to spec ify the "Data " wit h 16 bi ts va lue
even when access to the data is perfor med by byte access. This is
be ca use t he a nal yz er i s d esi gne d so tha t i t can ca pt ure dat a on interna l
data b us (whi ch has 16 bi ts wid th) . The fol lo wing tab le shows the
way to spe ci fy th e trigger condi ti on by d ata.
(DATA READ/WRITE)
=====================================================
| | Available
Location of data | Accesses | <DATA> Specification
=====================================================
Internal ROM,RAM | Word | HHLL *1
+----------+---------------------
| Byte | DDxx *2
-------------------+----------+---------------------
Others | DDxx
=====================================================
(INSTRUCTION FETCH)
=====================================================
| | Available
Location of data | Address | <DATA> Specification
=====================================================
Internal ROM,RAM | EVEN | HHLL *1
+----------+---------------------
| ODD | xxDD *2
--------------------+----------+---------------------
Others | DDxx *2
=====================================================
*1 HHLL means 16 bits data
*2 DD means 8 bits data
For exam pl e, to t ri gge r the analy zer when the proc essor p erf orm s word
access to data 1234 hex in internal ROM, you ca n use 1234h as the
"Dat a" speci fi ca ti on.
To trigge r th e an alyzer whe n the proc esso r ac cesses da ta 12 hex in
exte rna l ROM, you c an use 12xx h as "Data" spe cifi ca tion.
2-50 Getti n g Started
H8/536 An alysi s Statu s Q uali fiers
Now the "Sta tu s" field is high li ght ed. Use the Tab key to view the
sta tu s qualif ie rs whic h m ay be ent er ed. Th e status q ual if ie rs are
defin ed as f ollows.
Qualifier Status Bits (36..47) Description
backgrnd 0xxx xxxx xxxxB Background cycle
brelease x111 xxxx xxxxB Bus release cycle
byte x110 xxxx xx1xB Byte access
cpu x110 xx1x xxxxB CPU cycle
data x110 xxxx x1xxB Data access
dtc x110 xx0x xxxxB Data transfer controller cycle
exec x101 xxxx xxxxB Instruction execution cycle
fetch x110 xx1x x001B Program fetch cycle
foregrnd 1xxx xxxx xxxxB Foreground cycle
grd x110 0xx1 xxxxB Guarded memory access
intack x011 xxxx xxxxB Interrupt acknowledge cycle
io x110 xxx0 xxxxB Internal I/O access
memory x110 xxx1 xxxxB Memory access
read x110 xxxx xxx1B Read cycle
word x110 xxxx xx0xB Word access
write x110 xxxx xxx0B Write cycle
wrrom x110 x0x1 xxx0B Write to ROM cycle
Sel ect the read status and press Enter. Figure 2-6 an d 2-7 show the
result in g analy sis spe cific atio n. To save the new specifi cation, use
End Ente r to exi t the field in t he l owe r rig ht c orne r. You’l l re tur n to
th e tr ac e speci fic at ion. Pre s s End to mo ve to t he t rr i g er sp ec field.
Press Enter to exit the trace specif ication.
Getti n g Started 2-5 1
Fig ure 2-6. Modifying the Trace Specification
Figu re 2-7. Mo d ifyi ng the Pattern Speci fi catio n
2-52 Getti n g Started
Starting the Trace T o start the t rac e, sel ec t:
Analysis, Begin
A messag e on the stat us li ne will sh ow you that the trace is runnin g.
You do not expect the t ri gge r to be found bec au se no com ma nds ha ve
be en ente re d. Modify the com m and i npu t byte to "B" by sel ec ti ng:
Memory, Modify, Byte
Ente r "Cm d_I nput =4 2". The status li ne now shows th at the tra ce is
complete.
Displaying the Trace To display the trace, select :
Analysis, Display
You are no w given two f ields i n whic h to specify the stat es t o displa y.
Use the ri ght arr ow key t o move t he curso r to the "E ndi ng st at e to
di spla y" fi el d. Type "60" in to the ending sta te fie ld , pr ess Enter, and
use <CTR L> z to zoom the trace window.
Note If you cho ose t o dum p a com plete tra ce into th e tr ac e buffer, it wil l
take a few m in ute s to displ ay t he t rac e.
Use the Home ke y to get t he top of t he t rac e. The re sult ing tra ce is
sim ila r to the trace shown in the followin g disp lay.
Getti n g Started 2-5 3
Line 0 in the trace list abov e shows the stat e which trig ger ed the
an al yze r. The trigger sta te is alw ay s on li ne 0 . Th e other st at es sh o w
th e ex it f rom the Scan loop a nd the Exe_Cmd instruct ions.
To li st the next l ines of th e trac e, pre ss the PgDn or Next key.
2-54 Getti n g Started
The resul ti ng di spla y shows the Cmd_B instruction s and t he branc h to
Write_Msg a nd th e begin nin g of th e instru ct ion s whic h move the
"T HIS IS MESSAGE B" messa ge to the destin at ion loc ation s.
For a Complete
Description For a c ompl et e descri pt ion o f using the HP 64700 Seri es an alyze r wit h
th e PC Interfac e, refer to th e HP 64700 Emulators PC Interface:
Analyzer User’s Guide.
Using a Command
File You can use a comm a nd fi le to pe rfor m man y functi ons fo r you,
wit hou t havin g to manual ly type each fu nctio n. For exam pl e, you
might want to cre at e a com mand file tha t modi fies co nfi gura ti on, m aps
mem ory a nd loads p rogr am into m emory for th e sam pl e pr ogra m . To
create such a command file:
System, Log, Input, Enable
Enter comm a nd file nam e "cmd_rds. c md ", and pre s s Enter. This sets
up a fil e to rec ord a ll com m and s y ou ex ec ute . The com m and s wi ll be
logged to the file cmd_rds.cmd in the current directory. You can then
use thi s f ile as a com m and fil e to exe cut e these comm an d s
automatically.
First, to se t up the reset val ue for th e sta ck pointer:
Config, General
Use the arrow ke ys to move the cu rsor to the "Rese t valu e for Stac k
Poi nter" fiel d, type 0fc80, and press End and Enter.
To map the memory:
Config, Map, Memory
Map 1000 he x throug h 1fff h ex to erom and fc 00 he x thr ough fcff hex
to eram. (As shown in Figure 2-5.)
To loa d th e pro gra m into me mo ry:
Memory, Load
Ente r fi le form at , me mo ry ty pe, an d abso lute fi le nam e, and pre s s
Enter.
Now we’ re fini shed logg ing c omm and s to th e file. To disabl e loggi ng:
Getti n g Started 2-5 5
System, Log, Input, Disable
T he c om ma nd fi le cm d_ r ds . cm d wil l no lon g er a cc ept comm and inp ut.
Let’s execut e the command file "cmd_rds.c md".
System, Command_file
Ente r "cm d_ rds. cmd", pre ss Enter. As you can see , the seque nce of
co mm ands you ent ere d is automati ca ll y exec ute d.
Resetting the
Emulator To rese t the emu la tor , sele ct:
Processor, Reset, Hold
The emu la tor is hel d in a rese t stat e (suspend ed) until a " Processor
Bre ak ", " Processor Go ", or "Processor Step" co mmand is e ntere d. A
CMB exec ut e signal will also cause the em ulato r to run if reset .
You can a lso spe ci fy t hat the emul at or be gin exe cut ing in the moni tor
af ter rese t instead of rem a ini ng i n the suspe nde d sta te . To do this,
select:
Processor, Reset, Monitor
2-56 Getti n g Started
Exiting the PC
Interface T her e are two d iff ere nt ways to exit the PC Inter fac e. You can ex it the
PC Int er face usi ng t he "l ocked" op ti on wh i ch sp e ci fi es that the c urrent
co nfi gura ti on wi ll b e presen t ne xt tim e you sta rt up the PC Inte rface.
You can se lect thi s option a s foll ows.
System, Exit, Locked
Sym bol s are lost when y ou use the "Syste m Exi t Locked" com ma nd;
howe ve r, y ou can re loa d th em (af te r you reenter the PC Int erf ac e) wi th
the "Syst em Sym bol s Globa l Loa d" comm an d.
The ot her way to exe cu te t he PC Inte rface is wit h th e "unl oc ked "
opt io n whic h spe ci fie s tha t t he de fa ult config uration will be pre sent the
next time you start up the PC Interface. You can select this option with
the fol lo wing com m and .
System, Exit, Unlocked
Getti n g Started 2-5 7
Notes
2-58 Getti n g Started
3
In-Circuit Emulation
Man y of th e to pic s desc ribed in th is chapt er involve the com mands
which re la te to using the e mula tor i n-c ircui t, th at is, con n ec te d to a
targe t system .
This c hap te r wil l:
Desc ri be the issues c onc ern ing t he inst alla ti on of the e mu lator
pro be into tar get syste ms.
Show yo u how to inst al l the em ulat or pr obe .
We wil l cover the fir st to pic in this c hap te r. For complet e de ta il s on
in-circuit emulation configuration, refer to the "Configuring the
Emulat or" ch apt er.
Prerequisites Be fore per form i ng th e tasks descri be d in this c hap te r, you shou ld be
fa mi li ar with how the em ul at or ope rate s i n ge ner al . Refer t o th e HP
647 00 Emulators: Syst em Overvi ew m a nua l an d the "Get ti ng Sta rted"
ch apt er of thi s ma nual.
In-Ci rcui t Emu lati on 3-59
Installing the
Target System
Probe
The emu la tor probe has a PLCC c onn ector. The emu la tor is ship ped
wit h a pin gua rd ov er the t arg et sy ste m probe. This gu ard i s desi gne d
to p rev ent impact dam ag e to the pins a nd shou ld be left i n pla ce whil e
you are not using the emulator.
Caution DAMAGE TO THE EMULAT OR CIRCUITRY MAY RESULT
IF THESE PRE CAUTIO NS ARE NOT OBSERVE D. The
fol lowing prec auti ons shou ld be taken whil e using th e H8/536 e mu la tor .
Power Down Tar get System . Turn off powe r to the user t arg et
syst em and to the H8/ 536 e mula tor b efo re inser ti ng the use r plug to
av oid cir cuit dam age resu lt ing f rom vol tage t ran sie nts or mi s-in sert io n
of t he user pl ug.
Ver ify User Pl ug Or ientat ion. Make certain that Pin 1 o f the target
syst em micr opro ce ssor soc ket and Pin 1 of the user pl ug ar e proper ly
alig ned befo re inser ti ng th e user plu g in the socke t. Failure to do so
may result in damage to the emulator circuitry.
Prot ec t Against Stati c Di schar ge. T he H8/536 emula tor conta ins
de vic es w hi ch are suscepti bl e to dam ag e by st at ic disc harge.
Therefo re, ope ra tor s sh oul d take pr ec aut io nar y me asu res be for e
ha ndl ing the u ser pl ug t o avo id e mu la tor dam ag e.
Prot ec t Tar get System CMOS Component s. If your targe t system
incl ude s any CMOS c omponents, turn on the tar get syste m first , the n
turn on t he H8/ 536 em ulato r; whe n poweri ng down , turn of f the
emul ator fi rst , then turn off power to the tar get syste m.
3-60 In- Circu it Emul atio n
Installing into a
PL CC Typ e So c ke t To con nect the mic rop roc essor c onn ector t o the ta rge t system ,
pro ceede d with th e follo wing instructi ons.
1 . Remo ve the H8/536 mi cro proc esso r from the targe t system
socke t (PLCC so cke t). Note th e locati on of pi n 1 on the
pro cessor and on the ta rge t system soc ket.
2 . Store the microprocessor in a prote cted envi ronment (such as
an ti sta ti c foam ).
3 . Instal l the targ et sy ste m probe int o the target system
microprocessor soc ket.
Fig ure 3-8. Inst all in g into a PLCC typ e socket
In-Ci rcui t Emu lati on 3-61
Note To make su re the cont ac t be twe en emu la tor probe and tar get syste m
microprocessor soc ket, we recomm en d that you use
ITT CANNON "LCS-84" serie s 84 pi n PLCC sock et .
Runnin g the
Emulator from
Target Reset
You can spe cify t hat the emul at or be gin s exe cut in g from ta rge t system
reset. When the tar get syste m /RE S line be co mes ac tive and th en
in ac ti ve, th e emul at or w i ll st ar t re set sequenc e (op era ti o n) a s ac tua l
microprocessor.
At Fi rst, you must spec if y the emul at or re spond s to /R ES si gnal by the
targe t system (se e the "Enab le /RE S inp ut from Ta rge t" co nfi gura tion
in C ha p ter 4 of this m a nual ).
To spec if y a run from rese t stat e, sel ect:
Processor, Go, Reset
The st atus now shows t hat the em ulat or is "Awa it ing tar get rese t".
Aft er the targ et syste m i s rese t, the sta tus l ine messag e wil l chan ge to
show the appro pri at e emulat or st at us.
3-62 In- Circu it Emul atio n
4
Confi guring the Emulator
Introduction The H8/536 em ula tor can be used in a ll sta ges of tar get syste m
devel opm e nt. For instance, you ca n run the em ulato r out -of- ci rcu it
whe n devel opi ng ta rge t system softwar e, or you c an use th e emul ator
in-circuit when integrating software with target system hardware.
Emulation memory can be used in place of, or along with, target
syst em mem ory. You ca n use t he emula to r’s in terna l cloc k or the
targe t system cl ock. You can exe cut e target p rogr ams in real-t im e or
al lo w em ulato r exe cution to b e di ver te d into th e monitor when
comm a nds re que st acce ss of targe t syst em re sourc es (t arget syste m
mem ory , re gi ste r con te nts, etc.)
The e mu la tor is a flexi ble instru me nt and i t may be con fig ure d to sui t
you r nee ds at any stage of the develop ment process. T hi s cha pter
de scri be s the opti ons a vai la bl e whe n con fig uri ng th e H8/ 536 e mu la tor .
This c hap te r wil l:
Show yo u how to acc ess t he emula tor conf iguratio n opt ion s.
Desc ri be the e mu lator conf igu ratio n opt ion s.
Show yo u how to save a par ti cular e mula to r con fig ura ti on,
and load it again at a later time.
Co nfig u rin g the Emu lat or 4-1
Accessing the
Emulator
Configuration
Options
To enter the genera l configura ti on m en u, Sele ct :
Config, General
The ge neral con fig ura ti on menu a ppe rs as fo llows:
When you posi ti on the cursor to a confi gur at ion ite m , a brie f
de scri pt ion of the it em app ears at t he b ott om of th e di spla y.
Note It is possi ble to use the Syste m Te rmina l window t o modif y the
emul at or c onfi gur at ion . However , if you do t hi s, som e PC Interfa ce
feat ure s ma y no lo nge r work pr ope rly. We recom m en d tha t yo u onl y
modify th e em ul at or configur ation by usin g the opt ion s prese nt ed i n
th e PC Interfac e.
Fi gure 4-9. H8/536 G eneral E mul ato r Confi gurati o n
4-2 Con fig u rin g the Emu lat or
Int ern al Emul ator
Clock? This configur ation quest io n allows yo u to select the em ula to r’s cloc k
sour ce; you can c hoo se either the inte rna l clock sour ce or the targe t
syst em cl ock source. The defaul t e mula tor configurat ion selects the
inte r nal clo ck.
yes Selec ts t he i nte rnal cloc k o sc il la tor as the em ul at or
cloc k source. The emul ators’ int ern al clo ck speed
is 10 MHz (system clock).
no Sel ec ts the c lock input to th e emul at or probe from
the targe t system . You must use a clock input
co nfor mi ng t o the spec if ic at ion s for the H8/536
microprocessor.
You sho uld alwa ys sel ec t the externa l cloc k opt io n when using the
emul ator i n-c ircui t to ensure that the em ula tor is pro per ly synchr oni ze d
wit h your targe t syst em.
Note Changing the cloc k sour ce driv es th e em ul ator i nto the rese t state .
Enable Real-Time
Mode? If it is i mp ort ant tha t the e mu la tor exe cut e t arg et syste m pr ogra m s in
re al-time, you can e nab le the rea l-t im e em ula tor mode. In ot her words,
whe n you exec ute target progra m s (wit h the " Processor, Go"
co mm a nd), th e emul at or wi ll exe cut e i n rea l- ti me .
Co nfig u rin g the Emu lat or 4-3
No The defa ult em ul at or co nfigura ti on di sab le s the
re al -ti m e m ode . When t he em ulato r is ex ec uting
th e targe t pr ogra m , you are allowed to e nt er
emulatio n com m an ds that requi re a cc ess to ta rge t
syst em reso urc es (di spl ay/ m odi fy: registe rs or
targe t system memory ). If one of the se comma nds
is entere d, the sy ste m cont roller wil l tem porari ly
bre ak e m ula tor exe cu ti on into t he m oni tor.
Yes If your targe t syst em pro gra m requi re s real-t ime
ex ec uti on, you shoul d enabl e the re al -ti m e m ode i n
ord er to pre ven t te m pora ry br eaks that might c ause
targe t system proble m s.
Co mmand s Not Allow ed w hen Real-Ti me Mod e is En abl ed
When em ulato r exe cuti on is re s tr ic te d to real -t im e a nd th e em ul at or i s
run nin g user code , the sy ste m refuse s all comm a nds that r equ ire acce s s
to proc essor regi ste rs or t arg et syste m mem or y. The foll owi ng
comm a nds are not allowe d whe n runs are restr ic ted to real-t im e:
Register display/modific ation.
Targ et syste m mem or y disp lay/m od ifi ca tion.
Int er nal I/O re gi ste rs disp la y/m odifi cati on.
If the re al -t im e m ode is en abl ed , these resources can onl y be displ ay ed
or modifi ed while runn ing in th e monitor .
Breaking ou t of Real-T ime Execu tion
The only com mands whi ch are allowe d to break real-ti me execu tion
are:
Processor, Reset
Processor, Go
Processor, Break
Processor, Step
4-4 Con fig u rin g the Emu lat or
Enable Breaks on
Writes to ROM? This quest ion all ows you t o spe cify that the em ula to r bre ak to the
moni tor upon a ttem pt s to wri te to mem ory space mapped as ROM.
The emu la tor will pre ven t the pro cessor fro m act ually writ ing to
mem ory ma ppe d as emul atio n ROM; ho weve r, they canno t preve nt
wri tes to targe t system RAM locati ons whi ch are map ped as ROM,
even though the write to ROM bre ak is ena bled.
yes Causes t he emu la tor to bre ak into the em ul at ion
monitor whene ver the user program at te mpts to
wri te t o a mem or y reg ion ma ppe d as ROM.
no The emulator will not break to the monitor upon a
wri te t o ROM. The emul at or wil l not m odi fy th e
memory location if i t is in emulation ROM.
Note The wrrom ana ly sis spe ci fic at io n sta tus op ti on al lo ws you to us e
"wri te t o ROM" cycl es as t rig ger and storage qu al ifier s.
Co nfig u rin g the Emu lat or 4-5
Enable Software
Breakpoints? W hen y ou de fin e or enable a soft ware bre akp oint to a specified
ad dre ss, t he emu lator will rep lace the opco de wi th one of H8/ 536
und efi ne d opc ode (1B he x) as br ea kpoi nt int errupt inst ruction. Whe n
the emul at or de tect s the breakpoin t interrup t in stru ction (1B he x), user
pro gra m brea ks to the m oni to r, and t he or igi na l opc ode wil l be
replaced at the soft ware bre akp oin t ad dre ss. A subse que nt run or ste p
co mma nd wil l e xec ut e fro m this address.
Re fer to th e "Get ti ng St art ed" f or in form a ti on on usi ng s of twa re
breakpoints.
No The softwa re brea kpoi nt s f eatur e is di sab le d. Thi s
is spe cified by t he d efa ul t emul at or c onfi gur at ion ,
so you must cha nge thi s con fig uration it em before
you can use soft war e bre ak poi nts.
Yes The softwa re brea kpoi nt s f eatur e is e nab led. The
emulator de te ct s the bre akp oin t in te rrup t in stru ct ion
(1B hex) , it gener at es a brea k to back grou nd
reque st which as with t he "proc essor break"
comm a nd. Sinc e the syst em con tro ll er knows the
lo cati ons of de fined softwa re brea kpo int s, it can
de termine whet her the breakp oint in te rrupt
in stru ct ion ( 1B he x) is a softwa re b rea kpo int or
opc ode in your target progra m .
When you defin e (add) a brea kpo int, so ftwa re brea kpo ints are
au tom a ti ca ll y enabl ed.
4-6 Con fig u rin g the Emu lat or
Enable CMB
Interaction? Coordi nated me asur em ents ar e mea sure ment s synch rono usly m ade in
mult ip le e mula to rs or an alyze rs. Coord ina te d measurement s can be
made betwee n HP 6470 0 Seri es e mu la tor s whic h com m uni ca te ove r
the Coo rdi nated Measu rem e nt Bus (CMB).
Mul tiple emul at or sta rt /st op is on e type of coordin ated mea sure m ent .
The CMB signa ls RE ADY an d /EXE CUT E are used to perf orm
multiple emulator start/stop.
This c onfi gur at ion ite m allows you t o enabl e/di sabl e inte ra ction over
the READY and / EXEC UTE signals. (The third CMB si gna l,
TRIGGER, is una ffe ct ed by thi s con fig uration it em .)
No The emu la tor igno res t he /EXE CUT E and READY
line s, and the READY line is not driven.
Yes Mul ti ple emul at or sta rt /stop is enabled. If t he
Processor, CMB, Go, ...
co mm a nd is e nte re d, the em ula tor wil l sta rt
ex ecuting code wh en a p ulse on the /EXECUT E
line is rec eive d. The READY l ine is dri ve n false
while t he e m ula tor is runnin g in t he m oni tor; it goe s
true whe never execut io n switche s to the user
program.
Note CMB inte ra ction will also be enab le d when t he
Processor, CMB, Execute
co mm a nd is e nte red.
Co nfig u rin g the Emu lat or 4-7
Enable Bus
Arbitration? The bus arbi tration c onf igu rat ion questi on defin es how yo ur em ul at or
responds to bus re que st si gna ls fro m t he targ et system durin g
for egr ound o per ation . The /BRE Q sign al from the targe t syst em is
alway s igno red when the emu la tor is runn ing t he bac kgro und monitor.
yes When bus arb it rat io n is enabled , the /BRE Q (bus
request) si gna l from the targ et syste m is r espo nde d
to e xa ct ly a s i t would be if on ly t he e mula ti on
pro cessor was pr ese nt wi tho ut an emul ator. I n
other words, if the emu la tion pro ce ssor re ceive s a
/BRE Q from the target syst em, it will respond by
asse rting / BACK a nd wil l set the vario us proc esso r
lines to tr i-state. /BREQ i s the n rel ea sed by the
targe t; /BAC K is negated by the processor , and the
emul at ion proc esso r rest ar ts ex ecuti on.
Note DMA (direc t memor y acce ss) dev ices is pr ohi bited from accessing to
emulation mem ory.
no When you disabl e bus arbitr at ion , the e mu la tor
ig nore s the /BR EQ si gna l fro m the targ et syste m.
The emu la tion processor wil l neve r dri ve the
/BACK li ne true ; nor will it pla ce t he addr ess, data
an d con tro l sig nal s int o th e tr i-st at e mode .
Enabling and disabling b us ma ste r ar bit ra ti on ca n be usefu l to y ou in
iso lati ng targe t system pro blem s. For exampl e, you ma y have a
sit ua tion whe re the pr oce ssor neve r see ms t o execu te any c ode . You
can di sabl e bu s arbi tration to ch eck and see i f fau lty arb it rat ion
circ uit ry in your tar get syste m i s con tributing to the problem.
4-8 Con fig u rin g the Emu lat or
Driv e Bac kgro und
Cycles to Target? This quest ion all ows you spec ify whet her o r not the em ula tor will dri ve
the targe t system bus on bac kgro und c ycles.
If yo u have sel ecte d to use a fo reg roun d mo nit or, emul at or fo reg roun d
monitor cycles will appear at the target interface exactly as if they were
bus cycl es c ause d by any ta rge t syst em pro gra m.
yes Speci fies tha t back grou nd cy cl es ar e drive n to the
targe t system . E mul at ion p roc essor ’s add ress a nd
co ntr ol st robe s (ex ce pt /WR ) are dri ven duri ng
backg round cycle s. Back grou nd wri te cycle s won’t
appear t o the target system.
no Backgroun d monit or c ycl es are no t drive n to the
targe t syst em. W he n you sele ct this option, the
emul ator wi ll appe ar to th e target system as if it is
be twe en b u s cyc le s whil e it is ope ra ti ng in t he
backgroun d monit or.
Note Changing this c onfi guration driv es th e emulator i nto t he reset state .
Co nfig u rin g the Emu lat or 4-9
Enable NMI Input
from Target? This c onfi gur at ion all ows you to spe cify whe the r or no t the em ulat or
respond s to NMI(n on-m a skab le int err upt requ est ) sign al from the targe t
syst em duri ng fo reg roun d ope ratio n.
yes The emu lator will resp ond t o the NMI req uest from
the targe t system .
no The e mu lator will not r espo nd to the NMI request
fro m the targ et sy ste m.
If yo u are usin g the backgr ound mon it or, the emul at or doe s not a ccep t
an y int er rupt duri ng ba ck grou nd executi on. All edge -sensed int err upts
(i ncl ude NMI) ar e la tched last one duri ng i n background , and suc h
inte rrup ts wil l occu r when context is chan ged to foreground . All
level-sensed interrupts and internal interrupts are ignored during in
backg round operat io n.
Note Changing this c onfi guration driv es th e emulator i nto t he reset state .
4-10 Con fig u rin g the Emu lat or
Enable /RES Input
from Target? This c onfi gur at ion all ows you to spe cify whe the r or no t the em ulat or
responds to /R ES a nd /ST BY si gnals by the target syste m du rin g
foreground operation.
Whil e ru nni ng th e backgroun d monit or, th e emul at or i gnor es /R ES a nd
/ST BY si gna ls ex ce pt that the emul ator’s st at us is "Awai ti ng t arg et
reset".
yes The emu la tor will respond t o /RE S an d /ST B Y
input during foreground operation.
no The e mu lator wi ll not respo nd to / RE S and /S T BY
input f rom the target system .
Note Changing this c onfi guration driv es th e emulator i nto t he reset state .
Note If you specif y tha t the e mu la tor will dri ve t he / RE S si gna l to the ta rge t
syst em duri ng e mu lati on re set or by the ove rfl ow of W at ch Do g Tim er,
th e emul at or sho uld be co nfi gure d to respo nd to t he /RE S input to the
targe t system .
Co nfig u rin g the Emu lat or 4-1 1
Drive Emul atio n
Re set to T arg et? This c onfi gur at ion all ows you to sel ect whe ther or not the emu la tor
wil l drive the /RE S sig nal to the t arg et syste m du rin g em ul at ion rese t.
no Spe ci fie s tha t the e mulator will not driv e th e /RES
sig nal duri ng e mu lati on re set.
yes The emulator will drive an active level on the /RES
sig nal to the targ et syste m du rin g emulation rese t.
This c onfi guration opti on i s me ani ngf ul on ly whe n th e em ul at or is
configure d to r espo nd to the /RE S inp ut to the targe t system
Refer to the "Enable /RE S Inpu t from Tar get ?" confi gur at ion in this
chapter.
Trace Bus
Release Cycles? You c an di re ct the em ula to r to se nd bus re le ase cyc le data t o emul at ion
an al yze r or not to se nd i t.
yes When y ou en abl e trac ing bus rele ase c yc le s, bu s
re lease c yc le s will app ear as one ana ly sis trace line .
no Bus rele ase cyc le s wil l not app ea r on an alysis t rac e
list (d isplay ).
4-12 Con fig u rin g the Emu lat or
Processor type The confi gur ation all ows you to sel ect proce ssor t o be emu late d.
536 When you ar e goi ng t o emul at e H8/536
mic ropr ocessor, selec t this ite m.
534 When you ar e goi ng t o emul at e H8/534
mic ropr ocessor, selec t this ite m.
Note Changing this c onfi guration driv es th e emulator i nto t he reset state .
Processor
O pe r atio n Mod e This c onfi guration defi ne s o per ation mod e in whic h the em ul ator
works.
ext The emu lator will work usi ng the m ode set ting by
the targe t system. The targe t syst em must supp ly
approp ria te input to MD0, MD1 and MD2. If you
ar e usi ng the em ul at or out of circ uit whe n
"e xte r nal" is s elected, the em u lat o r w ill o pe rat e i n
mode 7.
<mode_num> When <mode_num> is selected, the emulator will
ope ra te i n sel ecte d mode rega rdless of the mo d e
setting by th e target system.
Valid <mode_num> are following:
<mode_num> Description
1 The e mula tor will ope rat e i n mo de 1.
(e xpa nde d mi ni mum mode )
Co nfig u rin g the Emu lat or 4-1 3
2 The e mula tor will ope rat e i n mo de 2.
(expanded minimu m mode with internal ROM)
3 The e mula tor will ope rat e i n mo de 3.
(e xpa nde d ma xi mum mode )
4 The e mula tor will ope rat e i n mo de 4.
(expanded maximu m mode with internal ROM)
7 The e mula tor will ope rat e i n mo de 7.
(si ngl e chip m ode )
Note Changing this c onfi guration driv es th e emulator i nto t he reset state .
Monitor Type
bg Spe cify m oni tor type as background monitor.
When you sel ec t ba ck grou nd m oni tor,
co nfi gura ti on qu est ion of fore gro und m oni tor
ad dre ss have no ef fec t to emulator’s op era ti on.
fg Spe cify m oni tor type as for eg round m onit or.
When you sel ec t foreg round monit or, you must
spe cify corre ct fore ground monitor st ar t addre s s
wit h next confi gur at ion q uest io n (foregr ound
monitor address). After you completed t he
co nfi gura ti on se tt ing , you nee d to l oa d foreground
moni tor progr am to the emula tor with "Mem ory
Load" fea ture. The foreground m onitor program
must a lre ady assembled and l in ked with appropri at e
monitor start address spe cification.
4-14 Con fig u rin g the Emu lat or
To use t he fo reg roun d mo nit or, fol lo w bel ow ste ps.
1 . Decid e whi ch locati on t he foreg roun d mo nitor sho uld be
loaded.
2 . Assem bl e and li nk the fo reg round monit or progra m alo ng wit h
th e lo ca ti on yo u dec ide d.
3 . Con fig ure the em ula to r as de scri be d in this c hap te r. (mon it or
ty pe select ion and m oni tor loc at io n).
4 . Load t he fore grou nd m oni tor progr am into mem ory b y
"Memory Load" feature.
Note Changing this c onfi guration driv es th e emulator i nto t he reset state .
Foreground
Monitor Address You must sp ecify fore grou nd m oni tor star t addre ss when yo u sel ect
"fg" by a bov e confi guration qu estion "Monit or t ype ". This a ddre s s
specificat io n mu st be sa m e wit h th e ad dre ss sp ec ifi ca ti on wh e n yo u
asse m ble the foreground monito r program .
The a ddre ss mu st be sp ecified in a 20-bi t he xad ec im al add ress, an d
must be locat ed on a 2K byte bo unda ry ot her than 0 he x.
Co nfig u rin g the Emu lat or 4-1 5
Re se t Valu e for
Stack Pointer? This qu estion allows you t o speci fy th e value to which the stac k point er
(SP) and th e sta ck page reg ist er (TP) wi ll b e set on entra nc e to t he
emul at io n monit or i nitia te d RESE T st ate (t he "Em ula tion re set" status) .
The addre ss specifie d in response to thi s question mu st be a 20-bit
he xadecimal even addres s .
You cannot se t this ad dre ss at the foll owin g locat io n.
Odd addre s s
Internal I/O register address
When you ar e using th e for egr ound mo n itor, thi s add ress sho uld be
de fin ed in an emu lati on or t arg et syste m RAM area which is no t use d
by use r progra m.
Note We re com m en d tha t you use t his m et hod of con fig uri ng the stack
poi nt er a nd th e sta ck page register. Wi th out a sta ck po int er and a stac k
pa ge re giste r, the em ula tor is una bl e to ma ke t he t ransit ion t o th e run
sta te, step , or perform many ot he r em ul ation func ti ons. Howeve r,
usi ng this opt io n does not prec lude you from ch ang ing t he stac k
poi nt er va lu e or location withi n you r prog ram ; it just sets th e init ia l
condi ti ons to all ow a run to begi n.
4-16 Con fig u rin g the Emu lat or
Storing an
Emulator
Configuration
The PC Interface l ets you store a par ti cul ar em ula to r con figura ti on so
th at it may b e re-lo aded la ter. The fol lowi ng i nfor ma ti on i s save d in
th e em ul at or configur ation.
Emulator configuration items.
Memor y ma p.
Break conditions.
Trigger configuration .
Window spec if icat ion s.
To stor e the curre nt e mula tor configu ratio n, select :
Config, Store
E nte r th e na me of fi le t o which t he e mu la tor con f igu ratio n will be
saved.
Loading an
Emulator
Configuration
If yo u have pre vi ousl y stor ed an emul ator co nfi gura ti on a nd wish to
re -l o ad i t in to t he e m u la t or , sele ct :
Config, Load
Enter the co nfi guration fi le nam e and pr ess Enter. Th e emul ator will
be r e-c onf igu red wi th the val ues spe ci fi ed i n the con fig uration file.
Co nfig u rin g the Emu lat or 4-1 7
Notes
4-18 Con fig u rin g the Emu lat or
5
Using the Emulat or
Introduction In the "Ge tting St ar ted" chapt er, you lea rne d how t o loa d co de into t he
emulator, how t o mo dif y me mory a nd view a regi ster, a nd ho w to
perfor m a si mple analy zer measu reme nt. In this ch apter , we will
discuss i n mo re deta il oth er feat ure s of th e emul at or.
This c hap ter shows you h ow to:
Making Coordinat ed Measurements.
Sto re the cont ent s of mem ory i nto abso lut e file s.
This c hap te r also disc usse s:
Disp lay or Modi fy re gi ste rs.
Usin g the Emu lat or 5-1
Making
Coordinated
Measurements
Coo rdin ated measureme nt s are measure ment s synchronously made in
mult ip le e mula to rs or an alyze rs. Coord ina te d measurement s can be
made betwee n HP 6470 0 Seri es e mu la tor s whic h com m uni ca te ove r
the Coo rdi nated Measu rem ent Bu s ( CMB). Coordin ated
mea sure ment s can also be made betwee n an em ulato r and some oth er
instru me nt conn ec ted to the BNC conn ector .
This section will desc ri be coordina ted m ea sure ments m ade fr om t he
PC Int er fac e which in vo lve the em ul at or. These types o f coo rdi nated
measurements ar e:
Run nin g the emul at or on re ce pt ion of the CMB /EXE CUTE
signal.
Usin g the analy zer trigge r to b reak emul ator e xecut ion i nt o
th e moni tor.
Note You must use th e backg roun d emul at ion mo n itor to perf orm
co ordi na te d me asu rem e nts.
Thre e sig nal lines on the CMB are active and ser ve the fo llowing
functions when enabled:
/TRIGGER Act iv e lo w. The a nalyz er t rig ger lin e on t he CM B
an d on th e BNC serve the sam e logical purp ose.
They provide a me an s for the anal yze r to driv e it s
trigger signa l out of the syst em or for ext ern al
tr igg er s i gna ls to arm the ana ly ze r or break the
emulator i nto its m oni to r.
READY Act iv e high. Thi s line is f or sync hro niz ed ,
multi- em ul at or sta rt a nd st op. Whe n CMB ru n
co ntr ol i ntera ct ion i s ena bl ed, all emulators a re
required to break t o backg roun d upon recept io n of a
false READY si gna l and wil l not return to
for egr ound u ntil this l ine is kno wn to be in a true
state.
5-2 Using the Emulator
/EXECUTE Act iv e lo w. T his line serves as a glob al interr upt
signal . Upo n rec epti on of a n ena bl ed / EXECUTE
sig nal, eac h emul ator i s t o inte rrup t whate ver it is
doi ng and ex ec ute a pre vi ousl y def ined pro ce ss,
ty pic al ly, ru n the em ul at or or start a trac e
measurement.
Running the
Emulator at
/EXECUTE
Be fore you can specify t hat the em ul at or run u pon re ce ip t of the
/EXE CUTE signal, you must ena bl e CMB interact ion . To do th is,
select:
Config, General
Use the arrow ke ys to mov e the cursor t o t he "Ena ble CMB
Int er ac ti on? [ n]" que sti on, an d typ e "y". Use the Enter ke y to exit out
of the l ower r igh t-h and fie ld in the con fig ura ti on di splay.
To spec if y that the emu lator begi n executi ng a program upon rec eptio n
of the /EXE CUTE sign al, sele ct:
Processor, CMB, Go
At this point you may eit he r sel ec t the cu rre nt pr ogra m coun te r, o r you
may select a specific address.
The c ommand yo u ent er is save d an d is ex ec ute d whe n the /E XE CUT E
sig nal becomes act ive. Also, you wil l see the message "AL ERT : CMB
ex ec ute ; ru n starte d".
Breaking on the
Analyzer Trigger To cause e mu la tor e xe cut ion to brea k int o th e m oni tor when t he
an al yze r tr igg er c ondi ti on i s found , yo u mu st m odi fy th e tr igg er
co nfigura ti on. To acc ess the trigger configuratio n, se le ct:
Config, Trigger
The trig ger conf igu rat ion disp la y conta ins t wo diagra m s, on e for eac h
of the interna l TRIG1 and T RIG2 si gna ls.
Usin g the Emu lat or 5-3
To use t he interna l TRIG1 signa l t o con nec t the analyz er trig ger to th e
emul ator br ea k line, m ove the curso r to the highl ig hted "Ana lyz er"
fiel d in the TRIG1 port ion of the disp lay, and use the Tab ke y to s ele ct
the "-----> >" arrow whi ch shows tha t the analyzer is drivi ng TRIG1 .
Nex t, mo ve the c ursor to th e hi ghl igh te d "Em ul at or" fi el d an d use t he
Tab key to sele ct the arr ow poi nti ng towards the emul at or (< <-- ---) ;
th is speci fie s tha t e mu la tor e xe cutio n wil l bre ak i nt o the mo nit or w he n
the TRIG1 si gnal is driven. The trigge r confi gura ti on di spl ay is shown
in figure 5-1.
Note If your em ulator i s conf igured with e xt ern al ana lyzer , "Tim i ng" cr o ss
trigg er op tions ar e displa ye d.
Figu re 5-1. Cross Tri g ger Co nf igu ratio n
5-4 Using the Emulator
Storing Memory
C onten ts to an
Absolute File
The "Ge tting Star te d" chapt er shows y ou how to load ab solu te fil es
into emulation or target system memory. You can also store emulation
or target syste m m emory to an absolute file with the fol lowi ng
command.
Memory, Store
Note The first c harac ter of t he absol ute fil e na me must be a lett er . You can
na me the abso lute file wit h a tota l of 8 alph anumeric chara ct er s, a nd
opt io nally , you ca n inclu de an exten sion of up to 3 alp han um eri c
characters.
Caution The "Memo ry Store" com ma nd wri te s ove r an exist in g fil e if it h as th e
sam e name that is specifie d wit h the comm and. Yo u ma y wish t o
ve rif y before han d that the sp e ci fied fi le na me doe s n ot a lre ady exi st.
Accessing Target
System with E
clock synchronous
instruction
You can acc ess targe t syst em devic es i n synchronization with the E
cloc k. To do t his, use the foll owi ng comma nds:
Processor, IO, Display
Processor, IO, Modify
The emulator will ac ce ss t he devi ce using the MOVFPE/ MOVTPE
instruction.
Usin g the Emu lat or 5-5
Re gister Names
and Classes The fo llowing regist er na mes an d classes ma y be used wit h " Register
Display/Modify" commands.
Summary H8/5 36 re gi ster desi gnato rs. All avai la ble regist er c lass names an d
re gist er nam es a re listed be lo w.
* (Basic) Class
Reg iste r name Desc ripti on
pc
cp
sr
dp
ep
tp
br
r0
r1
r2
r3
r4
r5
r6
r7
r7
fp
sp
mdcr
Prog ram co unter
Code page regi ste r
Status register
Dat a pa ge regi ster
E xte nde d page re gi ster
Stack page register
Ba se re gist er
Register R0
Register R1
Register R2
Register R3
Register R4
Register R5
Register R6
Register R6
Register R7
Fra me pointer
Stack pointer
Mode control re gister
5-6 Using the Emulator
sys Class System control re gisters
Reg iste r name Desc ripti on
wcr
ramcr
mdcr
sbycr
Wai t co ntr ol regi ste r
RAM contr ol re gister
Mode control re gister
Soft war e stand- by co ntr ol re gister
intc Class Interrupt contro l re gisters
ipra
iprab
iprc
iprd
ipre
iprf
Int er rupt pri ori ty re gi ster A
Int er rupt pri ori ty re gi ster B
Int er rupt pri ori ty re gi ster C
Int er rupt pri ori ty re gi ster D
Int er rupt pri ori ty re gi ster E
Int er rupt pri ori ty re gi ster F
dtc Class Dat a tran sfer c ont rol le r regist er s
dtea
dteb
dtec
dted
dtee
dtef
DT enable register A
DT enable register B
DT enable register C
DT enable register D
DT enable register E
DT enable register F
Usin g the Emu lat or 5-7
port Class I/O port registers
Reg iste r name Desc ripti on
p1ddr
p2ddr
p3ddr
p4ddr
p5ddr
p6ddr
p7ddr
p9ddr
p1dr
p2dr
p3dr
p4dr
p5dr
p6dr
p7dr
p8dr
p9dr
p1cr
p69cr
Port 1 data dire ct ion regi ste r
Port 2 data dire ct ion regi ste r
Port 3 data dire ct ion regi ste r
Port 4 data dire ct ion regi ste r
Port 5 data dire ct ion regi ste r
Port 6 data dire ct ion regi ste r
Port 7 data dire ct ion regi ste r
Port 9 data dire ct ion regi ste r
Port 1 data regi ste r
Port 2 data regi ste r
Port 3 data regi ste r
Port 4 data regi ste r
Port 5 data regi ste r
Port 6 data regi ste r
Port 7 data regi ste r
Port 8 data regi ste r
Port 9 data regi ste r
Port 1 contro l regist er
Port 69 contr ol re gister
frt1 Class Free runnin g ti mer 1 regist er s
frtcr1
frtcsr1
frc1
ocra1
ocrb1
icr1
Timer control register
Time r control/status register
Fre e runnin g cou nter
Out put com pa re re gi ster A
Out put com pa re re gi ster B
Inp ut c apt ure reg ist er
5-8 Using the Emulator
frt2 Class Free runnin g ti mer 2 regist er s
Reg iste r name Desc ripti on
frtcr2
frtcsr2
frc2
ocra2
ocrb2
icr2
Timer control register
Time r control/status register
Fre e runnin g cou nter
Out put com pa re re gi ster A
Out put com pa re re gi ster B
Inp ut c apt ure reg ist er
frt3 Class Free runnin g ti mer 3 regist er s
frtcr3
frtcsr3
frc3
ocra3
ocrb3
icr3
Timer control register
Time r control/status register
Fre e runnin g cou nter
Out put com pa re re gi ster A
Out put com pa re re gi ster B
Inp ut c apt ure reg ist er
tm r Class Time r reg ister s
tcr
tcsr
tcora
tcorb
tcnt
Timer control register
Time r control/status register
Time r constant r egister A
Timer constant r egister B
Timer counter
pwm1 Class PWM timer1 registers
pwmtcr1
dtr1
pwmtcnt1
Timer control register
Dut y reg ist er
Timer counter
Usin g the Emu lat or 5-9
pwm2 Class PWM timer2 registers
Reg iste r name Desc ripti on
pwmtcr2
dtr2
pwmtcnt2
Timer control register
Dut y reg ist er
Timer counter
pwm3 Class PWM timer3 registers
pwmtcr3
dtr3
pwmtcnt3
Timer control register
Dut y reg ist er
Timer counter
wdt Class Wat chdog tim er regi ste r s
wdtcsr
wdtcnt
rstcsr
Time r control/status register
Timer counter
Reset control/status register
sci1 Class Serial co mm un icat ion i nt erf ace 1 regist er s.
rdr1
tdr1
smr1
scr1
ssr1
brr1
Re ceive data register
Transmi t data reg ist er
Ser ial m ode r egi ste r
Ser ia l control re gi ste r
Ser ial sta tu s regi ste r
Bi t ra te r egi ste r
5-10 Using the Emulator
sci2 Class Serial co mm un icat ion i nt erf ace 2 regist er s.
Reg iste r name Desc ripti on
rdr2
tdr2
smr2
scr2
ssr2
brr2
Re ceive data register
Transmi t data reg ist er
Ser ial m ode r egi ste r
Ser ia l control re gi ste r
Ser ial sta tu s regi ste r
Bi t ra te r egi ste r
adc Class A/D conve rt er re gi ste r s
Reg iste r name Desc ripti on
addra
addrb
addrc
addrd
adcsr
adcr
A/D da ta reg ist er A
A/D da ta reg ist er B
A/D da ta reg ist er D
A/D da ta reg ist er D
A/D cont rol/st atus reg ister
A/D control registe r
Usin g the Emu lat or 5-1 1
Notes
5-12 Using the Emulator
A
Fi le Format Reader s
Using the HP 64000
Reader An HP 64000 “read er” is pro vid ed with the PC In terfa ce . The
HP 6400 0 Rea de r con ver ts th e fi le s i nt o two fi les that are usable with
you r emul at or. This m ea ns tha t yo u can use a vai la bl e langu age tools to
cr eate HP 64000 a bsol ute fil es, then load those fil es i nto t he em ula to r
usi ng the PC Inter face.
The HP 64000 Re ade r ca n operate from wit hin the PC Inte rface or as a
sep arate process. When operating the HP 64000 Re ader, it ma y be
nece ssary to exec ute it as a separa te proc ess if there is not e nou gh
mem ory on your p erso nal compu te r to opera te the PC Int erf ace and HP
640 00 Re ader sim ul tane ousl y. You can also operate the read er as part
of a “m ake fil e.
What the Reader
Accomplishes Usin g the HP 64000 files (<file. X> , <fil e.L>, <scr1. A> , <scr2.A> , .. .)
the HP 6400 0 Reader wil l produc e two new fi le s, an “absol ute” file and
an ASC II sy m bol fil e, th at will be us e d by t he PC In te rface. T he se ne w
fi le s a re n am ed : “<file>. hpa ” an d “< fil e> .hps.
The Ab solute Fi le
Duri ng exec ut ion of the HP 6 4000 Rea der , an abso lute file (<f ile> .hpa)
is created. This absolu te file is a binary mem or y image which is
opt im ize d for e ffi ci ent downl oa din g int o th e emul at or.
The ASCI I Symb ol Fi le
The ASCII sym bol fil e (<file>. hps) produc ed b y the HP 64000 R eader
co ntain s g lobal sy mbols, module names, local symbols, a nd, when
usi ng appli ca ble devel opm e nt tool s such as a “C” compi ler, prog ram
File Format Readers A-1
line num bers. Local symbols eval ua te t o a fixe d (sta ti c, not stack
relat ive) address.
Note You must use th e re qui red o ptions fo r your specifi c lang uag e tools t o
in clude sy mb oli c (“ de bug” ) in form a ti on in the HP 64000 symbo l file s.
The HP 640 00 Re ader wil l only conve rt symb ol infor ma tion pr esent in
the HP 64000 sym bol fil es (<file.L >, <sr c1.A> , <src2 .A>, ... ).
The sym bo l file c ont ains sym bol and addr ess in form a ti on in the
following form:
module_name1
module_name2
...
module_nameN
global_symbol1 address
global_symbol2 address
...
global_symbolN address
|module_name1|# 1234 address
|module_name1|local_symbol1 address
|module_name1|local_symbol2 address
...
|module_name1|local_symbolN address
Eac h of th e sym bol s is sort ed a lp hab et ic ally i n the order: mod ule
na mes, global sy mbols, and local symbols.
L ine num be r s wil l ap pea r simila r to a loc al sy mb ol e xcept t ha t
“local _sym bol X” will be replace d by “#NNNNN” where NNNNN is a
five digi t deci mal line num ber. The add resse s assoc ia ted wit h globa l
and local sym bol s are spec ifi c to the processo r for whi ch the HP 64000
fil es were generated.
Note When t he l in e number sym bol is di spla ye d in t he e mu la tor , it ap pea r s
in brackets. Th erefore, the sym bol “MODNAME: line 345” will be
displa ye d as “MODNAME : [345 ]” in mnem oni c memor y and tra ce l ist
displays.
A-2 File Fo rmat Readers
The spa ce prece din g mo dul e na me s is re qui red . Al tho ugh fo rm at te d for
readabi lity he re , a singl e tab se par at es sym bol and a ddr ess.
The loca l symbo ls ar e scoped . Thi s means t hat to access a vari able
named “coun t” in a source fil e module nam ed “m ain. c,” you woul d
ente r “mai n.c:c o u nt” as sh own below.
Module Name Variable Name You Enter:
main.c count main.c:count
main.c line number 23 main.c: line 23
You acc ess li ne n um ber symb ols by e nt eri ng t he fo ll owin g on one line
in the order shown:
module nam e
colon (:)
space
the word line
space
th e de ci ma l line num ber
For exam ple:
main.c: line 23
Location of the
HP 64000 Reader
Program
The HP 64000 Reade r is located in the d irectory named \hp6 4700 \bin
by de fa ult , a lo ng wit h th e PC Int er face. T his di re ct ory m ust be in the
environmen t varia bl e PATH for th e HP 6400 0 Reade r and PC Inte rfa ce
to oper at e proper ly. The PATH is usually de fin ed in the
“\autoexec.bat” file .
The followi ng examples assum e that y ou have “\hp64 000\ bin”
inc lude d in your PATH va riable . If not, you must suppl y the
dir ector y nam e when executing the Reader program .
File Format Readers A-3
Using the Reader
from MS-DOS T he com ma nd na m e for t he HP 64000 Re ad er i s RHP64000.EXE. To
ex ec ute the Rea de r from the co mm a nd li ne, for example, e nt er:
RHP64000 [-q] <filename>
-q This option spe ci fie s the “qu ie t” mod e, and
supp resse s the disp lay of messa ges.
<f il ena m e> This re presen ts th e na me of th e HP 6400 0 linke r
sym bol file (fil e.L ) for the absol ute file to be load ed.
The foll owin g com man d will create the fil es “TE ST PROG. HPA” an d
“TESTPROG.HPS”
RHP64000 TESTPROG.L
Using the Reader
from the PC Interface T he PC Inte rfa ce h as a file form at opt io n unde r th e “Memory Load”
comm a nd. After you sele ct HP6400 0 as the file format, the HP 64000
Re ade r wil l op era te on th e fi le you specify. After th is comp le te s
suc cessful ly, th e PC Inter face wi ll acc ep t th e ab solu te and symbol file s
produced by the Reader.
To use t he Re ader fr om t he PC Inte rface:
1. Start up the PC Interface.
2. SelectMemory Load.” The memory load menu will appear.
3 . Speci fy th e file form at as “HP6 4000 .” Thi s wil l appea r as the
d efault file format.
4 . Spe cify the name of an HP 64000 l ink er sym bo l fi le
(TESTFILE.L for example ) .
Usin g the HP 64000 f ile that y ou specify (T ESTFI LE .L , for exa mple ),
th e PC Int er fac e pe rf o rm s the followi ng:
It che cks t o see if two fil es wit h th e same b ase n ame an d
exte nsio ns .HPS a nd .HPA alr ea dy ex ist (for e xam pl e,
TESTFILE.HPS and TESTFILE.HPA).
A-4 File Fo rmat Readers
If TESTFI LE .HPS and TE ST FIL E.HPA don ’t exist , the HP
640 00 Re ade r pro duc es them. The new absol ute fil e,
TEST FILE. HPA, i s the n loade d into th e emul ator.
If TESTFILE.HPS and T EST FIL E. HPA alre ady exi st but the
crea te dat es an d times are earli er tha n the HP 64000 lin ker
symbol fil e creation date /t im e , the H P 64 0 00 Re ader re cre ates
them . The new absolute fil e, T ESTFIL E .HPA, is then loade d
in to t he e mula tor.
If TESTFILE.HPS and T EST FIL E. HPA alre ady exi st but the
dates and times are later than the creation date and time for
the HP 6400 0 linke r symbol fil e, the HP 6 4000 Rea der will
not rec reat e TEST FIL E. HPA. T he curr ent abso lute file ,
TEST FILE. HPA, i s the n loade d into th e emul ator.
Note Date/ ti m e ch ecking is only don e wit hi n the PC Int erf ac e.
When runni ng the HP 64000 Reader at the MS-DOS comm and line
pro mpt, the HP 6 4000 Rea der will al ways update the a bsolute and
sym bol files.
When the HP 64000 Re ad er op era te s on a file , a sta tus message wi ll be
di spla ye d ind ic at ing tha t it is re adi ng a n HP 64000 fil e. Wh en the H P
640 00 Reader co mp letes its pr ocessin g, anot he r messag e will be
di spla ye d ind ic at ing the absol ut e fi le is bei ng l oad ed.
If the Reader Won’t
Run If yo ur pro gra m is v ery lar ge, th e PC Inter face may run out of m emory
while attempting to create the database file. If this occurs, you will
need to exit the PC Interface and execute the program at the MS-DOS
comm and pro mpt to cre ate the files that are downloa ded to the
emulator.
File Format Readers A-5
Including RHP64000
in a Make File You may wish to inc orpo rat e the “RHP640 00” p roc ess as t he last step
in y our “ma ke fil e,” a s a step in yo ur co nstr uctio n proc ess, to eli m ina te
the possi bi lity of havi ng to exi t the PC Interface due t o space
lim itat ion s desc rib e above. If the fil es wit h “. HPA” and “ .HPS”
exte nsio ns are not current, loa din g an HP 64000 fi le will autom atic ally
c reat e th em.
Using the
HP 64869 Reader A HP 64869 f orm at "rea de r" is pro vided with the PC In te rfa ce. The
HP 6486 9 Reade r converts a HP 64869 for mat file into two fil es th at
are usable wit h the HP 64739 e mula to r. Thi s me ans yo u can use
avai la ble language tools to crea te HP 6 4869 f ormat absolute file s, then
load those fil es in to the emu lator using the H8/536 PC Interf ac e.
The HP 64869 Re ade r ca n operate from wit hin the PC Inte rface or as a
sep arate process. Operation from wit hin the PC Interface is avai lable if
th ere is enough me mo ry on yo ur pe rsonal computer to run the PC
Int er face and HP 6486 9 Reade r sim ul ta neo usly .
You can a lso ru n the reader as part of a "ma ke fil e. "
What the Reader
Accomplishes Usin g any HP 64869 fo rm at absol ut e file in th e form "<fil e>.<e xt>",
the HP 6486 9 Reader wil l produc e two new fi le s, an "absolut e" file and
an ASC II sym bol file, that will be used by t he H8/536 PC Interfa ce .
The Ab solute Fi le
Duri ng exec ut ion of the HP 64869 Reader , an abso lute file
(<fil e>. HPA) is crea ted. This absol ut e file is a bi nar y memory i mage
whi ch is opti miz ed for eff ic ient do wnlo adi ng into the em ulato r.
The ASCI I Symb ol Fi le
The ASCII sym bol fil e (<fil e>.HPS) prod uced by the HP 64869 Reader
co ntain s g lobal sy mbols, module names, local symbols, a nd, when
usi ng ap pli ca bl e de vel opm e nt t ool s lik e a "C" com pil er , program lin e
A-6 File Fo rmat Readers
numbers. Local symbols evaluate to a fixed (static, not stack relative)
ad dre ss.
Note You must use th e re qui red o pti ons fo r you spe ci fi c langu age too ls to
in clude sy mb oli c ("d ebu g") in form a ti on in the HP 64 869 fo rm at
absolut e fi le.
The sym bo l file c ont ains sym bol and addr ess in form a ti on in the
following form:
module_name1
module_name2
...
module_nameN
global_symbol1 address
global_symbol2 address
...
global_symbolN address
|module_name|local_symbol1 address
|module_name|local_symbol2 address
...
|module_name|local_symbolN address
|module_name|# 1234 address
Eac h of th e sym bol s is sort ed a lp hab et ic ally i n the order: mod ule
na mes, global sy mbols, and local symbols.
L ine num be r s wil l ap pea r simila r to a loc al sy mb ol e xcept t ha t
"lo cal_sy mb olX" wi ll b e repla ced by "#NNNNN" where NNNNN is a
five di git de cima l line num be r. Lin e numbe rs should appear i n
asc en din g orde r in both the lin e number itsel f an d its associate d
address.
Note When t he l in e number sym bol is di spla ye d in t he e mu la tor , it ap pea r s
as a brac ke te d num be r. The re fore , the sy mb ol "modname: # 345" will
be display ed as "mod name:[345]" in mn em oni c mem or y and t ra ce list
displays
File Format Readers A-7
The spa ce prece din g mo dul e na me s is re qui red . Althou gh for ma tt ed
for rea dab il it y her e, a single ta b sepa ra te s symb ol and addre ss.
The loca l symbo ls are sco ped . When a ccessi ng t he vari able nam ed
"co unt " in th e source fil e modul e nam ed "mai n.c", you would enter
"m ai n:c oun t". Noti ce tha t th e module nam e of the s ou rce file "m ai n. c"
is "m ain". see the foll owin g ta ble.
Module Name Variable Name You Enter:
main count main:count
main line number 23 main: line 23
Location of the
HP 64869 Reader
Program
The HP 64869 Reade r is located in the d irectory named \hp6 4700 \bin
by de fa ult, a lo ng with th e PC Interfac e. This direc to ry m ust be in the
environmen t varia bl e PATH for th e HP 6486 9 Reade r and PC Inte rfa ce
to o per at e pro per ly. T his i s usually d efi ne d in "\ autoe xec . bat " file.
Using the HP 64869
Reader from MS-DOS The com ma nd na m e for t he HP 64869 Re ad er i s RD64869.EXE. You
can ex ec ute the HP 6 4869 Rea der f rom the command line with t he
command:
C:\HP64700\BIN\RD64869 [-q] <filename>
<RETURN>
where:
[-q ] spe cifie s the "qui et" mod e. This option suppr esse s
th e display of messa ge s.
<f il ena m e> is t he na m e of the file con ta ini ng t he HP 64 8 69
for mat absol ute program .
The command
C:\HP64700\BIN\RD64869 TESTPROG.ABS
wil l ther efo re create the files "T ESTPROG.HPA" and
"TESTPROG.HPS".
A-8 File Fo rmat Readers
Using the HP 64869
Reader from the PC
Interface
The H8/ 536 PC Inte rfa ce has a f ile for mat op tion under the " Memory,
Loa d" co mm a nd. Af ter you se le ct thi s o pti on, th e HP 64869 Rea der
wil l opera te on the fi le you specify. Afte r th is co mplete s succ essfu ll y,
th e H8/536 PC Interfa ce will accept t he absol ute and symbol file s
produced by the Reader.
To use t he Re ader fr om t he PC I nte rfa ce , f oll ow th ese st ep s:
1 . Start up the H8/5 36 PC Int er fac e.
2. Select "Memory, Load". The m em ory load m enu will app ea r.
3 . Speci fy th e file form at as "HP648 69". T hi s wil l appea r as the
d efault file format.
4 . Specify a file in HP 64869 format ("T EST FIL E.ABS", for
exampl e, ). The fil e exte nsio n ca n be some thing othe r than
".ABS", but c annot be ".HPA", ".HPT", or ". HPS".
Note The "<fil en ame> .HPT" fi le is a tem por ary file use d by the HP 64869
Reade r to proc ess th e symbol s.
Usin g the HP 64869 form at file that you speci fy (TE ST FIL E. ABS, for
ex am pl e), th e PC Int er face perf o rm s t he f oll ow i ng:
Che ck s to see if t wo fil es wi th t he same base nam e an d
exte nsio ns .HPS a nd .HPA alr ea dy ex ist (for e xam pl e,
TESTFILE.HPS and TESTFILE.HPA).
If TESTFI LE .HPS and TE ST FIL E.HPA don ’t exist , the HP
648 69 Re ader pro duc es th em . The new ab solu te fil e,
TEST FILE. HPA, i s the n loade d into th e emul ator.
If TESTFILE.HPS and T EST FIL E. HPA alre ady exi st but the
crea te dat es an d times are earli er tha n the HP 64869 f orm at
fi le cre at ion dat e/ ti me , the HP 64 869 Re ad er recr ea tes t he m.
The new abso lut e file, TE ST FIL E.HPA, is then load ed into
th e emulator.
File Format Readers A-9
If TESTFILE.HPS and T EST FIL E. HPA alre ady exi st but the
da te s and t im es a re l at er t han the cre at ion dat e/ ti me for the H P
648 69 format file, the curr ent abso lute file, TE ST FIL E.HPA,
i s th e n loaded in to t h e e mu lato r .
Note Date/ ti m e ch ecking is only don e wit hi n the PC Int erf ac e. Wh en
run nin g the HP 64869 R eader at the MS-DOS comma nd line prom pt,
the HP 6486 9 Reader wil l alway s upda te the absol ut e an d symbol files.
When the HP 64869 Re ad er op era te s on a file , a sta tus message wi ll be
di spla ye d ind ic at ing t ha t it is re adi ng a HP 64869 fo rmat fil e. Whe n
the HP 6486 9 Reade r compl etes i ts pro cessing, anot her message wil l
be d ispl ay ed i ndi ca ti ng th e ab solu te f ile is be in g loa ded.
If the Reader Won’t
Run If yo ur pro gra m is very lar ge, th en the PC In terfa ce ma y run ou t of
mem ory wh il e at te mpting to cre at e t he da ta ba se fi le u sed. If this
co ndi ti on occur s, yo u will need t o exi t t he PC In te rface a nd e xec ut e th e
pro gra m at the comm and pro mp t to cre ate the files tha t ar e downloade d
to the emulator.
Including RD64869 in
a Make File You may wish to inc orpo rat e the "RD64869 " proc ess as t he last step in
you r "make " fil e, or as a step in you r con stru ction proc ess, so as to
elim inat e the possibi li ty of hav ing t o exit the PC Inte rfa ce due t o space
lim itat ion s desc rib e above . If the "-.HPA" and "-. HPS" fil es are no t
cu rre nt, the pro cess o f loa di ng an HP 64869 fo rmat file wil l
au tom a ti ca ll y creat e them .
A-10 File Fo rmat Readers
Index
!.HPA file 2-13
.HPS file 2-13
Aabsolut e fi les
.HPA create d by HP 64869 Reader A-6
<file>.hp a create d by HP 64000 Reade r A-1
loading 2-12
storing 5-5
anal ysis begi n 2-31
anal ysis display 2-31
anal ysis spe cifi cati on
rese tt in g the 2-27
saving 2-31
tri gge r co ndi ti on 2-27
tri gge ring by da ta 2-28
analyzer
sta tus qu al ifi er s 2-29
tri gge ring by da ta 2-28
usin g the 2-27
ASCII symbo l file (<file>.hps) A-1
ASCII symbol files
.HPS create d by HP 64769 Reader A-6
assemblers 2-9
asse m bli ng t he ge tting started sample progra m 2-6
BBNC conne ct or 5-2
break command 2 -20, 2-23, 2 -34
break conditions 4-17
bre akpoint interru pt instr uct io n
soft ware breakpoin ts 2-24
breakpoints
software 2-24
breaks 1-5
gua rde d mem ory a ccesse s 2-9
on an al yze r trigg er 5-3
soft ware breakpoin ts 1-5
writ e to ROM 4-5
Index-41
writ es to ROM 2-9
bus arbi tra tion
usin g con fig ura ti on to isol at e targe t pr obl em 4-8
Ccautions
fil en am es i n the mem ory st ore com m and 5-5
inst alli ng t he targ et syste m probe 3-2
characteriza tion of memory 2-9
cim, Terminal Interface command 2-25
clock sourc e
external 4-3
internal 4-3
cloc k sourc e select ion , emu lator c onf igu ratio n 4-3
CMB (coor din at ed measure m ent bus) 5-2
enabling interaction 4-7
exe cu te signa l whi le emulator is reset 2-34
signals 5-2
co mm a nd fi le
creatin g and using 2-33
co mma nds (PC Interfa ce ), select in g 2-8
Configuration
for sa mple p rogr am 2-8
rese t value for stac k poi nt er 2-8
co nfi gura ti on (emulato r)
accessing 4-2
background cycles to t arget 4-9
bre ak processor on writ e to ROM 4-5
clock selection 4-3
enabl e CMB intera ct ion 4-7
enabl e NMI input 4-10
ena bl e soft war e breakpoi nts 4-6
enabling re al-time runs 4-3
hono r targe t reset 4-11
loading 4-17
mo nit or t ype) 4-14
proc esso r mode 4-13
sta ck po int er 4-16
storing 4-17
configurat ion(hardware), instal ling the emulator 2-2
co ordi na te d measu rements
b r eak o n an aly ze r tr igger 5-3
definition 5-2
42-Index
mult ipl e emu lator star t/ stop 4-7
run at /EXE CUT E 5-3
co unt , st ep c om ma nd 2-20
Dde vic e t abl e, emulat or 2-7
di spla y co mm a nd
registers 5-6
di spla yi ng the trac e 2-31
EE cl ock) 5-5
em u l atio n me mor y
RAM and ROM 2-9
siz e of 2-9
emulator
before using 2-2
de vic e tabl e 2-7
DMA support 1-6, 4-8
fea tu res of 1-3
limitations 1-6
mem ory m ap per resol ut ion 2-9
prerequisites 2-2
purp ose of 1-1
reset 2-34
running from target reset 3-4
sle ep mode 1-6
soft ware stand-by mode 1-6
status 2-8
targe t system 1-5
wat ch- dog t im er 1-6
emul at or c onfi gur at ion
bus ar bit ra ti on 4-8
Emulat or feat ures
analyzer 1-5
clock speeds 1-3
emulation memory 1-4
suppo rted micropr oce ssors 1-3
Em ulat o r limit atio ns
RAM enable bit 1-6
en abl e re al -tim e ru ns
emulator co nfigura ti on 4-3
eram, memory characterization 2-9
er om , m em or y chara ct eri za ti on 2-9
Index-43
EXECUTE
CMB sig nal 5-3
run at 5-3
ex ecuting pr ogra m s 2-22
e xiting the PC In t er fac e 2-35
exte rna l cloc k source 4-3
Ffeatures of the emulator 1-3
file format
HP 64869 A-6
file formats
HP64000 A-4
fi nd da ta i n mem o ry 2-23
foreground monitor a ddress 4-15
function codes
mem ory m ap pin g 2-9
function key macro 2-20
Ggetting start ed
prerequisites 2-2
gl oba l symbols 2-14 , 2-19
grd, mem ory cha ra ct eri za tion 2-9
gua rde d mem ory accesses 2-9
Hhardwa re i nsta llat io n 2-2
HP 6400 0 Reade r A-1
using wit h PC Interface A-4
HP 6400 0 Reade r comm and (RHP64 000. EXE ) A-3
HP 6486 9 forma t 2-13
loading 2-13
HP 6486 9 Reade r A-6
using wit h PC Interface A-8
HP 6486 9 Rea der comm an d (RD64869.EXE ) A-8
HP64000 file format A-4
HP64000 for mat 2-13
HPTABL ES e nvi ronm e nt va riabl e 2-7
Iin -circ uit em ulation 3-1, 4-1
installation
hardware 2-2
software 2-2
installing targ et system probe
See targe t system probe
44-Index
inte rna l cloc k source 4-3
in te rna l I/ O regi ster display/ mo dif y 5-6
interrupt
NMI 4-10
Llimitations of the emulato r 1-6
line numbers 2-32
link the samp le progr am 2-6
linkers 2-9
lo ad m ap 2-9
loading a bsol ute files 2-12
lo cal sym bol s 2-15 , 2- 25, A-3, A-7
loca ti on of fo reg roun d mo nit or 4-15
lo cke d, PC Int erf ac e ex it o pti on 2-35
lo ggi ng of c om ma nds 2-33
Mmacro 2-20
m ake fil e A-1 , A-6
mapping memory 2-9
memory
disp layin g in mne mo nic form a t 2-18
mapping 2-9
modifying 2-21
re- assi gnm en t of emu la tion m em ory b locks 2-12
searching for dat a 2-23
memor y char a cter izat io n 2-9
memory mapping
func tion c ode s 2-9
ran ges, maximum 2-9
monitor type 4-14
MOVFPE instruction 5-5
MOVTPE instr uct ion 5-5
Nnon -maska bl e inte rrup t 4-10
Notes
"Ti m ing " option on ly with externa l analyz er 5-4
abso lute fi le name s for sto red m e mo ry 5-5
changi ng c lock sour ce forc es re set 4-3
CMB in te rac ti on e nab le d on ex ec ute com m an d 4-7
con fig . opti on for rese t sta ck poin te r rec om m end ed 4-16
dat e checki ng onl y in PC Interfa ce A-5, A-10
disp layin g com pl ete trac es 2-31
DMA to em ulat io n mem ory no t supp ort ed 4-8
Index-45
int er nal mem ory m ust be assigne d as e mu la tion m em ory 2-9
re- assi gnm ent of emu l. mem . bl oc ks by m app er 2-12
reg ist er c om ma nd 2-20
set ting soft ware bkpts. whil e runni ng user code 2-25
soft ware breakpoint lo ca tions 2-24
soft ware bre akp oin ts an d ROM cod e 2-25
term inal wi ndow t o modif y emul . confi g. 4-2
use re qui re d opt ions to in cl ude sy mb ols A-2 , A-7
writ e to ROM ana ly ze r sta tus 4-5
Oout - o f-ci rcuit emulation 4-1
PPC Int er fac e
exi ti ng t he 2-35
HP 64000 Reader A-4
HP 64869 Reader A-8
sel ecti ng co mm a nds 2-8
sta rti ng t he 2-7
Pin guard
targe t system prob e 3-2
PL CC socket
connect to the target system 3-3
predefining stack pointer 4-16
pre re qui sites for g etti ng start ed 2-2
pro cessor ope ra ti on m ode 4-13
purpose of the emu lator 1-1
Qqua lifiers, an alyzer statu s 2-29
RRAM, mappi ng e mu la tion or t arg et 2-9
Raw HP64000 f ormat 2-13
reader
RD64869 A-6
READY, CMB signal 5-2
re al -ti m e ex ec ution
com m an ds not all owe d duri ng 4-4
com m an ds whic h wil l cause bre ak 4-4
re al -ti m e ope ra ti on 1-6
re al -ti m e runs 4-3
register display/modify 2-20
registers 1 -5, 5-6
relocatable fi les 2-9
reset 2-34
46-Index
r eset (e mula tor)
running from target reset 3-4
reset(emulator) 1-6
re set ti ng the analyze r speci fic at ions 2-27
ROM
mapping emu la ti on or t arg et 2-9
writ es t o 2-9
run at /EXECUTE 5-3
run from target reset 3-4
run nin g program s 2-22
Ssam pl e program, linking 2-6
sam pl e programs
for ge tt in g sta rte d 2-2
saving an alysis specifications 2-31
sea rc hin g for da ta in m em or y 2-23
sel ecti ng PC In te rfa ce com m and s 2-8
sim pl e trig ger, spe cifying 2-27
single-step 1-5
soft war e break poi nt
H8 /53 6 bre akp oin t in terrup t in stru ct ion 4-6
soft war e break poi nts 1-5 , 2-24
clearing 2-26
def ini ng (a dding) 2-25
displaying 2-26
enabling 4-6
setting 2-26
soft war e insta llat ion 2-2
specifications
See analy sis spe ci ficat io n
stack pointer
rese t value 2-8
stack pointer,defining 4-16
s t ar ting the tr ace 2-31
status (analyzer) qualifiers 2-29
s tatus li ne 2-8
status qualifiers, H8/536/520 2-29
step 2-19
cou nt speci fi ca ti on 2-20
supe rvi sor st ack poi nte r
req uir ed for prop er op erati on 4-16
symbols 2-14
Index-47
.HPS file forma t A-2, A-7
global 2-19
loca l 2-25, A-1, A-6
Ttarget reset
running from 3-4
targe t system probe
cauti ons fo r instal lati on 3-2
installation 3-2
inst alla tion pr oce dur e 3-3
pin guard 3-2
targe t system RAM and ROM 2-9
trace
analy zer sign als 2-27
desc ri pti on of list in g 2-32
disp layin g the 2-31
sta rti ng t he 2-31
tram, memory characterization 2-9
TRIG1, T RIG2 inte rna l signals 5-3
trigger 2-27
bre aki ng i nto mon it or on 5-3
spec if yin g a sim pl e 2-27
tr igg er st ate 2-32
TRIGGER, CMB signal 5-2
tr om , m em or y chara ct eri za ti on 2-9
Uund efine d soft ware bre akp oin t 2-24
unl oc ked , PC Inte rfa ce exi t opt io n 2-35
usi ng the HP 64000 file read er A-1
Vvi sibl e ba ck grou nd cy cl es 4-9
Wwri te to ROM bre ak 4-5
Zzoom , window 2-14, 2-18
48-Index