easypack/sld - micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · installing the emulator...

139
EasyPack/SLD for 6502F MICETEK INTERNATIONAL INC. Doc. No. 100-000004 First Edition April, 2000

Upload: others

Post on 25-Feb-2020

27 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

EasyPack/SLDfor

6502F

MICETEK INTERNATIONAL INC.

Doc. No. 100-000004First EditionApril, 2000

Page 2: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

ii • Contents

Trademark AcknowledgmentsEasyPack is a registered trademark of Microtek International.SLD is a trademark of Microtek International.IBM is a registered trademark and PS/2 is a trademark of IBM.Microsoft, MS, MS-DOS, and Windows are registered trademarks ofMicrosoft Corporation.Intel is a registered trademark and Intel386SX is a trademark of IntelCorporation.Motorola is a registered trademark of Motorola, Inc.Philips is a trademark of Philips Semiconductors2500AD is a trademark of 2500AD Software, Incorporated.IAR is a trademark of IAR Systems AB.Franklin is a trademark of Franklin Software, Inc.Keil is a trademark of Keil Elektronik GmbHBSO/Tasking is a trademark of Boston System Office.

Document Number 100-000004 (First Edition)2000 MICETEK INTERNATIONAL INC.All Rights Reserved.Printed in Taiwan, 04/2000

The contents of this manual are subject to change without notice. MicetekInternational Inc., assumes no responsibility for errors that may appear in thismanual. Micetek makes no commitment to update, nor to keep current, theinformation contained in this manual. Nothing herein shall be construed as arecommendation to use any product in violation of existing patents or otherrights of third parties. No part of this manual may be reproduced or transmittedin any form or by any other means without prior written permission fromMicetek.

EasyPack/SLD is copyrighted by Micetek International Inc., and is furnishedunder a license or nondisclosure agreement, and may be used or copied only inaccordance with the terms of the agreement.

USER MAY NOT USE, COPY, MODIFY, OR TRANSFER EasyPack/SLD, ORMAKE ANY COPY THEREOF, EXCEPT AS EXPRESSED IN THEAGREEMENT.

MICETEK INTERNATIONAL INC.

MICETEK4F, Building 14, No.470 Guiping RD.Shanghai 200233, P.R.C.Voice : +86 21 6495-4008Fax : +86 21 6485-3259E-mail : [email protected]

MICETEK7F-1, #237, Sec.1, Wu Chuan WestRoad, Taichung, Taiwan, 403Voice : +886 4 378-6288Fax : +886 4 378-6289E-mail : [email protected]

Page 3: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Contents • iii

EasyPack/SLD for 6502F

C ontents

1 Introduction 1

Overview ............................................................................................................................ 1About This Manual ............................................................................................................. 1Related Publications ........................................................................................................... 1Registering.......................................................................................................................... 2How to Contact Micetek ..................................................................................................... 2

2 Getting Started 3

Overview ............................................................................................................................ 3Installing the Emulator and EasyPack /SLD™ Software.................................................... 3EasyPack to Host Communication Setup......................................................................... 3Learning the EasyPack /SLD™ Window Interface ............................................................ 3

Basic Mouse and Keyboard Techniques................................................................ 4Choosing and Selecting Items................................................................................ 4EasyPack/SLD Main Window .............................................................................. 5The Dialog Box..................................................................................................... 6EasyPack/SLD Windows Pointers ........................................................................ 7Shortcuts Keys ...................................................................................................... 7Shortcut (Local) Menus......................................................................................... 7

Invoking EasyPack /SLD™................................................................................................ 8Exiting EasyPack /SLD™.................................................................................................. 8Getting On-line Help .......................................................................................................... 9

Access Help .......................................................................................................... 9Help on Using Help............................................................................................... 9Help Menu ............................................................................................................ 9

3 Source Level Debugging 11

Overview .......................................................................................................................... 11Mapping Memory ............................................................................................................. 11

Map Setup ........................................................................................................... 11Loading Code.................................................................................................................... 13

Page 4: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

iv • Contents

EasyPack/SLD for 6502F

Loadfile Formats ..................................................................................................13Loading a File ......................................................................................................13Load Status Information.......................................................................................17

Debugging from the Source Window.................................................................................18Viewing Source....................................................................................................18Setting Breakpoints ..............................................................................................21Specifying the Breakpoint State and Type............................................................24Starting or Stopping Emulation in the Source Window ........................................24Stepping Through Source .....................................................................................25

4 Source Window and Browsing Modules 27

Overview ...........................................................................................................................27Source Window Menus......................................................................................................27

File Menu.............................................................................................................28Edit Menu ............................................................................................................30View Menu ..........................................................................................................31Group Menu.........................................................................................................32Run Menu ............................................................................................................33Options Menu.......................................................................................................36Window Menu .....................................................................................................37Help Menu ...........................................................................................................38

5 Viewing and Editing Variables 39

Overview ...........................................................................................................................39Viewing the Variable Window ..........................................................................................39

Opening the Variable Window.............................................................................39Variable Window Display....................................................................................40Adding and Deleting Variables ............................................................................40Editing Variables .................................................................................................42

Using the Stack Window ...................................................................................................42Stack Window Display.........................................................................................42Selecting Local Variables ....................................................................................43Formatting Function List......................................................................................44

6 Variable Window 45

Overview ...........................................................................................................................45Variable Menus .................................................................................................................45

Edit Menu ............................................................................................................46Variable Menu .....................................................................................................46

7 Stack Window 49

Page 5: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Contents • v

EasyPack/SLD for 6502F

Overview .......................................................................................................................... 49Stack Menus ..................................................................................................................... 51

Edit Menu............................................................................................................ 51View Menu.......................................................................................................... 52

8 Accessing CPU and Memory 53

Overview .......................................................................................................................... 53Viewing and Modifying Registers..................................................................................... 53

From the CPU Window....................................................................................... 53Viewing and Modifying Target Memory........................................................................... 54

Memory Window Display ................................................................................... 54Using the Single-line Assembler ......................................................................... 55Editing Memory .................................................................................................. 57Updating the Memory Window Display.............................................................. 57Scrolling Through the Memory Window............................................................. 57Memory Setup..................................................................................................... 58

9 CPU Window 65

Overview .......................................................................................................................... 65CPU Window Menu.......................................................................................................... 65

View Menu.......................................................................................................... 66

10 Memory Window 67

Overview .......................................................................................................................... 67Memory Menus................................................................................................................. 67

Edit Menu............................................................................................................ 68View Menu.......................................................................................................... 68

11 Trace Window 71

Overview .......................................................................................................................... 71Trace Menus ..................................................................................................................... 71

File Menu............................................................................................................ 72Edit Menu............................................................................................................ 72View Menu.......................................................................................................... 73Trace Menu ......................................................................................................... 73

12 Events 75

Overview .......................................................................................................................... 75Defining a New Event....................................................................................................... 75

Page 6: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

vi • Contents

EasyPack/SLD for 6502F

13 Trace, Filter and Trigger 77

Overview ...........................................................................................................................77Trace Fundamentals...........................................................................................................77

Trace Memory......................................................................................................78Collecting Trace ................................................................................................................78Configuring Trace..............................................................................................................79Defining Trace...................................................................................................................80

Defining a Trace Buffer Machine Cycle ..............................................................80Defining a Trace Buffer Trigger ..........................................................................82

Saving Trace......................................................................................................................83Viewing Trace ...................................................................................................................84

Bus Mode.............................................................................................................85Assemble Mode....................................................................................................85Cursor Link..........................................................................................................85

14 Shell Window Commands 87

Overview ...........................................................................................................................87Shell Menus.......................................................................................................................87

File Menu.............................................................................................................88Syntax Notational Conventions..........................................................................................89Address..............................................................................................................................89

Symbolic Address ................................................................................................89Address ................................................................................................................90Data .....................................................................................................................90

Commands and System Variables Grouped By Function...................................................90Getting Help On Shell Commands.....................................................................................91Shell Window Commands Entry........................................................................................91$variable............................................................................................................................92

Define Integer Variable or C Expression .............................................................92@macroname.....................................................................................................................93

Execute a Macro ..................................................................................................93Alias ..................................................................................................................................93

Rename a Shell Window Command.....................................................................93Assemble ...........................................................................................................................94

Line Assembly .....................................................................................................94Breakpoint .........................................................................................................................94

Set Hardware Breakpoint.....................................................................................94BYte ..................................................................................................................................95

Memory Modify in Byte Format ..........................................................................95CHecksum .........................................................................................................................96

Memory Checksum ..............................................................................................96CLear.................................................................................................................................96

Page 7: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Contents • vii

EasyPack/SLD for 6502F

Clear Execution Breakpoint ................................................................................ 96CLOck .............................................................................................................................. 97

Get/Set Target Clock........................................................................................... 97COMpare.......................................................................................................................... 97

Compare Two Memory Blocks............................................................................ 97CONtrol............................................................................................................................ 98

Enable/Disable Control Signals .......................................................................... 98Copy ................................................................................................................................. 99

Memory Copy ..................................................................................................... 99CReate ............................................................................................................................ 100

Create a User Defined Symbol .......................................................................... 100DElete............................................................................................................................. 100

Delete a Defined Symbol................................................................................... 100Disassemble.................................................................................................................... 101

Disassembly ...................................................................................................... 101Event............................................................................................................................... 102

Display, Set, and Clear Events .......................................................................... 102EV1................................................................................................................................. 103

Display, Set, and Clear Bus Event 1 ................................................................. 103EV2................................................................................................................................. 104

Display, Set, and Clear Bus Event 2 ................................................................. 104EV3................................................................................................................................. 105

Display/Set External Hardware Event 3............................................................ 105Fill .................................................................................................................................. 106

Memory Fill ...................................................................................................... 106Go................................................................................................................................... 107

Run Target ........................................................................................................ 107HAlt................................................................................................................................ 108

Halt Emulation .................................................................................................. 108Help ................................................................................................................................ 108

Help Get a Shell Window Command................................................................. 108IDentify........................................................................................................................... 109

Identify Emulator and F/W Version .................................................................. 109Include ............................................................................................................................ 109

Execute a Command File................................................................................... 109Jump ............................................................................................................................... 111

Jump/Branch to an Address............................................................................... 111LEvel .............................................................................................................................. 111

Set/Display Trigger and Trace Level................................................................. 111List.................................................................................................................................. 112

List Trace Buffer............................................................................................... 112LOad............................................................................................................................... 113

Load Code with Symbol to Memory.................................................................. 113

Page 8: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

viii • Contents

EasyPack/SLD for 6502F

LOG ................................................................................................................................114Log Shell Commands to a File ...........................................................................114

LONg...............................................................................................................................114Memory Modify in Long Format........................................................................114

LV1 .................................................................................................................................115Set/Display Level 1 Trigger and Trace Mode ....................................................115

LV2 .................................................................................................................................115Set/Display Level 2 Trigger and Trace Mode ....................................................115

MACro ............................................................................................................................116Create Macro .....................................................................................................116

MAp ................................................................................................................................117Memory Mapping...............................................................................................117

MDel ...............................................................................................................................118Delete Macro .....................................................................................................118

Memory ...........................................................................................................................119Memory Dump...................................................................................................119

MENd..............................................................................................................................120End of Macro File ..............................................................................................120

MList ...............................................................................................................................120List Name or Contents of Macro........................................................................120

Qualify.............................................................................................................................121Set/Display Trace Qualifier ...............................................................................121

QUEry .............................................................................................................................122Symbol/Address Query ......................................................................................122

Register............................................................................................................................123Display/Modify Register....................................................................................123

RESet...............................................................................................................................123Reset Emulation .................................................................................................123

SEarch .............................................................................................................................124Memory Search..................................................................................................124

SRecall ............................................................................................................................125Recall Stored Symbols .......................................................................................125

SSave...............................................................................................................................125Save Symbol to File ...........................................................................................125

Step..................................................................................................................................126Instruction/Line Step ..........................................................................................126

SYmbol............................................................................................................................127List Symbol........................................................................................................127

TEst .................................................................................................................................128Memory Test......................................................................................................128

TRAce .............................................................................................................................129Enable/Disable Trace.........................................................................................129

Trigger.............................................................................................................................129

Page 9: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Contents • ix

EasyPack/SLD for 6502F

Set/Display/Enable/Disable Trigger.................................................................. 129Upload ............................................................................................................................ 130

Upload Data to a File ........................................................................................ 130Verify.............................................................................................................................. 131

Memory Write Verification............................................................................... 131WAtch ............................................................................................................................ 132

Watch Variable or C Expression....................................................................... 132Word............................................................................................................................... 132

Memory Modify in Word Format...................................................................... 132

Appendix A

Compiler Information 133

Overview ........................................................................................................................ 133Supported Compilers and Assemblers: .............................................................. 133

Loading and Generating Object Files.............................................................................. 1332500AD Compiler .......................................................................................................... 133WDC Compiler............................................................................................................... 135

Contents ix

Page 10: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 1 • 1

EasyPack/SLD for 6502F Introduction

1 Introduction

OverviewThis chapter explains the following:

• About this manual.

• Related publications.

• Registering

• How to contact Micetek.

About This ManualThis manual describes all the details about EasyPack/SLD source leveldebugger for EasyPack 6502F in-circuit emulators.

See the pertinent Up & Running in 30 Minutes for EasyPack 6502Femulator to get hardware related information.

NOTE

The “EasyPack” is referred to EasyPack 6502F in-circuitemulator throughout this manual.

Related Publications• See your Up and Running in 30 Minutes manual for details on

hardware/software products and host to emulatorcommunication interface information.

• See the Microsoft Windows Version 3.1 User's Guide for theMicrosoft Windows Operating System for more information onusing Windows, Notepad.

Page 11: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

2 • Chapter 1

Introduction EasyPack/SLD for 6502F

• See the pertinent Processor User's Manual for information onthe target processor you are using.

• See the manual that came with the compiler you are using. Alsorefer to Appendix A at the back of this manual for informationof all of the supported compilers.

RegisteringBe sure to complete and return the enclosed registration card so thatMicetek can provide you with technical support and keep you informedof new product development.

How to Contact MicetekAs a Micetek customer, you can call Micetek technical support for helpwith an emulator problem during your warranty period. To register forthis support, be sure to fill out and mail the registration card that camewith the emulator.

If you have any questions about EasyPack/SLD, try to find the answerin the user's manual or on-line Help. If you can't find the answer,contact our Customer Support Department at any of the following sites:

Micetek

Shanghai, PRC

Voice : +86 21 6495-4008 Monday through Friday from9 AM to 5 PM, Beijing Time.

FAX : +86 21 6485-3259 24 hours

Email : [email protected] 24 hours

Micetek

TaiChung, Taiwan

Voice : +886 4 378-6288 Monday through Friday from9 AM to 5 PM, Taiwan Time.

FAX : +886 4 378-6289 24 hours

Email : [email protected] 24 hours

For getting the latest information, please visit our web page:

http: //www.micetek.com

Page 12: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 2 • 3

EasyPack/SLD for 6502F Getting Started

2 Getting Started

OverviewThis chapter explains the following:

• Learning the EasyPack/SLD Window Interface

• Invoking and quitting EasyPack/SLD.

• Getting on-line help.

Installing the Emulator and EasyPack/SLD™ SoftwareInstall the emulator and EasyPack/SLD software following theinstructions in your Up and Running in 30 Minutes! manual.

EasyPack to Host Communication SetupSetup proper EasyPack to host communication link by clicking on theEasyPack Config icon from EasyPack/SLD program group. SeeChapter 5 “Getting Started”of your Up and Running in 30 Minutes!manual.

Learning the EasyPack/SLD™ Window InterfaceIt is assumed that you are already familiar with using Windows. SomeWindows basics are explained below, but if you are uncertain aboutusing a mouse, choosing a command from a menu, opening multiplewindows, entering text, selecting options, choosing actions, or sizingwindows, you should run the Windows tutorial before proceeding. TheWindows tutorial is on the Help menu in the Program Managerwindow.

Page 13: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

4 • Chapter 2

Getting Started EasyPack/SLD for 6502F

This section highlights some of the basic skills you need to work withthe EasyPack/SLD Windows. If you are already familiar withWindows, skip to the section “Invoking EasyPack/SLD” on page 8.

Basic Mouse and Keyboard Techniques

This section explains some of the basic terms that are used in thismanual set.

