The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers.    


Datasheet Search Engine   
 
Part # or Description: • 5V RS232 Driver • 2SC5066* • "Real Time Clock" • "USB connector" • "blue led" 5mm • 10 watt zener diode • 2N3055* motorola
 
Search Tip: Try entering the part number only. Include a wildcard (eg. lm317* or 1n4148*)

 

 

Copyright 2006 HOLTEK SEMICONDUCTOR INC. rights reserved. Printed Taiw


Datasheet Thumbnail

  

Download PDF



Top Searches for this datasheet



HT-IDE3000 Guide
Copyright 2006 HOLTEK SEMICONDUCTOR INC. rights reserved. Printed Taiwan. part this publication reproduced, stored retrieval system, transmitted form means, electronic, mechanical photocopying, recording, otherwise without prior written permission HOLTEK SEMICONDUCTOR INC.
NOTICE
information appearing this Guide believed accurate time publication. However, Holtek assumes responsibility arising from specifications described. applications mentioned herein used solely purpose illustration Holtek makes warranty representation that such applications will suitable without further modification, recommends products application that present risk human life malfunction otherwise. products authorized critical components life support devices systems. Holtek reserves right alter products without prior notification. most up-to-date information, please visit site http://www.holtek.com.tw.
Contents
Contents
Part Integrated Development Environment
Chapter Overview Installation
HT-IDE Development Environment.3 Holtek In-Circuit Emulator HT-ICE HT-ICE Interface Card.4 Programmer OTPAdapter Card System Configuration Installation.6 System Requirement.6 Hardware Installation Software Installation.6
Chapter Quick Start
Step Create Project Step Source Program Files Project.11 Step Build Project Step Programming Device Step Transmit Code Holtek
Chapter Menu File/Edit/View/Tools/Options
Start HT-IDE3000 System File Menu Edit Menu.16 View Menu
HT-IDE3000 Guide
Tools Menu Configuration Option Diagnose Writer.19 Library Manager Voice/VROM Editor Voice/Download Simulator.20 Virtual Peripheral Manager.21 Data EEPROM Editor.21 Options Menu Project Command Debug Command Directories Command Editor Command Color Command Font Command
Chapter Menu Project.27
Create Project.27 Open Close Project.28 Manage Source Files Project.28 Source File Project.29 Delete Source File from Project Move Source File Down Build Task Files.30 Build Project Task File Rebuild Project Task File Assemble/Compile.31 Assemble Compile Program Print Option Table Command Generate Demo File (.DMO) Command
Chapter Menu Debug.33
Reset HT-IDE3000 System.34 Reset from HT-IDE3000 Commands.35 Reset from Target Board Emulation Application Programs.35 Emulate Application Program Stop Emulating Application Program.36 Application Program Line.36 Directly Jump Line Application Program Single Step Breakpoints.37 Breakpoint Features Description Breakpoint Items Breakpoints.40
Contents
Trace Application Program Initiating Trace Mechanism Stopping Trace Mechanism.43 Trace Start/Stop Setup.43 Trace Record Format Debugger Command Mode Enter/Quit Command Mode Functions Supported Command Mode.47 File Format HT-COMMAND Error Messages
Chapter Menu Window
Window Menu Commands.56
Chapter Simulation
Start Simulation
Chapter Programming.63
Introduction Installation.64 Adapter Card Programming Device with HT-HandyWriter.65 System Messages
Part Development Language Tools.75
Chapter Assembly Language Cross Assembler
Notational Conventions.77 Statement Syntax Name.78 Operation Operand Comment.79 Assembly Directives Conditional Assembly Directives File Control Directives Program Directives.81 Data Definition Directives.84 Macro Directives Assembly Instructions.88 Name.89 Mnemonic.89 Operand, Operator Expression
HT-IDE3000 Guide
Miscellaneous Forward References.91 Local Labels Reserved Assembly Language Words Cross Assembler Options Assembly Listing File Format.93 Source Program Listing.93 Summary Assembly Miscellaneous
Chapter Holtek Language.97
Introduction Program Structure.98 Statements Comments.98 Identifiers Reserved Words.99 Data Types.99 Data Types Sizes Declaration .100 Constants.101 Integer Constants.101 Character Constants .101 String Constants.101 Enumeration Constants.102 Operators.102 Arithmetic Operators .102 Relational Operators .102 Equality Operators .103 Logical Operators.103 Bitwise Operators.103 Assignment Operators .103 Increment Decrement Operators.104 Conditional Operators .104 Comma Operator .104 Precedence Associativity Operators .104 Type Conversions .105 Program Control Flow.106 Functions .109 Classic Form .109 Modern Form.109 Pointers Arrays .110 Pointers .110 Arrays .111 Structures Unions.111 Preprocessor Directives.112
Contents
Holtek Language Extensions Restrictions.116 Keywords.116 Memory Bank .116 Data Type .117 Line Assembly .117 Interrupt .117 Variables.118 Static Variables.119 Constants .119 Functions .119 Arrays .119 Constant Variables .119 Pointer.120 Initial Value .120 Multiply/Divide/Modulus .120 Built-in Functions.120 Stack .122
Chapter Mixed Language .123
Little Endian .123 Naming rule Functions Parameters .124 Global Variable .124 Local Variable.124 Function .125 Function Parameters.125 Parameter Passing .126 Return Value .126 Preserving Registers .126 Calling Assembly Function from Program.126 Calling Function from Assembly Program.127 Programming with Assembly Language .130
Chapter Cross Linker .131
What Cross Linker Does.131 Cross Linker Options .131 Libraries .131 Section Address .131 Generate File .132 File .132 Cross Linker Task File Debug File .132
HT-IDE3000 Guide Part Utilities .133
Chapter Library Manager .135
What Library Manager Does.135 Setup Library Files .135 Create Library File .136 Program Module into Library File.137 Delete Program Module from Library File .137 Extract Program Module from Library Create Object File .137 Object Module Information .137
Chapter Simulator .139
Introduction .139 Panel Configuration File .139 Relationship Between Panel File Current Project .140 Selecting HT-LCDS .140 Panel Picture File .141 Setup Panel Configuration File.141 Setup Panel Configurations .141 Select Patterns Their Positions .142 Pattern .142 Delete Pattern .143 Change Pattern .143 Change Pattern Position .143 User-define Matrix .144 Define Pattern Using Panel Editor .144 Pattern Items Using Batch File .145 Selecting Color Panel .145 Setting Pattern Color Panel .146 Simulating LCD.146 Stop Simulation .146
Chapter Virtual Peripheral Manager .147
Introduction .147 Window .147 Menu.148 File Menu .148 Function Menu .149 Peripherals.151 .151 Button/Switch .152 Seven Segment Display.152 Quick Start Example .154 Scanning Light .154
Contents Part Appendix .157
Appendix Reserved Words Used Cross Assembler .159
Reserved Assembly Language Words .159 Instruction Sets .160
Appendix Cross Assembler Error Messages .165 Appendix Cross Linker Error Messages .169 Appendix Cross Library Error Messages.175 Appendix Holtek Cross Compiler Error Messages.177
Error Code .177 Warning Code.180 Fatal Code .182
HT-IDE3000 Guide
viii
Part Integrated Development Environment
Part
Integrated Development Environment
HT-IDE3000 Guide
Chapter Overview Installation
Chapter
Overview Installation
ease process application development, importance availability supporting tools microcontrollers cannot underestimated. support range MCUs, Holtek fully committed development release easy fully functional tools full range devices. overall development environment known HT-IDE, while operating software known HT-IDE3000. software provides extremely user friendly Windows based approach program editing debugging while HT-ICE emulator hardware provides full real time emulation with multi functional trace, stepping breakpoint functions. With complete interface cards full device range regular software Service Pack updates, HT-IDE development environment ensures that designers have best tools maximize efficiency design release their microcontroller applications.
HT-IDE Development Environment
Holtek Integrated Development Environment, otherwise known HT-IDE, high performance integrated development environment designed around series 8-bit devices. Incorporated within system hardware software tools necessary rapid easy development applications based Holtek range 8-bit MCUs. component within HT-IDE system HT-ICE In-Circuit Emulator, capable emulating Holtek 8-bit real time, addition providing powerful debugging trace features. latest version HT-ICE In-Circuit Emulator also incorporates complete writer which provides user with tools required design, debug program their devices. software, HT-IDE3000 provides friendly workbench ease process application program development, integrating software tools, such editor, Cross Assembler, Cross Linker, library symbolic debugger into user friendly Windows based environment. addition, HT-IDE3000 provides software simulator which capable simulating behavior 8-bit range without connection HT-ICE. fundamental functions HT-ICE hardware valid simulator. More detailed information HT-IDE3000 development system contained within HT-IDE3000 Guide. Installed conjunction with HT-IDE3000 ensure that development system contains information microcontrollers latest software updates, Holtek provides regular HT-IDE3000 Service Packs. These Service Packs, which downloaded from Holtek website, replace HT-IDE3000 installed after HT-IDE3000 system software been installed.
HT-IDE3000 Guide
Some special features provided HT-IDE3000 include: Emulation Real-time program instruction emulation Hardware Easy installation usage Either internal external oscillator Breakpoint mechanism Trace functions trigger qualification supported trace emulation chip Printer port connecting HT-ICE host computer interface card connecting application board HT-ICE writer hardware integrated within HT-ICE Software Windows based software utilities Source program level debugger (symbolic debugger) Workbench multiple source program files (more than source program file application project) tools included development, debug, evaluation generation final application program code (mask file file) Library setting common procedures which linked later date other projects. Simulator simulate debug programs without connection HT-ICE hardware Virtual Peripheral Manager (VPM) simulates behavior peripheral devices. simulator simulates behavior panel.
Holtek In-Circuit Emulator HT-ICE
Developed alongside Holtek 8-bit microcontroller device range, Holtek fully functional in-circuit emulator 8-bit microcontroller devices. Incorporated within system comprehensive hardware software tools rapid easy development user applications. Central system in-circuit hardware emulator, capable emulating 8-bit devices real-time, while also providing range powerful debugging trace facilities. Regarding software functions, system incorporates user-friendly Windows based workbench which integrates together functions such program editor, Cross Assembler, Cross Linker library manager. addition, system capable running software simulation mode without connection HT-ICE hardware.
HT-ICE Interface Card
interface cards supplied with HT-ICE used most applications, however, possible user omit supplied interface card design their interface card. including necessary interface circuitry their interface card, user means directly connecting their target boards connectors HT-ICE.
Chapter Overview Installation
Programmer
devices fully supported range programmers. engineering level device programming, Holtek supplies stand alone programming tool which provides quick efficient means volume programming. HT-ICE In-Circuit Emulators integrated writer part hardware package, facilitating complete design, debug device programming within HT-ICE. More programmers from other suppliers available which provide more efficient higher volume production capability. Refer website further suppliers information.
Adapter Card
Holtek programmers supplied with standard Textool chip socket. Adapter Card used connect Holtek programmers various sizes available chip packages that unable this supplied socket.
System Configuration
HT-IDE system configuration shown below, which host computer Pentium compatible machine with Windows 95/98/NT/2000/XP later. Note that Windows NT/2000/XP later systems used, then HT-IDE3000 software must installed Supervisor Privilege mode.
HT-IDE system contains following hardware components: HT-ICE contains emulator with printer port connector connecting host machine, signal connector power-on interface card connecting target board HT-ICE Power Adapter, output 25-pin D-type printer cable Integrated writer
HT-IDE3000 Guide Installation
System Requirement
hardware software requirements installing HT-IDE3000 system follows: PC/AT compatible machine with Pentium higher SVGA color monitor least best performance drive (for installation) least free disk space Parallel port connect HT-ICE Windows 95/98/NT/2000/XP
Windows 95/98/NT/2000/XP trademarks Microsoft Corporation.
Hardware Installation
Step Plug power adapter into power connector HT-ICE Step Connect target board HT-ICE using interface card flat cable Step Connect HT-ICE host machine using printer cable HT-ICE should lit, not, there error your dealer should contacted. Caution Exercise care when using power adapter. power adapter whose output voltage 16V, otherwise HT-ICE damaged. strongly recommended that only power adapter supplied Holtek used. First plug power adapter power connector HT-ICE.
Software Installation
Step1 Insert HT-IDE3000 into drive, following dialog will shown.
Chapter Overview Installation
Click <HT-IDE3000> button following dialog (Fig 1-5) will shown.
Click <HT-IDE3000> <Service Pack> want. Example installing HT-IDE3000 Click <HT-IDE3000> button. Step Press <Next> button continue setup press <Cancel> button abort.
HT-IDE3000 Guide
Step following dialog will shown user enter directory name.
Chapter Overview Installation
Step Specify path want install HT-IDE3000 click <Next> button. Step SETUP will copy files specified directory.
1-10
HT-IDE3000 Guide
Step process successful dialog will shown.
1-11 Step Press Finish button restart computer system. Then HT-IDE3000 now. SETUP will create four subdirectories, BIN, INCLUDE, LIB, SAMPLE, under destination directory specified Step subdirectory contains system executables (EXE), dynamic link libraries (DLL) configuration files (CFG, FMT) supported MCU. INCLUDE subdirectory contains include files (.H, .INC) provided Holtek. subdirectory contains library files (.LIB) provided Holtek. SAMPLE subdirectory contains some sample programs. Note that before running HT-IDE3000 first time, system will company information shown figure below. Select appropriate area fill company name HT-IDE3000 provider requested supply number.
1-12
Chapter Quick Start Chapter
Quick Start
This chapter gives brief description using HT-IDE3000 develop application project.
Step Create Project
Click Project menu select command Enter your project name select from combo Click button system will setup configuration options Setup configuration options click Save button
Step Source Program Files Project
Create your source files using File/New command Write your program save them with file name, TEST.ASM Click Project menu select Edit command Edit Project dialog will add/delete files to/from project Select source file name, TEST.ASM, click button Click button after setup files project
Step Build Project
Click Project menu select Build command system will assemble/compile source files project there some errors programs, double click error message line system will prompt position where error happened. program files error free, system will create Task file download HT-ICE debug. repeat this step before finish debugging your programs
Step Programming Device
Build project creating .OTP file Click Tools menu select Writer command program devices
HT-IDE3000 Guide
Step Transmit Code Holtek
Click Project menu select Print Option Table command Send .COD file Option Approval Sheet Holtek Programming data flow illustrated following diagram:
Chapter Menu File/Edit/View/Tools/Options Chapter
Menu File/Edit/View/Tools/Options
This chapter describes some menus commands HT-IDE3000. Other menus described Project, Debug Window chapters.
Start HT-IDE3000 System
Click Start Button, select Programs select Holtek HT-IDE3000 Click HT-IDE3000 icon
HT-IDE3000 Guide
last project worked HT-IDE3000 emulation mode (using HT-ICE), then will displayed following conditions occurs. connection between HT-ICE host machine connection fails. HT-ICE powered off.
selected connection between HT-ICE host machine been made, then displayed, HT-IDE3000 enters emulation mode HT-ICE begins function.
last project work HT-IDE3000 simulation mode (using Simulator), then will displayed indicate that HT-IDE3000 will enter simulation mode.
HT-IDE3000 program supports menus File, Edit, View, Project, Debug, Tools, Options, Window Help. following sections describe functions commands each menu. dockable toolbar, below menu (Fig 3-5), contains icons that correspond assist user with more convenient execution frequently used menu commands. When cursor placed toolbar icon, corresponding command name will displayed alongside. Clicking icon will cause command executed.
Chapter Menu File/Edit/View/Tools/Options
Status Bar, bottom line (Fig 3-5), displays emulation simulation present status result status commands. status bar, field (PC=0001H) displays Program Counter while debugging process (Debug menu).
Status contains information that useful during program debug. Program Counter used during program execution indicates actual present Program Counter value while column indicators used show present cursor position when using program editor.
File Menu
File menu provides file processing commands, details behind which shown following list along with corresponding toolbar icons. Create file Open Open existing file Close Close current active file
HT-IDE3000 Guide
Save Write active windows data active file Save Write active windows data specified file Save Write windows data corresponding opened files Print Print active data printer Print Setup Setup printer Recent Files List most recently opened closed four files Exit Exit from HT-IDE3000 return Windows
Edit Menu
Undo Cancel previous editing operation Redo Cancel previous Undo operation Remove selected lines from file place onto clipboard Copy Place copy selected lines onto clipboard Paste Paste clipboard information present insertion point Delete Delete selected information Find Search specified word from editor active buffer Replace Replace specified source word with destination word editor active buffer
View Menu
View menu provides following commands control window screen HT-IDE3000. (Refer 3-6) Line Move cursor specified line (specified line number) active file
Chapter Menu File/Edit/View/Tools/Options
Cycle Count Count instruction cycles accumulatively. Press reset button clear cycle count. radio buttons used change radix count, hexadecimal decimal. maximum cycle count 65535. Toolbar Display toolbar information window. toolbar contains some groups buttons whose function same that command each corresponding menu item. When mouse cursor placed toolbar button, corresponding function name will displayed next button. mouse clicked, command will executed. Refer corresponding chapter functionality each button. Toggle Breakpoint button will line specified cursor breakpoint (highlighted). toggle action this button will clear breakpoint function previously set. Status Displays status information window.
Tools Menu
Tools menu provides special commands facilitate user application debug. These commands Configuration Option, Diagnose, Writer, Library Manager, Voice tools Simulator virtual peripheral manager.
Configuration Option
This command generates option file used Build command Project menu. contents option file depend upon specified MCU. This command allows options modified after creation project.
HT-IDE3000 Guide
Choosing Clock Source clock source used HT-ICE chosen when setting options, either when creating project modifying options. HT-ICE provides clock sources, namely internal external. external clock source chosen, jumper must placed correct position. crystal mode, crystal location short positions jumper interface card. mode, adjust system frequency with short positions jumper interface card. Internal Clock Source internal clock source used, system application frequency specified. HT-IDE3000 system will calculate frequency which supported HT-ICE, which will most approximate value specified system frequency. Whenever calculated frequency equal specified frequency, warning message specified frequency along with calculated frequency will displayed. Confirmation will then required confirm calculated frequency specify another system frequency. Otherwise external clock source only option. matter which kind clock source chosen, system frequency must specified.
Diagnose
This command (Fig 3-8) helps check whether HT-ICE working correctly. There total items diagnosis. Multiple items selected clicking check pressing Test button, press Test button diagnose items. These items listed below. resource option space Diagnose options space HT-ICE. Code space Diagnose program code memory HT-ICE. Trace space Diagnose trace buffer memory HT-ICE. Data space Diagnose program Data Memory HT-ICE. System space Diagnose system Data Memory HT-ICE. Diagnose EV-chip socket HT-ICE. Diagnose EV-chip socket HT-ICE. Diagnose EV-chip socket HT-ICE. Diagnose EV-chip socket HT-ICE.
Chapter Menu File/Edit/View/Tools/Options
Writer
Writer command under Tools menu controls OTP/MTP programming functions HT-ICE built-in writer. Within this command, sub-command Handywriter used program type HT-MTPWriter program type MCU. However, this command applicable other external stand-alone writer which known HT-Writer. Please visit website relevant information.
Library Manager
Library Manager command, 3-9, supports library functions. Program codes used frequently compiled into library files then included application program using Project command Options menu. (Refer Cross Linker options item Options menu, Project command). functions Library Manager are: Create library file modify library file Add/Delete program module into/from library file Extract program module from library file, create object file
HT-IDE3000 Guide
Part gives more details library manager.
Voice/VROM Editor
Holtek provides VROM Editor user arrange voice code specific (eg. HT86 series)
Voice/Download
This command downloads contents specified voice data file with extension name .VOC HT-ICE emulation. also uploads from HT-ICE VROM saving data specified .VOC file. 3-10 displays dialogue which shows name downloaded voice file .VOC, which generated VROM Editor. size displays voice size bytes current MCU. When uploading, different file name from project name specified save contents voice from HT-ICE. Ensure that voice file .VOC been generated VROM Editor before downloading.
3-10
Simulator
simulator HT-LCDS, provides mechanism simulate output driver. According designed patterns control programs, HT-LCDS displays patterns screen real time. Part gives more details simulator.
Chapter Menu File/Edit/View/Tools/Options
Virtual Peripheral Manager
Virtual Peripheral Manager (VPM) provides mechanism simulate peripheral device. must used while HT-IDE3000 simulation mode.
Data EEPROM Editor
Some MCUs (eg. HT48E series) have internal EEPROM. Data EEPROM Editor provides interface user arrange data download/upload data to/from HT-ICE.
3-11
Options Menu
Options menu (Fig 3-12) provides following commands which working parameters other menus commands.
Project Command
Project command sets default parameters used Build command Project menu. During development, project options changed according needs application. According options set, HT-IDE3000 will generate proper task file these options when Build command Project menu issued. dialog (Fig 3-13) used setting options Project.
3-12 Note Before issuing Build command, ensure that project options correctly.
HT-IDE3000 Guide
3-13 Micro Controller name this project. scroll arrow browse available names select appropriate one. Enter Free Mode (Debug Options Disabled) After Build Check this that HT-IDE3000 will enter free mode after build. debug functions will disabled while free mode. Language Tool Option Holtek permits Third Party provide compiler MCU. Currently, select Hi-Tech language tool another choice. Assembler/Compiler Options command line options Cross Assembler. Define symbol allows user define value specified symbol which used assembly program. syntax follows: symbol1[=value1] [,symbol2 [=value2] [,.]] example: debugflag=1, newver=3 check Generate listing file used check source program listing file been generated.
Chapter Menu File/Edit/View/Tools/Options
Cross Linker Options specify options Cross Linker. Libraries used specify library files refered Cross Linker. example: libfile1, libfile2 Library files selected clicking Browse button. Section address used ROM/RAM addresses specified sections, example: codesec=100, datasec=40 check Generate file used check file Cross Linker generated.
Debug Command
This command sets options used Debug menu (Chapter HT-IDE3000 menu Debug dialog (Fig 3-14) lists debug options with check boxes. selecting options pressing button, Debug menu then obtain these options during debugging process.
3-14 Trace Record Fields This location specifies information displayed when issuing Trace List command, contained within Window menu. each source file instruction, information will displayed same order that items dialog box, from bottom. item been selected, next selected item will moved forward. default trace list will display file name line number only. de-assembled instruction obtained from machine code, source line obtained from source file. execution data read data execution read operation only, written data execution write only read write operation. external signal status effect simulation mode selected.
HT-IDE3000 Guide
Auto Stepping Command Selects automatic call procedure step option, namely Step Into Step Over. Only option selected. Connection Port Selects connection port HT-ICE. parallel port, LPT1, LPT2 LPT3 selected connection HT-ICE. connection port effect simulation mode selected. Mode Selects HT-IDE3000 working mode either simulation emulation mode. HT-ICE connected host machine powered HT-IDE3000 selected either emulation simulation mode. Detect Stack Overflow Uncheck this want system show message while detecting stack overflow.
Directories Command
command sets default search path directories saving files. (Fig 3-15)
3-15 Executable files path search path referred HT-IDE3000 when executable files called. Include files path search path referred Cross Assembler search included files. Library files path search path referred Cross Linker search library files. Output files path directory saving output files Cross Assembler (.obj, .lst) Cross Linker (.tsk, .map, .dbg)
Editor Command
This command sets editor options such size Undo command count. Save Before Assemble option will save file before assembly. Maximum Undo Count maximum allowable counts consecutive undo operations.
Chapter Menu File/Edit/View/Tools/Options
3-16
Color Command
This command sets foreground background colors specified line. From available options (Fig 3-17), Text Selection used Edit menu, Current line, Breakpoint Line, Trace Line Stack Line Debug menu Error line Assembler output.
3-17
Font Command
This command will change displayed fonts.
HT-IDE3000 Guide
Chapter Menu Project
Chapter
Menu Project
HT-IDE3000 provides example Project, which will assist first time users quickly familiarizing themselves with project development. should noted that from standpoint HT-IDE3000 system, working unit project with each user application described unique project. When developing HT-IDE3000 application first time, development steps, described earlier, recommended.
Create Project
Project menu (Fig 4-1), select command create project. this command, user needs select pieces information project, namely Project
Name Micro Controller (Fig 4-2). user browse directories existing projects select them overwrite project) choose available MCU.
Note
project name file name with extension .PRJ.
HT-IDE3000 Guide
Open Close Project
HT-IDE3000 work with only project time, which opening project, time. project worked upon, project should first opened, using Open command Project menu (Fig 4-1). Then, insert project name directly browse directories select project name. Close command close project.
Note
When opening project, current project closed automatically. Within development period, i.e. during editing, setting options debugging etc., ensure that project open state. This shown displaying project name opening project title HT-IDE3000 window. Otherwise, results unpredictable. HT-IDE3000 will retain opening project information system exits from HT-IDE3000 without closing opening project. This project will opened automatically next time HT-IDE3000 run.
Manage Source Files Project
Edit command remove source program files from opened project. order, from bottom, each source file list box, order input files Cross Linker. Cross Linker processes input files according order these files box. buttons, namely [Move [Move Down], used adjust order source file project. dialog Project Edit command.
Chapter Menu Project
Source File Project
Type source file name into text File Name Edit dialog Alternatively, choose source file type browse List Files. Choose drive directory where source files located using browse Drives Directories items Choose source file name from list below File name item Double-click selected file name choose button source files project When selected source file been added, this file name displayed list Files project.
Delete Source File from Project
Choose file deleted from project Click Delete button
Note
Deleting source files from project does actually delete file refers removal file information from project.
Move Source File Down
Choose file moved list (Files project), moving cursor this file clicking mouse button Click [Move button [Move Down] button
HT-IDE3000 Guide Build Task Files
sure that following tasks have been completed before building project: project been opened project options have been project source files have been added options have been (refer Tools menu chapter) There commands related building project file, Build command Rebuild command. Project Build command performs following operations: Assemble compile source files current project, calling Cross Assembler compiler depends file extension .asm Link object files generated Cross Assembler compiler, generate task file debugging file. Load task file into HT-ICE powered-on Display source program execution entry point active window (the HT-IDE3000 refers source files, task file debugging file emulation)
Note
Build command execute above tasks execution dependent creation date/time corresponding files. rules are: creation date/time source file later than that object file, then Cross Assembler compiler called assemble, compile this source file generate object file. object files later creation date/time than that task file, then Cross Linker called link object files this task generate task file. Build command downloads task file into HT-ICE automatically whether there action not. Rebuild command carries same task Build command. difference that Rebuild command will execute task immediately without first checking creation date/time project files. result message executing Build Rebuild command displayed Output window. error occurs processing procedure, actions following skipped, task file generated, download performed.
Build Project Task File
Click Open command Project menu open project Click either Build command Project menu Build button toolbar (Fig 4-1) start building project
Chapter Menu Project
Rebuild Project Task File
Click Open command Project menu open project Click either Rebuild command Project menu Rebuild button toolbar (Fig 4-1) start building project Once project task been built successfully, emulation debugging application program begin (refer HT-IDE3000 menu Debug chapter).
Assemble/Compile
verify integrity application programs, this command used assemble compile source code display result message Output window.
Assemble Compile Program
File menu open source program file assembled compiled Either select Assemble/Compile command Project menu click Assemble button toolbar assemble/compile this program file opened file .asm file extension name, Cross Assembler will execute assembly process. file extension then Holtek compiler will compile program. errors detected, object file with extension .OBJ generated stored directory which specified Output Files Path (refer Options menu, Directories command). error occurs corresponding message displayed Output window, following commands used move cursor error line: Double-click left button mouse Select error message line Output window, press <Enter>
Print Option Table Command
This command will print current active option file specified printer. printer selected where options file printed out. recommended different printer port from port which connected HT-ICE. both printer HT-ICE using same printer port, issuing this command will cause loss debug information corresponding data. After printing finished, user should proceed very beginning development procedure Build command Project menu further emulation/debugging application program required.
Generate Demo File (.DMO) Command
This command will generate file (.dmo) HT-DEMO. User carry HT-DEMO with .dmo file demonstrate project without installation HT-IDE3000.
HT-IDE3000 Guide
Chapter Menu Debug
Chapter
Menu Debug
development process, repeated modification testing source programs inevitable procedure. HT-IDE3000 provides many tools only facilitate debugging work, also reduce development time. Included functions such single stepping, symbolic breakpoints, automatic single stepping, trace trigger conditions, etc. After application program been successfully constructed, (refer chapter Build task files) first execution line source program displayed highlighted active window (Fig 5-1). HT-IDE3000 ready accept execute debug commands.
HT-IDE3000 Guide Reset HT-IDE3000 System
There kinds reset methods HT-IDE3000 system: Power-on reset (POR) plugging power adapter pressing reset button HT-ICE Reset from target board Software reset command HT-IDE3000 Debug menu (Fig 5-2) Software power-on reset command HT-IDE3000 Debug menu (Fig 5-2)
Chapter Menu Debug
effects above types reset listed table 5-1. Reset Item Clear Registers Clear Options Clear PDF, Value Emulation Stop Check Stand-Alone Power-On Reset (**) (**) Target Board Reset No(***) Table Software Reset Command Software Power-On Reset Command
Note
Refer Data Book corresponding effects registers under different resets. (**) value emulation stops. (***) reset from target board, will start emulating application after reset completed.
Program Counter Power Down Flag Time-out Flag
Reset from HT-IDE3000 Commands
Either choose Reset command from Debug menu click Reset button toolbar execute software reset Either choose Power-on Reset command from Debug menu click Power-on Reset button execute software power reset
Reset from Target Board
target board circuit take advantage m_RES (pin 03-C) connector design reset button. effect this reset listed table 5-1.
Emulation Application Programs
After application program been successfully written assembled, Build Rebuild command should executed. successful, first executable line source program will displayed highlighted active window (Fig 5-1). this point, emulation application program begin using HT-IDE3000 debug commands.
Note
During emulation application program, corresponding project open.
HT-IDE3000 Guide
Emulate Application Program
Choose command from Debug menu press press button toolbar Other windows activated during emulation. HT-IDE3000 system will automatically stop emulation break condition met. Otherwise, will continue emulating until application program. Stop button toolbar illuminated with color while HT-ICE emulation. Pressing this button will stop emulation process.
Stop Emulating Application Program
There three methods stop emulation, shown follows: breakpoints before starting emulation Choose Stop command Debug menu press Alt+F5 Press Stop button toolbar
Application Program Line
emulation stopped specified line when debugging program. following methods provide this function. instructions between current point specified line will executed except conditional skips. Note however that program stop specified line conditional jumps other situations. Move cursor stopped line highlight this line) Choose Cursor command Debug menu press press Cursor button toolbar
Directly Jump Line Application Program
possible jump directly line, result executed instructions between current point specified line important. This command will change contents Data Memory, registers status except Program Counter. specified line next line executed. Move cursor appropriate line highlight this line Choose Jump Cursor command Debug menu
Single Step
execution results some instructions above section viewed checked. also possible view execution results instruction time, i.e., step-by-step manner. HT-IDE3000 provides step modes, namely manual mode automatic mode. manual mode, HT-IDE3000 executes exactly step command each time single-step command executed. automatic mode, HT-IDE3000 executes single step commands continuously until emulation stop command issued, using Stop command Debug menu. automatic mode, user specified breakpoints discarded step rate from FAST, 0.5, seconds. There step commands, namely Step Into, Step Over Step Out.
Chapter Menu Debug
Step Into command executes exactly instruction time, however, will enter procedure stop first instruction procedure when encounters CALL procedure instruction. Step Over command executes exactly instruction time, however upon encountering CALL procedure, will stop next instruction after CALL instruction instead entering procedure. instructions this procedure will have been executed register contents status have changed. Step command only used when inside procedure. executes instructions between current point instruction (including RET), stops next instruction after CALL instruction.
Note
Step command should only used when current pointer within procedure otherwise unpredictable results happen.
step commands, Step Into Step Over, automatic mode using Debug sub-menu Options menu start automatic single step mode Choose Stepping command from Debug menu also choose stepping speed (the step command Debug command from Options menu) automatic single step mode Choose Stop command from Debug menu change automatic single step command automatic mode Choose Debug command from Options menu Choose Step Into Step Over command Stepping command start Step Into Choose Step Into command from Debug menu press press Step Into button toolbar start Step Over Choose Step Over command Debug menu press press Step Over button toolbar start Step Choose Step command Debug menu press Shift+F7 press Step button toolbar
Breakpoints
HT-IDE3000 provides powerful breakpoint mechanism which accepts various forms conditioning including program address, source line number symbolic breakpoint, etc.
HT-IDE3000 Guide
Breakpoint Features
following main features HT-IDE3000 breakpoint mechanism: most breakpoints with equal priority take effect instant. breakpoint will recorded breakpoints list after set, however this breakpoint immediately effective. effective later, long deleted, i.e.still breakpoints list box. acceptable most breakpoints list simultaneously. least breakpoint should deleted first, 21st breakpoint added. Breakpoints address data, binary form with bits, permitted. When instruction effective breakpoint, HT-ICE will stop this instruction, will execute i.e. this instruction will become next executed. Although instruction effective breakpoint, HT-ICE stop this instruction execution flow conditional skips. effective breakpoint Data Space (RAM), instruction that matches this conditional breakpoint data will always executed. HT-ICE will stop next instruction.
Description Breakpoint Items
breakpoint consists following descriptive items. necessary items, 5-3: Space location breakpoint, either Program Code space Data space. Location actual location breakpoint. next paragraph will give location format. Content data content breakpoint. This item effective only when Space assigned Data space. Read Write check used executing conditions breakpoint. Format Description Items Location allowed formats Location items are: Absolute address code space data space) with format types, namely decimal, hexadecimal (suffix with binary bits. example
14h, 00010100b, 10xx0011
represents decimal hexadecimal 14h, binary 00010100b t-care bits respectively. Note
bits must binary format.
Chapter Menu Debug
Line number with without source file name, format [source_file_name!].line_number where source_file_name name optional source file. there file name, current active file assumed. exclamation point necessary only when source file name specified. must prefix line number which decimal. Example: C:\HIDE\USER\GE.ASM!.42 sets breakpoint 42nd line file GE.ASM directory \HIDE\USER drive Example: sets breakpoint 48th line current active file. Program symbol with without source file name. format [source_file_name!].symbol_name same line number location format except that line_number replaced with symbol_name. following program symbols acceptable: Label name Section name Procedure name Dynamic data symbols defined data section Format Description Items Content External Signals format content external signals have four digital number options, similar format Location absolute address. These four types number decimal, hexadecimal, binary t-care bits. Format Breakpoints List Breakpoints list contains breakpoints that have been added, including effective breakpoints non-effective breakpoints. button should used breakpoints list box, Delete button remove breakpoints from list box. format each breakpoint list follows: <status> {<space read/write>, <location>, <data content>, <external signal>} where <status> effective status. effective (enabled) non-effective (disabled). <space read/write> space type operating mode. code space, "D/R" data space with read, data space with write, data space with read write. <location>, <data content> <external signal> have same data format input form respectively.
HT-IDE3000 Guide
Breakpoints
There methods set/enable breakpoint, using Breakpoint command from Debug menu, other using Toggle Breakpoint button toolbar. rules breakpoint mechanism follows: breakpoint Breakpoints list (Fig 5-3), then descriptive items must designated first, then added Breakpoints list box. long breakpoint exists list box, made effective Enabling breakpoint fails initially effective. Press button confirmation. Otherwise, changes here will effective. When using Toggle Breakpoint button toolbar, cursor should first moved breakpoint line, then Toggle Breakpoint button pressed. effective breakpoint changed non-effective breakpoint, this achieved merely pressing Toggle breakpoint button. Breakpoint Choose Breakpoint command from Debug menu press Ctrl+B) breakpoint dialog displayed (Fig 5-3) Designate descriptive items breakpoint Space, Location items Content item Read/Write check Space data space External signals necessary Press button this breakpoint Breakpoints list box. Press button confirm
Note
total count effective breakpoints less than newly added will take effect automatically after been added. Breakpoints list full, with breakpoints, button disabled more breakpoints added.
Chapter Menu Debug
Delete Breakpoint Choose Breakpoint command from Debug menu press Ctrl+B breakpoint dialog displayed (Fig 5-3) Choose highlight breakpoint deleted from Breakpoints list Press Delete button delete this breakpoint from Breakpoints list Press button confirm Delete Breakpoints Choose Breakpoint command from Debug menu press Ctrl+B breakpoint dialog displayed (Fig 5-3) Choose Clear button delete breakpoints from Breakpoints list Press button confirm also click Clear Breakpoint button toolbar accomplish this task. Enable (Disable) Breakpoint Choose Breakpoint command from Debug menu press Ctrl+B breakpoint dialog displayed (Fig 5-3) Choose disabled (enabled) breakpoint from Breakpoints list Press Enable (Disable) button, enable disable this breakpoint Press button confirm
Trace Application Program
HT-IDE3000 provides powerful trace mechanism which records execution processes relative information when HT-IDE3000 emulating application program. trace mechanism provides qualifiers filter specified instructions trigger conditions order stop trace recording. also provides method record specified count trace records before after trigger point.
Note
When HT-IDE3000 starts emulating (refer section Emulation Application Programs), trace mechanism will begin record executing instructions relative information automatically, vice versa.
Initiating Trace Mechanism
basic requirement initializing trace mechanism Trace Mode with without Qualify. Trace Mode defines trace scope application program Qualify defines filter conditions trace recording. available Trace Modes Normal Sets trace scope application programs default mode. Trace Main Sets trace scope application programs except interrupt service routine programs. Trace Sets trace scope interrupt service routine programs.
HT-IDE3000 Guide
According Qualify, trace mechanism decides which instructions what corresponding information should recorded trace buffer during emulation process. rule that instruction will recorded information status satisfy enabled qualifiers. format Qualify same that breakpoint. program steps required recorded, then Qualify needed Qualify). default Qualify. contrast Trace Mode Qualify, which specify conditions trace recording, both Trigger Mode Forward Rate specify conditions stop trace recording. Trigger Mode specifies kind trigger point, standard used determine location stop trace point. Forward Rate specifies trace scope between trigger point stop trace point. available Trigger Modes are: Trigger stopping trace recording condition. This default case. Trigger Condition trigger point condition Trigger Condition trigger point condition Trigger Condition trigger point either condition condition Trigger Condition after trigger point condition after condition occurred. Trigger when meeting condition times trigger point when condition occurred times. Trigger Condition after meeting times trigger point condition after condition occurred times. Condition Condition specify trigger conditions. format condition same that breakpoint. Loop Count specifies number occurrences specified condition used only when Trigger Mode from last modes above list. Forward Rate specifies approximate rate trace recording information between trigger point stop trace point whole trace buffer. trigger point divides trace buffer into parts, before after trigger point. forward rate used limit trace recording scope after trigger point. percentage adjustable between 100%.
Note
necessary trace recording scope equal forward rate. breakpoint before reaching trace recording scope trace stop command (refer Stopping trace mechanism) issued, trace recording will stopped. Qualify list records displays qualifiers used Trace Mode. qualifiers added into list qualifiers effective. Qualifier disabled deleted from list box. format each qualifier Qualify list same format breakpoint Breakpoints list (refer section Breakpoints, Format breakpoints list box)
Chapter Menu Debug
Stopping Trace Mechanism
There methods stop trace recording mechanism: trigger point (Trigger Mode) Forward Rate shown above breakpoints stop emulation trace recording. Issue Trace Stop command from Debug menu (Fig 5-2) stop trace recording. lists requirements trace mechanism. This result Trace command from Debug menu.
Trace Start/Stop Setup
Trace Mode Choose Trace command from Debug Menu Trace dialog displayed 5-4. Choose trace mode from Trace Mode pull-down list Press button
Trigger Mode Choose Trace command from Debug Menu Trace dialog displayed 5-4. Choose trigger mode from Trigger Mode pull-down list press button Change Forward Rate Choose Trace command from Debug Menu Trace dialog displayed Forward Rate scroll specify desired rate Press button
HT-IDE3000 Guide
Setup Condition A/Condition Choose Trace command Debug Menu Trace dialog displayed 5-4. Press Condition A/Condition radio button Press Condition button Qualify dialog displayed 5-5. Enter conditional information Press button close Condition dialog Press button close Trace dialog
Trace Qualify Condition Choose Trace command from Debug Menu Trace dialog displayed 5-4. Press Qualify radio button Press Qualify button Qualify dialog displayed 5-5. Enter qualifier information Press button close Qualify dialog Press button qualifiers into Qualify list below Press button close Trace dialog Delete Trace Qualify Condition Choose Trace command from Debug Menu Trace dialog displayed 5-4. Choose qualify line deleted from Qualify list Press Delete button Press button confirm Delete Qualify Conditions Choose Trace command from Debug Menu Trace dialog displayed 5-4. Press Clear button Press button confirm
Note
there qualifier, instructions qualified default.
Chapter Menu Debug
Enable (Disable) Trace Qualify Condition Choose Trace command from Debug Menu Trace dialog displayed Choose disabled (enabled) qualifier line enabled (disabled) from Qualify list Press Enable (disable) button Press button confirm
Note
most, trace qualifications enabled same time.
Trace Record Format
Once trace qualify trigger conditions have been setup, those instructions which satisfy qualify conditions will recorded trace buffer. Trace List command Window menu provides functions view check trace record information, used debugging program. trace record fields displayed screen except sequence number. These fields dependent upon settings Debug sub-menu from Options menu. text enclosed parentheses headings shown Trace List command Window menu. illustrate contents trace list under different debug options.
Sequence number (No) trigger modes, sequence number trigger point trace records before after trigger point numbered using negative positive line numbers respectively. fields Trace Record Fields Debug Option Option menu) selected, result shown 5-7. trigger mode selected trigger point occurred, sequence number starts from -00001 decreases sequentially trace records (Fig 5-6). Program count (PC) program count instruction this trace record.
HT-IDE3000 Guide
Machine code (CODE) machine code this instruction. Disassembled instruction (INSTRUCTION) disassembled mnemonic instruction disassembled using HT-IDE3000 utility. Execution data (DAT) data content executed (read/write). Source file name with line number (FILE-LINE) source file name line number this instruction. Source file (SOURCE) source line statement (including symbols). above fields optional except sequence number which always displayed.
Note
trace record fields Debug command Options menu. view trace record fields Trace List command Window menu.
Clear Trace Buffer trace buffer cleared issuing Reset Trace command. Hereafter, trace information will saved from beginning trace buffer. Note that both Reset command Power-On Reset command also clear trace buffer.
Chapter Menu Debug Debugger Command Mode
addition windows based debugging mode, HT-IDE3000 provides alternative debugging mode, named Command Mode. Under this mode, user, addition obtaining same functions menu-driven windows based debugging mode, also access additional debugging functions. These added functions include ability save debugging history into file order execute these debugging commands automatically again well ability execute previous debugging command without rewriting command.
Enter/Quit Command Mode
Enter Command Mode From Debug Menu HT-IDE3000 select command. When command mode been entered screen will appear where commands entered after prompt second line. (Fig 5-8) Command Mode Window Command Mode Title shows name present project file. command entered after prompt command line. When command entered full command syntax will displayed bottom status bar. After command been entered prompt, next line will display result command execution. (Fig 5-9) Another prompt will then displayed where another command entered. Quit from Command Mode quit from Command Mode normal windows exit method used Q[uit] command entered command prompt.
Functions Supported Command Mode
following table shows complete list debugging statements supported Command Mode Command Function Description Execute previous command Comment Breakpoint Commands Breakpoint Dump Program Memory Dump Data Memory Fill string Fill bytes {-C|-D|-E|-L} [list|*]. list=11 S[,RW], Location [,Data] [,Ext Sig] [bank.address [,range] [bank.]address[,range] {bank.address|symbol} list. ®list=11 {bank.address|symbol} list list=11 Command Syntax
Free specified address [address]
HT-IDE3000 Guide
Command Function Description Jump specified address directly Help History commands Load execute file Load project Quit Reset Power reset Single Step (Into/Over/Out) Trace list Open/Write/Close file address [-V] [LogFileName] ProjectName [-I|-V|-O] default option: [-L] [length] {-S|-C} [LogFileName] Command Syntax
debugging command syntax, large brackets exist, this indicates that parameter must inserted otherwise error will occur. Parameters separated symbol.
Breakpoint Commands There breakpoint commands, their command syntax function follows: Breakpoint Clear/Enable/Disable/List Syntax: [list Parameter clear breakpoint parameter. This will delete indicated breakpoint clear breakpoints shown Breakpoint Box. Within list there from 1~20 numbers
Chapter Menu Debug
PROJECT NAME COMMAND LINE
COMMAND SYNTAX
which represent breakpoints already setup. This means that more than selected. example, three numbers each separated space, indicates that 1st,, 8th, breakpoints will cleared. This same operation Delete function within Debug/Breakpoint window. star symbol means that breakpoints already setup will cleared. same operation Clear function within Debug/Breakpoint window. Parameter will change indicated breakpoints non-active, however breakpoints will still remain shown Breakpoint Box. This command same Disable function within Debug/Breakpoint window. star same operation that described above. Parameter will change indicated breakpoints active. This command same Enable function within Debug/Breakpoint window. star same operation that described above. Parameter will display presently setup breakpoints window, format consistent with contents Debug/Breakpoint window, where first column shows breakpoint number. user refer this breakpoint number setup required numbers statement.
Note
BP-L this parameter does require list HT-IDE3000 only have maximum breakpoints active same time.
HT-IDE3000 Guide
parameters given then Breakpoint command will following type: Breakpoint Syntax: [,RW] ,Location [,Data] [,Ext Sig] parameter within brackets optional however under certain conditions must specified. denotes Space, where choice made between letter indicates that breakpoint Program Code Memory, while indicates that breakpoint Data Memory (RAM) chosen replace then read/write option [,RW] must also specified. user choose from This because breakpoints Data Memory then choice exists breakpoint activated either read, write both read write. chosen replace which indicates program code, then necessary setup parameter sets position breakpoint, format [SourceFileName!].LineNumber [SourceFileName!].SymbolName SourceFileName specified then already opened source file will taken default. chosen replace then parameter must setup. breakpoint setup specified location Data Memory will initiate break when read write with specified data occurs. parameter that chosen, consult HT-IDE3000 Guide Comment Command Syntax: comment string This command provided give explanation file. characters found after will have functional effect. Dump Command Syntax: bank.address ,range range This command will display window, contents specified program memory area. This area specified indicating address, well range bank. data format. address specified bank number specified then bank number will taken that current bank. neither address bank number specified bank number will taken that current bank number address will taken that present Program Counter. range specified then range value will taken words. range allowed exceed bank (2000h). example this statement would 1.0f00 which would indicate that bank number address value 0f00h. Syntax: bank.address ,range address This command will display window, contents specified area Data Memory. This data area specified address, range bank. data displayed format. range specified then will bytes. range allowed exceed bank (100h) bank address expressed format.
Chapter Menu Debug
Fill Command This command changes contents Data Memory Syntax: {bank.address symbol}, list Will write bytes specified list into Data Memory area specified bank number specified start address symbol. Either bank.address symbol name used. Also list more than byte, however least blank must used delimiter. values specified format. list range cannot cross over bank boundary. Syntax: {bank.address symbol}, string same function except that data supplied ASCII user chose following symbol formats: .var filename!.var path\filename!.var
Note
path contains spaces then name must included quotation marks otherwise error condition will occur.
Example:
Go/Jump Commands Syntax: address address specified program will free until specified address encountered. address specified program will until active breakpoint encountered. Syntax: address Will force direct jump specified address. Note that address must specified. Help Command Syntax: This command will list window debugging commands, their syntax description. History Commands Syntax: This command will display window last commands, including command, that were executed. same time first column will display command sequence numbers succession. Syntax: displayed command sequence number above mentioned command. This command will execute previously executed command again. writing sequence number adding same command executed again reducing need re-input commands parameters. command sequence number indicated last command will executed. Load Commands Syntax: [-V] [LogFileName] This command will load execute Debugging Commands File, specified LogFileName
HT-IDE3000 Guide
LogFileName specified, then same name current Project File name will taken filename. Parameter indicates that command line execution result should displayed window. option, then result record will placed logfile same name with .res file extension name. file created using command. contents modified using File Edit function within HT-IDE3000. However these contents must contain correct Debugging Commands otherwise error condition will occur, execution will stop return prompt sign
Note
spaces included LogFileName then name must included within quotation marks otherwise error condition will occur. logfile cannot contain commands.
Quit Command Syntax: This command will Command Mode return present window.
Note
This command effect Command file. After quitting from command mode files opened will closed execution commands will stop.
Reset Commands Syntax: function this command same Debug/Reset command Syntax: function this command same Debug/Power-On Reset command Step Commands There kinds Single Step commands; which after execution will display contents STATUS Syntax: Single Step Command. Step Into, which same function Debug/Step Into Step Over, which same function Debug/Step Over Step Out, which same function Debug/Step option been setup default condition will Trace Command Syntax: [-L] length trace command will display contents trace buffer window. Parameter indicates that records will displayed, which include Sequence number, Program count, Machine code, Disassembled instructions, Execution data, External signal, source file name with line number source file.
Chapter Menu Debug
parameter supplied, then default condition will only display Sequence number, Program count, Machine code, Disassembled instructions source file name with line number. parameter indicates length displayed trace. trace display will begin from sequence number trace back with specified length. length also specify length trace forward. this forward rate must first setup system. default length value Trace mode, qualify conditions forward rate etc. parameters directly setup within HT-IDE3000 window, command mode does support these functions. Write Command Syntax: [LogFileName] This command will write debugging commands corresponding results into File. File will terminate whenever command encountered command mode terminated. will create File which following commands results will written will close previously created File, further commands will written into File indicated File already saved, then system will require confirmation before overwriting continuing with next step. necessary file extension name. File name does exist, then file name will take same name project with added .CMD file extension name.
Note
spaces included LogFileName then name must included within quotation marks otherwise error condition will occur. After executing command command cannot executed.
File Format
File text file that modified text editor including editor contained within HT-IDE3000. This editor accessed selecting Edit from main menu. format that every Debugging command will occupy line. command: LogFileName will clear contents File, after write commands results. command string, been created then note that prompt signs will also written into File. However, next time read debugger command these previously written prompt signs will ignored automatically. case where command strings generated using editor, note that necessary enter prompt signs into File. File been created then before each command execution result will automatically inserted making execution result into annotated note. this when next upload executed only command string will executed, result string will ignored.
HT-IDE3000 Guide
HT-COMMAND Error Messages
Error Message Invalid Command find HT-IDE Syntax error project debug bank range bank range Description command just entered illegal present environment HT-IDE3000 input syntax incorrect project file been opened HT-IDE3000 Program Memory dump exceeded range Data Memory dump exceeded range
command emulation mode command cannot executed command load file mode command write file mode Unterminated string Command history buffer Open file error Close file error Read file error Write file error emulation status Sources have been modified, please rebuild Stop user failed Stack overflow debug info Cannot find symbol Cannot find register command cannot executed command cannot executed character string definition requires balanced quotes History buffer empty Cannot open file Cannot close file Cannot read file Cannot write file Before executing this command first enter emulation mode original source file been modified requiring files rebuilt User stopped execution Reading value Program Counter failed stack exceeded capacity setup breakpoints have debug information indicated symbol cannot found indicated register cannot found
Chapter Menu Window
Chapter
Menu Window
HT-IDE3000 provides various kinds windows which assist user emulate simulate application programs. These windows shown 6-1) include program Data Memory (RAM), program code memory (ROM), Trace List, Register, Watch Stack, Program, Output, etc.
HT-IDE3000 Guide Window Menu Commands
window display contents program Data Memory space shown 6-2. address spaces registers included window because they displayed register window. contents window modified directly debugging purpose. address displayed vertically base address while horizontal single digit address offset. digits displayed hexadecimal format.
window displays contents program code memory space shown 6-3. address range from last address where last address depends upon selected project. horizontal vertical scrollbars used view address window. contents window displayed hexadecimal format cannot modified.
Trace List Trace List window displays trace record information shown 6-4. contents trace record defined Debug command Options menu. Double click trace record Trace List window will activate source file window cursor will stop corresponding line.
Chapter Menu Window
Register Register window displays registers defined selected project. shows example Register window HT48C70-1. contents Register window modified debugging. Note that Register window dockable.
Watch Watch window displays memory addresses contents specified symbols defined data sections, i.e., space. format symbol [source_file_name!].symbol_name contents registers also displayed first typing period then typing symbol name register name pressing Enter key. memory address contents specified symbol register will displayed right symbol shown following format: :[address]=data contents
HT-IDE3000 Guide
Note that both address data displayed hexadecimal format shown 6-6. symbol their corresponding data will saved HT-IDE3000 displayed next time Watch window opened. symbols deleted from Watch window pressing delete key. Note that Watch window dockable.
Stack Stack window displays contents stack buffer selected current project. maximum stack level dependent upon selected. shows example Stack window. growth stack numbered from number increased push operation (CALL instruction interrupt) decreased operation (RET RETI instructions). stack line highlighted. E.g. shown stack line. While executing RETI instruction, program line number specified stack line (134 this example) will used next instruction line executed. Also, line above stack line (00: this example) will used stack line. there stack line anymore, line Stack window will highlighted. format stack line Stack_level: program_counter source_file_name(line_number) where stack_level level number stack, program_counter hexadecimal return address calling procedure program address interrupted instruction, source_file_name complete name source file containing calling interrupted instruction, line_number decimal line number instruction after call instruction interrupted instruction source file.
Chapter Menu Window
Program Program window displays program code memory disassembly format. address range from last address where last address depends upon selected project. Output Output window shows system messages from HT-IDE3000 when Build/Rebuild commands executing. double clicking error message line, window containing source file will displayed corresponding line containing error highlighted.
HT-IDE3000 Guide
Chapter Simulation
Chapter
Simulation
HT-IDE3000 provides simulation mechanism debugging application programs. HT-IDE3000 simulator provides same functions HT-ICE, does require actual presence HT-ICE function. HT-IDE3000, debugging window functions HT-ICE valid simulator. addition, simulator provides interface input output ports. Although simulator provides many functions, some hardware characteristics cannot simulated. therefore recommended that emulation carried application program using HT-ICE before manufacture masked Some series support emulation mode only some support simulation mode.
Start Simulation
Upon entering HT-IDE3000, situations occur. first when project already been opened, second when project been opened. first case, working mode HT-IDE3000 depends upon working mode this project. latter case, working mode will simulation. Even working mode project emulation, changed user simulation. addition, working mode HT-IDE3000 will simulation when following situations occur. connection between HT-ICE host machine when connection fails. HT-ICE powered off. Debug command Option menu provides function working mode HT-IDE3000. displays contents Debug command.
HT-IDE3000 Guide
addition simulator, Holtek provides Virtual Peripheral Manager (VPM) which enable user directly drive monitor simulation inputs outputs Part gives more details VPM.
Chapter Programming
Chapter
Programming
Introduction
writer specifically developed range Holtek (One-Time Programmable) devices, allowing users easily efficiently burn their programming code into devices. small easy manage size, ease installation easy-to-use special features among advantages using this writer. Furthermore, writer been integrated board recent version HT-ICE Emulator, thus, making more convenient users during product development.
HT-IDE3000 Guide Installation
Since writer built-in HT-ICE box, after completion HT-ICE installation, burning function ready used within HT-IDE3000 software with further installation procedure needed. Refer Chapter Overview Installation.
Adapter Card
HT-ICE emulator shipped with 40-pin TEXTOOL Adapter Card. device package format match with this Adapter Card, user change Adapter Card himself. Refer other Holtek Technical Document visit website further information selecting Adapter Cards.
Chapter Programming Programming Device with HT-HandyWriter
HT-HandyWriter Software HT-HandyWriter software under Holtek Development System icon main Windows programs menu shown below:
Setup Printer Port After running HT-HandyWriter software program, window shown will shown, however first necessary setup correct printer port. selecting command, menu shown will displayed. From here LPT1, LPT2 LPT3 chosen. writer connected HT-ICE, then select printer port which HT-ICE connected. example HT-ICE connected LPT1 then select LPT1 from 8-5. writer directly connected printer port then choose relevant printer port same way.
HT-IDE3000 Guide
Chapter Programming
!Body Select Type clicking [Set Body] dialog will shown 8-6. there type identifier stored device, read/write operations will completed according chip type that selected users.
Option Check Option Option When [Option]/Option instruction selected, pop-up dialog, shown 8-7, will displayed. will illustrate option that comes from opened file device content. Print This instruction will print option comes from opened file device content.
HT-HandyWriter Programming Functions shows internal functions HT-HandyWriter. buttons shown right hand side this window each represent instruction, function which explained below: Open This opens file with .OTP suffix, which will load program contents into memory. This data will accessed when programming relevant device. After selecting file dialogue will displayed from which correct folder file name chosen. file content will displayed message window after being opened, checksum opened file will shown underneath button.
HT-IDE3000 Guide
Program This instruction encompasses functions. first place program data memory into device, second verification check verify that actual data burned into device same that memory data. After verification result this process will shown HT-HandyWriter display. Verify contents presently loaded device will read checked that same data loaded into memory, results which will displayed HT-HandyWriter display. Blank Check Check that presently loaded device previously been written results this check will displayed HT-HandyWriter display. device empty, memory area that been written will also shown display. Lock This instruction will implement protect function device preventing contents this from being read. After programming device, this instruction then used protect contents. Auto This instruction will execute order three instructions Blank Check, Program Verify. instructions execute correctly, process will halted following instruction executed. There also lock function, which selected prevent data from being read after programming. This lock function should first selected before Auto button pressed. Read This instruction will read contents device presently loaded into writer store them memory. This instruction will also cause file checksum displayed underneath button. required, this data also stored file with .OTP file suffix. Chip Info This instruction will read power-on software size, option size from display info from message inform users listed information comes from interior. there such information inside specification defined command will shown. will display info from inform users that above information comes from system setting. HT-HandyWriter Additional Functions Duplicate automatic detection duplication This function enables multi-OTPs same type continuously programmed. After opening file using Open instruction inserting into TEXTOOL socket, writer will automatically detect device then proceed implement functions that have been setup. this way, after desired .OTP file been opened, only necessary place correct device socket program large number devices. Before using this function, first necessary setup Auto-Program functions that required. setup these functions, select [duplicate]/Setup instruction shown 8-8. Duplicate Setup window shown will then displayed from which user select required functions from Blank Check, Program, Verify Lock list.
Chapter Programming
When [Duplicate]/Enable instruction selected shown 8-10, Auto-Program function will activated. After this instruction been activated, possible proceed with multi-chip programming. After chips have been programmed, Auto-Program function switched off, again selecting toggle action [Duplicate]/Enable instruction shown 8-10.
HT-IDE3000 Guide
8-10 Writing Serial Numbers serial number function allows user specified serial number written into each device. This serial number address specified user written into lower byte address Program each device. After serial number written into device, auto-incrementing function ensures that subsequently programmed devices will contain serial numbers incremented each time. First required setup initial data fixed address first serial number. After selecting [S/N]/Setup, window, shown 8-11, used input initial serial data corresponding address. After initial data address information been setup, [S/N]/Enable should selected activate serial number function. When serial number function activated, present serial corresponding address data will displayed lower right hand side main window. During programming stage first device programmed will contain previously setup serial number data Program indicated address. Subsequent devices will contain serial numbers incremented each additional device. reset order serial numbers, again select [S/N]/Setup function.
Chapter Programming
8-11
8-12
HT-IDE3000 Guide System Messages
HT-HandyWriter Connect LPT1. writer already connected LPT1. Cannot Connect Connection problems between writer, HT-ICE printer port. Invalid Chip! writer unable support chip HT-ICE. HT-ICE must changed correct operation take place. Connect HT-HandyWriter Through writer successfully connected HT-ICE. Cannot find HT-HandyWriter, Please Connect This HT-HandyWriter Version HT-ICE already connected printer port, writer connected HT-ICE. also that version writer being used (THANDYOTP-A) system unable detect good connection. former case, please connect writer directly ICE. File PID: ADh, OID: opened files recorded power-on ADh, software 50h. Invalid File Format opened file format incorrect. Chip PID: ADh, OID: Doesn Match with File PID: ADh, OID: Sure Continue? type device chip supported opened file does match. Chip Size: 0400h, File Size: 0800h. System Will Size 0400h. Sure Continue? device 400h writable space, file content 800h, writer only write 400h data into contents device. Addr: xxxxh, Data: yyyyh, Rdata: zzzzh Program/Option Verify Failed! Errors exist either program option verification information. reason because data zzzzh address xxxxh device same data yyyyh memory. Addr: xxxxh, Data: zzzzh Blank! device blank address xxxxh contains data zzzzh, inhibiting implementation further instructions. Chip Mismatched! device presently writer device mentioned .OTP file match, inhibiting implementation further instructions. Chip Locked! device presently writer locked, inhibiting implementation further instructions.
Chapter Programming
Data Verify/Program! Before executing Verify Program instruction, .OTP file must loaded using function HT-HandyWriter system software.
HT-IDE3000 Guide
Part Development Language Tools
Part
Development Language Tools
HT-IDE3000 Guide
Chapter Assembly Language Cross Assembler
Chapter
Assembly Language Cross Assembler
Description convention
Assembly-Language programs written source files. They assembled into object files Holtek Cross Assembler. Object files combined Cross Linker generate task file. source program made statements look tables, giving directions Cross Assembler assembly time processor time. Statements constituted mnemonics (operations), operands comments.
Notational Conventions
following list describes notations used this document. Example convention
Syntax elements that enclosed pair brackets optional. example, syntax command line follows: HASM [options] filename [optional items] above command line, options semicolon; both optional, filename required, except following case: Brackets instruction operands. this case, brackets refer memory address. {choice1 choice2} Braces vertical bars stand choice between more items. Braces enclose choices whereas vertical bars separate choices. Only item chosen.
HT-IDE3000 Guide
Example convention Description convention Three dots following item signify that more items with same form entered. example, directive PUBLIC following form: Repeating elements. PUBLIC name1 [,name2 [,.]] above form, three dots following name2 indicate that many names entered long each preceded comma.
Statement Syntax
construction each statement follows: [name] [operation] [operands] [;comment] fields optional. Each field (except comment field) must separated from other fields least space character. Fields case-sensitive, i.e., lower-case characters changed upper-case characters before processing.
Name
Statements assigned labels enable easy access other statements. name consists following characters: with following restrictions cannot first character name cannot stand alone name Only first characters recognized
Operation
operation defines statement action which types exist, directives instructions. Directives give directions Cross Assembler, specifying manner which Cross Assembler generate object code assembly time. Instructions, other hand, give directions processor. They translated object code assembly time, object code turn controls behavior processor time.
Operand
Operands define data used directives instructions. They made symbols, constants, expressions registers.
Chapter Assembly Language Cross Assembler
Comment
Comments descriptions codes. They used documentation only ignored Cross Assembler. text following semicolon considered comment.
Assembly Directives
Directives give direction Cross Assembler, specifying manner which Cross Assembler generates object code assembly time. Directives further classified according their behavior described below.
Conditional Assembly Directives
conditional block following form: statements [ELSE statements] ENDIF Syntax expression expression Description directives test expression following them. directive grants assembly value expression true, i.e. non-zero. directive grants assembly value expression false, i.e. zero. Example debugcase ACC1 extern username: byte ENDIF this example, value variable ACC1 username declared external variable symbol debugcase evaluated true, i.e. nonzero. Syntax IFDEF name IFNDEF name Description directives IFDEF IFNDEF test whether given name been defined. IFDEF directive grants assembly only name label, variable symbol. IFNDEF directive grants assembly only name been defined. conditional assembly directives support nesting structure, with maximum nesting level Example IFDEF buf_flag buffer dup(?) ENDIF this example, buffer allocated only buf_flag been previously defined.
HT-IDE3000 Guide
File Control Directives
Syntax INCLUDE file-name INCLUDE Description This directive inserts source codes from source file given file-name into current source file during assembly. Cross Assembler supports most nesting levels. Example INCLUDE macro.def this example, Cross Assembler inserts source codes from file macro.def into current source file. Syntax PAGE size Description This directive specifies number lines page program listing file. page size must within range from 255, default page size Example PAGE This example sets maximum page size listing file lines. Syntax .LIST .NOLIST Description directives .LIST .NOLIST decide whether source program lines copied program listing file. .NOLIST suppresses copying subsequent source lines program listing file. .LIST restores copying subsequent source lines program listing file. default .LIST. Example .NOLIST .LIST this example, instructions block enclosed .NOLIST .LIST suppressed from copying source listing file. Syntax .LISTMACRO .NOLISTMACRO Description directive .LISTMACRO causes Cross Assembler list source statements, including comments, macro. directive .NOLISTMACRO suppresses listing macro expansions. default .NOLISTMACRO.
Chapter Assembly Language Cross Assembler
Syntax .LISTINCLUDE .NOLISTINCLUDE Description directive .LISTINCLUDE inserts contents included files into program listing. directive .NOLISTINCLUDE suppresses addition included files. default .NOLISTINCLUDE. Syntax MESSAGE Description directive MESSAGE directs Cross Assembler display text-string screen. characters text-string must enclosed pair single quotation marks. Syntax ERRMESSAGE Description directive ERRMESSAGE directs Cross Assembler issue error. characters error-string must enclosed pair single quotation marks.
Program Directives
Syntax (comment) text Description comment consists characters preceded semicolon terminated embedded carriage-return/line-feed. Syntax name .SECTION [align] [combine] Description .SECTION directive marks beginning program section. program section collection instructions and/or data whose addresses relative section beginning with name which defines that section. name section unique same name given other sections program. Sections with same complete names treated same section. optional align type defines alignment given section. following: BYTE uses byte address (the default align type) WORD uses word address PARA uses paragraph address PAGE uses page address CODE section, byte address single instruction unit. BYTE aligns section instruction address, WORD aligns section even instruction address, PARA aligns section instruction address which multiple PAGE aligns section instruction address with multiple 256.
HT-IDE3000 Guide
DATA sections, byte address byte units bits/byte). BYTE aligns section byte address, WORD aligns section even address, PARA aligns section address which multiple PAGE aligns section address which multiple 256. optional combine type defines combining sections having same complete name (section class name). following: COMMON Creates overlapping sections placing start sections with same complete name same address. length resulting area length longest section. address Causes label variable addresses defined section relative given address. address valid expression except forward reference. absolute address specified ROM/RAM bank must within ROM/RAM range. combine type given, section combinative, i.e., this section concatenated with sections having same complete name form single, contiguous section. class type defines sections that loaded contiguous memory. Sections with same class name loaded into memory after another. class name CODE used sections stored ROM, class name DATA used sections stored RAM. complete name section consists section name class name. named section includes codes data below (after) until next section defined. Syntax ROMBANK banknum section-name [,section-name,.] Description This directive declares which sections allocated specified bank. banknum specifies bank, ranging from maximum bank number destination MCU. section-name name section defined previously program. More than section declared bank long total size sections does exceed bank size words. this directive declared, bank assumed CODE sections defined this program will bank CODE section declared bank, then bank assumed. Syntax RAMBANK banknum section-name [,section-name,.] Description This directive similar ROMBANK except that specifies bank, size bank bytes. Syntax Description This directive marks program. Adding this directive included file should avoided.
Chapter Assembly Language Cross Assembler
Syntax expression Description This directive sets location counter expression. subsequent code data offsets begin offset specified expression. code data offset relative beginning section where directive defined. attribute section determines actual value offset, absolute relative. Example this example, statement begins location current section. Syntax PUBLIC name1 [,name2 [,.]] EXTERN name1:type [,name2:type Description PUBLIC directive marks variable label specified name that available other modules program. EXTERN directive, other hand, declares external variable, label symbol specified name type. type four types: BYTE, WORD (these three types data variables), NEAR label type used call jmp). Example PUBLIC start, setflag EXTERN tmpbuf:byte CODE .SECTION start: call setflag setflag proc tmpbuf, setflag endp this example, both label start procedure setflag declared public variables. Programs other sources refer these variables. variable tmpbuf also declared external. There should source file defining byte that named tmpbuf declared public variable.
HT-IDE3000 Guide
Syntax name name PROC ENDP
Description PROC ENDP directives mark block code which called jumped from other modules. PROC creates label name which stands address first instruction procedure. Cross Assembler will value label current value location counter. Example toggle PROC tmpbuf, xorm flag tmpbuf toggle ENDP Syntax [label:] expression1 [,expression2 [,.]] Description directive stores value expression1, expression2 etc. consecutive memory locations. This directive used CODE section only. size result value dependent size MCU. Cross Assembler will clear redundant bits; expression1 value label. This directive also employed setup table code section. Example table1: 0128h, 025CH this example, Cross Assembler reserves units space also stores 0128H 025CH into these units.
Data Definition Directives
assembly language program consists more statements comments. statement comment composition characters, numbers, names. assembly language supports integer numbers. integer number collection binary, octal, decimal, hexadecimal digits along with optional radix. radix given, Cross Assembler uses default radix (decimal). table lists digits that used with each radix. Radix Type Binary Octal Decimal Hexadecimal Digits 01234567 0123456789 0123456789ABCDEF
Chapter Assembly Language Cross Assembler
Syntax [name] [name] [name] [name] [name]
value1 [,value2 value1 [,value2 DBIT repeated-count DUP(?) repeated-count DUP(?)
Description These directives reserve number bytes/words specified repeated-count reserve bytes/words only. value1 value2 should microcontroller Cross Assembler will initialize data. DBIT reserves bit. content denotes uninitialized data, i.e., reserves space data. Cross Assembler will gather every DBIT together reserve byte these DBIT variables. Example DATA .SECTION tbuf chksum flag1 DBIT sbuf cflag DBIT this example, Cross Assembler reserves byte location tbuf, location chksum, location flag1, location sbuf location cflag. Syntax name LABEL {BIT|BYTE|WORD}
Description name with data type same address following data variable Example lab1 LABEL WORD this example, byte lab1 high byte lab1. Syntax name expression
Description directive creates absolute symbols, aliases, text symbols assigning expression name. absolute symbol name standing 16-bit value; alias name representing another symbol; text symbol name another combination characters. name must unique, i.e. having been defined previously. expression integer, string constant, instruction mnemonic, constant expression, address expression. Example accreg bmove this example, variable accreg equal bmove equal instruction mov.
HT-IDE3000 Guide
Macro Directives
Macro directives enable block source statements named, then that name re-used source file represent statements. During assembly, Cross Assembler automatically replaces each occurrence macro name with statements macro definition. macro defined place source file long definition precedes first source line that calls this macro. macro definition, macro defined refer other macros which have been previously defined. Cross Assembler supports maximum nesting levels. Syntax name
MACRO [dummy-parameter statements ENDM
Cross Assembler supports directive LOCAL macro definition. Syntax name
LOCAL dummy-name
Description LOCAL directive defines symbols available only defined macro. must first line following MACRO directive, present. dummy-name temporary name that replaced unique name when macro expanded. Cross Assembler creates actual name dummy-name each time macro expanded. actual name form ??digit, where digit hexadecimal number within range from 0000 FFFF. label should added LOCAL directive when labels used within MACRO/ENDM block. Otherwise, Cross Assembler will issue error this MACRO referred more than once source file. following example, tmp1 tmp2 both dummy parameters, replaced actual parameters when calling this macro. label1 label2 both declared LOCAL, replaced ??0000 ??0001 respectively first reference, other MACRO referred. LOCAL declaration takes place, label1 label2 will referred labels, similar declaration source program. second reference this macro, multiple define error message displayed. Delay MACRO tmp1, tmp2 LOCAL label1, label2 tmp1, label1: tmp2, label2: wdt1 wdt2 tmp2 label2 tmp1 label1 ENDM
Chapter Assembly Language Cross Assembler
following source program refers macro Delay
Cross Assembler will expand macro Delay shown following listing file. Note that offset each line macro body, from line line 0000. Line expanded lines forms macro body. addition formal parameters, tmp1 tmp2, replaced with actual parameters, BCnt SCnt, respectively.
HT-IDE3000 Guide
Assembly Instructions
syntax instruction following form: [name:] mnemonic [operand1[,operand2]] [;comment] where name: mnemonic operand1 operand2 label name instruction name (keywords) registers memory address registers memory address immediate value
Chapter Assembly Language Cross Assembler
Name
name made letters, digits, special characters, used label.
Mnemonic
Mnemonic instruction name dependent upon type used source program.
Operand, Operator Expression
Operands (source destination) argument defining values that acted instructions. They constants, variables, registers, expressions keywords. When using instruction statements, care must taken select correct operand type, i.e. source operand destination operand. dollar sign special operand, namely current location operand. expression consists many operands that combined describe value memory location. combined operators evaluated assembly time. They contain constants, symbols, combination constants symbols that separated arithmetic operators. Operators specify operations performed while combining operands expression. Cross Assembler provides many operators combine evaluate operands. Some operators work with integer constants, some with memory values, some with both. Operators handle calculation constant values that known assembly time. following some operators provided Cross Assembler. Arithmetic operators (MOD) operators Syntax expression count expression count values these shift operators constant values. expression shifted right left number bits specified count. bits shifted position, corresponding bits that shifted zero-filled. following such examples: 01110111b 01110111b result ACC=00001110b result ACC=01110000b
Bitwise operators NOT, AND, Syntax expression expression1 expression2 expression1 expression2 expression1 expression2 bitwise complement. bitwise AND. bitwise inclusive bitwise exclusive
HT-IDE3000 Guide
OFFSET operator Syntax OFFSET expression OFFSET operator returns offset address expression. expression label, variable, other direct memory operand. value returned OFFSET operator immediate operand. LOW, HIGH operator Syntax expression expression HIGH expression LOW/MID/HIGH operator returns value expression result expression immediate value. LOW/MID/HIGH operators will then take low/middle/high byte this value. expression label, LOW/MID/HIGH operator will take values low/middle/high byte program count this label. BANK operator Syntax BANK name BANK operator returns bank number allocated section name declared. name label then returns bank number. name data variable then returns bank number. format bank number same defined. more information format please refer data sheets corresponding MCUs. (Note: format might different between MCUs.) Example BANK start BP,A start Example BANK BP,A OFFSET MP1,A A,IAR1 Operator precedence Precedence (Highest) (Lowest) Operators (unary), LOW, MID, HIGH, OFFSET, BANK SHL, (binary) (greater than), (greater than equal to), (less than), (less than equal (equal to), (not equal (bitwise NOT) (bitwise AND) |(bitwise OR), ^(bitwise XOR)
Chapter Assembly Language Cross Assembler Miscellaneous
Forward References
Cross Assembler allows reference labels, variable names, other symbols before they declared source code (forward named references). symbols right allowed forward referenced.
Local Labels
local label label with fixed form such $number. number 0~29. function local label same label except that local label used repeatedly. local label should used between consecutive labels same local label name used between other consecutive labels. Cross Assembler will transfer every local label into unique label before assembling source file. most local labels defined between consecutive labels. Example. Label1: Label2: Label3: Label1 local label label local label local label label local label
HT-IDE3000 Guide
Reserved Assembly Language Words
following tables list reserved words used assembly language. Reserved Names (directives, operators) BANK BYTE DBIT ELSE ENDIF ENDM ENDP ERRMESSAGE EXTERN HIGH IFDEF IFNDEF INCLUDE LABEL .LIST .LISTINCLUDE .LISTMACRO LOCAL MACRO MESSAGE NEAR .NOLIST .NOLISTINCLUDE .NOLISTMACRO OFFSET PAGE PARA PROC PUBLIC RAMBANK ROMBANK .SECTION WORD
Reserved Names (instruction mnemonics) ADCM ADDM ANDM CALL CPLA DECA HALT INCA RETI RLCA RRCA SBCM SDZA SIZA SUBM SWAP SWAPA TABRDC TABRDL XORM
Reserved Names (registers names) WDT1 WDT2
Chapter Assembly Language Cross Assembler Cross Assembler Options
Cross Assembler options Options menu Project command HT-IDE3000. Cross Assembler Options located center part Project Option dialog box, shown 3-12. symbols could defined Define Symbol edit box. Syntax symbol1[=value1] symbol2[=value2] Example, debugflag=1, newver=3 check Generate listing file used decide whether listing file should generated not. check checked, listing file will generated. Otherwise, generated.
Assembly Listing File Format
Assembly Listing File contains source program listing summary information. first line each page title line which include company name, Cross Assembler version number, source file name, date/time assembly page number.
Source Program Listing
Each line source program following syntax: line-number offset [code] statement Line-number number line starting from first statement assembly source file decimal digits). field offset offset from beginning current section code hexadecimal digits) field code present only statement generates code data (two hexadecimal 4-digit data) code shows numeric value hexadecimal value known assembly time. Otherwise, proper flag will indicate action required compute value. following flags appear behind code field. relocatable address (Cross Linker must resolve) external symbol (Cross Linker must resolve) following flag appear before code field equal-sign directive following flags appear code field section address (Cross Linker must resolve) nn[xx] expression: DUP(?) field statement source statement shown exactly appears source file, expanded macro. following flags appear before statement. Macro-expansion nesting level line from INCLUDE file
HT-IDE3000 Guide
Summary
line number digits, right alignment) oooo offset code digits) hhhh 4-digits opcode external reference statement from included file relocatable name Macro-expansion nesting level
Summary Assembly
total warning number total error number information provided Cross Assembler listing file.
Miscellaneous
errors occur during assembly, each error message error number will appear directly below statement where error occurred.
Chapter Assembly Language Cross Assembler
Example Assembly Listing File
HT-IDE3000 Guide
Chapter Holtek Language
Chapter
Holtek Language
Introduction
Holtek compiler based ANSI architecture Holtek microcontroller, only subset ANSI supported. This chapter describes programming language supported Holtek compiler. This chapter covers following topics: program structure Identifiers Data types Constants Operators Program control flow Functions Pointers arrays Structures unions Preprocessor directives Holtek language extensions restrictions
HT-IDE3000 Guide Program Structure
program collection statements, comments, preprocessor directives.
Statements
Statements, which consist variables, constants, operators functions, terminated with semicolon perform following operations: Declare data variables data structures Define data space Perform arithmetic logical operations Perform program control operations line contain more than statement. Compound statements more statements contained within pair braces used single statement. Some statements preprocessor directives required Holtek source files. following shell: void main() user application source code main function defined within user application source code. There more than source file application, only source file contain main function.
Comments
Comments used document meaning operation source statements placed anywhere program except middle keyword, function name variable name. compiler ignores comments. Comments cannot nested. Holtek compiler supports kinds comments, block comment line comment. Block Comment block comment begins with ends with example: this block comment block character placed different line from beginning block comment characters. this case characters between starting comment characters comment characters, treated comments ignored compiler. Line Comment line comment begins with comments characters line, example this line comment
Chapter Holtek Language Identifiers
name identifier contains sequence letters, digits, under scores with following rules: first character must digit Only first characters significant Upper case lower case letters different Reserved words cannot used
Reserved Words
following reserved words supported Holtek compiler. They must lower case. auto const enum static unsigned continue extern long struct void break default return switch volatile case goto short typedef while char else signed union
reserved words double, float register supported Holtek compiler.
Data Types
Data Types Sizes
Four basic data types supported Holtek compiler, char void single single byte holding character integer occupying byte empty values, used type returned functions that generate value
following qualifiers allowed Qualifier const long short signed unsigned Applicable Data Type char, char, place data space create 16-bit integer create 8-bit integer create signed variable create unsigned variable
HT-IDE3000 Guide
following data types, sizes ranges. Data Type char unsigned char unsigned short unsigned short long unsigned long Size (bits) Range -128~127 0~255 -128~127 0~255 -128~127 0~255 -32768~32767 0~65535
Declaration
Variables must declared before being used this defines data type size variable. syntax variable declaration data_type variable_name [,variable_name.]; where data_type valid data type variable_name name variable. variables declared function private local) that function other functions cannot access these variables directly. local variables function exist valid only when this function called, non-valid when exiting from function. variable declared outside functions, then global functions. qualifier const applied declaration variable, specify that value variable will changed. variables declared with const placed within space. const qualifier used array variables. const variable must initialized upon declaration, followed equal sign expression. Other variables cannot initialized when declared. variable declared specified address using character; syntax data_type variable_name memory_location; memory_location specifies address variable located. allocate variable above bank multiple banks MCU, might specify bank high byte memory_location. should check data sheet Holtek MCUs information available space. example: declare bank offset declare bank offset
Chapter Holtek Language
Also, array declared specified location: port[8] array port takes memory location through
variables implemented Holtek compiler static unless they declared external variables. Note that both static external variables will initialized zero default. Note Declaring variable unsigned type will more efficient code than signed.
Constants
constant literal number, single character character string.
Integer Constants
integer constant evaluated type, long constant terminated with Unsigned constants terminated with suffix indicates unsigned long. value integer constant specified with following forms: Binary constant: preceding number Octal constant: preceding number (zero) Hexadecimal constant: preceding number Others included above decimal
Character Constants
character constant integer, which denoted single character enclosed single quotes. value character constant numeric value character character set. ANSI escape sequences treated single character constant. Escape Character Description alert (bell) character backspace character form feed character line character carriage return character horizontal character vertical character backslash question mark character single quote (apostrophe) double quote character Value
String Constants
String constants represented zero more characters (including ANSI escape sequences) enclosed double quotes. string constant array characters implied null (zero) value after last character. Hence, total required storage more than number characters within double quotes.
HT-IDE3000 Guide
Enumeration Constants
Another method naming integer constants called enumeration. example: enum {PORTA, PORTB, PORTC} defines three integer constants called enumerators assigns values them. enumeration constants have type (-128~127). explicit integer value might associated with enumeration constants. example, enum {BIG=10, SMALL=20}; first enumeration constant value explicit value specified. Subsequent enumeration constants without explicit associations receive integer value greater than value associated with previous enumeration constant. enumeration named. example: enum boolean {NO, YES}; first name (NO) enum statement value next value
Operators
expression sequence operators operands that specifies computation. expression follows rules algebra, result value cause side effects. order evaluation subexpressions determined precedence grouping operators. usual mathematical rules associativity commutativity operators applied only where operators really associative commutative. different types operators discussed following.
Arithmetic Operators
There five arithmetic operators, addition subtraction multiplication division modulus (the remainder division, always positive zero)
modulus operator only used with integral data types.
Relational Operators
relational operators compare values return either TRUE FALSE result based comparison. greater than greater than equal less than less than equal
Chapter Holtek Language
Equality Operators
equality operators exactly analogous relational operators equal equal
Logical Operators
logical operators support logical operations AND, NOT. They create TRUE FALSE value. Expressions connected evaluated from left right. evaluation stops soon result known. numeric value relational logical expression relation true, otherwise. unary negation operator converts non-zero operand into zero operand into logical logical logical
Bitwise Operators
There operators manipulating bit-by-bit operations. shift operators perform right left shifts left operand number positions given right operand, which must positive. unary yields complement integer, converts every 1-bit 0-bit vice versa. bitwise bitwise bitwise complement right shift left shift
Assignment Operators
There total assignment operators expression statements. simple assignment, equal sign used with value expression replacing variable, left operand. This also provides shortcut modifying variable performing operation itself. <var> <var> <var> <var> <var> <var> <var> <var> <var> <var> <expr> <expr> <expr> <expr> <expr> <expr> <expr> <expr> <expr> <expr> value <expr> <var> subtract value <expr> from <var> multiply <var> value <expr> divide <var> value <expr> modulus, remainder when<var>is divided <expr> bitwise <var> with value <expr> bitwise <var> with value <expr> bitwise <var> with value <expr> right shift <var> <expr> positions left shift <var> <expr> positions
HT-IDE3000 Guide
Increment Decrement Operators
increment decrement operators used statement themselves, embedded within statement with other operators. position operator indicates whether increment decrement performed before (prefix operators) after (postfix operators) evaluation statement embedded within. <var> <var> -<var> <var>-pre-increment post-increment pre-decrement post-decrement
Conditional Operators
conditional operator shortcut executing statement between selectable statements according result expression. <expr> <statement1> <statement2> <expr> evaluates nonzero value, <statement1> executed. Otherwise, <satement2> executed.
Comma Operator
pair expressions separated comma evaluated from left-to-right value left expression discarded. side effects left expression performed before evaluation right expression. type value result type value right operand. example, f(a, (t=3, t+2), three arguments, second which value
Precedence Associativity Operators
following table lists precedence associativity operators. precedence from highest lowest. Each holds operators with same precedence. Unary assignment operators right associative, others left associative. Operators sizeof Description subscription parenthesis structure pointer structure member size type Associativity left right
Chapter Holtek Language
Operators Description increment decrement complement unary minus unary plus address dereference multiply divide modulus (remainder)

Other recent searches


UDZS18B - UDZS18B   UDZS18B Datasheet
PIC17C756A - PIC17C756A   PIC17C756A Datasheet
MNLF441M-X - MNLF441M-X   MNLF441M-X Datasheet
EL526 - EL526   EL526 Datasheet
EL5293 - EL5293   EL5293 Datasheet
EL5293A - EL5293A   EL5293A Datasheet
DC-501 - DC-501   DC-501 Datasheet
DC-502 - DC-502   DC-502 Datasheet
DC-511 - DC-511   DC-511 Datasheet
DC-5t7 - DC-5t7   DC-5t7 Datasheet
DC-52r - DC-52r   DC-52r Datasheet
DC-507 - DC-507   DC-507 Datasheet
DC-508 - DC-508   DC-508 Datasheet
DC-509 - DC-509   DC-509 Datasheet
DC-518 - DC-518   DC-518 Datasheet
DC-519 - DC-519   DC-519 Datasheet
DC-528 - DC-528   DC-528 Datasheet
DC-506 - DC-506   DC-506 Datasheet
DC-516 - DC-516   DC-516 Datasheet

 

Privacy Policy | Disclaimer
© 2012 Datasheet Archive