Term Meaning

Click To quickly press and release the mouse button.

Double-click To click the mouse button twice in rapid succession.

Drag To hold down the mouse button while you move the mouse.

PointTo move the mouse until the mouse pointer on the screenrests on the item of choice.

NOTE

Unless otherwise specified, press the mouse left button to carryout mouse operations.

Choosing and Selecting ItemsA dialog box is a window thatappears temporarily to requestinformation. Many dialog boxeshave options you must selectbefore EasyPack/SLD cancarry out a command. Anellipsis (...) after a menucommand indicates a dialog boxwill appear when you choosethat command.

In any Windows application, the terms of “choose” and “select” havedifferent and specific meanings. Selecting an item usually meansmarking it with the selection cursor, which can appear as a highlight, adotted rectangle, or both. You can select check boxes in dialog boxes.Selecting alone does not initiate action.

One way to select an item is to point to it and click.

You choose an item to carry out an action. For example, choosing anicon might start an application, open a window, or carry out acommand. You can also choose an item from a menu, or choose acommand button in a dialog box.

One way to choose an item is to point to it and double-click.

Menus and dialog boxes are discussed in great detail in the MicrosoftWindows User's Guide.

Page 14: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 2 • 5

EasyPack/SLD for 6502F Getting Started

EasyPack/SLD Main Window

The Main EasyPack/SLD Window

As you work with EasyPack/SLD, you might often open more than onewindow at the same time. These windows can be moved, sized, andmade active.

The active window is on top. It accepts your commands.

Activate a window by doing one of the following

• Click on it.

• Choose it from the Window menu of any debugging windows.

To display multiple windows with their contents visible at the sametime, you can change their size and rearrange them on the screen. Formore information about moving and sizing windows, please see theUser's Guide for the Microsoft Windows Operating System.

The Toolbar

Toolbar provides instant access to commonly used commands. If noother debugging windows are opened, the Main window toolbar willdisplay below the menu bar.

The Main Window Toolbar

Toolbar

Pull-down menu

Active debugging windowwindow

Status bar

Menu bar

Page 15: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

6 • Chapter 2

Getting Started EasyPack/SLD for 6502F

During debugging, the toolbar buttons will automatically switch todifferent debugging buttons associated to active window.

You can drag (point and hold down the left mouse button on toolbarblank area but not on any of the icons) and drop the toolbar to anyborder of the EasyPack/SLD window.

You may also hide the toolbar as you work. Choose the Toolbarcommand from the View menu and click to remove check mark (hidetoolbar). Restore check mark to reinstate toolbar.

Tip-Box

If you point to a Toolbar button for about 3 seconds, EasyPack/SLDwill provide a tip-box for that button to remind you of its function.

Tip-Box for “Restart” Toolbar Button

The Status Bar

The status bar at the bottom of the EasyPack/SLD window gives youinformation about the task being carried out, and other information ofthe active debugging window.

You can hide or display the status bar as you work. Choose the Statusbar command from the View menu. Click to provide check mark(display) or click to remove check mark (hide) status bar.

Typical Status Bar

The Dialog Box

EasyPack/SLD dialog boxes are standard Windows dialog boxeswhich may have options you must select or require you to fill ininformation before EasyPack/SLD can carry out a command. Anellipsis (...) after a menu command indicates a dialog box will appearwhen you choose that command.

Page 16: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 2 • 7

EasyPack/SLD for 6502F Getting Started

A Typical Sample of a (Register) Dialog Box

EasyPack/SLD Windows Pointers

Bull’s Eye Pointer

During debugging, the EasyPack/SLD mouse pointer changes itsshape (from an arrow to a bull’s eye pointer) as you point at thebreakpoints address (left) column to search or set a breakpoint.

Shortcuts Keys

Help Button

Shortcut keys are usually listed to the right of a menu item. Instead ofopening the menu and choosing a command, you can simply press theshortcut key. For example, to open the Help window relative to theactivated debugging window, press F1. For complete list of theavailable EasyPack/SLD shortcut keys, invoke the On-line Help.Shortcut keys offered by function keys (F1 ~ F10) is summarizedbelow:

F1 Help F6 Step over return

F2 Halt F7 Goto cursor

F3 Switch between Source/Mixed/Assembly Modes

F8 Step into

F4 Search next F9 Open Breakpoint dialogbox

F5 Go F10 Step over

Shortcut (Local) Menus

When you activate a debugging window, e.g., a Source window, aCPU window, etc., you can display a shortcut menu by clicking theright mouse button. Shortcut menu of EasyPack/SLD usually containscommands associated to the active debugging window. To cancel aShortcut menu, click on anywhere outside the menu or press Esc.

Page 17: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

8 • Chapter 2

Getting Started EasyPack/SLD for 6502F

Shortcut Menu (CPU Window)

Invoking EasyPack/SLD™

Once EasyPack/SLD is installed on your host computer, you caninvoke the program by clicking the EasyPack SLD 6502F V1.0 iconfrom the group of EasyPack/SLD 6502F.

Invoking EasyPack/SLD from Program Manager

Exiting EasyPack/SLD™

To exit from EasyPack/SLD, choose the Exit EasyPack/SLD commandfrom the File menu on the Menu Bar, double click on the system boxon the main window, or press Alt+F4.

Double click thisicon to start

EasyPack/SLD

Page 18: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 2 • 9

EasyPack/SLD for 6502F Getting Started

Getting On-line HelpEasyPack/SLD on-line help is accessed as in any other Windows helpfile. Here are some of the features of using a Windows help file:

Access Help

• From the Help menu, choose a Help category.

-or-

• Press F1 for context-sensitive help.

-or-

• From the Help window, choose a topic from the Help Contents,or search for a topic by using the Search button.

Help on Using Help

If this is the first time you are using help, you may want to choose"How to Use Help" from the Help menu. (Or, press F1 twice.)

For more information on using Help, see the User's Guide for theMicrosoft Windows Operating System.

Help Menu

Open the Help menu to access on-line Help. The Help menu is thesame as any Windows help menu.

The Help menu is available from each window (or, Press F1).

Page 19: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 3 • 11

EasyPack/SLD for 6502F Source Level Debugging

3 Source Level Debugging

OverviewThis chapter describes how to do the following:

• Map emulator memory.

• Open the Source window to load and display code.

• Set breakpoints and execute codes from the Source window.

Mapping Memory

Map Setup

By default, the EasyPack/SLD will automatically search for the"MAP.SAV" file every time the debugger is invoked. This filecontains the memory map settings information. If not found,EasyPack/SLD will open the Set Map dialog box (shown below) toprompt you to define the settings.

Memory Mapping Dialog Box

Page 20: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

12 • Chapter 3

Source Level Debugging EasyPack/SLD for 6502F

NOTE

The memory settings will remain valid only for the particularEasyPack model installed during memory mapping. It will not berecognized by other EasyPack model. Hence, the Set Map dialogbox will display the first time you run EasyPack/SLD on each newEasyPack model.

You can re-define emulation memory mapping anytime you deemnecessary. To do so, do one of the following to open the Set Mapdialog box anytime during debugging:

Map button

• Click on the Map button on the Toolbar.

• Choose Map from Group menu.

Set the following in the dialog box:

1. Set the map range by clicking on (or marking) the map graphic box.Each block in the map graphic box is equal to 128 bytes and total64KB can be mapped.

2. Select the map attribute by clicking on its color button to the rangeset in step 1. Then the map range will change into the attribute coloraccordingly. The attributes are:

Overlay Sets internal (EasyPack) memory to read/write

Target Sets external (target) memory to read/write

Overlay Read Only Sets internal (EasyPack) memory to read only

Target Read Only Sets external (target) memory to read only

Guard Sets guard (non-existence or guarded)

NOTE

• Up to 64KB of emulation memory can be mapped forEasyPack 6502. The map resolution is 1 byte.

Notice the mapped memory status is displayed in the display box as thespace and attributes are entered.

You may also save the present definitions to your hard disk or restorethe previous mapping definitions from the host.

Page 21: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 3 • 13

EasyPack/SLD for 6502F Source Level Debugging

Loading CodeOne of the first steps in the debugging process is to load the file to bedebugged into target or overlay memory.

Loadfile Formats

EasyPack/SLD supports the following load file formats:

• Intel Hex format (*.hex)• 2500AD High Level format (*.sym)• Extended Micetek format (*.sym)

For more information on compilers, see the "Appendix A: CompilerInformation."

Loading a File

EasyPack/SLD offers several methods of loading your source files asdescribed below.

Loading Definition for Load Code or Symbols or Both

Options for loading load code only (where symbols are alreadyloaded), or symbols only (where task requires for ROM codedebugging only), are defined in the Load Option tab of the SourceGroup dialog box.

Access Source Group dialog box as explained in the above paragraphor click on the Option button from the Load dialog box as shown inSection on Loading with Load Command or Load Button in page 14.

Page 22: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

14 • Chapter 3

Source Level Debugging EasyPack/SLD for 6502F

Load Option Tab Dialog Box

Where:

Load Code Selects to load only code if symbols arealready loaded. (default)

Load Symbols Selects to load only symbols for debuggingROM code. (default)

Report Status Selects to report the loading status. (default)

Report Warnings Selects to suppress warnings during loading.(default)

Loading from List of Recently Loaded Files

If you have worked with a file recently, you may be able to load itagain by choosing its name from the File menu on the menu bar.EasyPack/SLD lists four most recent files you have loaded at thebottom of the File menu. This is the fastest way to load a file and isespecially handy when you work with a small group of loaded filesover a period of time.

Loading with Load Command or Load Button

Choose Load command from the File menu on the menu bar or pointand click on the Load button on the Toolbar. Specify the path and filethat you want to load in the Load dialog box (see below) that follows.

Page 23: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 3 • 15

EasyPack/SLD for 6502F Source Level Debugging

Load Button Note that the dialog box saves the last pathname specified.

Load Dialog Box

Loading from Source Path Tab of Source Group

Sometimes you compile a module in a directory other than the currentdirectory. If you want to load source file from your source directory,click on Source Path tab of the Source Group dialog box.

To access Source Group dialog box, do one of the following:

• Click on Group from menu bar, then choose Source commandfrom the resulting pull-down menu. The Source Group dialogbox will then display.

• Click on Option from menu bar, then choose Load Optioncommand from the resulting pull down menu. The SourceGroup dialog box will then display.

Page 24: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

16 • Chapter 3

Source Level Debugging EasyPack/SLD for 6502F

Source Path Tab Dialog Box

Where:

Directories Select the directory where your source file is located.

Drives The drive where the applicable directory is located.

Add Add the highlighted module in the Directory box to thePath box (the right side box).

Remove Remove the highlighted module from the Path box.

Loading from Extension Names Tab of Source Group

If you want to load source file using the filename extensions you set,click on Extension Names tab of the Source Group dialog box.

Access Source Group dialog box as explained in the above paragraph.

Page 25: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 3 • 17

EasyPack/SLD for 6502F Source Level Debugging

Extension Names Tab Dialog Box

Where:

Extension Names Displays the filename extensions of selected sourcefiles to be loaded.

Add Opens additional filename extensions for inclusioninto the Extension Names box.

Remove Remove the highlighted extensions from theExtension Names box.

Edit Open the highlighted extension name into EditExtension Name dialog box for alteration.

Load Status Information

To see current status of the load file, click on File on menu bar andchoose Load Information from the resulting pull-down menu.

Page 26: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

18 • Chapter 3

Source Level Debugging EasyPack/SLD for 6502F

Loading Information Box

Debugging from the Source WindowYou can view source, set or clear breakpoints, start or stop emulation,step through source, or view variables from Source window.

Viewing SourceYou can view modules from the Source Window as illustrated.

Source Window

Program Counter

Source Line number

Breakpoint symbol

Page 27: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 3 • 19

EasyPack/SLD for 6502F Source Level Debugging

To view the source file:

1. Load the executable file. The Source window initially displayscode starting at current PC address. If source is not available,disassembly is displayed.

NOTE

When you open the Source window after loading code, assembly-level startup code is displayed. You or a compiler vendor maywrite initialization code which sets up the processor environmentprior to the start of main(). Many programs start in assemblycode and not in main().

2. To view a module (a C or assembly source file), do one of thefollowing:

Browse Module Button

• Click on the Browse modules button on the toolbar.

• Choose Browse Modules command from the File menu

• Choose Source from Group Menu and switch to the BrowseModule tab.

Page 28: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

20 • Chapter 3

Source Level Debugging EasyPack/SLD for 6502F

Next Browsed Module Button

Previous Browsed Module

Then browse next or previous modules by clicking on the buttonsshown at left.

Source Group Window Showing Browse Module Tab

Where:

Modules Displays all module names of current file.

ModuleInformation

Displays the file, last creating time, address and pathinformation of the highlighted item in the Modules box.

Page 29: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 3 • 21

EasyPack/SLD for 6502F Source Level Debugging

Source Only Button

Mixed Source

Assemble Button

3. Toggle between Source Only and Mixed Source and Assemblydisplays from the View menu.

4. Toggle Symbolic Disassembly from the View menu. If toggledto on position, code symbols will appear in the disassemblydisplay.

Setting Breakpoints

Bull’s-Eye

Breakpoint Symbol

You can set a hardware execution breakpoint in the Source windowwith a mouse. If you point the mouse to the left margin of a sourceline, EasyPack/SLD displays a breakpoint (bull’s-eye) cursor. Thenclick on the source line to set a breakpoint. A breakpoint set (palm)symbol appears to the left margin of the source line.

If you try to set a breakpoint on a non-executable statement, you willget no response. A breakpoint should be set on the executablestatement.

Page 30: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

22 • Chapter 3

Source Level Debugging EasyPack/SLD for 6502F

Setting Breakpoint Without Browsing the Source

Breakpoint Button

You can set a specific breakpoint without browsing through theSource window by accessing the Breakpoint tab in the Source Groupdialog box, or as follows:

1. To display the Source Group dialog box-

• Choose the Breakpoint command from the Run menu, or

• Click on the Breakpoint button (see figure at left) on theToolbar, or

• Choose the Source command from Group menu.

2. Then from Source Group dialog box open the Breakpoint tab.

3. Then set the breakpoint in the Breakpoint window as illustratedbelow.

Breakpoint Setup with Breakpoint Tab

4. Select a function for the module from the Function edit box..

5. Select a module from the Module edit box.

6. Type an address in the address edit box.

Page 31: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 3 • 23

EasyPack/SLD for 6502F Source Level Debugging

NOTE

1. You can enter a numeric or symbolic address. Numericaddresses are hexadecimal addresses such as 1000. Anexample of a symbolic address is #ModuleName#codelabel.

2. Breakpoint address must be set at the first address of theinstruction.

7. Click on Add button to add the result into the Breakpointsdisplay pane.

8. Clicking on Enable or Disable buttons after selecting abreakpoint in the display pane will enable or disable thatbreakpoint. The plus (+) symbol prefixing the breakpointimplies breakpoint is enabled; the minus (–) symbol meansbreakpoint is disabled.

9. Select a breakpoint you want to delete in the Breakpoints paneand then click on Delete button.

10. Click on Delete All button directly to delete all the breakpointsin the Breakpoints pane.

11. Click on Save button to save the current breakpoints settings toa file. The Save Breakpoint dialog box will pop up toaccommodate saving process.

Saving Defined Breakpoints Settings Dialog Box

12. Click on Restore button to recall all saved breakpoints fromthe file. You have to specify the directory and filename in theRestore Breakpoint dialog box (identical with the abovefigure) that follows.

Page 32: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

24 • Chapter 3

Source Level Debugging EasyPack/SLD for 6502F

13. Click on Close button to exit.

Specifying the Breakpoint State and TypeWhen the breakpoint isreached, emulation haltsbefore the instruction at thebreakpoint address isexecuted.

Breakpoints can be enabled, disabled, or cleared. An enabledbreakpoint is defined and active; emulation breaks when thebreakpoint is reached. A disabled breakpoint is defined but inactive;emulation does not break when the breakpoint is reached.

The two states, enabled and disabled, allow you to turn breakpoints onor off. For example, enable a permanent breakpoint and emulate untilthat breakpoint is reached. Then, disable the breakpoint and continueemulation. Later, you can re-enable the breakpoint and continueemulation.

NOTE:

Symbols must be loaded before you can define breakpoints online numbers or functions.

Starting or Stopping Emulation in the SourceWindow

You can emulate, halt emulation, step and step continuously in theSource window.

Starting Emulation

Do one of the following to start emulation:

Go Button

• Choose the Go button from Toolbar.

• Choose the Go command from the Run menu.• Press F5.

• Choose Go Run command from the Run menu.

Stopping Emulation

Do one of the following to stop emulation:

Halt Button

• Click on the Halt button on the toolbar.

• Press F2.

Resetting Emulation

Do one of the following to reset emulation:

Page 33: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 3 • 25

EasyPack/SLD for 6502F Source Level Debugging

Reset Button

• Choose Reset command from Run menu.

• Click on the Reset button on the toolbar.

Stepping Through Source

Step Into

This function allows single step of the program in source or assemblymode.

If a step begins on a source statement containing a function call forwhich source is available, it steps into the source for that function andstops at the first executable line in the function.

Do one of the following to start stepping:

Step Into Button

• Click on the Step Into button on the toolbar.

• Choose Step Into command from the Run menu.

• Press F8.

Step Over

This function allows single stepping of the program in source orassembly mode.

If a step begins on a source statement containing a function call forwhich source is available, it steps into the source for that function andstops at the first executable line in the function.

Do one of the following to start stepping:

Step Over Button

• Click on the Step Over button on the toolbar.

• Choose Step Over command from the Run menu.

• Press F10.

If the Source Only is toggled from the View menu, and a function hasno source associated with it, then a step into works the same as a stepover. To step into a function with no associated source, choose ViewMixed Source and Asm.

If stepping is slow, close windows to improve performance. Eachwindow must be updated after each step. Performance can be affectedby these updates.

Stepping Into Continuously

This function allows to step into continuously of the program in sourceor assembly mode.

Choose Step Into Continuously from Run menu.

Page 34: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

26 • Chapter 3

Source Level Debugging EasyPack/SLD for 6502F

Press ESC to stop the emulation.

NOTE

How fast EasyPack/SLD performs continuous stepping dependson the number of windows it must update after each step.

Stepping Over Continuously

This function allows to step over continuously of the program in sourceor assembly mode.

Choose Step Over Continuously from Run menu.

Press ESC to stop the emulation.

Page 35: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 4 • 27

EasyPack/SLD for 6502F Source Window and Browsing Modules

4 Source Window andBrowsing Modules

OverviewThis chapter describes the menus and commands in the Sourcewindow. It also covers the usage of the Browse window.

Source Window Menus

Source Window

Menu Use To:

FileLoad code, browse modules, browse from one module toanother, save file path names or restore file path names, orexit the EasyPack/SLD.

Edit Navigate through source.

Page 36: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

28 • Chapter 4

Source Window and Browsing Modules EasyPack/SLD for 6502F

ViewToggle the source display between source only and mixedsource and assembly, toggle the display of line numbers.

Group Set the event, trace, trigger, source load options.

RunStart and stop emulation, step, or continuously step. Also,reset the CPU or Reset the CPU and start emulation.

OptionsAdd a source path.

WindowsOpen another window. For more information, see chapter on"Getting Started."

HelpGet help on commands. For more information, see thechapter on "Getting Started."

File Menu

From the File menu, you can load files, browse modules, page throughmultiple files. If you have loaded a file recently, you may be able toreload it by choosing its name from the File menu. EasyPack/SLDlists the four most recently loaded files at the bottom of the File menu.This is the fastest way to load a file and is especially handy when youwork on a small group of files over a period of time.

Load...

Load Button

Loads a file into overlay memory or target memory. To quickly loadcode, click on the Load button on the toolbar.

Load Information...

Opens the Load information dialog box to inspect path, types, modules,etc., of the loaded file.

Browse Module...

Browse Module Button.

Opens the Source Group dialog box for access to the Browse Moduletab. To directly access the Browse Module tab, click on BrowseModule button from Toolbar.

A module is a source file displayed together with its symbolinformation.

Page 37: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 4 • 29

EasyPack/SLD for 6502F Source Window and Browsing Modules

Previous Browsed Module

Previous Browsed ModuleButton

During a debugging session, you can open as many modules as youwant but at one module at a time. EasyPack/SLD remembers thesequence of modules you have opened within a debugging session andthe functions you have browsed. Use this command to scroll backwardand browse through the previously browsed modules.

To directly access the function click on Previous Browsed Modulebutton from toolbar.

Next Browsed Module

Next Browsed Module Button

Use this command to scroll forward and browse through the previouslybrowsed modules mentioned above.

To directly access the function click on Next Browsed Module buttonfrom toolbar.

Save Configuration...

Opens the Save Configuration dialog box to save hardware settingstatus to the “*.cfg” file. You can select part or all of the hardwaresettings (map, event, or trigger) to save by checking your choice in thecheck box.

Save (Restore) Configuration Dialog Box

Restore Configuration...

Opens the Restore Configuration dialog box to retrieve the savedhardware setting status from the “*.cfg” file. You can select part or allof the hardware settings (map, event, or trigger) to restore by checkingyour choice in the check box.

Select setting(s) to be saved orrestored in this Check Box.

Page 38: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

30 • Chapter 4

Source Window and Browsing Modules EasyPack/SLD for 6502F

Exit

Closes the EasyPack/SLD.

List 4 files

Lists 4 of the most recently loaded files. Click on one of the files (ondisplay from File menu) to restore. This is the fastest way to open afile.

Edit Menu

Scroll the Source window from the Edit menu. You can search for astring, search for the next occurrence of the string, scroll to a line insource.

Browse From ...

Use this command to move cursor directly to a specified line in thecurrent module. Specify the line number in the Number pane of theBrowse From Line dialog box and click OK. If the specified linenumber exceeds the last line number, the cursor will stop at the end ofthe displayed module.

Browse From Dialog Box

Page 39: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 4 • 31

EasyPack/SLD for 6502F Source Window and Browsing Modules

Browse From Current PC

Moves the cursor to the line pointed at by the current PC address.

Search...

Search Combobox.

Searches for a specific name or other string in the current module.Clicking on the command will open the Search dialog box shown below.

You can also directly key in the string you want to search in the SearchCombobox from the tool bar. Then click on search Next button toexecute.

Search Dialog Box

Where:

Search What Type the string you want to find.

Match Whole Word Only Option to the find string as a whole word, not as apart of a longer string.

Case Sensitive Option to find the string exactly as it occurs withcombination of uppercase and lowercase characters.

Up Search from the insertion point or bottom of theselection to the beginning of the module orselection.

Down Search from the insertion point or beginning of theselection to the bottom of the module or selection.

All Search the entire module from the insertion point.

Search Execute search.

Search Next (F4)

Search Next Button

Finds the next occurrence of a string. For short-cut, use F4 or click onthe Search Next button.

View Menu

Sometimes it is useful to view the source display together with theassembly language display. As you debug, EasyPack/SLD allows youto toggle the display between source only and mixed source and

Page 40: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

32 • Chapter 4

Source Window and Browsing Modules EasyPack/SLD for 6502F

assembly language. You can also toggle between line numbers thedisplay.

Source Only

Source Only Button

Displays source code only. For short-cut, click on the Source Onlybutton from the toolbar.

Mixed Source

Mixed Button

Displays the program intermixed with the assembly language compiledfor each source line. For short-cut, click on the Mixed Source buttonfrom the toolbar.

Assemble

Assemble Button

Displays assembly instruction.It is transfered from machine code of thememory. For short-cut, click on the Assemble button from the toolbar.

Symbolic Disassembly

Changes the low level instruction into symbol.

Line Numbering

Displays line numbers (of a source file) in the Source window.

Syntax Coloring

Displays syntax in dominant different color.

Toolbar

Toggle display the toolbar below the menu bar.

Status Bar

Toggle display the status bar to indicate the command information.

Group Menu

Offers several group options to make memory, trace, source file andoverlay map settings.

Memory...

Opens the Memory dialog box group for memory settings.

Trace...

Opens the Trace dialog box group for trace settings.

Page 41: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 4 • 33

EasyPack/SLD for 6502F Source Window and Browsing Modules

Source...

Opens the Source dialog box group to define source settings, e.g., LoadOptions, Source Path, Extension Names. The same dialog box is willalso appear directly from Options menu.

Map...

Map Button

Opens the Map dialog box to define overlay map settings. For fastdialog box display, click on the Map button on the toolbar.

Run Menu

Choose commands from the Run menu to start and stop emulation or tostep. Set the size and number of steps from the Options menu.

Go (F5)

Go Button

Starts the emulation. For faster execution, click on the Go button onthe toolbar or press F5.

Go Run

Go Run Button

Halt Button

Starts the emulation freely and ignores any breakpoint or event settingsbut allows you to view or edit registers and memory . Duringemulation, trace buffer will record the address, data, and statusinformation by default.

To quickly execute the command, click on the Go Run button on thetoolbar. To stop, click on the Halt button on the toolbar.

Go Monitor

Sets the opened debugging window refresh frequency when running theprogram automatically. The input Monitor Count value is decimal inseconds.

Step Into (F8)

Step Into Button

Steps into function calls from Source window. For faster execution,click on the Step Into button on the toolbar or press F8.

Page 42: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

34 • Chapter 4

Source Window and Browsing Modules EasyPack/SLD for 6502F

NOTE

If the Source Only is toggled from the View menu, and a functionhas no source associated with it, then the Step Into will functionthe same as Step Over (see next paragraph). To step into afunction with no associated source, choose View Mixed Sourceand Assemble.

Step Over (F10)

Step Over Button

Steps over function calls if one exists in the next line or statement.You may also click on the Step Over button on the toolbar or pressF10 for faster execution of the command..

NOTE

Step over causes the program to execute until it reaches thestatement or line after the call. However, if you set a breakpointinside of a function in that execution path, then emulation stops atthe breakpoint.

Step Into Continuously

Continuously steps by statement or line. If a function is encountered,the function is stepped into. To stop stepping, press the ESC or clickon the Halt button on the toolbar.

Step Over Continuously

Continuously steps by statement or line. If a function is encountered,the function is stepped over. To stop stepping, press he ESC or click onHalt button on the toolbar.

Step Out

Step Out Button

Executes from the current Program Counter until the line (in thecalling function) is encountered after a return instruction.

Page 43: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 4 • 35

EasyPack/SLD for 6502F Source Window and Browsing Modules

Breakpoint...(F9)

Breakpoint Button

Opens the Source Group dialog box Breakpoint tab which allowsyou to specify the hardware execution breakpoint. You may alsopress F9 or click on the Breakpoint button on the Toolbar to quicklyexecute the command,.

Reset

Reset Button

Resets the CPU (user target). Choose Reset to assert the reset pin ofthe target processor. This command causes the CPU to reset itsinternal register and to load the PC and SP registers from the resetvector locations. The reset pin is then released. Click on the Resetbutton on the toolbar for fast execution of the command.

Jump...

Opens the Jump dialog box which allows you to specify the addressyou want to jump to and not to execute the emulation during this leap.

Jump Dialog Box

Where:

Jump to the Initial PC Sets Program Counter to the initial address of theloaded file. When this box is checked, you cannotdefine an address in the New PC field.

New PC Specifies a symbol or hexadecimal address to

Toggle on to this check box.With this box checked, the

PC goes back to initialaddress of loaded file.

Page 44: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

36 • Chapter 4

Source Window and Browsing Modules EasyPack/SLD for 6502F

jump.

NOTEIf the loaded file has no PC, the “Jump to the Initial PC” will begrayed. When this box is checked, the New PC field will begrayed.

Jump to Cursor...

Sets the program counter to the current location in the source window.

Options Menu

Add a new source path, toggle go until call/return, and go intocall/return; set step granularity and count, set the source browserhistory depth, and set the source line delimiter.

Load Options...

Opens the Load Options tab under Source Group dialog box whichallows you to make settings when loading code.

Source Path...

Opens the Source Path tab under Source Group dialog box whichallows you to set the path for the source file (in case you are compilinga module in a directory other than the current one).

Source Extension Names...

Opens the Source Extension Names tab under Group dialog box whichallows you to open source files following the specified extension name.

Source Options...

Opens the Source Options tab under Source Group dialog box whichallows you to set the source browser history depth.

NOTE

The above tabs from Source Group dialog box are discussed in amore detailed manner in section under “Loading Code” ofChapter 3.

Save Layout Now

Stores the current screen windows arrangement and use it as screentemplate the next time EasyPack/SLD is invoked.

Page 45: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 4 • 37

EasyPack/SLD for 6502F Source Window and Browsing Modules

Save Layout On Exit

Saves the existing screen layout and cursor position at the time ofexiting from the EasyPack/SLD. The next time EasyPack/SLD isinvoked, same layout and cursor position is restored. Hence you canimmediately starts working where you have last left off.

Window Menu

Chooses the debugging windows you wish to open and work withduring the debugging session. Opened windows are separately listed atthe bottom of the Window menu for easy access.

Cascade

Arranges all opened debugging windows in an overlapping patternwith only their title bars conveniently visible in cascading manner.

Tile

Arranges all opened debugging windows into cropped blocks anddisplays them side by side so that all opened windows are visible.

Close All

Closes all open debugging windows.

CPU

Opens or closes the CPU window with a check mark toggle. SeeChapter 9 for details.

Memory

Opens or closes the one Memory windows with a check mark toggle.This command allows you to inspect wide and deferent areas of thememory. See Chapter 10 for details.

Shell

Shell Button

Toggles to open and close the Shell window of EasyPack/SLD with acheck mark. To quickly open the window, click on the Shell windowbutton on the toolbar. See Chapter 15 for details.

Source

Opens or closes the Source window of EasyPack/SLD with a checkmark toggle. See Chapter 4 for details.

Browse

Opens or closes the Browse window of EasyPack/SLD with a checkmark toggle.

Page 46: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

38 • Chapter 4

Source Window and Browsing Modules EasyPack/SLD for 6502F

You may choose File Browse File command or Window Browsecommand to open it.

Browse window looks quite like the Source Window. It allows you toinspect other modules or files without exiting from Source windowworkplace. You may load code or browse module in the Browsewindow. But you cannot execute Go, Step, and other emulationexecution commands.

Stack

Opens or closes the Stack window of EasyPack/SLD with a checkmark toggle. See Chapter 7 for details.

Trace

Opens or closes the Trace window of EasyPack/SLD with a checkmark toggle. See Chapter 12 for details.

Variable

Opens or closes the Variable window of EasyPack/SLD with a checkmark toggle. See Chapter 6 for details.

Help Menu

Contents (F1)

Help Button

Displays the Help contents of the EasyPack/SLD on-line-help system.To directly invoke on-line-help, click on the Help button on the toolbaror press F1.

About EasyPack/SLD for 6502F

Displays the following information about EasyPack/SLD:

• Version

• CPU type

• F/W version

• MS-Windows version

• DOS version

• Communication type

• Port address

Page 47: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 5 • 39

EasyPack/SLD for 6502F Viewing and Editing Variables

5 Viewing and Editing Variables

OverviewThis chapter describes how to use the Variable window to view andedit a variable.

Viewing the Variable Window

Opening the Variable Window

When a breakpoint set at the Main( ) of the source file is executed, youmay open the Variable window from Source window to see thevariables.

Open the Variable window by choosing Variable from the Windowmenu. To view a variable, choose Add from the Variable menu. Youcan also choose Add from Shortcut menu which will display byclicking mouse right button while pointing inside the Variable window.

The following example shows one way to open the Variable windowfrom the Source window.

1. Load a file.

2. Choose Set Breakpoints from the Breakpoint menu.

3. Set a breakpoint at main().

4. Execute to the breakpoint.

5. Open the Variable window by choosing the Variable commandfrom the Window menu.

6. Choose Add command from Variable menu in the Variablewindow. This will bring forth the Add dialog box promptingyou to add, edit or select the previously entered variables toview. If you have not previously entered any variables, all thecommands relative to variables will be grayed.

Page 48: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

40 • Chapter 5

Viewing and Editing Variables EasyPack/SLD for 6502F

You can also inspect and modify a local variable from the Stackwindow.

NOTE

Only those local variables which have been defined in thesubroutines (or in function) are valid. To view the correctvariable value, you must execute program and go to subroutine.

Variable Window Display

If a variable is a compound type, such as array, structure, or a datapointer, it is prefixed with symbol when the data is not expanded(default). When the data is expanded (you can expand the data recordby double-clicking the variable) the symbol changes to . If youwant to collapse an expanded variable, point to it and double-click.The symbol changes from to .

The symbol for non-compound variables is . This type of variablescannot be expanded or collapsed.

When a variable is invalid, its symbol is .

Adding and Deleting Variables

To add variables, do one of the following:

• Choose Add command from Variable menu (or Shortcut menu).

• Click on the Add button on the toolbar.

• In the Source window, double-click and mark the variable to beviewed. Press the mouse right button for Shortcut menu. Selectthe Watch Variable: XX (the variable you've marked)command. The Variable window will then activate and thevariable you've marked is added into it automatically.

Add Button

Page 49: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 5 • 41

EasyPack/SLD for 6502F Viewing and Editing Variables

In the Add dialog box that pops up, you can add global, static, andlocal variables. But local variables that are outside of the current stackcontext will have the prefix of invalid variable symbol .

To delete a variable from the display, do one of the following:

Delete Button

• Choose Delete command from Variable menu.

• Click on the Delete button on the toolbar.

To delete all variables, choose the Delete All command.

Specifying Symbols

You can specify a symbol name in a fully-qualified form or specify thevariable name. A fully qualified variable is in the form[#module][#function]var, where var is in the form#basename[(→ext) | (.ext)]*. The following are examples ofvariables:

#mod1#a#mod2#func1#a#globalvar

Modifying Variable Value

Choose Modify value command from Edit menu in the Variablewindow. In the Modify Variable dialog box, you can change the valueof the currently highlighted item in the Variable window.

Where:

Variable Displays name of the currently highlighted variable.

Current Value Displays value of the currently highlighted variable value.

New Value Types new value for the currently highlighted variable.

Page 50: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

42 • Chapter 5

Viewing and Editing Variables EasyPack/SLD for 6502F

Editing Variables

Choose Edit from the Variable menu. In the Edit Variable dialog boxthat pops up, fill in the variable you want to edit. Any highlighted itemin the Variable window will show up on the Variable box when youinvoke this command. This command enables you to add a variable todisplay while deleting the not necessary one.

Using the Stack Window

Stack Window Display

Where:Level is the scope of the call stack. The scope of the current PC

function location is 0; the scope of its caller is 1, and so on.

Address is the entry point address of the nested function.

Entry Point is the function call name in which the function was defined.

Module is the module name in which the function was defined.

Function is the function name and/or its associated parameter values.

Page 51: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 5 • 43

EasyPack/SLD for 6502F Viewing and Editing Variables

The Stack window contains two panes. The upper pane displays thenested function call sequence up to the current function. You mayresize the panes.

Upper Pane

The Level and Function columns are key items. The others can bedefined to display or not by View Format Function List command ofthe Stack window. The default is to display all items.

All of the columns can be resized by using the mouse when it becomesclipper. To resize these columns, drag the column margins with theclipper.

Lower Pane

Shows parameters and local variables for the highlighted function callin the upper pane. The pane functions as a miniature Variablewindow. Not only that it provides most of the features of the VariableWindow, but that both windows have the same look.

To highlight a function, single-click the mouse or use Up/Down keys toreposition the cursor to the desired line.

Selecting Local Variables

In the Stack window, activate the lower pane by clicking on it. Thendo one of the following to open the Select Local Variables dialog boxto define the variables that will be displayed in the lower pane:

Select Local Variable Button

• Choose Edit Select Local Variables in the Stack window.

• Click on the Select Local Variables button on the toolbar.

Page 52: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

44 • Chapter 5

Viewing and Editing Variables EasyPack/SLD for 6502F

Where:

Not On Display Displays the local variables which have been removedfrom the On Display box.

On Display Displays the local variables which are visible in thelower pane of the Stack window.

Add Adds back the highlight items in the Not On Displaybox to On Display box.

Remove Removes the highlighted items from the On Displaybox.

The default is to display all local variables for the highlightedfunctions. You may use this dialog box to configure the lower pane.

Formatting Function List

In the Stack window, activate the upper pane. Then choose ViewFormat Function List. In the dialog box that pops up, configure theitems to be displayed in the upper pane.

The default is to show all the items. Unchecked item(s) will not showin the pane and the sequence jumps onward. Then the function callsare stretched to fill the space.

Page 53: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 6 • 45

EasyPack/SLD for 6502F Variable Window

6 Variable Window

OverviewThis chapter describes the menus and commands in the Variablewindow.

Variable Window

Variable MenusMenu Use To:

File Load code, browse modules, browse from one module to another orexit the EasyPack/SLD.

Edit Search for, search for next, and edit a variable.

View Compress, show, or format function list.

Group Open the Memory, Trace, Source dialog box.

Page 54: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

46 • Chapter 6

Variable Window EasyPack/SLD for 6502F

Run Start and stop emulation, step, or continuously step. Also, reset orreset and start emulation.

Variable Add, delete, or undelete Variables from the window display.

Options Add a source path, user configuration.

Windows Open another window. For more information, see the chapter"Getting Started."

Help Get help on commands. For more information, see the chapter"Getting Started."

Of the above menus, only “Edit” and “Variable” are discussed here.The rest are common with Source Window (see Chapter 4).

Edit Menu

You can scroll the Variable window from the Edit menu. You cansearch for a string, and search for the next occurrence of the string.

Modify Value...

Opens the Modify Value dialog box to change the currently highlightedvariable value.

Search...

Looks for a specific name or other string in the current module. Chooseto open the Search dialog box to make settings. If you are looking forrepeated occurrence of the same string, choose Search Next command.

Search Combobox

You can directly key in the string you want to search in the SearchCombobox on toolbar. Then click on the search Next button. TheSearched strings are nested in the Combobox.

Search Next (F4)

Search Next Button

Finds the next occurrence of a string or click on the Search Next buttonon the toolbar.

Variable Menu

You can choose commands from this menu to add, edit or delete avariable to and from the window (see preceding Chapter 5 for moredetails).

Page 55: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 6 • 47

EasyPack/SLD for 6502F Variable Window

Add...

Add Button

Displays the Add Variable dialog box to add global, static or localvariables to display. To quickly add, click on the Add button on thetoolbar.

Edit...

Displays the Edit Variable dialog box from where you can add a newvariable. This command is also used to retrieve an existing variableyou no longer need and overwrite it with a new one.

Delete

Delete Button

Deletes a variable from the display. To quickly delete a variable, clickon the Delete button on the toolbar. To delete all variable choose theVariable Delete All command.

Delete All

Deletes all variables from the display.

Page 56: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 7 • 49

EasyPack/SLD for 6502F Stack Win dow

7 Stack Win dow

OverviewThis chapter describes the menus and commands in the Stack window.

• The stack list displays the nested function call sequence leadingup to the current context. Optionally, stack and/or codeaddresses are displayed by the function names of each frame.The stack address is the memory address of the frame. Thecode address is the return address to the calling function.

• You can view any listed function's source. Click on thefunction, then choose Inspect Source from the Options menu inthe Stack window. The function's source is displayed in theSource window.

• The variables list displays the local variables and parameters ofthe highlighted frame in the stack list. Click on a frame in thestack list to display the frame's local variables and parametersin the variables list.

Page 57: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

50 • Chapter 7

Stack Win dow EasyPack/SLD for 6502F

Stack Window (the Upper Pane Active)

Stack Window (the Lower Pane Active)

Page 58: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 7 • 51

EasyPack/SLD for 6502F Stack Win dow

Stack Menus

Menu Use To

File Load code, browse modules, browse from one module to anotheror exit the EasyPack/SLD.

Edit Search for, search for next, and edit a variable.

View Show or hide toolbar and status bar.

Group Open the Memory, Trace, Source dialog box.

Run Start and stop emulation, step, or continuously step. Also, resetor reset and start emulation.

Options Add a source path, user configuration.

Windows Open another window. For more information, see the chapter on"Getting Started."

Help Get help on commands. For more information, see the chapter on"Getting Started."

Of the above menus, only “Edit” and “View ” are further discussedhere. The rest are common with Source Window (see Chapter 4).

Edit Menu

Inspect Source

Scrolls the Source window to the top of the function that is highlightedin upper pane of the Stack window. The Source window will thenactivate.

NOTE

The following Edit menu commands are greyed when the upperpane is active.

Select Local Variables...

Select Local Variables button

Displays the Select Local Variable dialog box to select variables fordisplay on the lower pane. Clicking on the Select Local Variablesbutton on the toolbar will directly execute the command.

Modify Value...

Opens the Modify Value dialog box to change the currently highlightedvariable value.

Search...

Page 59: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

52 • Chapter 7

Stack Win dow EasyPack/SLD for 6502F

Search Combobox.

Searches for a specific name or other string in the current module.Clicking on the command will open the Search dialog box.

You can also directly key in the string you want to search in the SearchCombobox from the toolbar. Then click on the search Next button toexecute.

Search Next (F4)

Search Next Button

Finds the next occurrence of a string. To quickly execute command,click on the Search Next button on the toolbar.

View Menu

NOTE

The View menu commands are applicable only when the upperpane is active. They are greyed when the lower pane is active.

Functions Only

Hides the lower pane and zoom out to fill the whole Stack window asupper pane. You can also use the mouse to adjust the pane size.

Functions And Locals

Zoom in from upper pane only display and returns to dual panes(default) display.

Format Function List...

Defines the items to be displayed in the upper pane from the pop-upFormat Function List dialog.

Set Breakpoint

Sets the breakpoint at the function where the cursor is blinking. Afterexecuting the command, EasyPack/SLD automatically switches to theSource window and displays the corresponding breakpoint.

Run Until

Run until the return address of the current function level (where thecursor is blinking) is reached. After execution, EasyPack/SLDautomatically switches to the Source window.

Page 60: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 8 • 53

EasyPack/SLD for 6502F Accessing CPU and Memory

8 Accessing CPU and Memory

OverviewThis chapter describes how to:

• Access registers from the CPU window.

• Access Memory from the Memory window.

• Access internal registers from the Peripheral window.

Viewing and Modifying Registers

From the CPU Window

The CPU window (see Chapter 9) displays or changes the targetprocessor CPU registers. You can also modify the source of a subsetof the target processor control signals.

NOTE

The register display of the CPU Window may differ depending onthe target processor under emulation. The window you see onscreen may look different from the window introduced in thefollowing pages.

Color Highlighting of Register Changes

When a Register changes (i.e., when it has a new value from since itlast halted), the register is displayed in a different color.

Updating CPU Registers

The CPU Register display is updated when emulation halts.

Resetting the CPU Registers

Reset Button

Choose Reset from the Options menu in the CPU window to reset andreinitialize the target processor.

Page 61: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

54 • Chapter 8

Accessing CPU and Memory EasyPack/SLD for 6502F

A reset causes the following:

• The processor reset pin is asserted.

• All windows are updated, with the following consequences:

° The Stack window display is invalidated because thestack is reset.

° The Source window points to the start of code.

Editing a CPU Register

To edit a CPU register in the CPU window, click on a register name(not its value) and then enter the new value in the Register dialog box.

Click on Increment button to increase the register value and Decrementbutton to decrease the register value. Also you may open the pulldown choice box to choose from the previous entered value.

Defining Registers for Display

Except for PC (Program Counter), all other registers can be defined fordisplay (or hidden) from the CPU window. Choose the ConfigureRegisters command from View menu. In the popped-up ConfigureRegisters dialog box, select the registers you wish to display.

Viewing and Modifying Target Memory

Memory Window Display

Display or edit memory from the Memory window (see Chapter 10).Memory is displayed in three regions, these are:

Page 62: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 8 • 55

EasyPack/SLD for 6502F Accessing CPU and Memory

• The hexadecimal memory address region.

• The region that shows the contents of memory, which can beedited. These contents can be displayed under four modes.

• The ASCII equivalent of the memory contents region. Thisregion changes accordingly with memory contents. You mayclose this display by using the Show ASCII commands (removecheck mark to close).

Changing the Memory Window Display

Display memory as disassembly, hexadecimal, or decimal data (SignedDecimal and Unsigned Decimal) from the View menu

Sixteen bytes or eight bytes of memory are displayed on each line asdisassembly, or as hexadecimal or decimal data (grouped in bytes,words, or long words).

The ASCII field displays the memory as ASCII characters or a period;A period (.) represents for a non-printable character.

Using the Single-line Assembler

To assemble code starting at a specified address, do the following:

1. In the Memory window, choose Disassembly from the Viewmenu to display disassembled lines of code. If necessary,reposition the Memory window display by choosing Gotocommand from the Edit menu.

2. If necessary, reposition the Memory window display bychoosing Goto command from the Edit menu.

3. Double-click on the disassembled line in the Instruction area toopen Assemble dialog box. Fill the 6502 instruction in the box.Note that the value in the same line of OP code area changesaccordingly.

Page 63: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

56 • Chapter 8

Accessing CPU and Memory EasyPack/SLD for 6502F

-or-

Double-click on the OP code area to pop up Modify Memorydialog box to enter the value. The contents in the same line ofInstruction area changes accordingly.

4. Choose Accept in the Assemble dialog box

-or-

Choose Modify in the Modify Memory dialog box to write theresults to memory and update the Memory window.

5. Choose OK button to quit the Assemble dialog box

-or-

Modify Memory dialog box.

6. Choose Cancel button to ignore what you have entered and quitthe Assemble dialog box

-or-

Modify Memory dialog box.

Page 64: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 8 • 57

EasyPack/SLD for 6502F Accessing CPU and Memory

Editing Memory

To edit a memory field:

1. Move the cursor into the field you want to change.

2. Type over the field to modify it. A field is defined as either acenter column or one of the 16 ASCII characters.

3. Move the cursor out of the field to change the field.

An Illegal entry will receive no response from EasyPack/SLD. Illegalentries include:

• Non-numeric values in Decimal display.

• Non-hexadecimal values in Hexadecimal display.

The default display for address is in Hexadecimal, and that of data is inDecimal.

In Decimal display, values longer than the defined field width aretruncated (all digits to the right of the digit entered become zero). Avalue must fall within the range of the displayed radix. For example, if199 is displayed, in decimal byte radix, and you replace the “1” with a“2”, resulting in 299, then 200 is displayed (the maximum value in thisfield is 255).

Updating the Memory Window Display

The Memory window display is updated when emulation halts. Toupdate the display during emulation:

1. Choose Run Access from the Options menu on theEasyPack/SLD Toolbar before starting emulation.

2. Choose Refresh Display from the View menu in the Memorywindow.

Scrolling Through the Memory Window

In memory or disassembly display, you can choose Goto from the Editmenu. In the Goto dialog box that pops up, specify a numeric orsymbolic address to scroll to another area of memory.

Page 65: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

58 • Chapter 8

Accessing CPU and Memory EasyPack/SLD for 6502F

Memory Setup

Choose Memory command from the Group menu to define memorysetup. The command displays the Memory Dialog which contains 6tabs. You can fully define your memory settings within this group ofdialog boxes.

Memory Checksum Dialog Box

Where:Start Address Sets the start address of checksum. Input hexadecimal

value in external data area (default).

Sets the end address of checksum in the next field;- End Address sets the end address of checksum- Length sets the address range of checksum

Result The checksum value

Click on OK button to make memory checksum or Close button to quitor cancel.

Page 66: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 8 • 59

EasyPack/SLD for 6502F Accessing CPU and Memory

Memory Compare Dialog Box

Where:Start Address Sets the start address of the first block to compare

Sets the end address of the first block in the nextfield;- End Address sets the end address- Length sets the address range

Destination -Start Address

Sets the start address of the second block to compare

Stop whenmismatch is

found

When selected (checked) the compare command willstop when first mismatch address is found

NOTE: The Mismatch message box in the abovefigure shows the mismatch address and data

Click on OK button to start memory compare and close to quit orcancel.

Page 67: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

60 • Chapter 8

Accessing CPU and Memory EasyPack/SLD for 6502F

Memory Copy Dialog Box

Where:Start Address Sets the start address of the first block to copy.

Sets the end address of the first block in the nextfield;- End Address sets the end address- Length sets the address range

Destination -Start Address

Sets the start address of the destination block to copyto.

Click on OK button to execute memory copy or Close button to quit orcancel. You will see the result directly from the Memory window.

Page 68: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 8 • 61

EasyPack/SLD for 6502F Accessing CPU and Memory

Memory Fill Dialog Box

Where:Start Address Sets the start address of the memory block to be filled.

Sets the end address of the block to be filled in thenext field;- End Address sets the end address- Length sets the address range

Data Sets the data pattern of the block to be filled.

Click on OK button to fill the memory and you will see the resultdirectly from the Memory window. Click on Close button to quit orcancel.

Page 69: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

62 • Chapter 8

Accessing CPU and Memory EasyPack/SLD for 6502F

Memory Search Dialog Box

Where:Start Address Sets the start address of the memory block to perform

search.

Sets the end address of the block to perform search inthe next field;- End Address sets the end address- Length sets the address range

Pattern Key-in the string of the data pattern to search from theblock.

Output Message box displays the area where the search datapattern is found. If none is found, “Not Found” willdisplay.

Case Sensitive Case sensitive search

Click on OK button to start memory search or Close button to quit orcancel.

Page 70: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 8 • 63

EasyPack/SLD for 6502F Accessing CPU and Memory

Memory Test Dialog Box

Where:Start Address Sets the start address of the memory block to be

tested.

Sets the end address of the block to be tested in thenext field;- End Address sets the end address- Length sets the address range

Output Message box shows the test result for the tested block.

Click on OK button to execute or Close button to quit or cancel.

Page 71: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 9 • 65

EasyPack/SLD for 6502F CPU Window Reference

9 CPU Window

OverviewThis chapter describes the menu and commands in the CPU window.

CPU Window

CPU Window MenuThe CPU window menu has the following commands:

Menu Use To

File Load or browse file. Make configurations.

View Display the CPU register value in Hex or Decimal mode, orrefresh the display.

Page 72: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

66 • Chapter 9

CPU Window Reference EasyPack/SLD for 6502F

Group Open the Memory, Trace, Source dialog box.

Run Start and stop emulation, step, or continuously step. Also, resetor restart.

Options Set Map, Set User Config.

Windows Open another window. For more information, see the chapter"Getting Started."

Help Get help on commands. For more information, see the chapter"Getting Started."

Of the above menus, only “View ” is further discussed here. The restare common with Source Window (see Chapter 4).

View Menu

Refresh

Refreshes the display.

Hexadecimal

Displays the values in hexadecimal.

Decimal

Displays the values in decimal.

Configure Registers...

Displays the Configure Register dialog box to select registers to bedisplayed in the CPU window. Default is all registers selected. See“Defining Registers for Display” on page 54 of Chapter 8 for moredetails.

NOTE

PC cannot be removed from display.

Page 73: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 10 • 67

EasyPack/SLD for 6502F Memory Window

10 Memory Window

OverviewThis chapter describes the menus and commands in the Memorywindow.

Memory Window

Memory MenusMenu Use To

File Load or browse files. Make configuration.

Edit Search for, search for next, and go to the desire address.

Page 74: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

68 • Chapter 10

Memory Window EasyPack/SLD for 6502F

Group Open the Memory, Trace, Source dialog box.

Run Start and stop emulation, step, or continuously step. Also, resetor reset and start emulation.

Options Set Map, Set User Config.

Windows Open another window. For more information, see the chapter"Getting Started."

Help Get help on commands. For more information, see the chapter"Getting Started."

Of the above menus, only “Edit” is further discussed here. The rest arecommon with Source Window (see Chapter 4).

Edit Menu

From the Edit menu, navigate through memory or modify memory.

Search...

Looks for a specific name or other string in the current module. Chooseto open the Search dialog box to make settings. If you are looking forrepeated instances of the same string choose Search Next command.

Search Next (F4)

Finds the next occurrence of a string

Goto...

Displays Goto dialog box to specify a numeric or symbolic address toscroll to another area of memory.

View Menu

You can view memory as disassembly (instruction), hexadecimal, ordecimal and as bytes, words or dwords (double-words).

Show ASCII

Displays (with check mark next to the command) or hide the ASCIIarea in the Memory window.

Hexadecimal

Displays memory contents in hexadecimal.

Signed Decimal

Displays memory contents in decimal, indicating positive or negativevalues.

Page 75: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 10 • 69

EasyPack/SLD for 6502F Memory Window

Unsigned Decimal

Displays memory contents in decimal, indicating positive values in allcases.

Disassemble

Displays disassembly instruction.

Byte

Displays memory elements in bytes or chars.

Word

Displays memory elements in two bytes.

Long

Displays memory elements in four bytes.

Page 76: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 11 • 71

EasyPack/SLD for 8XC196F Trace Window

11 Trace Window

OverviewThis chapter describes the menus and commands in the Trace window.

Trace Window

Trace MenusMenu Use To:

File Load code, browse modules and save trace.

Edit Specify the trace buffer viewing.

View Toggle bus or instruction mode display or link cursors between theBrowse and Trace Windows.

Page 77: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

72 • Chapter 11

Trace Window EasyPack/SLD for 8XC196F

Trace Configuring trace settings

Group Open the Memory, Trace, Source group dialog box.

Run Start and stop emulation, step, or continuously step. Also, reset orreset and start emulation.

Options Set Map, Set User Config.

Windows

Open another window. For more information, see the chapter"Getting Started."

Help Get help on commands. For more information, see the chapter"Getting Started."

Of the above menus, only “File”, “Edit”, and “View ” are furtherdiscussed here. The rest are common with Source Window (seeChapter 4).

File Menu

Save Trace...

Displays the Save Trace dialog box to save the current trace data.

Edit Menu

Goto Start Frame

Scrolls to the beginning of the current trace buffer.

Goto End Frame

Scrolls to the end of the current trace buffer.

Page 78: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 11 • 73

EasyPack/SLD for 8XC196F Trace Window

Goto Frame...

Displays the Goto dialog box to specify a frame.

View Menu

Bus

Displays the Trace window in Bus mode.

Instruction

Displays the Trace window in Instruction mode.

Cursor Link

Link the trace with the Browse window.

Trace Menu

Clear Buffer

Clears the trace buffer.

Trace Control

Displays the Trace Setup dialog box Trace Control tab to configure thetrace parameters.

Event

Displays the Trace Setup dialog box Event tab to define new events.

Trigger

Displays the Trace Setup dialog box Trigger tab to define triggers.

Trace Filter

Displays the Trace Setup dialog box Filter tab to define trace buffer

machine cycles (filter).

Page 79: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 12 • 75

EasyPack/SLD for 8XC196F Events

12 Events

OverviewEasyPack 6502F has 3 event settings. That is Event1, Event2 andEvent3. Event1 and Event2 are bus events which have multiplesettings for address, data and cycle status. Event3 is an event leveltriggered by an external hardware signal. Event1 also has countoption.

For how to use Events to define Triggers, see the Chapter 14 "Trace ,Filter and Triggers."

Defining a New EventTo define a new Event, do one of the following to open a Trace setupdialog box from Event tab.

• Choose Trace command from the Group menu in any windowand switch to Trace Setup dialog box Event tab.

Click on the button next to the desired event. When you select Event1and Event2, the High/Low options is grayed. When Event3 is selected,only the High/Low option is available.

Page 80: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

76 • Chapter 12

Events EasyPack/SLD for 8XC196F

The count option is grayed when Event 2 or Event3 is selected. It setsthe time that Event1 is triggered and its range is from 1 to FFFFH.

When Event1 or Event 2 are selected:

• In the Address Mode group:

° Choose Range, Multiple or Wildcard to define addressrange, multiple address (separated by a space or comma)or wildcard address.

° Start Address specifies the start address of bus event.

° End Address specifies the end address of bus event.

-or- Length specifies the address length of bus event.

• In the Data Mode group:

° Choose Range, Single or Wildcard to define data range,single data or wildcard data.

° Start Data specifies the start data of bus event.

° End Data specifies the end data of bus event.

-or- Length specifies the data length of bus event.

• In the Status group:

° S Sync

° R Memory read

° W Memory write

° AK Interrupt acknowledgement

• In the Clear check, choose whether to clear the current eventsettings.

When Event3 is selected:

• High specifies the signal “High” level to be matched at the EXTTRIGGER INPUT for Event3.

• Low specifies the signal “Low” level to be matched at the EXTTRIGGER INPUT for Event3. It’s the default.

Click on the Apply button to set the current bus event and choose OKto quit the dialog box.

Page 81: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 13 • 77

EasyPack/SLD for 8XC196F Trace, Filter and Trigger

13 Trace, Filter and Trigger

OverviewThis chapter describes how to do the following:

• Configure trace buffers.

• Define a trace buffer using triggers and events.

• Collect, view and save trace.

NOTE

For more information on defining events, which are used todefine triggers, see the Chapter13 "Events."

Trace FundamentalsTrace is a record of processor bus events occurring during emulation.Trace is collected at the target processor bus cycle level. Trace can beused to reconstruct a history of executed instructions, along with thedata transfers to and from the processor that result from those executedinstructions.

The trace features are:

• 32 K trace frames.

• Trace is collected within buffers as:

° Backward When emulation starts, the trace buffer keepson refreshing until the set trigger is matched and emulation stops.

Page 82: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

78 • Chapter 13

Trace, Filter and Trigger EasyPack/SLD for 8XC196F

° Center When emulation starts, the trace buffer keeps on refreshing while the trigger matching, trace cycles continue to fill the trace buffer for3FFFH cycles, then emulation stops.

° Forward When emulation starts, the trace buffer keeps refreshing until the set trigger is matched. While matching, the trace cycles will continue to fill the trace buffer for 7FFFH cycles, then emulation stops.

° Delay Sets how many trace buffer frames are required to record the information. When the set trigger is matched, emulation continues and will stop only after the “delay value” cycles are completed.For example, set the “delay value” as 4FFFH. When emulation starts, the trace buffer keeps refreshing until the set trigger is matched. While matching, trace cycles continues to fill 4FFFH cycles into the trace buffer. Then emulation stops.

• Display trace as bus cycles, or disassembled instructions.

• Search trace for an condition.

Trace Memory

Trace memory is 32K frames deep (0~7FFFH). Events are thecombinations of address, data, count and status. Recognition of anevent occurs when the event definition is matched by the values of theaddress, data, count and status. Events are used to define the trace thatis collected in each trace buffer and/or when to stop emulation.

Collecting TraceThe status bar indicates whether trace is collected or otherwise. Bydefault, trace is collected during emulation.

All bus cycle information is collected. You can view trace orinstructions. You can use Qualify command in the Shell window or setconditions in the Trace setup dialog box Filter tab to record specifiedmachine cycles into the trace buffer.

For more information on viewing trace, see "Defining Trace” on page80.

Page 83: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 13 • 79

EasyPack/SLD for 8XC196F Trace, Filter and Trigger

Configuring TraceTo configure trace, do one of the following:

• Choose Trace command from the Group menu in any windowand switch to Trace Control tab of the Trace Setup dialog box.

• Choose Trace Control command from the Trace menu in theTrace window.

In the popped-up Trace Setup dialog box Trace Control tab, you canspecify the trigger position.

• In the Trigger position group choose one of the following triggerpositions:

° Backward (0) causes the trace buffer to keep onrefreshing until the set trigger is matched and emulationstops.

° Center (3FFFH) causes the trace buffer to keep onrefreshing in the while the trigger matching, trace cycles continue to fill the trace buffer for3FFFH cycles, then emulation stops.

Page 84: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

80 • Chapter 13

Trace, Filter and Trigger EasyPack/SLD for 8XC196F

° Forward (7FFFH) causes the trace buffer to keeprefreshing until the set trigger is matched. While.matching, the trace cycles will continue to fill the tracebuffer for 7FFFH cycles, then emulation stops.

° Delay (0 ~ 7FFFH) allows you to specify the number oftrace buffer frames required to record the information.When the set trigger is matched, emulation continues andwill stop only after the “delay value” cycles arecompleted.

Defining Trace

Defining a Trace Buffer Machine Cycle

Do one of the following to define the filter (machine cycle) in theTrace Setup dialog box Filter tab:

• Choose Trace command from the Group menu in any windowand switch to Trace Setup dialog box Filter tab.

• Choose Trace Filter command from the Trace menu in the Tracewindow.

Page 85: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 13 • 81

EasyPack/SLD for 8XC196F Trace, Filter and Trigger

• Set the conditions of displayed trace or the conditions of tracing.The default is Display.

• Three types of address/data mode are available:

° Range allows you to enter an address/data range withstart address and end address.

° Multiple allows you to enter up to 10 address/data(wildcard is not allowed in this case) separated withcommas.

° Single allows you to enter a datum (wildcard is notallowed in this case).

° Wildcard allows a wildcard address/data.

• The status group is four processor status code (as defined in thetable below) to specify status code to be matched as part of theevent condition.

Code Status

S Sync

R Memory read

W Data memory write

AK Interrupt acknowledgement

Page 86: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

82 • Chapter 13

Trace, Filter and Trigger EasyPack/SLD for 8XC196F

Defining a Trace Buffer Trigger

Do one of the following to define a trace buffer trigger in the TraceSetup dialog box Trigger tab:

• Choose Trace command from the Group menu in any windowand switch to Trigger tab from Trace Setup dialog box .

• Choose Trigger command from the Trace menu in the Tracewindow.

• In the Level group:

° Click on the radio button to specify the conditional levels(Level 1 or Level2) of triggers. The default is Level1

° There are 17 combinations of event settings.

• In the Trigger group:

° Click on the radio button to choose trigger enable ordisable. The default is Enable.

° Fill the check box to Run tracing but continue to emulate.The default is not checked.

° There are 3 combinations of trigger settings. The defaultis Level1.

Choose the Set button to set the trigger settings and the level settings.Choose the Close button to quit the dialog box.

When emulation begins, the EasyPack immediately starts recordingtarget system and emulation processor status (which is set in the Filter

Page 87: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 13 • 83

EasyPack/SLD for 8XC196F Trace, Filter and Trigger

tab of Trace setup dialog box) in real-time. Data are recorded until thetrigger condition, including any cycle-count delay, is matched.

When the trace ends, the EasyPack stops the emulation processor onecycle beyond the location where the trigger condition was matched.The recorded information can be examined with the list Trace Buffercommand.

NOTE

1. The trigger setting specifies a break condition. It is noteffective until the Go command is input to start the emulationprocessor. Also the trigger setting has no effect on theInstruction Step command.

2. Up to 32768 machine cycles can be recorded. If more thansuch cycles elapse before tracing ends, only the last 32768cycles will be recorded.

3. Whenever the processor is running, external hardware syncsignals are generated at the EXTERNAL TRIGGER OUT(ETO) bit when the Event3 is matched.

Saving TraceIf you want to save the current trace settings, choose Save Tracecommand from the File menu in the Trace window. Make your choicesin the popped-up Save Trace dialog box.

Page 88: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

84 • Chapter 13

Trace, Filter and Trigger EasyPack/SLD for 8XC196F

Choose the directory, enter the file name, select the trace mode and fillin the frame range. The frame range is for specifying the framenumber where the trace data to save will start and end.

Viewing TraceYou can display a trace buffer in the Trace window. Each timeemulation halts, the Trace window is updated.

Page 89: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 13 • 85

EasyPack/SLD for 8XC196F Trace, Filter and Trigger

Bus Mode

Displays raw trace frame information including address, data andstatus pins. Every address and datum occuring on bus are recordedand can be viewed here.

Assemble Mode

Displays assemble code only.

Cursor Link

Selects Cursor Link as on or off status.

If Cursor Link is on, there is a highlighted line displayed in tracewindow. This line is cursored. User can scroll this line throughpressing <Page Up> or <Page Down> key. and with the change of thecursored line, the relative information is displayed in Browse Window.

Page 90: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 87

EasyPack/SLD for 6502F Shell Window Commands

14 Shell Window Commands

OverviewThis chapter lists the commands you can enter in the Shell window.You can use these commands instead of window menu commands.

Shell Window

Shell MenusMenu Use To:

File Load code, browse modules, enable or disable log and open or closelog file.

View Display or close toobar and status bar.

Group Open the Memory, Trace, Source group dialog box.

Run Start and stop emulation, step, or continuously step. Also, reset orrestart.

Options Map, User Config, Set History Size.

Page 91: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

88 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

Windows

Open another window. For more information, see the chapter"Getting Started."

Help Get help on commands. For more information, see the chapter"Getting Started."

Of the above menus, only “File” is further discussed here. The rest arecommon with Source Window (see Chapter 4).

File Menu

Open Log File...

Displays the Open Log File dialog box to open an existing or create anew logging file.

Select the path in Directories box and enter log file name in File namebox.

Choose Append to append the current log contents to an existing fileand Overwrite to overwrite it. The default is Overwrite.

Choose Commands Only to log the commands that were entered;Choose Commands and Result to log both commands and the resultingresponses. The default is for Commands and Result.

Close Log File

Close the current log file.

Logging On

Enable logging of executed commands. It will be greyed when no logfile is opened.

Page 92: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 89

EasyPack/SLD for 6502F Shell Window Commands

Logging Off

Disable logging of executed commands. It will be greyed when no logfile is opened.

Syntax Notational Conventions

Notation Meaning

COMMANDNAMEcommandnameCommandName

Command names and aliases may be entered inupper- or lowercase .

[option]Brackets indicate that the item can be repeated zeroor 1 time. Brackets are used to define syntax andshould not be entered, unless otherwise noted.

option_1 | option_2A vertical line separates options, one of which can beselected.

{option_1 |option_2}

One of the options must be selected. Do not enter thebraces.

"string_constant"String constants must be surrounded by doublequotation marks.

addressA hexadecimal data or symbol representing anaddress.

Memory space type may be omitted whenhexadecimal data are entered.

AddressThe EasyPack supports normal memory space, register space (r:) andsymbolic. Some Address Types examples are given in the followingtable.

Form Type Sample

addr memory space 0000

[#module]#symbol Depend on the #symbol type #main

Symbolic Address

A symbolic reference to an address is an address specified by amodule, procedure, line number, or global variable in a high-level-language program. Symbolic referencing is available when a high-level-language program is compiled with the debug option set and thenloaded into target-system memory. If you have your program stored on

Page 93: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

90 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

your target system in a ROM memory device, such as an EPROM, youcan disable symbolic by loading with the nocode option.

Address

The default input address radix is in Hexadecimal.

Data

The default input data radix is in decimal. If input is in hexadecimal,you must prefix it with “0x”.

Commands and System Variables Grouped By Function

To Do See

Assembly/Disassembly Assemble Command

Disassemble Command

Breakpoints Breakpoint Command

CLear Command

Emulation CONtrol Command

Go Command

HAlt Command

Jump Command

Step Command

Events Event Command

EV1 Command

EV2 Command

EV3 Command

Trace TRAce Command

Trigger Command

Qualify Command

LEvel Command

LV1 Command

LV2 Command

List Command

Help Help Command

Load Code LOad Command

Upload Command

Page 94: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 91

EasyPack/SLD for 6502F Shell Window Commands

Map memory MAp Command

Memory BYte Command

CHecksum Command

COMpare Command

Copy Command

Fill Command

LONg Command

SEarch Command

TEst Command

Verify Command

Word Command

Register Register Command

Macro MACro Command

MDel Command

MENd Command

MList Command

Shell Identify Command

Include Command

LOG Command

Reset RESet Command

RESTart Command

Getting Help On Shell CommandsGet help by entering either of the following commands in the Shellwindow command entry pane:

1. help <command> ;To display the syntax of the <command>

2. help ;To display an alphabetical list of all Shell commands

Help is also available from the Help menu in the Shell window, or bypressing F1.

Shell Window Commands Entry

EasyPack/SLD features an auto-expansion function which allows youto input command names with a short-hand or abbreviated entry.

Page 95: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

92 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

These are illustrated in the following pages where each shell commandis described in detail.

Note that as you start keying in the shell command, the Message Bar atthe bottom of Shell window will display hints on all shell commands(with short-hand portion in upper case) that start with the same firstcharacter you have keyed in. The tip will expand to its entirecommand syntax as you continue keying in the full shell commandname.

$variable

Define Integer Variable or C Expression

$variable [=value]

=value defines an integer value or C expression to a variable.

Keyboard Examples:

1. $a=1 ;Define variable "a" as the integer value 1.

2. $b=$a++ ;Define variable "b" as C expression "$a++".

Shell command tipsare displayed as

you type thecommand name.

Page 96: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 93

EasyPack/SLD for 6502F Shell Window Commands

@macroname

Execute a Macro

@macroname [(arg0, ..., arg9)]

arg0, ..., arg9 are the arguments defined to substitute thecorresponding variables (%0, %1, %2, ... , %9)specified in the command batch file.

Keyboard Examples:

@c:\temp\aa.mac ;Execute macro file "aa.mac".

Alias

Rename a Shell Window Command

ALias [original_name new_name]

original_name specifies the system default Shell command name tobe provided with an alias.

new_name specifies a new (user defined) alias name for thesystem Shell command.

This command adds another user-defined name to an existing Shellcommand. It does not overwrite the Shell command which remainsexecutable in parallel with the alias name.

You cannot assign same alias name to more than one Shell command.

Keyboard Examples:

ALias Memory MM ;Shorten the Memory command as MM.

Page 97: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

94 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

Assemble

Line Assembly

Assemble [adr]

adr specifies the memory location where the EP/SLD is to beginstoring the assembly language program input by the user. It maybe a symbol name, line number or an unsigned value.

Show the assembly equivalent of the entered string and write theinstruction bytes to memory at the last known address.

If memory location is not specified, assembly begins from currentprogram counter (PC).

Keyboard Examples:

1. Assemble 0000 ;Input assembly from program address 0000

2. Assemble ;Input assembly language from current PC

Breakpoint

Set Hardware Breakpoint

Breakpoint [adr]

adr specifies the memory location of hardware executionbreakpoint.

If no parameters are specified, all breakpoints will display.

To delete breakpoints, refer to “CLear” command.

Keyboard Examples:

1. Breakpoint 0010 ;Set breakpoint at address 0010.

2. Breakpoint ;display all breakpoints.

Page 98: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 95

EasyPack/SLD for 6502F Shell Window Commands

BYte

Memory Modify in Byte Format

BYte adr datum1 [..datum32]

adr specifies the location where the Memory Modifyoperation is to begin. It is a hexadecimal addressrepresenting a hex address in the memory spaceof the emulation CPU.

datum1.. datum32 is a hexadecimal value up to 32 bytes(0~FF H).

Keyboard Examples:

1. BYte 34 1 2 3 ;Write 1,2,3 data to memory 34,35,36

2. Create #B 1000 ;Create symbol B = 1000

3. BYte #B a

Page 99: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

96 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

CHecksum

Memory Checksum

CHecksum adr1 {adr2 | Length length}

adr1 specifies the memory location where the checksumoperation is to begin.

adr2 is the end memory space of the emulation CPU specifyingthe last location in the range in which the checksum is to becarried out.

Length is the required prefix when specifying a "length" value.

length is a decimal value (by default) specifying the memory sizeto do a checksum on. This value ranges from 0x1 to0x10000. When this value is entered in hexadecimalformat, you must prefix it with "0x"

Calculate the checksum of the specified memory block. The checksumcould be calculated by byte size.

This command does not affect the memory contents.

Keyboard Examples:

1. CHecksum 10 40

2. CHecksum 30 Length 50

CLear

Clear Execution Breakpoint

CLear {All | adr}

All Clear all execution breakpoints.

adr Clear a particular breakpoint.

This command is ineffective when emulation processor is running. Toadd breakpoints, refer to "Breakpoint" command.

Keyboard Examples:

1. CLear All ;Clear all S/W breakpoint settings.

2. CLear 0010 ;Clear breakpoint address 0010.

Page 100: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 97

EasyPack/SLD for 6502F Shell Window Commands

CLOck

Get/Set Target Clock

CLOck {clock}

This command is to get/set EP target clock .

Keyboard Examples:

1. CLOck ;Get target clock.

2. CLOck 100KHz ;Set target clock to 100KHz.

3. CLOck 1Mz ;Set target clock to 1MHz.

COMpare

Compare Two Memory Blocks

COMpare adr1 {adr2 | Length length} adr3

adr1 specifies the starting address of Block 1, the first of the twomemory ranges to be compared.

adr2 specifying the end address of Block 1. It is a hexadecimaladdress in the memory space of the emulation CPUhexadecimal address in the memory space of the emulationCPU.

Length is the required prefix when specifying a "length" value.

length is a decimal value (by default) specifying the memory sizeof Block 1. This value ranges from 0x1 to 0x10000. Whenthis value is entered in hexadecimal format, you must prefixit with "0x"

adr3 is a hexadecimal address in the memory space if theemulation processor specifying the starting address of Block2.

Page 101: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

98 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

Referring to the above diagram, Block 1 is compared with Block 2.

If the blocks match exactly, the EasyPack/SLD will display:

"No different data"

If the blocks do not precisely match, EasyPack/SLD will display thefirst pair of nonmatching addresses.

Keyboard Examples:

COMpare 0 FF 400 ;Compare data segment memory 0-FF with 400-4FF

CONtrol

Enable/Disable Control Signals

CONtrol [{All Reset | Nmi | Ready}{Enable | Disable}]

All|Reset|Nmi|REAdy specifies a control signal to the emulationprocessor.

Enable|Disable sets the status of the specified control signalto be "enabled" or "disabled".

This command permits specific control signals going to the emulationprocessor to be enabled or disabled at the corresponding CPU inputpins. Only input to the processor is affected. The setting is transparentto circuits which generate the control signals in the target system.

Keyboard Examples:

1. CONtrol Nmi Enable ;Set target Nmi signal control to CPU.

2. CONtrol Reset Enable ;Enable target Reset signal to CPU.

3. CONtrol All Disable ;Disable all target signal to CPU.

Page 102: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 99

EasyPack/SLD for 6502F Shell Window Commands

Copy

Memory Copy

Copy adr1 {adr2 | Length length} adr3

adr1 specifies the first location in the memory range to be copied.

adr2 is a hexadecimal address specifying the last location in thememory to be copied.

Length is the required prefix when specifying a "length" value.

length is a decimal value (by default) specifying the memory sizeto be copied. This value ranges from 0x1 to 0x10000.When this value is entered in hexadecimal format, you mustprefix it with "0x"

adr3 is the starting address of the memory range where thespecified source memory range is to be written.

The contents of the memory ranges beginning at addr1 are copied byteby byte to the destination range beginning at addr3.

Keyboard Examples:

1. Copy 10 20 30 ;Copy memory 10 through 20 to data address 30 ;through 40.

2. Copy 10 Length 16 30 ;Copy memory 10-1F to data segment ;memory 30-3F.

3. Copy 100 200 300 ;Copy code segment memory 100 - 200 to 300-400.

Page 103: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

100 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

CReate

Create a User Defined Symbol

Create #symbol adr

#symbol is the symbol to be created with any (except “ #”) of thealphanumeric characters. "#" is used to prefix the createdsymbol.

adr is the symbol address.

Any symbol created by this command is temporary and effective onlyduring the current session. It will not be written back to the symbolfile but may be saved as a disk file using the "SSave" command.

To delete an existing symbol, use "DElete" command.

Keyboard Examples:

1. CReat #AAA 0010

2. CReat #BBB 0005

DElete

Delete a Defined Symbol

DElete #symbol | $variable | All

#symbol specifies the symbol to be deleted. "#" must prefix thesymbol to be deleted.

$variablel specifies the user defined variable to be deleted.

All specifies all symbols to be deleted.

Only user-defined symbols created with the "CReate" command can bedeleted with this command.

Keyboard Examples:

DElete #AAA

Page 104: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 101

EasyPack/SLD for 6502F Shell Window Commands

Disassemble

Disassembly

Disassemble [adr1 [adr2 | Length length]]

adr1 specifies the first location in the memory range to bedisassembled.

adr2 is a hexadecimal address specifying the last location in thememory to be disassembled.

Length is the required prefix when specifying a "length" value.

length is a decimal value (by default) specifying the memory sizeto be disabled. This value ranges from 0x1 to 0x10000.When this value is entered in hexadecimal format, you mustprefix it with "0x"

If no parameter is provided, disassembly will execute beginning at thecurrent PC.

Keyboard Examples:

1. Disassemble 400

2. Disassemble 0400 Length 0x10 ;Disassemble program from address;0400 to 040F

Page 105: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

102 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

Event

Display, Set, and Clear Events

Event [ [ [ 1 [ Address { Range adr1 adr2 | (xadr) |<badrs.. >} ] [ DATum {Range data1 data2 |(xdata) | bdata } ] [COunt data ] ] [Status<status..>] | [ CLear] ] | [ [ 2 [ Address { Rangeadr1 adr2 | (xadr) | <badrs.. >} ] [DATum{Range data1 data2 | xdata | bdata } [Status<status..>] ] | [ CLear ] ] | [ 3 [ High | Low ] ] ]

1 display/set/clear Bus Event 1. See EV1 command fordetails of the parameters.

2 display/set/clear Bus Event 2. See EV2 command fordetails of the parameters.

3 display/set external hardware Event 3. See EV3command for details of the parameters.

CLear clear EV1 and EV2.

Event alone without any parameter will display all current eventssetting. Events only affect real-time emulation/tracing and do not affectoperation during the Instruction Step command. Any event that hasbeen set becomes active only after Go command is executed.

Keyboard Examples:

Event Clear ; Clear all events(EV1 to EV2) settings.

Page 106: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 103

EasyPack/SLD for 6502F Shell Window Commands

EV1

Display, Set, and Clear Bus Event 1

EV1 [ [ Address { Range adr1 adr2 | (xadr) | <badrs..> } ] [ DATum { Range data1 data2 | xdata | bdata }

] [ COunt data ] ] [Status <status..>] | [ Clear]

Address is the required prefix when specifying an address event.

Range is the required prefix when specifying an address range.

adr1 specifies the starting address of the memory range.

adr2 specifies the end address of the memory range.

xadr is a wildcard address event.

<badrs..> is a multiple bus address event. 10 is the maximumacceptable number of data.

DATum is the required prefix when specifying a data event.

Range is the required prefix when specifying a data range.

data1 specifies the starting address of the data range.

data2 specifies the end address of the data range.

xdata is a wildcard data event.

bdata is a single bus data event.

COunt is the required prefix when specifying event match countexpression.

data is the number of times the event match condition is set tooccur. This value is from 0 to FFFF.

Status is the required prefix when specifying processor status.

<status..> is 1 to 4 processor status specifying status code to bematched as part of the event condition.

Clear clear EV1.

Event 1 is a real-time bus event. It consists of up to three elements:address, count, data.

Keyboard Examples:

Page 107: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

104 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

1. EV1 Address 400 ;Set EV1 at address 400.

2. EV1 Address Range 400 500 ;Set EV1 at address range 400-500.

3. EV1 Address <#print> ;Set EV1 at address labeled “#print” withDatum 55 data 55. When all the conditions match,

the emulated program will stop at that point.

4. EV1 Address (1FXX) ;Set event address 1F00-1FFF.

5. EV1 Clear ;Clear Event 1 setting.

6. EV1 ;Display Event 1 setting.

7. EV1 Address <100 150 ;Set multiple events at address 100, 200>150 and 200.

8. EV1 Datum 56 count 5 ;Datum 56 match 5 times, then EV1triggered.

9. EV1 Status <S W R AK> ;Set Event1status S, W, R, AK .

EV2

Display, Set, and Clear Bus Event 2

EV2 [ [ Address { Range adr1 adr2 | (xadr) | <badrs..> } ] [ DATum { Range data1 data2 | (xdata) | bdata

} ] ] [ Status <Status..>] | [ Clear ]

Address is the required prefix when specifying an address event.

Range is the required prefix when specifying an address range.

adr1 specifies the starting address of the memory range.

adr2 specifies the end address of the memory range.

xadr is a wildcard address event.

<badrs..> is a multiple bus address event. 10 is the maximumacceptable number of data.

DATum is the required prefix when specifying a data event.

Range is the required prefix when specifying a data range.

data1 specifies the starting address of the data range.

data2 specifies the end address of the data range.

xdata is a wildcard data event.

bdata is a single bus data event.

Status is the required prefix when specifying processor status.

<status..> is 1 to 4 processor status specifying status code to be

Page 108: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 105

EasyPack/SLD for 6502F Shell Window Commands

matched as part of the event condition.

Clear clear EV2.

Event 2 is real-time bus event. It consists of up to two elements:address, data.

Keyboard Examples:

1. EV2 Address 400 ;Set EV2 at address 400.

2. EV2 Address Range 400 500 ;Set EV2 at address range 400-500.

3. EV2 Address <#print> ;Set EV2 at address labeled “#print” withDatum 55 ;data 55. When all the conditions match,

;the emulated program will stop at that ;point.

4. EV2 Address (1FXX) ;Set event address 1F00-1FFF.

5. EV2 Clear ;Clear event 2 setting.

6. EV2 ;Display Event 2 setting.

7. EV2 Address <100 150 ;Set multiple events at address 100, 150200 > ;and 200.

EV3

Display/Set External Hardware Event 3

EV3 [ High | low ]

High|Low specifies the signal level to be matched at the EXTINPUT port for Event 3.

The external hardware event can be set to match either high / lowsignal input. Note, however, that a setting of high will be matchedimmediately if the EXT TRIGGER INPUT port is not connected to anappropriate signal source. The system default for Event 3 after poweron or a hardware reset is "Low". Event 3 logic is TTL compatible; amatch occurs when the specifies logic state is detected low.

Keyboard Examples:

EV3 High ; EV3 will match when External Trigger Input signal is high.

Page 109: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

106 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

Fill

Memory Fill

Fill adr1 {adr2 | Length length} {"string" | data..}

adr1 specifies the location in the memory where the fill operationis to begin.

adr2 is the location in the memory where fill is to end

Length is the required prefix when specifying a "length" value.

length is a decimal value (by default) specifying the memory sizeto be filled. This value ranges from 0x1 to 0x10000. Whenthis value is entered in hexadecimal format, you must prefixit with "0x"

“string” is a character string enclosed in quotation marks(“ ”). Astring may not be more than 32 bytes in length. Up to 16data are accepted and a total of 64 bytes may be entered.Combined use of hex and string is permitted.

data.. is the starting address of the memory range where thespecified source memory range is to be written.

To fill a memory range with a particular value or string, input thestarting address, the end address or length, and the desired value orstring (in byte format). If Memory Verification is on, the fill operationwill be verified, and any mismatch will be reported with a message.

Keyboard Examples:

1. Fill 400 500 90

2. Fill 0 Length 0x100 90 ;Write the value of 90 to memory 0 - FF

3. Fill 400 500 90 12 6A ;Write data 90, 12, and 6A from memory 400

4. Fill 100 200 “data” ;Write “data” ASCII code to 100 - 200

Page 110: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 107

EasyPack/SLD for 6502F Shell Window Commands

Go

Run Target

Go [ [ Run ] [ From adr1 ] | [ From adr1 ] [ Till adr2 ] ] | [ Monitortimer ]

Run specifies free run. During free run all breakpointsettings are ignored, but target information is stillrecorded in the trace buffer.

From adr1 is the address where emulation is to begin.

Till adr2 specifies a temporary breakpoint in the emulation. Thisbreakpoint (adr2) exists only in this emulation session.

Monitor specifies to refresh the content of the open window aftera defined period.(like source, CPU window etc.)

timer is the value of refresh window timer unit. It is limitedfrom 1 to ff.

If adr1 is specified, the emulation processor's program counter is firstset accordingly. The EasyPack/SLD then starts real-time emulation ofthe emulation processor and immediately begins recording systemstatus information to trace memory. If no address is specified,emulation starts at the current program counter.

When you execute the “Go” command and there is no breakpoint inthis program, the emulation CPU will continue to run without stoppinguntil you execute the “HAlt” command.

Keyboard Examples:

1. Go ;Execute program from current address

2. Go Till 0100 ;Execute program from current PC and break if pc = 0100H

Page 111: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

108 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

HAlt

Halt Emulation

Halt[ Sleep ]

Sleep if the current instruction is WAI, PC will point to thenext instruction.

This command may be used during free run emulation to stop programexecution at any time. When CPU is sleeping, this commond will setPC to the WAI instruction (PC=PC-1).

Help

Help Get a Shell Window Command

Help [command]

command is the shell command to view a command keyword andsyntax. If no parameter is entered, an alphabeticallisting of all available shell commands will display.

Keyboard Examples:

1. Help

2. Help Go

Page 112: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 109

EasyPack/SLD for 6502F Shell Window Commands

IDentify

Identify Emulator and F/W Version

IDentify

displays the current type of the emulation processor and firmwareversion of your EasyPack; the EasyPack/SLD software version; andthe MS-DOS, and Windows versions of your host PC.

Include

Execute a Command File

Include filename

filename is the command file to be executed. It is a text file youcan create or edit with a DOS based editor. You mayalso use the Log command to create a command file.

NOTE

Nested command files can be specified but is limited to a two-level nesting only, i.e., the nested command file should containone “Include” sub-command only.

The following are the pre-defined sub-commands you may utilize increating your command file:

\ uses to stop execution of the previouscommand.

{ specifies the beginning of a commandgroup.

} specifies the end of a command group.

:label specifies a label to be referred to by GOTOcommand.

Example: :case_1

BELL [count] beeps within executed command batch file.Beep duration is timed by [count] inseconds.

ELSE executes the other command group(enclosed in braces “{ }”) when the stated

Page 113: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

110 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

condition is met. Same with “IF” and“IF_NOT” (see below).

ERROR {ABORT|CONTINUE} defines whether to abort or continuecommand execution when an error occurs.

GOTO label jump to the line following the specifiedlabel.

ICE command specifies one of the shell commandsdescribed in this chapter.

IF “condition” executes the command group (enclosed inbraces “{ }”) when the stated condition issatisfied.

Example: IF “PC = C034”

IF (C-expression) executes the command group (enclosed inbraces “{ }”) when the stated C-expression is satisfied.

Example: IF ($PC = C034)

IF_NOT “condition” executes the command group (enclosed inbraces “{ }”) when the stated condition isnot met.

Example: IF_NOT “PC = C034”

IF_NOT (C-expression) executes the command group (enclosed inbraces “{ }”) when the stated C-expression is not met.

Example: IF_NOT ($PC = C034)

LOOP specifies the beginning of a loop block

LOOP END [count] specifies the end of a loop block after thespecified loop count (number of loopcycles).

PAUSE [count] specifies the checkpoint where executionpauses for the specified count (in seconds).

REM [text] specifies a comment string.

WAIT waits for the processor halt after it startsrunning.

Keyboard Examples:

Include TEST1 ;Execute command file, filename: TEST1

Page 114: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 111

EasyPack/SLD for 6502F Shell Window Commands

Jump

Jump/Branch to an Address

Jump adr

Jump adr is the command to change the program counter (PC) tohexadecimal address

Changing the emulation processor's PC causes subsequent emulation toproceed from the address in program memory.

Keyboard Examples:

1. Jump 0500 ;force IP=0500

LEvel

Set/Display Trigger and Trace Level

Level [ {1 | 2 } [ eventlogic ] ]

1|2 specifying LV1 or LV2.

eventlogic is the event logical operation setting. It is either a singleevent or a logical construct of EV1 to EV3. Default iseither EV1, or EV2, or EV3.

Keyboard Examples:

Level 2 EV2

Page 115: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

112 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

List

List Trace Buffer

List [Number ] [frame] [Address Range adr1adr2|(xadr)|<bardrs..>] [DATum Range data1data2|(xdata)|bdata] [Status <status..>]

Number is the option to list the number of frames recordedin the trace buffer..

frame is the value of refresh window timer unit. It islimited from 0 to 0x7fff. Default is 0.

Address is the required prefix when specifying an addressqualifier.

Range adr1 adr2 is an address range qualifier for trace listing.

xadr is a wildcard address qualifier for trace listing.

<badrs..> is a multiple bus address qualifier for trace listing.

DATum is the required prefix when specifying a datarange qualifier.

Range data1 data2 is an data range qualifier for trace listing.

xdata is a wildcard data qualifier for trace listing.

bdata is a single datum qualifier for trace listing.

Status is the required prefix when specifying processorstatus.

status.. is 1 to 4 processor status specifying status code tobe matched as part of the event condition.

List is the command to display information recorded in the trace buffer.This information is organized into frames, each representing oneexecution bus cycle. Address, data bus , port activity, processor statusand trace-bits levels (5 bits), are displayed for each frame.

The List shell command will also display the elapse time of processorexecution.

Keyboard Examples:

Page 116: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 113

EasyPack/SLD for 6502F Shell Window Commands

1. List ;List cycles from Frame 0

2. List x80 ;List cycles from frame x80

3. List 0x200 status <f w> ;List Read, Write cycles from frame200

4. List Address Range 100 200 ;List cycles with address rangeDATum Range 50 60 ;100-200 and data range 50-60

LOad

Load Code with Symbol to Memory

LOad filename [Symbols | NOSymbols] [Code | NOCode][Warn | NOWarn] [SYStem | NOSYStem]

filename the load filename

Symbols(default)

directs the loader to load symbols

NOSymbols skips loading symbols

Code(default)

directs the loader to load code

NOCode skips loading code

Warn(default)

displays warnings from the loader.

NOWarn Suppresses all warnings.

SYStem retains the symbols whose the first character is ?.

NOSYStem deletes the symbols whose the first character is ?.

Keyboard Examples:

1. LOad example.abs ;Load program to program memory

2. LOad example.abs NOSymbols

Page 117: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

114 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

LOG

Log Shell Commands to a File

LOG {filename [Command] [Append]} | {ON | OFf | Close}

filename is the file to store the logged shell commands.

Command is the command keyword to log. The command maythen execute using the Include command.

Append is the option to append the newly logged informationinto an existing file. Otherwise existing data in the fileis automatically overwritten.

On|OFf is the option to enable/disable logging of the executedcommand.

Close is the option to save the logged commands into theassigned file, and then end the logging session.

Keyboard Examples:

1. LOG test1 ;Log key-in commands to file TEST1.

2. LOG test1 Append ;Add new logged to existing file TEST1.

3. LOG Close ;Close log file.

4. LOG ON ;Active log file.

5. LOG OFf ;Inactive log file.

LONg

Memory Modify in Long Format

LONg adr data 1 [..data 8]

adr specifies the location of the emulation CPU where theMemory Modify operation is to begin.

data1..data8 is a hexadecimal value up to 4 bytes (0~FFFFFFFFH).

Note that data format in Long implies double words.

Keyboard Examples:

LONg 400 1234 8888 ;Write double-word data directly.

Page 118: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 115

EasyPack/SLD for 6502F Shell Window Commands

LV1

Set/Display Level 1 Trigger and Trace Mode

LV1 [eventlogic]

eventlogic is the event logical operation setting. It is either a singleevent or a logical construct of EV1 to EV3. Default iseither EV1, or EV2, or EV3.

Keyboard Examples:

1. LV1

2. LV1 EV1 ;When EV1 is matched

3. LV1 EV1 or EV2 or EV3

LV2

Set/Display Level 2 Trigger and Trace Mode

LV2 [eventlogic]

eventlogic is the event logical operation setting. It is either a singleevent or a logical construct of EV1 to EV3. Default iseither EV1, or EV2, or EV3.

Keyboard Examples:

1. LV2

2. LV2 EV1 ;When EV1 is matched.

Page 119: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

116 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

MACro

Create Macro

MACro macroname

macroname specifies the macro file name to define.

This command is used to define a macro file. If no path is specified inthe parameter, it will create the MACRO sub-directory automaticallyat the directory where EasyPack/SLD is installed (default isC:\EPSLD196).

NOTE

Each macro file must end with the MENd command as shown inthe example below (see page 120 for MENd command fordetails).

Keyboard Examples:

The following is an example on how to create (using a DOS editor) andexecute a macro file.

>MACro c:\temp\aa.mac ;Create a macro file named as “aa.mac” in;the directory c:\temp.

1. MACRO>Help %0 ;Contents of the macro file. 2. MACRO>Clear all 3. MACRO>$ADDRESS = %1 4. MACRO>WHILE ($ADDRESS) 5. MACRO>{ 6. MACRO>Breakpoint $ADDRESS 7. MACRO>$ADDRESS = $ADDRESS -1 8. MACRO>} 9. MACRO>Breakpoint10. MACRO>IF "Breakpoint at 0001 Enabled"11. MACRO>{12. MACRO>REM PASS13. MACRO>}14. MACRO>ELSE15. MACRO>{16. MACRO>REM FAIL17. MACRO>}18. MACRO>MENd ;The end of macro file.

Enter the following command to run the above macro@c:\temp\aa.mac MEMORY 3 ;See @macroname Shell command on

page 93.

Page 120: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 117

EasyPack/SLD for 6502F Shell Window Commands

MAp

Memory Mapping

MAp [{adr1 {adr2 | Length length}} map_attribute]

adr1 is the starting point of the memory block to bemapped.

adr2 is the end point of the memory block to be mapped.

Length is the required prefix when specifying a "length"value.

length is a hexadecimal value specifying the memory size tobe mapped.

map_attribute indicates the attributes for the mapped memory:

When the (read or write) guarded memory area is accessed, theemulation processor will stop or display a warning message duringexecution of Instruction Step or Go command.

Keyboard Examples:

1. Map 0 7fff Overlay ;Map 0-7FFF to overlay read/write.

2. Map 0 7fff Target ;Map 0-7FFF to Target read/write.

3. Map 0 7fff OR ;Map 0-7FFF to Overlay read only.

4. Map 0 7fff TR ;Map 0-7FFF to Target read only.

5. Map 0 7fff Guard ;Map 0-7FFF to Guard.

Page 121: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

118 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

MDel

Delete Macro

MDel macroname | ALL

macroname specifies the macro file name to delete. If no path isspecified, EasyPack/SLD will search the file in thec:\epsld\macro.

ALL is to delete all files in the c:\ep196\macro. Youcannot use this parameter to delete all files outsidethat directory.

NOTE

When you define a macro file with MACro command (see page115) without specifying path, EasyPack/SLD will automaticallycreate the MACRO sub-directory under the directory whereEasyPack/SLD is located. (default is C:\EP6502).

Keyboard examples:

1. MDel c:\temp\aa.mac ;Delete the macro file “aa.mac” from the directory;c:\temp.

2. MDel bb.mac ;Delete the macro file “bb.mac” from;c:\ep6502\macro

3. MDel ALL ;Delete all files from C:\ep6502\macro

Page 122: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 119

EasyPack/SLD for 6502F Shell Window Commands

Memory

Memory Dump

Memory adr1 [adr2 | Length length]

adr1 specifies the memory location where memory displayoperation is to begin. It is a hexadecimal addressrepresenting a hex address in the memory space of theemulation CPU.

adr2 is the hexadecimal address specifying the last memorylocation where memory display ends.

Length is the required prefix when specifying a "length" value.

length is a decimal value (by default) specifying the memory sizeto be dumped/displayed. This value ranges from 0x1 to0x10000. When this value is entered in hexadecimalformat, you must prefix it with "0x"

To display the contents of memory in a specific range, input a startingaddress and either an end address or the desired length. If no endaddress is given, the contents of memory will be displayed one page ata time.

When an end address is specified, the contents of memory aredisplayed continuously until the last location in the range is reached.

Memory contents are displayed in hexadecimal.

Keyboard Examples:

1. Memory 400 ;Display data from memory 400

2. Memory 400 500 ;Display data from memory 400 to 500

3. Memory 400 Length 0x100 ;Display data from memory 400 to 500

Page 123: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

120 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

MENd

End of Macro File

MENd

This command is used at the last line in a macro file to indicate the endof a file. See sample of MACro shell command on page 115 for moredetails.

MList

List Name or Contents of Macro

MList [macroname]

macroname specifies the macro file name.

When used without any parameter, this command will list all availablemacro file names in the c:\ep6502\macro. Otherwise, it will displaythe contents of the specified macro file.

Keyboard Examples:

1. MList c:\temp\aa.mac ;Display the contents of “aa.mac”.

2. MList ;List all filenames in the c:\ep6502\macro.

Page 124: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 121

EasyPack/SLD for 6502F Shell Window Commands

Qualify

Set/Display Trace Qualifier

Qualify [ [ Address { Range adr1 adr2 | (xadr) |<badrs..> } ] [ DATum {Range data1 data2 |(xdata) | bdata } ] [ Status <status ..>] ] | [CLear ]

Address is the required prefix when specifying an address event.

Range is the required prefix when specifying an address range.

adr1 specifies the starting address of the memory range.

adr2 specifies the end address of the memory range

xadr is a wildcard address event

<badrs..> is a multiple bus address event.

DATum is the required prefix when specifies an data event.

Range is the required prefix when specifies an data range.

data1 specifies the starting address of the data range.

data2 specifies the end address of the data range.

xdata is a wildcard data event.

bdata is a single bus data event.

Status is the required prefix when specifying processor statuscode.

<status..> is 1 to 4 processor status codes specifying status code tobe matched as part of the event condition.

CLear Clears the qualify setting and transfers all the address,data, and status information to Trace RAM.

Trace qualifier specifies which machine cycles to be recorded in thetrace buffer. Qualify alone without any parameter displays the currenttrace qualifier setting.

NOTE

Only one trace qualifier address or event will be invoked with Gocommand, whichever is the last set prior to Go execution.

Keyboard Examples:

Page 125: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

122 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

1. Qualify Address Range 100 200 ;Only address 100-200 cycles arerecorded to trace buffer.

2. Qualify ;Display qualify setting.

3. Qualify CLear

QUEry

Symbol/Address Query

QUEry #symbol | hex_adr

#symbol is the symbol name or line number of the address inquery. (Local variable cannot be queried.)

hex_adr is the hexadecimal address setting of the symbol name inquery.

To query for the address of a specified symbol or the symbol of aspecified address. EasyPack/SLD will search through the symbol tableand list the specified symbol or address.

Keyboard Examples:

1. QUEry #_main ;Query address of symbol "_main".

2. QUEry C ;Query the symbol corresponding to the program address C

3. QUEry #20 ;Query the address of the 20th line at current module.

Page 126: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 123

EasyPack/SLD for 6502F Shell Window Commands

Register

Display/Modify Register

Register [ {reg_id} [data] ]

reg_id is the register and SFR related to the processor.

data is the new data to be assigned to the designated register.

This command displays or modifies the contents of the emulationprocessor registers. If "Register" alone (without any parameter) isentered, the contents of all of the emulation processor registers aredisplayed.

Keyboard Examples:

Register PC 0100 ;Modify register PC to 0100 directly.

Register ;display all register value.

RESet

Reset Emulation

RESet [adr]

adr is the address where emulation is to begin after reset. It is anunsigned value which may be prefixed with its memory type.

Use this shell command to reset/initialize the emulation process to theaddress where emulation is to begin.

Keyboard Examples:

1. RESet ;Reset emulation processor.(Reset PC=0000)

2. RESet 0100 ;Reset Emulation processor and force pc to equal 0100.

3. RESet 0300 ;Reset Emulation processor and force pc to equal 0300.

Page 127: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

124 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

SEarch

Memory Search

SEarch adr1 {adr2 | Length length} {[Insensitive] "string"| data..}

adr1 indicates the starting point of the memory block to besearched.

adr2 is an unsigned value specifying the last memorylocation to be searched.

Length is the required prefix when specifying a "length" value.

length is a decimal value (by default) specifying the memorysize to search. This value ranges from 0x1 to 0x10000.When this value is entered in hexadecimal format, youmust prefix it with "0x"

Insensitive is the option to search data regardless of its case (upperor lower) status.

“string” is ASCII character string enclosed in quotationmarks("). A string may not be more than 32 bytes inlength. Up to 16 data are accepted and a total of 64bytes may be entered. Combined use of hex and stringis permitted.

data.. specifies data in hex.

This command is used for searching a specified data in the memory.Data may be either a character string or numerical values.

Keyboard Examples:

1. Search 100 200 34 ;Search data 34 from memory 100 to 200

2. Search 100 Length 100 34

3. SEarch Length 0x100 Insensitive “help” ;Search 'help' or 'HELP’ from memory 0 to FF

Page 128: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 125

EasyPack/SLD for 6502F Shell Window Commands

SRecall

Recall Stored Symbols

SRecall filename

filename is the symbol file where the to be recalled symbols arelocated.

Use this shell command to retrieve stored symbols from file. Symbolswere previously created with "CReate" command and saved with the"SSave" command.

This command is useful when retrieving stored symbols to insert theminto a newly created symbol table. If symbols already exist in the newsymbol file when the stored symbols are retrieved, the symbols fromdisk file are appended to the newly created symbol table.

Keyboard Examples:

SRecall TEST1.SYM

SSave

Save Symbol to File

SSave filename

filename the filename to save and store the created symbols. If thefilename already exists, it will be overwritten.

This command is used to save the symbols created by "CReate"command.

Keyboard Examples:

SSave TEST1.SYM

Page 129: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

126 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

Step

Instruction/Line Step

Step [[Over][FOrever] ] | [OUt]

Over is the option to treat subroutines(Call) as singlestep instruction. With this option, you need notstop into subroutines you are not concernedabout. EasyPack/SLD runs through suchsubroutines without displaying.

FOrever is the option to step instruction continuously untilforced to stop by pressing <Esc>.

OUt is to execute instruction until out currenttfunction.

After each step, the window information is also updated accordingly ifthe respective window updating toggle is enabled. During Stepexecution, NMI is disabled and other interrupts are masked.

Keyboard Examples:

1. Step ;Execute one Instruction.

2. Step Over ;Treat subroutines(Call, INT) or some repeated;instructions (REP, LOOP) as one step.

3. Step FOrever

4. Step OUt ;Stop stepping until current function return.

Page 130: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 127

EasyPack/SLD for 6502F Shell Window Commands

SYmbolList Symbol

SYmbol [Global | Module | #module | Lines]

global is the option to display global information.

Module is the option to display symbol only from a module.

#module is the option to display symbol from a specific modulename.

Lines is the option to display line information.

This shell command is used to display symbols. If no parameter isgiven, all existing symbols are displayed.

Keyboard Examples:

1. SYmbol Global

2. SYmbol Module

3. SYmbol #test

4 Symbol Lines

Page 131: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

128 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

TEst

Memory Test

TEst addr1 {adr2 | Length length}

adr1 indicates the starting point of the memory block to besearched.

adr2 is an unsigned value specifying the last memory location tobe tested.

Length is the required prefix when specifying a "length" value.

length is a decimal value (by default) specifying the memory sizeto be tested. This value ranges from 0x1 to 0x10000.When this value is entered in hexadecimal format, you mustprefix it with "0x"

Memory test command is used to verify serviceability of the overlayand target memory. The test changes the original contents of thespecified memory range.

Keyboard Examples:

1. Test 0 FFFF ;Test data memory from 0 to FFFF.

2. TEst 1000 Length 0x2000 ;Test memory from 1000 to 2FFF

Page 132: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 129

EasyPack/SLD for 6502F Shell Window Commands

TRAce

Enable/Disable Trace

TRace [ON | Off | Clear]

ON is the option to enable trace.

OFf is the option to disable trace.

Clear is the option to clear the trace buffer.

The trace on/off status is modified after trigger condition ismatched.This shell command enables or disables the emulation statusto trace memory while processor is in running condition.

Keyboard Examples:

1. TRace ON

2. TRace Off

3. Trace

Trigger

Set/Display/Enable/Disable Trigger

Trigger [[Run] {LV1 | LV2| LV1 Then LV2}] [Forward |Backward | Center | Delay count]] | [On | OFf]

Run is an optional parameter which allows the emulationprocessor to free run after trigger occurs.

LV1 | LV2 are the trigger levels; Levels 1 or 2.

Forward is the delay count = 07FFFH.

Backward is the delay count = 0.

Center is the delay count = 03FFFH.

Delay is the required prefix when specifying a "count" value.

count is a hexadecimal value specifying a cycle count fortrigger delay. After all trigger conditions have beenmatched, the trace will continue until the specifiednumber of cycles has elapsed (0 -7FFF).

On | OFf is the toggle to enable or disable trigger functionrespectively.

Page 133: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

130 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

"Trigger" alone without any parameters displays the current triggersetting. The trigger setting also specifies a break condition. It is noteffective until the Go command is input to start the emulationprocessor. Note also that the trigger setting has no effect on theInstruction Step command.

When emulation begins, the EasyPack/SLD immediately startsrecording target system and emulation processor status in real-time.Data are recorded until the trigger condition, including any cycle-countdelay, is matched.

When the trace ends, the EasyPack/SLD stops the emulation processorone cycle beyond the location where the trigger condition wasmatched. The recorded information can be examined with the Listcommand.

When the trigger is matched, an low pulse will be generated at theTRIGGER OUTPUT pin, this signal can be sent to the external devicesuch as logic analyzer.

Keyboard Examples:

1. Trigger Run LV1 Forward ;Level 1 matched, delay 7FFF cycles stop;tracing but processor emulation ;continues

2. Trigger LV1 Then LV2 Delay 50 ;Level 1 matched, then level 2 matches;Delay 50 cycles, stop emulation

3. Trigger On

Upload

Upload Data to a File

Upload adr1 { adr2 | Length length } filename

adr1 indicates the starting point of the memory block to beuploaded.

adr2 is an unsigned value specifying the last memory location tobe uploaded.

Length is the required prefix when specifying a "length" value.

length is a decimal value (by default) specifying the memory sizeto be uploaded. This value ranges from 0x1 to 0x10000.When this value is entered in hexadecimal format, youmust prefix it with "0x"

Page 134: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Chapter 14 • 131

EasyPack/SLD for 6502F Shell Window Commands

filename is the file (with path) to store the uploaded data.

This shell command is used for uploading code data (from EasyPack)by formatted hex record to a file.

Keyboard Examples:

1. Upload 1000 1FFF test1

2. Upload 0 Length 2000 c:\test\test1

Verify

Memory Write Verification

Verify [ON | OFf]

ON | OFf On/off toggle for memory verification operation.

When memory verification is on, the EasyPack/SLD verifies allmemory write operations. If incorrect data are read from any address,an error message will display and the command will be terminated.

If memory verification is turned off, the EasyPack/SLD does notperform verification operation. Default is ON.

Keyboard Examples:

1. Verify On ;Enable verification for memory write.

2. Verify Off ;Disable verification for memory write.

Page 135: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

132 • Chapter 14

Shell Window Commands EasyPack/SLD for 6502F

WAtch

Watch Variable or C Expression

WAtch "C-Expression"

"C-Expression" specifies variable or c expression enclosed withquotation marks (" ").

Keyboard Examples:

1. WAtch “a++"

2. WAtch “a+$b"

Word

Memory Modify in Word Format

Word adr data1 [.. data16]

adr specifies the location where the Memory Modifyoperation is to begin. It is a hexadecimal addressrepresenting a hex address in the space of theemulation CPU.

data1..data16 is a hexadecimal value of up to 2 bytes (0~FFFF H).

Note that data format in Word implies words.

Keyboard Examples:

Word 34 1 2 0xA0A3 ;Write 0001, 0002, A0A3 to memory 34, 36, 38

Page 136: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Appendix A • 133

EasyPack/SLD 6502F User's Guide Compiler Information

A Compiler Information

OverviewThis section briefly describes important compiler options toEasyPack/SLD for 6502F. For more information about compileroptions, refer to the user’s guide that came with the compiler that youare using.

Supported Compilers and Assemblers:

• 2500AD Software Inc. (V 5.20)

• The Western Design Center Inc. (V3.01, V3.02, V5.0)

Loading and Generating Object FilesYou need not specify the compiler before loading a file. TheEasyPack/SLD auto detects and determine the format of the loadedobject file regardless of its extension name.

When generating object file, the options are unlimited. The followingpages show the guidelines for generating object files using each of thesupported tool chains.

2500AD Compiler2500AD tool chain C Compiler Version 5.20 is supported

You can use the compiler Command Line Mode or its IDEenvironment. If the Command Line Mode is used, the followingenvironments should be set correspond with your pragram location.

PATH=C:\2500AD\BIN;%PATH%

SET LIB=C:\2500AD\LIB

SET INCLUDE=C:\2500AD\INCLUDE

SET PANELS=C:\2500AD\PANELS

SET PCONFIG=C:\2500AD\PANELS\PANELP.CFG

Page 137: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

134 • Appendix A

Compiler Information EasyPack/SLD 6502F User's Guide

SET DPMI32=MAXMEM 2048 SWAPFILEC:\2500AD\temp\2500AD.swp

You may use the EasyPack/SLD provided batch file Set65.BAT inEP6502\SAMPLES\2500AD sub-directory to set the environment ifyour directory conforms with the above example.

Three generated files (.HEX, .Sym and .DCF Files) are used byEasyPack/SLD.

Compiler Switches

C Compiler (C6502)

-C -- directly assemble and generate a 2500AD

High Level symbol file and debug control file.

-d -- include each source line in the output file and

generate listing file (Optional).

Assembler (X6502)

-q -- quiet mode (Optional).

-d -- listing file to disk (Optional).

Linker (LINK)

-C -- create 2500AD High Level Symbol Table

-H -- Intel Hex output file

-D -- generate map file (Optional).

For source level debugging of assembly file, these three assemblerdirectives must be included: LINKLIST, SYMBOLS, DEBUG asm.

Sample Projects

Provided in EP6502\SAMPLES\2500AD sub-directory.

• Prime sub-directory (C Sample)

Run the following:

a) c6502 -C -d prime1.c

b) c6502 -C -d prime2.c

c) c6502 -C -d prime3.c

d) x6502 -q -d C6502sr.asm

e) link prime.LNK

You may use the EasyPack/SLD provided batch file PRIME.BAT toexecute the above. You can also use Prime.prj in its IDE environment.

• ASM sub-directory (Assembly Sample)

Run the following:

Page 138: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

Appendix A • 135

EasyPack/SLD 6502F User's Guide Compiler Information

a) x6502 -q -d ASamp.asm

b) link ASamp.LNK

You may use the EasyPack/SLD provided batch file ASamp.BAT toexecute the above. You can also use Asamp.prj in its IDEenvironment.

WDC CompilerWDC tool chain V3.01, V3.02, V5.0 are supported. But C compiler ofV3.0x for 6502 CPU series isn't supported.

The following environments should be set correspond with yourpragram location for V3.0x.

Set PATH=%PATH%;c:\wdc\asmlnk\bin

You may use the EasyPack/SLD provided batch file set65V3.BAT inEP6502\SAMPLES\WDC sub-directory to set the environment if yourdirectory conforms with the above example.

The following environments should be set correspond with yourpragram location for V5.0.

SET WDC_INC_6502=C:\WDC_SDS\INCLUDE

SET WDC_LIB=C:\WDC_SDS\LIB

SET PATH=%path%;C:\WDC_SDS\BIN;You may use theEasyPack/SLD provided batch file Set6502.BAT inEP6502\SAMPLES\WDC sub-directory to set the environment if yourdirectory conforms with the above example.

Two generated files (.HEX and .Sym Files) are used byEasyPack/SLD.

Compiler Switches

C Compiler (WDC02CC for V5.0)

-BS -- generates source level debigging information

Assembler (ZAS for V3.0x, WDC02AS for V5.0)

-G -- generates assembly source information

-L -- generates list file

-S -- pass local symbols to linker

Linker (ZLN for V3.0x, WDCLN for V5.0)

-G -- generates source debug information

-HI -- Intel Hex output file

-SN -- Extended Microtek format

Page 139: EasyPack/SLD - Micetekmicetek.com/tw/pdf/sld_6502_eng.pdf · 2005-07-13 · Installing the Emulator and EasyPack /SLD™ Software Install the emulator and EasyPack/SLD software following

136 • Appendix A

Compiler Information EasyPack/SLD 6502F User's Guide

Sample Projects

Provided in EP6502\SAMPLES\WDC sub-directory.

• Prime sub-directory (C Sample for V5.0 only)

Run the following:

a) WDC02AS -g -s -l t0.asm

b) WDC02CC -bs prime1.c

c) WDC02CC -bs prime2.c

d) WDC02CC -bs prime3.c

e) WDCLN -cC000 -d0280 -sn -hi -g -t -o prime.hex

t0.obj prime1.obj prime2.obj prime3.obj -lc -lm

You may use the EasyPack/SLD provided batch file PRIME.BAT toexecute the above.

• ASM sub-directory (Assembly Sample)

Run the following for V3.0x:

a) ZAS -G -S -L AExmpl

b) ZLN -G -HI -SN AExmpl

You may use the EasyPack/SLD provided batch file MKV3.bat toexecute the above.

Run the following for V5.0:

a) WDC02AS -G -S -L AExmpl

b) WDCLN -G -HI -SN AExmpl

You may use the EasyPack/SLD provided batch file MKV5.bat toexecute the above.