MF910-06 CMOS 4-BIT SINGLE CHIP MICROCOMPUTER S5U1C63000A Manual (S1C63 Family Assembler Package)
NOTICE No part of this material may be reproduced or duplicated in any form or by any means without the written permission of Seiko Epson. Seiko Epson reserves the right to make changes to this material without notice.
The information of the product number change Starting April 1, 2001, the product number will be changed as listed below. To order from April 1, 2001 please use the new product number. For further information, please contact Epson sales representative.
INTRODUCTION Introduction This document describes the development procedure from assembling source files to debugging. It also explains how to use each development tool of the "S1C63 Family Assembler Package" common to all the models of the S1C63 Family.
INTRODUCTION Manual Notations This manual was prepared by following the notation rules detailed below: (1) Sample screens The sample screens provided in the manual are all examples of displays under Windows®95/98. These displays may vary according to the system or fonts used. (2) Names of each part The names or designations of the windows, menus and menu commands, buttons, dialog boxes, and keys are annotated in brackets [ ].
CONTENTS Contents CHAPTER 1 GENERAL ................................................................................................ 1 1.1 1.2 Features ......................................................................................................... 1 Tool Composition .......................................................................................... 2 1.2.1 Composition of Package .............................................................................. 2 1.2.
CONTENTS 3.8 Build Task ..................................................................................................... 36 3.8.1 Preparing a Build Task .............................................................................. 36 3.8.2 Building an Executable Object .................................................................. 36 3.8.3 Debugging .................................................................................................. 37 3.8.4 Executing Other Tools ..................
CONTENTS 4.8 Relocatable List File .................................................................................... 83 4.9 Sample Executions ....................................................................................... 84 4.10 Error/Warning Messages .............................................................................. 87 4.10.1 Errors ....................................................................................................... 87 4.10.2 Warning .............................
CONTENTS 7.3 7.4 7.5 7.6 Starting Method ........................................................................................... 112 Messages ..................................................................................................... 113 Disassembling Output ................................................................................. 114 Error/Warning Messages ............................................................................. 117 7.6.1 Errors .................................
CONTENTS 8.8.6 Trace Functions ......................................................................................... 152 8.8.7 Operation of Flash Memory ...................................................................... 155 8.8.8 Coverage ................................................................................................... 156 8.8.9 Writing Data to the FPGA on the Standard Peripheral Circuit Board ..... 156 8.9 Command Reference ......................................................
CONTENTS 8.9.15 Coverage ................................................................................................. 222 cv (coverage) ............................................................................... 222 cvc (coverage clear) .................................................................... 223 8.9.16 Command File ......................................................................................... 224 com (execute command file) ...................................................
CONTENTS 11.3 Using winmla .............................................................................................. 263 11.3.1 Starting Up .............................................................................................. 263 11.3.2 Window .................................................................................................... 264 11.3.3 Menus and Toolbar Buttons .................................................................... 265 11.3.4 Operation Procedure ...............
CHAPTER 1: GENERAL CHAPTER 1 GENERAL 1.1 Features The S1C63 Family Assembler Package contains software development tools that are common to all the models of the S1C63 Family. The package comes as an efficient working environment for development tasks, ranging from source program assembly to debugging. Its principal features are as follows: Simple composition A task from assembly to debugging can be made with minimal tools.
CHAPTER 1: GENERAL 1.2 Tool Composition 1.2.1 Composition of Package The S1C63 Family Assembler Package contains the items listed below. When it is unpacked, make sure that all items are supplied. 1) CD-ROM (Tools and PDF manuals are included) .................. One 2) Warranty card ......................................................................... One each in English and Japanese 3) Registration card ....................................................................
CHAPTER 1: GENERAL The tools listed below are Windows GUI applications for creating mask data. A device information definition file (s1c63xxx.ini) is required to run these tools. The CD-ROM contains the device information definition files for the models supported with the following tools. For unsupported models, model specific Development Tools are provided. Function option generator (winfog.
CHAPTER 1: GENERAL 1.4 Installation The supplied CD-ROM contains the installer (Setup.exe) that installs the tools. To install the tools, start up the "Setup.exe" and follow the instructions in the dialog boxes that will be appeared. For more information on the installation procedure, please refer to "setup_e.pdf" on the CDROM. 1.5 Directories and Files after Installation The installer copies the following files in the specified directory (default is "C:\EPSON\S1C63\"): [EPSON\S1C63] README_E.
CHAPTER 1: GENERAL [\DOC] [\ENGLISH] REL_xxxx_E.TXT MANUAL_E.PDF QUICK_E.PDF [\HARD] xxxx_E.PDF [\JAPANESE] REL_xxxx_J.TXT MANUAL_J.PDF QUICK_J.PDF [\HARD] xxxx_J.PDF ... Document folder (English) ... Tool release note ... This manual in PDF format ... Quick reference in PDF format ... Hardware development tool manuals in PDF format ... Document folder (Japanese) ... Tool release note ... This manual in PDF format ... Quick reference in PDF format ...
CHAPTER 2: SOFTWARE DEVELOPMENT PROCEDURE CHAPTER 2 SOFTWARE DEVELOPMENT PROCEDURE This chapter outlines a basic development procedure. 2.1 Software Development Flow Figure 2.1.1 represents a flow of software development work. Work Bench wb63 file.MAK Make file file.S or file.MS Assembly source file(s) S1C63xxx Development Tool file.par Assembler as63 Assembly list file(s) Linker command file file.LST file.O Object file(s) file.CM Function Option Generator winfog file.MS file.
CHAPTER 2: SOFTWARE DEVELOPMENT PROCEDURE 2.2 Development Using Work Bench This section shows a basic development procedure using the work bench wb63. Refer to Chapter 3, "Work Bench", for operation details. 2.2.1 Starting Up the Work Bench Start up the work bench by choosing "WorkBench63" from the program menu.
CHAPTER 2: SOFTWARE DEVELOPMENT PROCEDURE 2.2.2 Creating a New Project The work bench manages necessary file and tool setting information as a project. First a new project file should be created. 1. Select [New] from the [File] menu (or click the [New] button). [New] button The [New] dialog box appears. 2. Select [EPSON Project File] and click [OK]. The [Project] dialog box appears. 3. Enter a project name, select an ICE parameter file and select a directory, then click [OK].
CHAPTER 2: SOFTWARE DEVELOPMENT PROCEDURE A new edit window appears. [Edit] window 3. Enter source codes in the [Edit] window. 4. Save the source in a file by selecting [Save] from the [File] menu (or clicking the [Save] button).
CHAPTER 2: SOFTWARE DEVELOPMENT PROCEDURE 5. Click the [Insert into project] button on the [Edit] window. [Insert into project] button The created source file is added in the project. To add existing source files, use [Files into project...] in the [Insert] menu. It can also be done by dragging source files from Windows Explorer to the project window. Create necessary source files and add them into the project. Sample list in the [Project] window The added source files are listed in the project window.
CHAPTER 2: SOFTWARE DEVELOPMENT PROCEDURE 2.2.5 Building an Executable Object To make an executable object file: 1. Select [Build] from the [Build] menu (or click the [Build] button). [Build] button This will invoke the assembler and linker to create an executable object file. If a HEX file format (Intel HEX or Motorola S) is selected by the [Output format] box, the HEX converter will be invoked after linking. By default, an absolute object file in IEEE-695 format will be created.
CHAPTER 2: SOFTWARE DEVELOPMENT PROCEDURE 2.2.6 Debugging To debug the executable object: 1. Select [Debug] from the [Build] menu (or click the [Debug] button). [Debug] button The debugger starts up with the specified ICE parameter file and then loads the executable object file. Note: Make sure that the ICE is ready to debug before invoking the debugger. Refer to the ICE hardware manual for settings and startup method of the ICE. For the debugging functions and operations, refer to Chapter 8, "Debugger".
CHAPTER 3: WORK BENCH CHAPTER 3 WORK BENCH This chapter describes the functions and operating method of the Work Bench wb63. 3.1 Features The Work Bench wb63 provides an integrated operating environment ranging from editing source files to debugging. Its functions and features are summarized below: • Source edit function that supports copy/paste, find/replace, print, label jump and tag jump from error messages. • Allows simple management of all necessary files and information as a project.
CHAPTER 3: WORK BENCH 3.3 Work Bench Windows 3.3.1 Window Configuration Menu bar [Project] window Toolbar [Edit] window [Output] window Status bar The work bench has three types of windows: [Edit] window, [Project] window and [Output] window. [Edit] window This window is used for editing a source file. A standard text file can also be displayed in this window. Two or more windows can be opened in the edit window area.
CHAPTER 3: WORK BENCH [Output] window This window displays the messages delivered from the executed tools in a build or assemble process. Double-clicking a syntax error message with a source line number displayed in this window activates or opens the [Edit] window of the corresponding source so that the source line in which the error has occurred can be viewed. Menu bar Refer to Section 3.5. Toolbar Refer to Section 3.3.
CHAPTER 3: WORK BENCH Closing the [Project] and [Output] window The [Project] window and the [Output] window can be closed by selecting [Project Window] and [Output Window] from the [View] menu, respectively. To open them, select the menu items again. Maximizing the [Edit] window area The [Edit] window area can be maximized to the full screen size by selecting [Full Screen] from the [View] menu. All other windows and toolbars are hidden behind the [Edit] window area.
CHAPTER 3: WORK BENCH 2 Tile windows To tile windows vertically, select [Tile Vertically] from the [Window] menu or click the [Tile Vertically] button. [Tile Vertically] button To tile windows horizontally, select [Tile Horizontally] from the [Window] menu or click the [Tile Horizontally] button.
CHAPTER 3: WORK BENCH 3 Maximizing an [Edit] window Click the [Maximize] button on the window title bar. The window will be maximized to the [Edit] window area size and other [Edit] windows will be hidden behind the active window. 4 Minimizing an [Edit] window Click the [Minimize] button on the window title bar. The window will be minimized as a window icon. The minimized icons can be arranged at the bottom of the [Edit] window area by selecting [Arrange Icons] from the [Window] menu.
CHAPTER 3: WORK BENCH 3.4 Toolbar and Buttons Tree types of toolbars have been implemented in the work bench: standard toolbar, build toolbar and window tool bar. Standard toolbar Build toolbar Window toolbar 3.4.1 Standard Toolbar This toolbar has the following standard buttons: [New] button Creates a new document. A dialog box will appear allowing selection from among three document types: assembly source, assembly header and project. [Open] button Opens a document.
CHAPTER 3: WORK BENCH 3.4.2 Build Toolbar This tool bar has the following buttons and list boxes used to build a project: [Assemble] button Assembles the assembly source in the active [Edit] window. This button becomes active only when the active [Edit] window shows an assembly source file. [Build] button Builds the currently opened project using a general make process. [Rebuild All] button Builds the currently opened project.
CHAPTER 3: WORK BENCH 3.4.4 Toolbar Manipulation Hiding and showing toolbars Each toolbar can be hidden if not needed. Select the toolbar name from the [View] menu. This operation toggles between hiding and showing the toolbar. Changing the toolbar location Toolbars can be moved to another location in the toolbar area by dragging them. If a toolbar is moved out of the toolbar area, it will be changed to a window. 3.4.
CHAPTER 3: WORK BENCH 3.5 Menus 3.5.1 [File] Menu [New...] ([Ctrl]+[N]) Creates a new document. A dialog box will appear allowing selection from among three document types: assembly source, assembly header and project. [Open...] ([Ctrl]+[O]) Opens a document. A dialog box will appear allowing selection of the file to be opened. [Close] Closes the active [Edit] window. This menu item appears when an [Edit] window becomes active. [Open Workspace...] Opens a project.
CHAPTER 3: WORK BENCH 3.5.2 [Edit] Menu [Undo] ([Ctrl]+[Z]) Undoes the previous executed operation in the [Edit] window. [Cut] ([Ctrl]+[X]) Cuts the selected text in the [Edit] window to the clipboard. [Copy] ([Ctrl]+[C]) Copies the selected text in the [Edit] window to the clipboard. [Paste] ([Ctrl]+[V]) Pastes the text copied on the clipboard to the current cursor position in the [Edit] window or replaces the selected text with the copied text.
CHAPTER 3: WORK BENCH 3.5.4 [Insert] Menu [File...] Inserts the specified file to the current cursor position in the [Edit] window or replaces the selected text with the contents of the specified file. A dialog box will appear allowing selection of the file to be inserted. [Files into project...] Adds the specified source file in the currently opened project. A dialog box will appear allowing selection of the file to be added. 3.5.
CHAPTER 3: WORK BENCH 3.5.6 [Tools] Menu [HEX Converter...] Invokes the HEX converter to convert an absolute object into an Intel HEX object or Motorola S object. A dialog box will appear allowing selection of an absolute object and options for the HEX converter. [Disassembler...] Invokes the disassembler to disassemble an absolute object. A dialog box will appear allowing selection of an absolute object and options for the disassembler. [WinFOG] Invokes the function option generator winfog.
CHAPTER 3: WORK BENCH 3.6 Project and Work Space The work bench manages a program development task using a work space folder and a project file that contains file and other information necessary for invoking the development tools. 3.6.1 Creating a New Project A new project file can be created by the following procedure: 1. Select [New] from the [File] menu or click the [New] button. [New] button The [New] dialog box appears. 2. Select [EPSON Project File] and click [OK]. The [Project] dialog box appears.
CHAPTER 3: WORK BENCH 3.6.2 Inserting Sources into a Project The sources created must be inserted into the project. To insert a source into a project, use one of the four methods shown below: 1. [Insert | Files into project...] menu item A dialog box appears when this menu item is selected. Choose a source file from the list box and then click [Open]. 2. [File | Open...] menu item or [Open] button [Open] button A dialog box appears when this menu item or button is selected.
CHAPTER 3: WORK BENCH 3.6.3 [Project] Window The [Project] window shows the work space folder and the source files included in the project that has been opened. When a source file icon is double-clicked, the source file will be opened or the corresponding [Edit] window will be activated. When the folder icon or a source file icon is clicked with the right mouse button, a shortcut menu including the available build menu items appears. [Properties...
CHAPTER 3: WORK BENCH 3.6.5 Files in the Work Space Folder The work bench generates the following files in the work space folder: .epj Project file This file contains the project information. .cm Linker command file This file is generated when a build task is started, and is used by the linker to generate an absolute object file. Example: ; S1C WorkBench Generated ; Thursday, November 05, 1998 "C:\EPSON\S1C63\DEV\63A08\PAR63A08.PAR" -o "test.
CHAPTER 3: WORK BENCH 3.7 Source Editor The work bench has a source editor function. Sources can be created and modified in the [Edit] window. 3.7.1 Creating a New Source or Header File To create a new source file: 1. Select [New] from the [File] menu or click the [New] button. [New] button The [New] dialog box appears. 2. Select [EPSON Assembly Source File] and click [OK]. An [Edit] window appears. [Edit] window Enter source codes here. Enter source codes in this window.
CHAPTER 3: WORK BENCH 3.7.2 Loading and Saving Files To load a source file: 1. Select [Open...] from the [File] menu or click the [Open] button. [Open] button The [Open] dialog box appears. 2. Choose a source file to be opened after selecting the file type, "Assembly Source Files (*.s, *.ms)", and click [OK]. An [Edit] window opens and shows the contents of the source file.
CHAPTER 3: WORK BENCH To save the source: 1. Activate the [Edit] window of the source to be saved. 2. Select [Save as...] from the [File] menu. The [Save As] dialog box appears. 3. Enter the file name and then click [OK]. When overwriting the source on the existing file, select [Save] from the [File] menu or click the [Save] button. [Save] button To save all the source files opened and the project file, use the [File | Save All] menu item or the [Save All] button. [Save All] button 3.7.
CHAPTER 3: WORK BENCH The controls in the dialog are as follows: [Find what:] text box Enter the word to be found in this text box. The specified word is maintained as the finding word even if this dialog box is closed. [Match whole word only] check box If this option is selected, the work bench searches only the words that are completely matched with the specified word. If not, only the part of word that matches the specified word will be searched.
CHAPTER 3: WORK BENCH [Find Next] button Clicking this button starts searching the specified word. If the specified word is found, the [Edit] window refreshes the display and highlights the word found. [Replace] button By clicking this button after the specified word is found, it is replaced with the substitute word. Then the work bench searches the next. [Replace All] button Replaces all the specified found words with the substitute word.
CHAPTER 3: WORK BENCH Shortcut menu The [Edit] window supports a short cut menu that appears by clicking the right mouse button on the [Edit] window. It can also be done by pressing the [Short cut menu] key while the [Edit] window is active if the key is available on the keyboard. It contains the editing menu items descried above, so you can select an edit command using this menu. 3.7.
CHAPTER 3: WORK BENCH 3.7.5 Printing The document in the [Edit] window can be printed out. The [Print...], [Print Preview] and [Page Setup...] commands are provided in the [File] menu. The [Print] button can also be used. They have the same function as those of standard Windows application. Select one after activating the [Edit] window of the document to be printed. 3.
CHAPTER 3: WORK BENCH To invoke only the assembler, select [Assemble] from the [Build] menu or click the [Assemble] button after activating the [Edit] window of the source to be assembled. [Assemble] button 3.8.3 Debugging To debug the generated executable file, select [Debug] from the [Build] menu or click the [Debug] button. [Debug] button The debugger starts up with the specified ICE parameter file and then loads the executable object by the command file generated from the work bench.
CHAPTER 3: WORK BENCH 3.8.4 Executing Other Tools The HEX converter and disassembler can be invoked independently. The mask data creation tools can also be invoked from wb63. HEX converter To invoke the HEX converter, select [HEX converter...] from the [Tools] menu or click the [HEX convert] button. [HEX convert] button Then select an absolute object file to be converted in the [Hex data convert] dialog box. This dialog box allows selection of the HEX converter options.
CHAPTER 3: WORK BENCH Disassembler To invoke the disassembler, select [Disassembler...] from the [Tools] menu or click the [Disassemble] button. [Disassemble] button Then select the executable object file to be disassembled in the [Disassemble] dialog box. This dialog box allows selection of the disassembler options. [Output error log file] check box Select this option to generate the error log file of the disassembler. [Output Option] Select a character case option using the radio buttons.
CHAPTER 3: WORK BENCH 3.9 Tool Option Settings The development tools have startup options that can be specified when invoking them. These settings can be made in the [Settings] dialog box that appears by selecting [Settings...] from the [Build] menu. Click the tool name tab to view option settings of each tool. Clicking the [OK] button updates option setting information in the project and then closes the dialog box. To continue to select other tool options, click the [Apply] button.
CHAPTER 3: WORK BENCH The edit box shows the default setting ([Default]) and the list of source files in the project. The default setting applies to all the sources excluding ones that are specified independently. To select options of a specific source, select the check box at the front of the source file name. Check here → ■ sub.s No No No Each of the [Error file], [Debug info] and [List file] options is set to either "No" or "Yes" and it toggles by double-clicking.
CHAPTER 3: WORK BENCH Symbol definition To define a symbol, click the [New] button and then enter the symbol name and address in the edit box. Symbol [ ] Addr [ ] ← Enter a symbol name and the address. To modify a symbol name or address, double click the name or the address in the edit box and then enter a new name or address. Symbol TEST Addr 0x0000 ← Double-click to modify. To delete a symbol, highlight the symbol line by clicking and then click the [Delete] button.
CHAPTER 3: WORK BENCH 3.9.3 Debugger Options [COM Port:] list box Select a COM port of the personal computer used to communicate with the ICE. COM1 is set by default. [bps:] list box Select a baud rate to communicate with the ICE. 9600 bps is set by default. [Initial Command:] edit box This box is used to edit the debugger commands to be executed when the debugger starts up. The work bench generates a command file with the commands entered in this box and specifies it when invoking the debugger.
CHAPTER 3: WORK BENCH 3.10 Work Bench Options [Options...] in the [Tools] menu allows selection of some options for customizing the work bench. When this menu item is selected, a dialog box appears. File menu options [MRU Files:] box This option allows selection of a number of recently used files to be listed in the [File] menu. The selectable range is 0 to 9. [MRU Projects:] box This option allows selection of a number of recently used project files to be listed in the [File] menu.
CHAPTER 3: WORK BENCH 3.
CHAPTER 3: WORK BENCH 3.13 Precautions (1) The source file that can be displayed and edited in the work bench is limited to 16M byte size. (2) The label search and coloring function of the work bench does not support labels that have not ended with a colon (:). (3) The work bench can create a make, linker command and debugger command files, note, however, that these files or settings created with another editor cannot be input into the work bench.
CHAPTER 4: ASSEMBLER CHAPTER 4 ASSEMBLER This chapter describes the functions of the assembler as63 and grammar involved with the creation of assembly source files. 4.1 Functions The assembler as63 is a tool that constitutes the core of this software package. It assembles (translates) assembly source files and creates object files in the machine language. The functions and features of the assembler are summarized below: • Allows absolute and relocatable sections mixed in one source.
CHAPTER 4: ASSEMBLER 4.2.2 Output Files Object file File format: Binary file in relocatable IEEE-695 format File name: .o (The is the same as that of the input file, unless otherwise specified with the -o option.) Output destination: Current directory Description: File in which machine language codes are stored in a relocatable form available for the linker to link with other modules and to generate an executable absolute object.
CHAPTER 4: ASSEMBLER 4.3 Starting Method General form of command line as63 ^ [options] ^ [] ^ denotes a space. [ ] indicates the possibility to omit. Source file name In the command line, only one assembly source file can be specified at a time. Therefore, you will have to process multiple files by executing the assembler the number of times equal to the number of files to be processed. A long file name supported in Windows and a path name can be specified.
CHAPTER 4: ASSEMBLER 4.4 Messages The assembler delivers all its messages through the Standard Output (stdout). Start-up message The assembler outputs only the following message when it starts up. Assembler 63 Ver x.xx Copyright (C) SEIKO EPSON CORP. 1998-2001 End message The assembler outputs the following messages to indicate which files have been created when it ends normally. Created preprocessed source file Created relocatable object file
CHAPTER 4: ASSEMBLER 4.5 Grammar of Assembly Source Assembly source files should be created on a general-purpose editor or the source editor of the work bench. Save sources as standard text files. For the file name, a long file name supported in Windows can be specified. This section explains the rules and grammar involved with the creation of assembly source files. 4.5.1 Statements Each individual instruction or definition of an assembly source is called a statement.
CHAPTER 4: ASSEMBLER Restrictions • Only one statement can be described in one line. A description containing more than two instructions in one line will result in an error. However, a comment or a label may be described in the same line with an instruction. Example: ;OK BOOT: ld %f,0x4 ;Error BOOT: ld %f,0x4 ld %a,0x0 • One statement cannot be described in more than one line. A statement that cannot complete in one line will result in an error. Example: .word 0x0,0x1,0x2,0x3 ... OK .
CHAPTER 4: ASSEMBLER 4.5.2 Instructions (Mnemonics and Pseudo-instructions) The assembler supports all the mnemonics of the S1C63000 instruction set and the assembler pseudoinstructions. The following shows how to describe the instructions. Mnemonics An instruction is generally composed of [mnemonic] + [operand]. Some instructions do not contain an operand.
CHAPTER 4: ASSEMBLER Types of pseudo-instructions The following 25 types of pseudo-instructions are available: #include #define #macro #endm #ifdef #ifndef #else #endif #defnum .abs .align .org .code .data .bss .codeword .word .comm .lcomm .global .set .list .nolist .stabs .stabn For details of each pseudo-instruction and its functionality, refer to Section 4.7, "Assembler PseudoInstructions". Restriction The mnemonics and pseudo-instructions are all not case sensitive.
CHAPTER 4: ASSEMBLER Scope The scope is a reference range of a symbol (label). It is called local if the symbol is to be referenced within the same file, and it is called global if the symbol is to be referenced from other files. Any defined symbol's scope is local in default. To make a symbol's scope global, use the .global pseudo-instruction both in the file in which the symbol is defined and in the file that references the symbol.
CHAPTER 4: ASSEMBLER Restrictions • The maximum number of characters of a symbol is 259 (not including colon). If this number is exceeded, an error will result. • Only the following characters can be used: A–Z a–z _ 0–9 ? • A symbol cannot begin with a numeral. Examples: ;OK FOO: L1: .set IO 0xfff0 .comm BUF 4 ;Error 1lable: L 1: .set #IO .lcomm 1st_BUF 0xfff0 2 • Since symbols are case sensitive by default, uppercase and lowercase are discriminated.
CHAPTER 4: ASSEMBLER 4.5.6 Register Names The CPU register names may be written in either uppercase or lowercase letters. Table 4.5.6.
CHAPTER 4: ASSEMBLER Other numerical notations The following numerical notations can also be used: nnnnB: Binary numbers nnnnO: Octal numbers nnnnQ: Octal numbers nnnnH: Hexadecimal numbers "nnnnB" (binary numbers) and "nnnnH" (hexadecimal numbers) are converted into the new format ("0bnnnn" and "0xnnnn") in the preprocessing stage. "nnnnO" and "nnnnQ" (octal numbers) are converted into hexadecimal numbers ("0xnnnn") in the preprocessing stage.
CHAPTER 4: ASSEMBLER Relational operators == Equal != Not equal < Less than <= Less than or equal > Greater than >= Greater than or equal && AND || OR Examples SW==0 SW!=0 ABC<5 ABC<=5 ABC>5 ABC>=5 ABC&&0xf ABC||0b1010 The relational operator returns 1 if the expression is true, otherwise it returns 0. Priority The operators have the priority shown below. If there are two or more operators with the same priority in an expression, the assembler calculates the expression from the left. 1. 2. 3. 4. 5. 6.
CHAPTER 4: ASSEMBLER Precautions • Minus numbers -1 to -32768 are handled as 0xffff to 0x8000. • The assembler handles expressions as 16-bit data. Pay attention to the data size when using it as 4-bit immediate data, especially when it has a minus value. Example: ld %a,-2+1 ... NG. It will be expanded as "ld a,0xffff". ld %a,(-2+1)&0xf ... OK. It will be expanded as "ld a,0xf". • Expressions are calculated with a sign (like a signed short in C language).
CHAPTER 4: ASSEMBLER 4.6 Section Management 4.6.1 Definition of Sections The memory configuration of the S1C63 Family microcomputer is divided into a code ROM that contains programs written, and data memories such as data RAM and I/O memory. Moreover, some models carry a data ROM that holds static data written. A section refers to an area where codes are written (or to be mapped), and there are three types of sections in correspondence with the memories: 1. CODE section 2. DATA section 3.
CHAPTER 4: ASSEMBLER 4.6.3 Sample Definition of Sections : CODE1 (Relocatable program) : .data : DATA1 (Relocatable data definition) : .bss : BSS1 (Relocatable RAM area definition) : .code .org 0x0 ... If this specification is omitted, a CODE section begins from the address following CODE1. : CODE2 (Absolute program) : .bss .org 0x0 ... If this specification is omitted, a BSS section begins from the address following BSS1. : BSS2 (Absolute RAM area definition) : .code : CODE3 (Relocatable program) : .
CHAPTER 4: ASSEMBLER 4.7 Assembler Pseudo-Instructions The assembler pseudo-instructions are not converted to execution codes, but they are designed to control the assembler or to set data. For discrimination from other instructions, all the assembler pseudo-instructions begin with a character "#" or ".". The instructions that begin with "#" are preprocessed pseudo-instructions and they are expanded into forms that can be assembled. The expanded results are delivered in the preprocessed file (.ms).
CHAPTER 4: ASSEMBLER 4.7.1 Include Instruction (#include) The include instruction inserts the contents of a file in any location of a source file. It is useful when the same source is shared in common among several source files. Instruction format #include "" • A drive name or path name can as well be specified as the file name. • One or more spaces are necessary between the instruction and the "". • Character case is ignored for both #include itself and "".
CHAPTER 4: ASSEMBLER 4.7.2 Define Instruction (#define) Any substitute character string can be left defined as a Define name by the define instruction (#define), and the details of that definition can be referred to from various parts of the program using the Define name. Instruction format #define [] : • The first character is limited to a–z, A–Z, ? and _. • The second and the subsequent characters can use a–z, A–Z, 0–9, ? and _.
CHAPTER 4: ASSEMBLER Precautions • The assembler only permits backward reference of a Define name. Therefore the name definition must precede the use of it. • Once a Define name is defined, it cannot be canceled. However, redefinition can be made using another Define name. Example: #define XL %xl #define Xlow XL ldb [Xlow],%ba ... Expanded to "ldb [%xl],%ba". • When the same Define name is defined duplicatedly, a warning message will appear.
CHAPTER 4: ASSEMBLER 4.7.3 Numeric Define Instruction (#defnum) Instruction format #defnum Function The #defnum pseudo-instruction is provided for compatibility with the older assembler. In the older assembler, #defnum is required to define a numeric constant, while #define is for defining a string. In the new assembler, there is no need to differentiate between a numeric constant and a string. Therefore the new assembler should use the #define instruction.
CHAPTER 4: ASSEMBLER 4.7.4 Macro Instructions (#macro ... #endm) Any statement string can be left defined as a macro using the macro instruction (#macro), and the content of that definition can be invoked from different parts of the program with the macro name. Unlike a subroutine, the part that is invoking a macro is replaced with the content of the definition. Instruction format #macro [] [,] ...
CHAPTER 4: ASSEMBLER Expansion rules When a defined macro name appears in the source, the assembler inserts a statement string defined in that location. If there are actual parameters described in that process, the dummy parameters will be replaced with the actual parameters in the same order as the latter are arranged. The internal branch labels are replaced, respectively, with __L0001 ... from top of the source in the same order as they appear.
CHAPTER 4: ASSEMBLER 4.7.5 Conditional Assembly Instructions (#ifdef ... #else ... #endif, #ifndef... #else ... #endif) A conditional assembly instruction determines whether assembling should be performed within the specified range, dependent on whether the specified name (Define name) is defined or not. Instruction formats Format 1) #ifdef [#else ] #endif If the name is defined, will be subjected to the assembling.
CHAPTER 4: ASSEMBLER Expansion rule A statement string subjected to the assembling is expanded according to the expansion rule of the other preprocessing pseudo-instructions. (If no preprocessing pseudo-instruction is contained, the statement will be output in a file as is.) Precaution A name specified in the condition is evaluated with discrimination between uppercase and lowercase. When assembling with the "-c" option, all symbols are case insensitive.
CHAPTER 4: ASSEMBLER 4.7.6 Section Defining Pseudo-Instructions (.code, .data, .bss) The section defining pseudo-instructions define one related group of codes or data and make it possible to relocate by the groups at the later linking stage. Even if these section defining pseudo-instructions are not used, the section kind will be automatically judged by its contents (however, a warning occurs).
CHAPTER 4: ASSEMBLER .bss pseudo-instruction Instruction format .bss Function Declares the start of a BSS section. Statements following this instruction are assembled as those to be mapped in the RAM, until another section is declared. Precautions • In a BSS section, nothing else other than the .comm, .lcomm, and .org pseudo-instructions, symbols, and comments can be described. • A BSS section can be divided among multiple locations of a source file for purpose of definition (describing the .
CHAPTER 4: ASSEMBLER 4.7.7 Location Defining Pseudo-Instructions (.org, .align) The absolute addressing pseudo-instructions (.align and .org) work to specify absolute location of a section in different precision such as 2n words alignment level and complete absolute address level. .org pseudo-instruction Instruction format .org
: Absolute address specification • Only decimal, binary and hexadecimal numbers can be described.CHAPTER 4: ASSEMBLER • If the .org pseudo-instruction is defined immediately before a section definer (.code, .data or .bss), it does not start a new section and makes no effect to the following sections. Example: .code ... The latest relocatable section definition. : .org 0x100 ... This does not start a new absolute section and makes no effect. .bss ... The another kind (BSS) of section which is not affected by the : previous ".org" pseudo-instruction in the CODE section. .code ...
CHAPTER 4: ASSEMBLER .align pseudo-instruction Instruction format .align : Word alignment in 2n value • Only decimal, binary and hexadecimal numbers can be described. • The alignment that can be specified is a 2n value. • One or more spaces or tabs are necessary between the instruction and the alignment number. Sample description: .code .align 32 ... Sets the location to the next 32-word boundary address.
CHAPTER 4: ASSEMBLER 4.7.8 Absolute Assembling Pseudo-Instruction (.abs) Instruction format .abs Function The .abs pseudo-instruction is provided for compatibility with the older assembler. In the older assembler, this pseudo-instruction is required to specify that a source file uses absolute sections as opposed to relocatable sections. It is not necessary to use this instruction in the new assembler, because the new assembler allows the use of absolute and relocatable sections in one source file.
CHAPTER 4: ASSEMBLER 4.7.9 Symbol Defining Pseudo-Instruction (.set) Instruction format .set [,] : Symbols for value reference • The 1st character is limited to a–z, A–Z, ? and _. • The 2nd and the subsequent character can use a–z, A–Z, 0–9, ? and _. • Uppercase and lowercase are discriminated. When assembling with the "-c" option, all symbols are case insensitive. • One or more spaces, or tabs are necessary between the instruction and the symbol.
CHAPTER 4: ASSEMBLER 4.7.10 Data Defining Pseudo-Instructions (.codeword, .word) .codeword pseudo-instruction Instruction format .codeword [, ...,] : 13-bit data • Only decimal, binary and hexadecimal numbers can be described. • The data that can be specified are from 0 to 8,191 (0x1fff). • One or more spaces or tabs are necessary between the instruction and the first data. • A comma (,) is necessary between one data and another. Sample description: .code .
CHAPTER 4: ASSEMBLER 4.7.11 Area Securing Pseudo-Instructions (.comm, .lcomm) Instruction format .comm .lcomm [,] [,] : Symbols for data memory access (address reference) • The 1st character is limited to a–z, A–Z, ? and _. • The 2nd and the subsequent character can use a–z, A–Z, 0–9, ? and _. • Uppercase and lowercase are discriminated. When assembling with the "-c" option, all symbols are case insensitive.
CHAPTER 4: ASSEMBLER 4.7.12 Global Declaration Pseudo-Instruction (.global) Instruction format .global : Symbol to be defined in the current file, or symbol already defined in other module • One or more spaces or tabs are necessary between the instruction and the symbol. Sample description: .global GENERAL_SUB1 Function Makes global declaration of a symbol.
CHAPTER 4: ASSEMBLER 4.7.15 Comment Adding Function The preprocessing pseudo-instructions that begin with "#" are all expanded to codes that can be assembled, and delivered in the preprocessed file. Even after that, those instructions are rewritten with comments beginning with a semicolon (;), so that the original instructions can be identified. However, note that the replacements of Define names will not subsist as comments. The comment is added to the first line following the expansion.
CHAPTER 4: ASSEMBLER 4.8 Relocatable List File The relocatable list file is an assembly source file that carries assembled results (offset addresses and object codes) added to the first half of each line. It is delivered only when the start-up option (-l) is specified. Its file format is a text file, and the file name, .lst. (The is the same as that of the input source file.) The format of each line of the assembly list file is as follows: Line No.
CHAPTER 4: ASSEMBLER 4.9 Sample Executions Command line C:\EPSON\S1C63\bin\as63 -g -e -l main.s Assembly source file ; main.s ; AS63 test program (main routine) ; ;***** INITIAL SP1 & SP2 ADDRESS DEFINITION ***** #ifdef SMALL_RAM .set SP1_INIT_ADDR 0xb #else .set SP1_INIT_ADDR 0x4b #endif .set SP2_INIT_ADDR 0x1f ;SP1 init addr = 0x2c ;SP1 init addr = 0x12c ;SP2 init addr = 0x1f ;***** NMI & BOOT, LOOP ***** .global INIT_RAM_BLK1 .global INC_RAM_BLK1 .org 0x100 calr reti INIT_RAM_BLK1 .
CHAPTER 4: ASSEMBLER Preprocessed file .stabs "C:\EPSON\S1C63\Test\main.s", FileName ; main.s ; AS63 test program (main routine) ; ;***** INITIAL SP1 & SP2 ADDRESS DEFINITION ***** ;#ifdef SMALL_RAM ; .set SP1_INIT_ADDR 0xb ;#else .set SP1_INIT_ADDR 0x4b ;#endif .set SP2_INIT_ADDR 0x1f ;SP1 init addr = 0x2c ;SP1 init addr = 0x12c ;SP2 init addr = 0x1f ;***** NMI & BOOT, LOOP ***** .global INIT_RAM_BLK1 .global INC_RAM_BLK1 .org 0x100 NMI: .stabn 23, LineInfo calr INIT_RAM_BLK1 .stabn 24, LineInfo reti .
CHAPTER 4: ASSEMBLER Assembly list file Assembler 63 ver x.xx Relocatable List File MAIN.LST Mon Jan 15 12:40:41 2001 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: ; main.s ; ASM63 test program (main routine) ; ;***** INITIAL SP1 & SP2 ADDRESS DEFINITION ***** #ifdef SMALL_RAM .set SP1_INIT_ADDR 0xb #else .set SP1_INIT_ADDR 0x4b #endif .
CHAPTER 4: ASSEMBLER 4.10 Error/Warning Messages 4.10.1 Errors When an error occurs, no object file will be generated. The assembler error messages are delivered/displayed in the following format: () Error : Example: TEST.S(431) Error: Illegal syntax ∗ Some error messages are displayed without a line number.
CHAPTER 4: ASSEMBLER 4.10.2 Warning When a warning occurs, the assembler will keep on processing, and terminates the processing after displaying a warning message, unless an error is produced. The warning message is delivered/displayed in the following formats: () Warning : Example: TEST.
CHAPTER 5: LINKER CHAPTER 5 LINKER This chapter describes the functions of the linker, lk63. 5.1 Functions The linker lk63 is a software that generates executable object files. It provides the following functions: • • • • Puts together multiple object modules to create one executable object file. Resolves external reference from one module to another. Relocates relative addresses to absolute addresses.
CHAPTER 5: LINKER 5.2.2 Output Files An output file name can be specified in the command line or command file using the -o start-up option. If no output file name is specified, the same name as that of the relocatable object file to be linked first is used. Absolute object file File format: Binary file in IEEE-695 format File name: .abs Output destination: Current directory Description: Object file in executable format that can be input to the debugger.
CHAPTER 5: LINKER 5.3 Starting Method General form of command line lk63 ^ [Options] ^ [] ^ [] ^ ^ denotes a space. [ ] indicates the possibility to omit. The order of options and file names can be arbitrary. File names Files are identified with their extensions. Therefore, an appropriate extension should be included in each file name. However, the extension ".o" of the relocatable object file can be omitted.
CHAPTER 5: LINKER -e Function: Output of error file Explanation: Creates an .err file which contains the information that the linker outputs to the Standard Output (stdout), such as error messages. Default: If this option is not specified, no error file will be created. -g Function: Addition of debugging information Explanation: • Creates an absolute object file containing debugging information.
CHAPTER 5: LINKER -bss
Function: Set up of a relocatable BSS section start address Explanation: • Sets the absolute start address of a relocatable BSS section. Absolute sections remain unaffected. • BSS sections are mapped in succession from this address, unless otherwise specified. • One or more spaces or tabs are necessary between -bss and . • The address should be described in hexadecimal format (0xnnnn).CHAPTER 5: LINKER 5.4 Messages The linker delivers all its messages to the Standard Output (stdout). Start-up message The linker outputs only the following message when it starts up. Linker 63 Ver x.xx Copyright (C) SEIKO EPSON CORP. 1998-2001 End message The linker outputs the following messages to indicate which files has been created when it ends normally. Created Created Created Created Created Created absolute object file absolute list file map file
CHAPTER 5: LINKER 5.5 Linker Command File To simplify the keystroke in the command line at the time of start up, execute the link processing through the linker by inputting a linker command file (.cm) that holds the necessary specifications (any options and file names) described. Sample linker command file -e ; Generate error file -g ; Add debug information -code 0x0100 ; Fix CODE section start address -rcode test2.o = 0x0110 ; Fix CODE section start position of test2.
CHAPTER 5: LINKER 5.6 Link Map File The link map file serves to refer to the mapping information for the modules of each section. It is output if the -m option is specified. The file format is a text file, and its file name is ".map". ( is the same as that of the output object file.) Sample link map file Linker 63 ver x.xx Link map file TEST.MAP Mon Jan 15 12:40:41 2001 CODE section map of TEST.
CHAPTER 5: LINKER 5.7 Symbol File The symbol file serves to refer to the symbols defined in all the modules and their address information. It is delivered if the -s start-up option is specified. The file format is a text file, and its file name is ".sym". ( is the same as that of the output object file.) Sample symbol file Linker 63 ver x.xx Symbol file TEST.SYM Mon Jan 15 12:40:41 2001 CODE section labels of TEST.ABS Address Type File Symbol 0x0110 Local "MAIN.O" ....
CHAPTER 5: LINKER 5.8 Absolute List File The absolute list file is an assembly source file that carries the absolute addresses and object codes added to the first half of each line. It is delivered only when the -l option is specified. Its file format is a text file, and the file name is .als. (The is the same as that of the output object file.
CHAPTER 5: LINKER 5.9 Cross Reference File The cross reference file enumerates all the address labels with their absolute addresses and all the addresses where the address labels are referred to. It is delivered only when the -x option is specified. Its file format is a text file, and the file name is .xrf. (The is the same as that of the output object file.) Sample cross reference file Linker 63 ver x.xx Cross reference file TEST.
CHAPTER 5: LINKER 5.10 Linking Linking rules The linking process takes place in conformity with the following rules: • Absolute sections are mapped ahead of relocatable sections, according to the absolute addresses which were defined at the time of assembling. If an absolute section exceeds the available memory area, an error will occur. • The relocatable sections in the file of which the section start address was specified with an option (-rcode, -rdata, -rbss) are mapped from the specified address.
CHAPTER 5: LINKER test1.o CODE1 CODE2 DATA1 BSS1 BSS2 test.abs 0x0000 0x0100 0x0110 (relocatable) (absolute 0x0100–) (relocatable) (relocatable) (absolute 0xf000–) CODE2 0x00ff 0x010f CODE3 Code ROM area CODE4 test2.
CHAPTER 5: LINKER 5.11 Branch Optimization Function The PC relative branch instructions (jr, jrc, jrnc, jrz, jrnz and calr) need an address extension instruction (ldb %ext, imm8) when the relative distance to the destination address exceeds the -127 to 128 range. Since the location of relocatable sections is not decided until the linking process is completed, the linker has a function that automatically inserts, removes or corrects the extension codes.
CHAPTER 5: LINKER 5.12 Error/Warning Messages 5.12.1 Errors When an error occurs, the linker will immediately terminate the processing after displaying an error message. No object file will be output. Other files will be delivered only in the part which was processed prior to the occurrence of the error. The error messages are given below.
CHAPTER 5: LINKER 5.13 Precautions (1) Upper limits, such as a maximum section count and the number of objects to be linked, depend on the free memory space. (2) To load the absolute object file created by the linker to the debugger, the same ICE parameter file must be specified when the debugger is invoked.
CHAPTER 6: HEX CONVERTER CHAPTER 6 HEX CONVERTER This chapter describes the functions of hex converter, hx63. 6.1 Functions The hex converter hx63 converts an absolute object file in IEEE-695 format output from the linker into a hex file in Motorola-S format or Intel-HEX format. This conversion is needed when debugging the program with the ROM or when creating mask data using the mask data checker. When creating the ROM-image hex data, the hex converter fills the unused area of each model with 0xff. 6.
CHAPTER 6: HEX CONVERTER 6.3 Starting Method General form of command line hx63 ^ [Options] ^ ^ ^ denotes a space. [ ] indicates the possibility to omit. The order of options and file names can be arbitrary. File names Absolute object file: .abs ICE parameter file: .par The extension of an absolute object file can be omitted. The ICE parameter file must be specified with its extension.
CHAPTER 6: HEX CONVERTER 6.4 Messages The hex converter delivers all its messages via the Standard Output (stdout). Start-up message The hex converter outputs only the following message when it starts up. Hex converter 63 Ver x.xx Copyright (C) SEIKO EPSON CORP. 1998-2001 End message The hex converter outputs the following messages to indicate which files have been created when it ends normally. Created Created Created Created hex file .HSA NAME>.
CHAPTER 6: HEX CONVERTER 6.5 Output Hex Files 6.5.1 Hex File Configuration Since each S1C63000 instruction has a 13-bit code, the hex converter always generates two hex files for the high-order data and the low-order data of the program code. The low-order data hex file (".lsa" or "l.hex") contains the low-order bytes (bits 7 to 0) of the object codes. The high-order data hex file (".hsa" or "h.hex") contains the high-order bytes (bits 12 to 8 suffixed by high-order bits 0b000).
CHAPTER 6: HEX CONVERTER 6.5.3 Intel-HEX Format The hex converter converts an absolute object file in the IEEE-695 format into the Intel-HEX format files when the -i option is specified. The files are generated with a name "h.hex" for the high-order program file, "l.hex" for the low-order program file and "c.hex" for the data ROM file.
CHAPTER 6: HEX CONVERTER 6.6 Error/Warning Messages 6.6.1 Errors When an error occurs, the hex converter immediately terminates the processing after displaying an error message. It will not output hex files. The hex converter error messages are given below.
CHAPTER 7: DISASSEMBLER CHAPTER 7 DISASSEMBLER This chapter describes the functions of the disassembler, ds63. 7.1 Functions The disassembler's input is an object in IEEE-695 or Motorola-S format. The code in the object file is disassembled into mnemonics, and output as a source file. The restored source file can be processed in the assembler/linker/hex converter to obtain the same object or hex file. 7.2 Input/Output Files from Linker IEEE-695 absolute object file file.abs from Hex converter file.
CHAPTER 7: DISASSEMBLER 7.3 Starting Method General form of command line ds63 ^ [Options] ^ ^ denotes a space. [ ] indicates the possibility to omit. File names Absolute object file: .abs Motorola-S files: .hsa, .lsa, .csa The input file must be specified with its extension. The Motorola-S file can be specified with either ".hsa", ".lsa" or ".csa" as the extension. The other unspecified files will be automatically loaded.
CHAPTER 7: DISASSEMBLER 7.4 Messages The disassembler delivers all its messages via the Standard Output (stdout). Start-up message The disassembler outputs the following message when it starts up. Disassembler 63 Ver x.xx Copyright (C) SEIKO EPSON CORP. 1998-2001 End message The disassembler outputs the following messages to indicate which files have been created when it ends normally. Created preprocessed source file .MS Created error log file DS63.
CHAPTER 7: DISASSEMBLER 7.5 Disassembling Output The data/code mnemonics are restored from the target code. As for the branch instructions, a label will be automatically generated such as "CODEx:" where "x" denotes a hexadecimal number string. Other reference symbols will also be generated as "LABELx", "IOx" and "RAMx". The ".org" pseudo-instruction is used to specify the starting location of each code block. The following shows examples of disassembled sources: Sample outputs Absolute list file "test.
CHAPTER 7: DISASSEMBLER 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: .org 0x110 BOOT: 0110 0111 0112 0113 0114 0115 094b 1fc4 091f 1fc6 08fe 02ea ldb %ba,SP1_INIT_ADDR ldb %sp1,%ba ldb %ba,SP2_INIT_ADDR ldb %sp2,%ba ldb ext,fe calr INIT_RAM_BLK1 (+) ; set SP1 ; set SP2 ; initialize RAM block 1 LOOP: 0116 0117 0118 08fe 02ef 00fd (+) ldb ext,fe calr INC_RAM_BLK1 jr LOOP ; increment RAM block 1 ; infinity loop Output source file "test.ms" (default) ;Disassembler 63 Ver x.
CHAPTER 7: DISASSEMBLER adc [%x]+,0x0 adc [%x],0x0 ret .code .org 0x100 ldb %ext,code1@rh calr code1@rl reti .code .org 0x110 ldb %ba,label3@l ldb %sp1,%ba ldb %ba,label4@l ldb %sp2,%ba ldb %ext,code1@rh calr code1@rl code3: ldb %ext,code2@rh calr code2@rl jr code3@rl Output source file "test.ms" (when -cu is specified) ;Disassembler 63 Ver x.xx Assembly source file TEST.MS Mon Jan 15 13:10:20 2001 .SET LABEL1 0X4 .SET LABEL2 0X4 .SET LABEL3 0X4B .SET LABEL4 0X1F .CODE .
CHAPTER 7: DISASSEMBLER 7.6 Error/Warning Messages 7.6.1 Errors When an error occurs, the disassembler immediately terminates the processing after displaying an error message. It will not output a source file. The disassembler error messages are given below.
CHAPTER 8: DEBUGGER CHAPTER 8 DEBUGGER This chapter describes how to use the Debugger db63. 8.1 Features The Debugger db63 is used to debug a program after reading an object file in the IEEE-695 format that is generated by the linker. It has the following features and functions: • Various data can be referenced at the same time using multiple windows. • Frequently used commands can be executed from tool bars and menus using a mouse.
CHAPTER 8: DEBUGGER Source file File format: Text file File name: .s Description: This is the source file of the above object file. It is read when the debugger performs source display. Program file File format: HEX file in Motorola-S format File name: .hsa, .lsa Description: This is a load image file of the program ROM, and is read into the debugger by the lo command. The file ".hsa" corresponds to the 5 high-order bits of the program code and the file ".
CHAPTER 8: DEBUGGER 8.3 Starting Method 8.3.1 Start-up Format General form of command line db63 ^ ^ [start-up option] ^ denotes a space. [ ] indicates the possibility to omit. Note: The parameter file will be recognized by its extension ".par", so ".par" must be included in the parameter file name to be specified. 8.3.2 Start-up Options The debugger has three start up options available. Function: Specifies a command file.
CHAPTER 8: DEBUGGER 8.3.3 Start-up Messages When the debugger starts up, it outputs the following message in the [Command] window. (Refer to the next section for details about windows.) Debugger63 Ver x.xx Copyright SEIKO EPSON CORP. 1998-2001 Connecting COMx with xxxxx baud rate ... done Parameter file name : xxxxxxxx.par Version : xx Chip name : 63xxx CPU version : x.x PRC board version : x.x LCD board version : x.x EXT board version : x.x ICE hardware version : x.x ICE software version : x.
CHAPTER 8: DEBUGGER If this test indicates that the ICE is not in ready state, the debugger performs the following: When the ICE is executing the target program: In this case, the debugger sends a forcible break command to the ICE; it then retests the connection of the ICE several seconds later. When the ICE is in the BUSY state: In this case, the debugger will try to retest the connection with the ICE several seconds later.
CHAPTER 8: DEBUGGER (3) ICE initialization When the above tests are finished, the debugger initializes the ICE as follows: • Mapping (memory configuration is set according to the parameter file) • Initializing mapped memory (RAM: 0xa; code ROM: 0x1fff; data ROM: 0xf) • Initializing option data (cleared to 0) • Initializing break conditions (all break conditions are cleared) • Initializing trace conditions (normal trace is set and the trace trigger point is set to 0) • Setting execution cycles counter to 0.
CHAPTER 8: DEBUGGER 8.4 Windows This section describes the types of windows used by the debugger. 8.4.1 Basic Structure of Window The diagram below shows the window structure of the debugger. [Source] window [Trace] window [Command] window [Register] window [Data] window Depending on the computer used, the windows may differ from the above display depending on the screen resolution, the number of dots in system font, etc. Adjust the size of each window to suit needs.
CHAPTER 8: DEBUGGER Features common to all windows (1) Open/close and activating a window All windows except [Command] can be closed or opened. To open a window, select the window name from the [View] menu. To close a window, click the [Close] box on the window. After initialization, the state of the screen including the position and size of the windows will return to the same as the last time the debugger was terminated. The opened windows are listed in the [Window] menu.
CHAPTER 8: DEBUGGER 8.4.2 [Command] Window The [Command] window is used to do the following: (1) Entering debug commands When the prompt ">" appears in the [Command] window, the system will accept a command entered from the keyboard. If some other window is selected, click on the [Command] window. A cursor will blink at the prompt, indicating that readiness to input a command. (Refer to Section 8.7.1, "Entering Commands from Keyboard".
CHAPTER 8: DEBUGGER 8.4.3 [Source] Window The [Source] window displays the contents of (1) to (4) listed below. This window also allows breakpoints to be set and words or labels to be found. (1) Unassembled codes and source codes You can choose one of the following three display modes: [Mix] button [Source] button 1.
CHAPTER 8: DEBUGGER ∗ Updating of display When a program is loaded and executed (g, gr, s, n, or rst command), or the memory contents are changed (a (as), pe, pf, or pm command), the display contents are updated. In this case the [Source] window updates its display contents so that the current PC address can always be displayed. The display contents are also updated when the display mode is changed.
CHAPTER 8: DEBUGGER 8.4.4 [Data] Window (1) Displaying data memory contents The [Data] window displays the memory dump results in hexadecimal numbers. The display area is the entire 64K-word data memory space (RAM, data ROM, I/O). The contents of all addresses from 0x0000 to 0xffff can be displayed by scrolling the window. The contents of unmapped addresses in each microcomputer model are indicated by an "∗".
CHAPTER 8: DEBUGGER 8.4.6 [Trace] Window The [Trace] window displays the trace result up to 8,192 cycles by reading it from the ICE trace memory. The following lists the trace contents: • Traced cycle number • Fetched address • Fetched code and disassembled contents • Register contents (A, B, X, Y, and flags) • Memory access status (address, R/W, data, and SP1/SP2) • TRCIN pin input status This window also displays the trace data search results by the ts command.
CHAPTER 8: DEBUGGER 8.5 Tool Bar This section outlines the tool bar available with the debugger. 8.5.1 Tool Bar Structure The tool bar has 14 buttons, each one assigned to a frequently used command. The specified function is executed when you click on the corresponding button. 8.5.2 [Key Break] Button This button forcibly breaks execution of the target program. This function can be used to cause the program to break when the program has fallen into an endless loop. 8.5.
CHAPTER 8: DEBUGGER [Go from Reset] button This button resets the CPU and then executes the target program from the program start address (0x110). It performs the same function when the gr command is executed. [Step] button This button executes one instruction step at the address indicated by the current PC. It performs the same function when the s command is executed. [Next] button This button executes one instruction step at the address indicated by the current PC.
CHAPTER 8: DEBUGGER 8.6 Menu This section outlines the menu bar available with the debugger. 8.6.1 Menu Structure The menu bar has eight menus, each including frequently-used commands. 8.6.2 [File] Menu [Load File...] This menu item reads an object file in the IEEE-695 format into the debugger. It performs the same function when the lf command is executed. [Load Option...] This menu item reads a program file, data file for the data ROM or an optional HEX file in Motorola-S format into the debugger.
CHAPTER 8: DEBUGGER [Command File...] This menu item reads a command file and executes the debug commands written in that file. It performs the same function when the com or cmw command is executed. [Reset CPU] This menu item resets the CPU. It performs the same function when the rst command is executed. 8.6.4 [Break] Menu [Breakpoint Set...] This menu item displays, sets or clears PC breakpoints using a dialog box. It performs the same function as executing the bp command. [Data Break...
CHAPTER 8: DEBUGGER 8.6.6 [View] Menu [Command] This menu item activates the [Command] window. [Program] This menu item opens or activates the [Source] window and displays the program from the current PC address in the display mode selected from the sub menu items. These sub menu items perform the same functions as executing the u, sc, and m command, respectively. [Data Dump] This menu item opens or activates the [Data] window and displays the data memory contents from the memory start address.
CHAPTER 8: DEBUGGER 8.7 Method for Executing Commands All debug functions can be performed by executing debug commands. This section describes how to execute these commands. Refer to the description of each command for command parameters and other details. To execute a debug command, activate the [Command] window and input the command from the keyboard. The menu and tool bar can be used to execute frequently-used commands. 8.7.
CHAPTER 8: DEBUGGER • Commands that replace existing data after confirmation The commands that rewrite memory or register contents one by one provide the option of skipping guidance (do not modify the contents), returning to the immediately preceding guidance, or terminating during the input session. [Enter] key ......... Skips input. [^] key ................ Returns to the immediately preceding guidance. [q] key ................ Terminates the input session.
CHAPTER 8: DEBUGGER 8.7.2 Executing from Menu or Tool Bar The menu and tool bar are assigned frequently-used commands as described in Sections 8.5 and 8.6. A command can be executed simply by selecting desired menu command or clicking on the tool bar button. Table 8.7.2.1 lists the commands assigned to the menu and tool bar. Table 8.7.2.
CHAPTER 8: DEBUGGER 8.7.3 Executing from a Command File Another method for executing commands is to use a command file that contains descriptions of a series of debug commands. By reading a command file into the debugger the commands written in it can be executed. Creating a command file Create a command file as a text file using an editor. Although there are no specific restrictions on the extension of a file name, Seiko Epson recommends using ".cmd".
CHAPTER 8: DEBUGGER 8.7.4 Log File The executed commands and the execution results can be saved to a file in text format that is called a "log file". This file allows verification of the debug procedures and contents. The contents displayed in the [Command] window are saved to this file. Command example >log tst.
CHAPTER 8: DEBUGGER 8.8 Debug Functions This section outlines the debug features of the debugger, classified by function. Refer to Section 8.9, "Command Reference" for details about each debug command. 8.8.1 Loading Program and Data Files Loading files The debugger can read a file in IEEE-695 format or Motorola-S format in the debugging process. Table 8.8.1.1 lists the files that can be read by the debugger and the load commands. Table 8.8.1.1 Files and load commands File type IEEE-695 Data type Ext.
CHAPTER 8: DEBUGGER 8.8.2 Source Display and Symbolic Debugging Function The debugger allows program debugging while displaying the assembly source statements. Address specification using a symbol name is also possible. Displaying program code The [Source] window displays the program in the specified display mode. The display mode can be selected from among the three modes: Unassemble mode, Source mode, Mix mode. Table 8.8.2.
CHAPTER 8: DEBUGGER (3) Mix mode In this mode, both unassembled codes and sources are displayed like an absolute list. This mode is available only when an absolute object file that contains source debugging information has been loaded. Refer to Section 8.4.3, "[Source] Window" for details about the display contents. Symbol reference When debugging a program after reading an object file in IEEE-695 format, the symbols defined in the source file can be used to specify an address.
CHAPTER 8: DEBUGGER 8.8.3 Displaying and Modifying Program, Data, Option Data and Register The debugger has functions to operate on the program memory, data memory, and registers, as well as option data. Each memory area is set to the debugger according to the map information that is given in a parameter file. Operating on program memory area The following operations can be performed on the program memory area: Table 8.8.3.
CHAPTER 8: DEBUGGER (3) Rewriting specified area An entire specified area is rewritten with specified data. (4) Copying specified area The content of a specified area is copied to another area. (5) Monitoring memory Four memory locations, each with area to store 4 consecutive words, can be registered as watch data addresses. The registered watch data can be verified in the [Register] window. The content of this window is updated in real time at 0.5-second intervals by the on-the-fly function.
CHAPTER 8: DEBUGGER 8.8.4 Executing Program The debugger can execute the target program successively or execute instructions one step at a time (single-stepping). Successive execution (1) Types of successive execution There are two types of successive execution available: • Successive execution from the current PC • Successive execution from the program start address (0x0110) after resetting the CPU Table 8.8.4.
CHAPTER 8: DEBUGGER Single-stepping (1) Types of single-stepping There are two types of single-stepping available: • Stepping through all instructions (STEP) All instructions are executed one step at a time according to the PC, regardless of the type of instruction.
CHAPTER 8: DEBUGGER Measuring execution cycles/execution time (1) Execution cycle counter and measurement mode The ICE contains a 31-bit execution cycle counter allowing you to measure the program execution time or the number of bus cycles executed. The measurement mode (time or bus cycle) can be selected using the md command. In the initial debugger settings, the bus cycle mode is selected.
CHAPTER 8: DEBUGGER 8.8.5 Break Functions The target program is made to stop executing by one of the following causes: • Break command conditions are satisfied. • The [Key Break] button is activated. • The ICE BRKIN pin is pulled low. • A map break or similar break occurs. Break by command The debugger has five types of break functions that allow the break conditions to be set by a command. When the set conditions in one of these break functions are met, the program under execution is made to break.
CHAPTER 8: DEBUGGER (3) Register break This break function causes a break when the A, B, F, X, and Y register reach a specified value. Each register can be masked (so they are not included in break conditions). The F register can be masked in bit units. A break occurs when the above registers are modified to satisfy all set conditions. Table 8.8.5.3 Commands/menu item to set register break Function Set register break conditions Clear register break conditions Command Menu br [Break | Register Break...
CHAPTER 8: DEBUGGER Map break and illegal instruction break The program also breaks when one of the following errors is encountered during program execution: (1) Access to undefined program area A break occurs when an undefined area of the program memory map is accessed. (2) Access to undefined data area A break occurs when an undefined area of the data memory map is accessed. (3) Write to data ROM area A break occurs when a write to the data ROM area is attempted.
CHAPTER 8: DEBUGGER 8.8.6 Trace Functions The debugger has a function to trace program execution. Trace memory and trace information The ICE contains a trace memory. When the program executes instructions in the trace range according to the trace mode, the trace information on each cycle is taken into this memory. The trace memory has the capacity to store information for 8,192 cycles, making it possible to trace up to 4,096 instructions (for two-clock instructions only).
CHAPTER 8: DEBUGGER Trace modes Three trace modes are available, depending on the method for sampling trace information. Table 8.8.6.1 Trace mode setup command Function Set trace mode Command Menu tm [Trace | Trace Mode Set...] (1) Normal trace mode In this mode, the trace information on all bus cycles is taken into the trace memory during program execution.
CHAPTER 8: DEBUGGER (3) Address-area trace In this mode, trace information is taken into the trace memory only when instructions within (or outside) a specified address range are executed. This address range can be set in up to four locations by the tm command. Whether you want trace to be performed within or outside that address range can also be specified by a command. ∗ Trace trigger address The tm command sets a trace trigger address regardless of the trace mode specified.
CHAPTER 8: DEBUGGER 8.8.7 Operation of Flash Memory The ICE in-circuit emulator contains flash memory. This memory is designed to allow data to be transferred to and from the ICE's emulation memory and the target memory by a command. The flash memory retains data even when the ICE is turned off. By writing the program and/or data under debug into the flash memory before turning off the power, you can call it up and continue debugging next time.
CHAPTER 8: DEBUGGER 8.8.8 Coverage The ICE retains coverage information (i.e., information on addresses at which a program is executed) and it can be displayed in the [Command] window. Because the executed address range is displayed as shown below, it is possible to know which areas have not been executed. Coverage Information: 0: 0110..0118 1: 0200..020f Table 8.8.8.1 Coverage commands Function Display coverage information Clear coverage information Command cv cvc 8.8.
CHAPTER 8: DEBUGGER 8.9 Command Reference 8.9.1 Command List Table 8.9.1.1 lists the debug commands available with the debugger. Table 8.9.1.
CHAPTER 8: DEBUGGER 8.9.2 Reference for Each Command The following sections explain all the commands by functions. The explanations contain the following items. Function Indicates the functions of the command. Format Indicates the keyboard input format and parameters required for execution. Example Indicates a sample execution of the command. Note Shows notes on using. GUI utility Indicates a menu item or tool bar button if they are available for the command.
CHAPTER 8: DEBUGGER 8.9.3 Program Memory Operation a / as (assemble mnemonic) Function This command assembles the input mnemonic and rewrites the corresponding code to the program memory at the specified address. Format (1) >a
[]↵ (direct input mode) (2) >a []↵ (guidance mode) Start address ? : ↵ ... Displayed only when is omitted. Address Original code Original mnemonic : ↵ ..........CHAPTER 8: DEBUGGER Notes • The a and as commands have the same function. • The start address you specified must be within the range of the program memory area available with each microcomputer model. An error results if the input one is not a hexadecimal number or not a valid symbol. Error : invalid value (no such symbol / symbol type error) An error results if the limit is exceeded. Error : Address out of range, use 0-0xXXXX • An error results if the input mnemonic is invalid for S1C63000.
CHAPTER 8: DEBUGGER pe (program memory enter) Function This command rewrites the contents of the specified address in the program memory with the input hexadecimal code. Format (1) >pe
[ [...]]↵ (direct input mode) (2) >pe []↵ (guidance mode) Program enter address ? ↵ ... Displayed only when is omitted. Address Original code : ↵ ..........
CHAPTER 8: DEBUGGER pf (program memory fill) Function This command rewrites the contents of the specified program memory area with the specified code.
CHAPTER 8: DEBUGGER pm (program memory move) Function This command copies the content of a specified program memory area to another area.
CHAPTER 8: DEBUGGER 8.9.4 Data Memory Operation dd (data memory dump) Function This command displays the content of the data memory in a 16 words/line hexadecimal dump format.
CHAPTER 8: DEBUGGER If both and are defined, the debugger displays data from to . >dd 008 017↵ 0 1 2 3 4 5 6 7 8 9 A B C D E F 0000: 0 0 0 0 0 0 0 0 0010: 0 0 0 0 0 0 0 0 > (3) During log output If a command execution is being output to a log file by the log command when you dump the data memory, data is displayed in the [Command] window even if the [Data] window is opened and are also output to the log file.
CHAPTER 8: DEBUGGER de (data memory enter) Function This command rewrites the contents of the data memory with the input hexadecimal data. Data can be written to continuous memory locations beginning with a specified address. Format (1) >de
[ [...]]↵ (direct input mode) (2) >de↵ (guidance mode) Data enter address ? : ↵ Address Original data : ↵ ..........CHAPTER 8: DEBUGGER GUI utility [Data] window The [Data] window allows direct modification of data. Click the [Data] window and select the displayed data to be modified then enter a hexadecimal number.
CHAPTER 8: DEBUGGER df (data memory fill) Function This command rewrites the contents of the specified data memory area with the specified data.
CHAPTER 8: DEBUGGER dm (data memory move) Function This command copies the contents of the specified data memory area to another area.
CHAPTER 8: DEBUGGER dw (data memory watch) Function This command registers four data memory locations as the watch data addresses. Memory contents equivalent to 4 words at each watch address are displayed in the [Register] window. Format (1) >dw [ ...
CHAPTER 8: DEBUGGER • Be aware that a value is displayed as the watch data even if the invalid address, which is displayed as an "∗" in the dd command, is registered. The value in this case is indeterminate. • The value displayed to the left shows the content of the start address, and that displayed to the right is the content of an address that is equal to the start address + 3.
CHAPTER 8: DEBUGGER 8.9.5 Command to Display Option Information od (option data dump) Function This command displays option data in the [Command] window in a hexadecimal dump format after reading it from the ICE. Option data Function option data (fog) Segment option data (sog) Melody data (mla) Target memory address range 0 to 0xef 0 to 0x1fff 0 to 0xfff Format (1) >od [ []]↵ (direct input mode) (2) >od↵ (guidance mode) 1. fog 2. sog 3. mla . . .
CHAPTER 8: DEBUGGER • Both the start and end addresses must be specified within the setup range of each option. An error results if this limit is exceeded. Error : FO address out of range, use 0-0xEF ... Specified address for the function option is outside the range. Error : SO address out of range, use 0-0x1FFF ... Specified address for the segment option is outside the range. Error : MLA address out of range, use 0-0xFFF ... Specified address for the melody data is outside the range.
CHAPTER 8: DEBUGGER 8.9.6 Register Operation rd (register display) Function This command displays the contents of the registers, execution cycle counter, and watch data. Format >rd↵ (direct input mode) Display (1) Contents of display The following lists the contents displayed by this command.
CHAPTER 8: DEBUGGER rs (register set) Function This command modifies the register values. Format (1) >rs [ [...
CHAPTER 8: DEBUGGER Notes • An error results if you input a value exceeding the register's bit width. Error : invalid value • An error results if you input a register name other than PC, A, B, X, Y, F, SP1, SP2, EXT or Q in direct input mode. Error : Incorrect register name, use PC/A/B/X/Y/F/SP1/SP2/EXT/Q • In guidance mode, the following keyboard inputs have special meaning: "q↵" … Command is terminated. (finish inputting and start execution) "^↵" … Return to previous register. "↵" … Input is skipped.
CHAPTER 8: DEBUGGER 8.9.7 Program Execution g (go) Function This command executes the target program from the current PC position. Format >g [ []]↵ (direct input mode) : Temporary break addresses; hexadecimal or symbol (IEEE-695 format only) Condition: 0 ≤ address1(2) ≤ last program memory address Operation (1) Program execution The target program is executed from the address indicated by the PC.
CHAPTER 8: DEBUGGER (4) Execution cycle counter The execution cycle counter displayed in the [Register] window indicates the number of cycles executed or the execution time of the target program. (Refer to Section 8.8.4 for details.) In the initial debugger settings, the execution cycle counter is set to hold mode so that execution time is added up until the CPU is reset.
CHAPTER 8: DEBUGGER gr (go after reset CPU) Function This command executes the target program from the boot address after resetting the CPU. Format >gr [ []]↵ (direct input mode) : Temporary break addresses; hexadecimal or symbol (IEEE-695 format only) Condition: 0 ≤ address1(2) ≤ last program memory address Operation This command resets the CPU before executing the program.
CHAPTER 8: DEBUGGER s (step) Function This command single-steps the target program from the current PC position by executing one instruction at a time. Format >s []↵ (direct input mode) : Number of steps to be executed; decimal (default is 1) Condition: 0 ≤ step ≤ 65,535 Operation (1) Step execution If the is omitted, only the program step at the address indicated by the PC is executed, otherwise the specified number of program steps is executed from the address indicated by the PC.
CHAPTER 8: DEBUGGER (4) During log mode If the program is single-stepped after turning on the log mode, the same contents as when executing the rd command are displayed in the [Command] window after each step is completed. Notes • The step count must be specified within the range of 0 to 65,535. An error results if the limit is exceeded. Error : Number of steps out of range, use 0-65535 • If the [Data] window is opened, its display contents are updated after the execution.
CHAPTER 8: DEBUGGER n (next) Function This command single-steps the target program from the current PC position by executing one instruction at a time. Format >n []↵ (direct input mode) : Number of steps to be executed; decimal (default is 1) Condition: 0 ≤ step ≤ 65,535 Operation This command basically operates in the same way as the s command. However, the calr, calz and int instructions, including all subroutines until control returns to the next address, are executed as one step.
CHAPTER 8: DEBUGGER 8.9.8 CPU Reset rst (reset CPU) Function This command resets the CPU. Format >rst↵ (direct input mode) Notes • The registers and flags are set as follows: PC: 0110 A: A B: A X: AAAA Y: AAAA EICZ: 0000 SP1: AA SP2: AA EXT: AA QUEUE: AAAA • The execution cycle counter is cleared to 0. • If the [Source] window is open, the window is redisplayed beginning with address 0x0110. If the [Register] window is open, the window is redisplayed with the above contents.
CHAPTER 8: DEBUGGER 8.9.9 Break bp (break point set) Function This command sets or clears breakpoints using a program's execution address. Format (1) >bp [ [ ... ]]↵ (direct input mode) (2) >bp↵ (guidance mode) PC break set status 1. set 2. clear 3. clear all ... ? <1 | 2 | 3>↵ ..........
CHAPTER 8: DEBUGGER GUI utility [Break | Breakpoint Set...] menu item When this menu item is selected, a dialog box appears for setting breakpoints. To set a breakpoint, select a [Set] button and enter an address in the text box corresponding to the selected button. When setting more than four breakpoints, click the [Next] button to continue settings. The [Previous] and [Next] buttons are used to view previous and subsequent four breakpoints.
CHAPTER 8: DEBUGGER bc / bpc (break point clear) Function This command clears the specified breakpoints that have been set. Format >bc [ [ . . .]]↵ (direct input mode) : Break address; hexadecimal or symbol (IEEE-695 format only) Examples >bp↵ 1: 0116 2: 0200 3: 0260 1. set 2. >bc 200↵ >bp↵ 1: 0116 2: 0260 1. set 2. >bc↵ >bp↵ No PC break 1. set 2. > ... Breakpoints that have been set. clear 3. clear all ...? ↵ ... Clears breakpoints at address 0x0200. clear 3.
CHAPTER 8: DEBUGGER bd (data break) Function This command sets or clears data break. This command allows you to specify the following break conditions: 1. Memory address range to be read or written (one area) 2. Data pattern to be read or written (bit mask possible) 3. Memory read/write (three conditions: read, write, or read or write) The program breaks after completing a memory access that satisfies the above conditions.
CHAPTER 8: DEBUGGER Notes • For the first time this command is executed, no item can be skipped because no default value is set. • In guidance mode, the following keyboard inputs have special meaning: "q↵" … Command is terminated. (finish inputting and start execution) "^↵" … Return to previous item. "↵" … Input is skipped. (keep current value) When the command is terminated in the middle of guidance by "q↵", the contents that have been input up to that time will be modified.
CHAPTER 8: DEBUGGER bdc (data break clear) Function This command clears the data break condition that has been set. Format >bdc↵ (direct input mode) GUI utility [Break | Data Break …] menu item When this menu item is selected, a dialog box appears for clearing the set data break condition. (See the bd command.
CHAPTER 8: DEBUGGER br (register break) Function This command sets or clears register break. This command allows you to specify data or a mask that constitutes a break condition for each register (A, B, F, X, and Y). The program will break when all setting conditions are met. Format (1) >br [ [... ]]↵ (direct input mode) (2) >br↵ (guidance mode) Register break set status 1. set 2. clear …? <1 | 2>↵ (Command is completed when "2" is selected.
CHAPTER 8: DEBUGGER Notes • For the first time this command is executed, no item can be skipped because no default value is set. • In guidance mode, the following keyboard inputs have special meaning: "q↵" … Command is terminated. (finish inputting and start execution) "^↵" … Return to previous address. "↵" … Input is skipped. (keep current value) When the command is terminated in the middle of guidance by "q↵", the contents that have been input up to that time will be modified.
CHAPTER 8: DEBUGGER brc (register break clear) Function This command clears the register break conditions that have been set. Format >brc↵ (direct input mode) GUI utility [Break | Register Break …] menu item When this menu item is selected, a dialog box appears for clearing the register break conditions. (See the br command.
CHAPTER 8: DEBUGGER bs (sequential break) Function This command sets and clears sequential break and displays the sequential break condition that have been set. This command allows you to set break addresses in up to three locations and the number of times you want the program to be executed at the last of the three addresses.
CHAPTER 8: DEBUGGER Notes • The maximum number of times a program can be executed is 4,095. Specifying a pass count exceeding this limit will result in an error. Error : Number of passes out of range, use 0-4095 • The addresses must be specified within the range of the program memory area available for each microcomputer model. An error results if the input one is not a hexadecimal number or a valid symbol.
CHAPTER 8: DEBUGGER bsc (sequential break clear) Function This command clears the sequential break condition that has been set. Format >bsc↵ (direct input mode) GUI utility [Break | Sequential Break …] menu item When this menu item is selected, a dialog box appears for clearing sequential break conditions. (See the bs command.
CHAPTER 8: DEBUGGER bsp (break stack pointer) Function This command allows you to specify a stack area to generate a break for illegal stack access. A break occurs when stack operation is performed in locations other than the area specified by this command.
CHAPTER 8: DEBUGGER GUI utility [Break | Stack Break …] menu item When this menu item is selected, a dialog box appears for setting stack areas. To set stack areas, enter start and end addresses in the text boxes, then click [OK].
CHAPTER 8: DEBUGGER bl (break point list) Function This command lists the current setting of all break conditions. Format >bl↵ (direct input mode) Example >bl↵ PC break: 1: 0116 2: 0200 Sequential break: 1: 0116 2: 0120 3: pass:3 Data break: data: 1*** R/W: W area: 0000 - 000F Register break: A:* B:* X:* Y:* EICZ:**1* Stack break: SP1 : 0000 - 03FF SP2 : 0000 - 00FF > GUI utility [Break | Break List] menu item When this menu item is selected, the bl command is executed.
CHAPTER 8: DEBUGGER bac (break all clear) Function This command clears all break conditions set by the bp, bd, br and/or bs commands. Format >bac↵ (direct input mode) GUI utility [Break | Break All Clear] menu item When this menu item is selected, the bac command is executed.
CHAPTER 8: DEBUGGER 8.9.10 Program Display u (unassemble) Function This command displays a program in the [Source] window after unassembling it.
CHAPTER 8: DEBUGGER (3) During log output If the command execution result is being output to a log file as specified by the log command, code is displayed in the [Command] window and its contents are also output to the log file. If the [Source] window is closed, the result is displayed in the same way as in (2) above. If the [Source] window is opened, the window is redisplayed. In this case, the same number of lines is displayed in the [Command] window as displayed in the [Source] window.
CHAPTER 8: DEBUGGER sc (source code) Function This command displays the contents of the program source file in the [Source] window.
CHAPTER 8: DEBUGGER (3) During log output If the command execution result is output to a log file as specified by the log command, code is displayed in the [Command] window and its contents are also output to the log file. If the [Source] window is closed, code is displayed in the same way as in (2) above. If the [Source] window is open, the window is redisplayed. In this case, the same number of lines is displayed in the [Command] window as displayed in the [Source] window.
CHAPTER 8: DEBUGGER m (mix) Function This command displays the unassembled result of the program and the contents of the program source file in the [Source] window.
CHAPTER 8: DEBUGGER (3) During log output If the command execution result is output to a log file as specified by the log command, code is displayed in the [Command] window and its contents are output to the log file also. If the [Source] window is closed, code is displayed in the same way as in (2) above. If the [Source] window is open, the window is redisplayed. In this case, the same number of lines is displayed in the [Command] window as displayed in the [Source] window.
CHAPTER 8: DEBUGGER 8.9.11 Symbol Information sy (symbol list) Function This command displays a list of symbols in the [Command] window. Format (1) >sy [/a]↵ (2) >sy $ [/a]↵ (3) >sy # [/a]↵ (direct input mode) (direct input mode) (direct input mode) : Search character string; ASCII character Condition: 0 ≤ length of keyword ≤ 32 Examples Format (1) >sy↵ INC_RAM_BLK1 INIT_RAM_BLK1 RAM_BLK0 RAM_BLK1 BOOT@C:\E0C63\TEST\MAIN.S LOOP@C:\E0C63\TEST\MAIN.S NMI@C:\E0C63\TEST\MAIN.
CHAPTER 8: DEBUGGER 8.9.12 Load File lf (load file) Function This command loads an object file in IEEE-695 format into the debugger. Format (1) >lf ↵ (direct input mode) (2) >lf↵ (guidance mode) File Name ? ↵ > : File name to be loaded (path can also be specified) Examples Format (1) >lf test.abs↵ Loading file ... OK! > Format (2) >lf↵ File name ? test.abs Loading file ...
CHAPTER 8: DEBUGGER lo (load option) Function This command loads a Motorola-S format program, data or option file listed below into the debugger. File Program file Data file* Function option data file Segment option data file* Melody data file* Name specification ~.hsa (5 high-order bits), ~.lsa (8 low-order bits) ~.csa ~.fsa ~.ssa ~.msa ∗ Not used in some microcomputer models Format (1) >lo ↵ (direct input mode) (2) >lo↵ (guidance mode) File Name ...
CHAPTER 8: DEBUGGER 8.9.13 Flash Memory Operation lfl (load from flash memory) Function This command loads the memory contents from the flash memory of the ICE into the target memory. It therefore allows you to debug the program beginning from the contents previously saved to the flash memory up to latest one. Format (1) >lfl [ ... ]↵ (direct input mode) (2) >lfl↵ (guidance mode) Read program 1. yes 2. no ...? <1 | 2>↵ data 1. yes 2. no ...? <1 | 2>↵ fog 1. yes 2. no ...
CHAPTER 8: DEBUGGER • If the flash memory and target memory are mapped differently (e.g., the parameter file used in the current debug differs from one that was used when the program was saved to the flash memory), an error will result and memory contents will not be loaded into the target memory. Error : Map information is not the same In this case, the system displays the map information of the target memory and the flash memory after showing the message above.
CHAPTER 8: DEBUGGER sfl (save to flash memory) Function This command writes the contents of the target memory in the ICE into the flash memory. Writing to the flash memory allows the ICE to be operated in free-run mode. Furthermore, the next debug session can be continued immediately from the current contents in the flash memory. Format (1) >sfl [ ... ] [-p]↵ (direct input mode) (2) >sfl↵ (guidance mode) Protect flash memory 1. yes 2. no ...? <1 | 2>↵ Write program 1. yes 2. no ...
CHAPTER 8: DEBUGGER • If the flash memory has been erased, an error results, in which case you can choose to continue or stop processing. Error : format error Save with the map information, or quit the command ? 1.save 2.quit ...? 1 Protect flash memory 1.yes 2.no ...? • If the flash memory and target memory are mapped differently, an error results. In this case, the system displays the map information of the memory and a message prompting you to choose to continue or stop processing.
CHAPTER 8: DEBUGGER efl (erase flash memory) Function This command erases the contents of the ICE flash memory (including map information) and removes its protect function. Format efl↵ (direct input mode) Example >efl↵ Clear flash memory ... done! > Note When erased by the efl command, all data in the flash memory is initialized at 0xff. Even when part of the data, such as a program, is thereafter written to the flash memory by the slf command, all other data remains unchanged (= 0xff).
CHAPTER 8: DEBUGGER 8.9.14 Trace tm (trace mode display/set) Function This command sets and displays a trace mode. It allows you to set the following three trace modes and a trace trigger point (when a specified address is executed, the TRGOUT pin outputs a pulse). 1. Normal trace mode The data written to the trace memory is always the latest trace information. 2.
CHAPTER 8: DEBUGGER >tm↵ Single delay mode Trigger Address : 0116 Position: Middle 1.normal 2.single delay 3.address area ...? 3↵ ... [2. address area] is selected. Trigger address ? :116↵ ... Trigger address is input. 1.in area 2.out area ...? 1↵ ... In/out is selected. Start address ? 110↵ ... Address range is input End address ? 200↵ in up to 4 locations. Start address ? ↵ ... Terminated by [Enter] key. > If you enter the [Enter] key only, the command will be canceled.
CHAPTER 8: DEBUGGER td (trace data display) Function This command displays the trace information that has been sampled into the ICE trace memory. Format (1) >td []↵ (direct input mode) (2) >td↵ (guidance mode) Start point ?: (ENTER from the latest) ↵ (Trace data is displayed) > : Start cycle number of trace data; decimal (from 0 to 8,191) Display The following lists the contents of trace information: trace cycle: Trace cycle (decimal).
CHAPTER 8: DEBUGGER (2) When [Trace] window is closed: When the td command is input without , the debugger displays 11 lines of the latest trace data in the [Command] window. When the td command is input with , the debugger displays 11 lines of the trace data from in the [Command] window.
CHAPTER 8: DEBUGGER >td 100↵ ... Started display in FORWARD. (Data on cycle Nos. 110 to 100 is displayed.) >b↵ ... Changed to BACKWARD. (Data on cycle Nos. 99 to 89 is displayed.) >↵ ... Continued display in BACKWARD. (Data on cycle Nos. 88 to 78 is displayed.) >f↵ ... Changed back to FORWARD. (Data on cycle Nos. 99 to 89 is displayed.) > Notes • Specify the trace cycle No. within the range of 0 to 8,191. An error results if this limit is exceeded.
CHAPTER 8: DEBUGGER ts (trace search) Function This command searches trace information from the trace memory under a specified condition. The search condition can be selected from three available conditions: 1. Search by executed address In this mode, you can specify a program memory address. The debugger searches the cycle in which the specified address is executed. 2. Search for a specified memory read cycle In this mode, you can specify a data memory address.
CHAPTER 8: DEBUGGER Note The address specified for search must be within the range of the program/data memory area available for each microcomputer model. An error results if the input one is not a hexadecimal number or not a valid symbol. Error : invalid value (no such symbol / symbol type error) An error results if the limit is exceeded for program memory address. Error : Address out of range, use 0-0xXXXX An error results if the limit is exceeded for data memory address.
CHAPTER 8: DEBUGGER tf (trace file) Function This command saves the specified range of the trace information displayed in the [Trace] window by the td or ts command to a file.
CHAPTER 8: DEBUGGER 8.9.15 Coverage cv (coverage) Function This command displays coverage information (addresses where the program is executed). The coverage information is displayed in the [Command] window.
CHAPTER 8: DEBUGGER cvc (coverage clear) Function This command clears the coverage information.
CHAPTER 8: DEBUGGER 8.9.16 Command File com (execute command file) Function This command reads a command file and executes the debug commands written in that file. You can execute the commands successively, or set an interval between each command execution. Format (1) >com []↵ (direct input mode) (2) >com↵ (guidance mode) File name ? ↵ Execute commands 1. successively 2. with wait ...? <1 | 2>↵ Interval (0 - 256 seconds) : ↵ (appears only when "2.
CHAPTER 8: DEBUGGER cmw (execute command file with wait) Function This command reads a command file and executes the debug commands written in that file at predetermined time intervals. The execution interval of each command can be set in a range of 1 to 256 seconds (in 1-second increments) using the md command. In the initial debugger settings, the execution interval is 1 second.
CHAPTER 8: DEBUGGER rec (record commands to a file) Function This command records all debug commands following this command to a specified command file. Format (1) >rec ↵ (direct input mode) (2) >rec↵ (guidance mode) ...See Examples for guidance. : Command file name (path can also be specified) Examples (1) First rec execution after debugger starts up >rec↵ File name 1. append > ? sample.cmd↵ 2. clear and open ...? 2↵ ...Displayed If the file is already exists.
CHAPTER 8: DEBUGGER 8.9.17 log log (log) Function This command saves the input commands and the execution results to a file. Format (1) >log ↵ (direct input mode) (2) >log↵ (guidance mode) ...See Examples for guidance. : Log file name (path can also be specified) Examples (1) First log execution after debugger starts up >log↵ File name 1. append > ? debug1.log↵ 2. clear and open ...? 2↵ ...Displayed If the file is already exists.
CHAPTER 8: DEBUGGER 8.9.18 Map Information ma (map information) Function This command displays the map information that is set by a parameter file. Format >ma↵ (direct input mode) Example After the command is input, the system displays the chip name, version of the parameter file, and map information in each area. When you input the [Enter] key here, the system goes on and displays the map information in the I/O area and LCD area.
CHAPTER 8: DEBUGGER 8.9.19 Mode Setting md (mode) Function This command sets the debugger modes described below. 1. Displaying on-the-fly information You can choose the display interval of the on-the-fly information from 0 to 5 (times) per second. When 0 is chosen, the on-the-fly information will not be displayed. 2.
CHAPTER 8: DEBUGGER Format (1) >md
CHAPTER 8: DEBUGGER GUI utility [Option | Mode Setting…] menu item When this menu item is selected, a dialog box appears allowing selection of each mode. Select the mode using the check boxes or enter the number interval settings, and then click [OK].
CHAPTER 8: DEBUGGER 8.9.20 FPGA Operation xfer/xfers (xilinx fpga data erase) Function This command erases the contents of the FPGA on the standard peripheral circuit board inserted in the ICE. Format >xfer↵ >xfers↵ for main FPGA for sub FPGA (direct input mode) (direct input mode) Example >xfer↵ > After the command is entered, a dialog box appears to select start or cancel erasing. Notes • A dialog box appears to show the progress of erasing while executing.
CHAPTER 8: DEBUGGER xfwr/xfwrs (xilinx fpga data write) Function This command writes peripheral circuit data to the FPGA on the standard peripheral circuit board inserted in the ICE. Format >xfwr ;{H | S} [;N]↵ >xfwrs ;{H | S} [;N]↵ : H: S: N: for main FPGA for sub FPGA (direct input mode) (direct input mode) FPGA data file (.mot: Motorola S, .mcs: Intel HEX) Load Intel HEX file Load Motorola S file Skip erasing before writing data Examples >xfwr ..\ice\fpga\c63xxx.
CHAPTER 8: DEBUGGER xfcp/xfcps (xilinx fpga data compare) Function This command compares the contents between the FPGA and the specified file. Format >xfcp ;{H | S}↵ for main FPGA >xfcps ;{H | S}↵ for sub FPGA (direct input mode) (direct input mode) : FPGA data file (.mot: Motorola S, .mcs: Intel HEX) H: Intel HEX file S: Motorola S file Examples >xfcp ..\ice\fpga\c63xxx.mot ;S↵ > ...No error has occurred. >xfcp ..\ice\fpga\c63yyy.mot ;S↵ Warning : Verify error ...
CHAPTER 8: DEBUGGER xdp/xdps (xilinx fpga data dump) Function This command displays the content of the FPGA on the standard peripheral circuit board to the [Command] window in a 16 words/line hexadecimal dump format.
CHAPTER 8: DEBUGGER 8.9.21 Quit q (quit) Function This command quits the debugger. Format >q↵ (direct input mode) GUI utility [File | Exit] menu item Selecting this menu item terminates the debugger.
CHAPTER 8: DEBUGGER 8.9.22 Help ? (help) Function This command displays the input format of each command. Format (1) ? (2) ? (3) ? (direct input mode) (direct input mode) (direct input mode) : Command group number; decimal : Command name Condition: 1≤n≤6 Examples When you input the command in Format 1 or 2, the system displays a list of commands classified by function. Use the command in Format 3 if you want to display the input format of each individual command.
CHAPTER 8: DEBUGGER 8.10 Status/Error/Warning Messages 1.
CHAPTER 8: DEBUGGER Error message Incorrect register name, use PC/A/B/X/Y/F/SP1/SP2/EXT/Q Input address does not exist invalid command invalid data pattern invalid file name invalid value Maximum nesting level(5) is exceeded, cannot open file MLA address out of range, use 0–0xFFF no such symbol no symbol information Number of passes out of range, use 0–4095 Number of steps out of range, use 0–65535 SO address out of range, use 0–0x1FFF SP1 address out of range, use 0–0x3FF SP2 address out of range, use 0–0x
CHAPTER 9: FUNCTION OPTION GENERATOR CHAPTER 9 FUNCTION OPTION GENERATOR 9.1 Outline of the Function Option Generator winfog The S1C63 chip allows several hardware specifications such as I/O port functions to be selected as mask options. This helps you to configure the hardware of your product by changing the S1C63 chip's mask patterns according to its specifications. The Function Option Generator winfog is the software tool for creating the files necessary to generate mask patterns.
CHAPTER 9: FUNCTION OPTION GENERATOR 9.3 Using winfog 9.3.1 Starting Up Startup from Explorer Double-click on the winfog.exe icon or select winfog from the start menu. If the device information definition file (s1c63xxx.ini) was loaded into your computer during previous execution, winfog automatically reads the same file as it starts. Alternatively, drag the Device information definition file icon into the winfog.exe icon to start winfog, which will then read the Device information definition file.
CHAPTER 9: FUNCTION OPTION GENERATOR 9.3.2 Window Option list area Function option document area ← → ← → The area can be resized by dragging the frame boundary. Message area ∗ The microcomputer model name on the title bar is the file name (not including the path and extension) of the device information definition file that has been read. ∗ The option list and the function option document vary with each type of microcomputer. Fig. 9.3.2.
CHAPTER 9: FUNCTION OPTION GENERATOR 9.3.3 Menus and Toolbar Buttons This section explains each menu item and toolbar button. [File] menu Open Opens a function option document file. Use this menu command when correcting an existing file. The [Open] button has the same function. [Open] button End Terminates winfog. [Tool] menu Generate Creates a file according to the selected contents of the option list. The [Generate] button has the same function.
CHAPTER 9: FUNCTION OPTION GENERATOR 9.3.4 Operation Procedure The following shows the basic operation procedure. (1) Loading the device information definition file First, select a device information definition file (s1c63xxx.ini) and load it. Select [Device INI Select] from the [Tool] menu or click the [Device INI Select] button. [Device INI Select] button The dialog box shown below appears. Enter a file name including the path in the text box or select a file by clicking the [Ref] button.
CHAPTER 9: FUNCTION OPTION GENERATOR EPROM Type This option is not available for S1C63 Family microcomputers. User's Name Enter your company name. Up to 40 characters can be entered. You can use English letters, numbers, symbols, and spaces. The content entered here is recorded in the USER'S NAME field of the function option document file. Comment Enter a comment. Up to 50 characters can be entered in one line. You can enter up to 10 lines. You can use English letters, numbers, symbols, and spaces.
CHAPTER 9: FUNCTION OPTION GENERATOR (5) Correcting an existing document file You can read an existing function option document file into winfog and correct it as necessary. To read a file, select [Open] from the [File] menu or click the [Open] button. [Open] button The dialog box shown below appears, so enter a file name including the path in the text box or select a file by clicking the [Ref] button. Click [OK], and the file is loaded.
CHAPTER 9: FUNCTION OPTION GENERATOR 9.4 Error Messages The error messages of winfog are listed below. The "Dialog" in the Display column means that messages are displayed in the dialog box, and "Message" means that messages are displayed in the [FOG] window message area. Table 9.4.1 List of winfog Error Messages Message Description Number of characters in the file name or extension exceeds the limit. Prohibited characters have been entered. File name has not been entered. File (xxxx) cannot be opened.
CHAPTER 9: FUNCTION OPTION GENERATOR 9.5 Example Output Files Note: Option and other configurations vary with each type of microcomputer. Example of a function option document file * S1C63xxx FUNCTION OPTION DOCUMENT Vx.xx * * FILE NAME zzzzzzzz.FDC * USER'S NAME SEIKO EPSON CORPORATION * INPUT DATE yyyy/mm/dd * COMMENT SAMPLE DATA * * *** OPTION NO.1 *** * --- OSC1 SYSTEM CLOCK --* Crystal(32.768KHz) ---- Selected OPT0101 01 * * *** OPTION NO.
CHAPTER 10: SEGMENT OPTION GENERATOR CHAPTER 10 SEGMENT OPTION GENERATOR 10.1 Outline of Segment Option Generator winsog Some types of microcomputers in the S1C63 Family allow the LCD output pin output specifications and LCD output pin assignments to be set with hardware options, so that mask patterns for the IC are generated according to option settings. The Segment Option Generator winsog is the software tool for creating the files required to generate mask patterns.
CHAPTER 10: SEGMENT OPTION GENERATOR Segment option HEX file (zzzzzzzz.ssa) This is the Motorola S2 format file necessary to set the selected segment options in the ICE. When you debug programs with the ICE, download this file into the ICE using debugger db63 commands. Segment assignment data file (zzzzzzzz.sad) This is a text format file in which segment assignment data is stored. Create this file when terminating winsog before finishing segment assignment.
CHAPTER 10: SEGMENT OPTION GENERATOR When winsog starts, it displays the [SOG] window. The following diagrams show a [SOG] window when the device information definition file has been loaded and when it has not.
CHAPTER 10: SEGMENT OPTION GENERATOR 10.3.2 Window ← → Option setup area The area can be resized by dragging the frame boundary. Message area ∗ The microcomputer model name on the title bar is the file name (not including the path and extension) of the device information definition file that has been read. ∗ The display memory addresses and segment configuration vary with each type of microcomputer. Fig. 10.3.2.1 Window Configuration The [SOG] window is divided into two areas as shown above.
CHAPTER 10: SEGMENT OPTION GENERATOR 10.3.3 Menus and Toolbar Buttons This section explains each menu item and toolbar button. [File] menu Open Opens a segment option document file. Use this menu command when correcting an existing file. The [Open] button has the same function. [Open] button Record - Save Saves the current option settings to a file (segment assignment data file). The [Save] button has the same function. [Save] button Record - Load Loads a segment assignment data file.
CHAPTER 10: SEGMENT OPTION GENERATOR 10.3.4 Option Selection Buttons The following buttons are available in the option setup area. OUTPUT Option buttons These buttons select SEG pin output modes. These buttons are enabled when you click a SPEC cell in [SEGMENT DECODE TABLE]. Selects LCD segment output. Selects DC-complementary output. Selects DC-Pch open-drain output. Selects DC-Nch open-drain output. Selects segment/common shared output. [Delete] button Clears one selected segment assignment. 10.3.
CHAPTER 10: SEGMENT OPTION GENERATOR Once a device information definition file is selected, the same file is automatically loaded the next time you start winfog. If a function option document file is required for setting the segment option, the dialog box shown below will appear to allow file selection. In this case enter the file name including the path in the text box or choose the file from the dialog box that appears by clicking on the [Ref] button.
CHAPTER 10: SEGMENT OPTION GENERATOR EPROM Type This option is not available for S1C63 Family microcomputers. User's Name Enter your company name. Up to 40 characters can be entered. You can use English letters, numbers, symbols, and spaces. The content entered here is recorded in the USER'S NAME field of the segment option document file. Comment Enter a comment. Up to 50 characters can be entered in one line. You can enter up to 10 lines. You can use English letters, numbers, symbols, and spaces.
CHAPTER 10: SEGMENT OPTION GENERATOR 2. From [SEGMENT DECODE TABLE], select the SEG pin/COM pin to which you want to assign the memory address/data bit selected in 1 by clicking the appropriate cell. A 3-digit numeric value is displayed in the cell, showing the selected address (2 high-order digits) and data bit (1 low-order digit), and the cell changes color to yellow. Selection example: If you select an incorrect cell, click the [Delete] button to clear its assignment and reselect from 1.
CHAPTER 10: SEGMENT OPTION GENERATOR (6) Setting unused SEG pins For SEG pins that are used for neither LCD output nor DC output, leave COM0 through COM3 cells in [SEGMENT DECODE TABLE] blank. However, SPEC cells cannot be left blank, so select segment output (S) for the corresponding SPEC cells. Selection example: (7) Creating files After selecting options, select [Generate] from the [Tool] menu or click the [Generate] button to create the files.
CHAPTER 10: SEGMENT OPTION GENERATOR Notes: • The segment assignment data file can be read only when the device information definition file has been loaded. • Some models need a function option document file to be loaded at the start of winsog, and the contents of the file affect the segment option setup condition. Therefore, the segment assignment data file in which the settings do not match the function option cannot be read.
CHAPTER 10: SEGMENT OPTION GENERATOR 10.4 Error Messages The error messages of winsog are listed below. The "Dialog" in the Display column means that messages are displayed in the dialog box, and "Message" means that messages are displayed in the [SOG] window message area. Table 10.4.1 List of winsog Error Messages Message Description Number of characters in the file name or extension exceeds the limit. Prohibited characters have been entered. File name has not been entered. File (xxxx) cannot be opened.
CHAPTER 10: SEGMENT OPTION GENERATOR 10.5 Example Output Files Note: The display memory addresses, the number of SEG/COM pins, and output specification vary with each type of microcomputer. Example of a segment option document file * * * * * * * * * * * * * * S1C63xxx SEGMENT OPTION DOCUMENT Vx.xx ← Version FILE NAME USER'S NAME INPUT DATE COMMENT ← File name (specified by [Setup]) ← User name (specified by [Setup]) ← Date of creation (specified by [Setup]) ← Comment (specified by [Setup]) zzzzzzzz.
CHAPTER 11: MELODY ASSEMBLER CHAPTER 11 MELODY ASSEMBLER 11.1 Outline of the Melody Assembler winmla Some S1C63 models have a built-in melody generator that outputs the sound converted from the melody ROM data. The Melody Assembler winmla is the software tool for converting the melody data created using an editor into the melody ROM data and melody option setup data. From the file created by winmla, Seiko Epson produces the mask patterns for the S1C63 chip.
CHAPTER 11: MELODY ASSEMBLER 11.3 Using winmla 11.3.1 Starting Up Startup from Explorer Double-click on the winmla.exe icon or select winmla from the start menu. If the device information definition file (s1c63xxx.ini) was loaded into your computer during previous execution, winmla automatically reads the same file as it starts. Alternatively, drag the Device information definition file icon into the winmla.exe icon to start winmla, which will then read the Device information definition file.
CHAPTER 11: MELODY ASSEMBLER 11.3.2 Window Option list area Melody ROM option document area ← → ← → The area can be resized by dragging the frame boundary. Message area ∗ The microcomputer model name on the title bar is the file name (not including the path and extension) of the device information definition file that has been read. ∗ The option list and the melody ROM option document vary with each type of microcomputer. Fig. 11.3.2.
CHAPTER 11: MELODY ASSEMBLER 11.3.3 Menus and Toolbar Buttons This section explains each menu item and toolbar button. [File] menu Open Opens a melody ROM option document file. Use this menu command when correcting an existing file. The [Open] button has the same function. [Open] button Exit Terminates winmla.
CHAPTER 11: MELODY ASSEMBLER 11.3.4 Operation Procedure The following shows the basic operation procedure. (1) Loading the device information definition file First, select a device information definition file (s1c63xxx.ini) and load it. Select [Device INI Select] from the [Tool] menu or click the [Device INI Select] button. [Device INI Select] button The dialog box shown below appears. Enter a file name including the path in the text box or select a file by clicking the [Ref] button.
CHAPTER 11: MELODY ASSEMBLER Melody ROM Option Document file Specify the melody ROM option document file name you want to create. The file name displayed by default can be modified. You can use the [Ref] button to look at other folders. Melody ROM Option HEX Do you make hex file? Select whether to create a melody ROM option HEX file. You need to create one when you use the ICE to debug programs. Melody ROM Option HEX file When you create a melody ROM option HEX file, specify its file name here.
CHAPTER 11: MELODY ASSEMBLER (4) Correcting an existing document file You can read an existing melody ROM option document file into winmla and correct it as necessary. To read a file, select [Open] from the [File] menu or click the [Open] button. [Open] button The dialog box shown below appears, so enter a file name including the path in the text box or select a file by clicking the [Ref] button. Click [OK], and the file is loaded.
CHAPTER 11: MELODY ASSEMBLER 11.4 Melody Data 11.4.1 Outline of Melody Data To produce music or sound effects with the melody generator of the S1C63xxx, the following four data must be created: (1) Tempo data Two types of tempo settings are available for a piece of music. They can be selected from 16 types of tempos. (2) Main data a) Control bits b) Note data c) Interval data d) Jump bit e) Tempo Attack (for separating notes), rest and the end of melody are specified. Eight types of notes are available.
CHAPTER 11: MELODY ASSEMBLER 11.4.3 Method of Creating Melody Data The following shows the method of creating melody data according to the creation procedure. (1) Writing score Describe music to be played with the S1C63xxx in the form of a score as shown below. Example of score =.. 40.0 <1> <3> =.. 80.0 <2> <4> <5> <6> <7> <8> <9> <10> <11> (2) Creating melody data Create a melody data based on the score using a general-purpose editor.
CHAPTER 11: MELODY ASSEMBLER 11.4.4 Description of Melody Data (1) Tempo data 16 types of tempo data (0 to 15) are available. 2 types of tempo data from them can be selected for each melody. Tempo data should be described as follows: TEMPO : TEMPO x 0 = 3 : : : : : END Start mark of tempo data (It cannot be omitted.) TEMPO x 1 = 9 Tempo data (0 to 15) Tempo No. (0, 1) Melody No. (0 to 15) End mark (It cannot be omitted.
CHAPTER 11: MELODY ASSEMBLER (2) Main data For the main part of the score such as pitches and the duration should be described in the main data field as follows: MAIN : ; mX data 0 1 7 G6 1 1 6 F5 2 1 5 D5# 3 2 4 RR 4 0 3 E5 5 1 2 E5 6 1 1 D5 7 1 0 C5 8 3 0 RR Start mark of main data (It cannot be omitted.) A comment should be described for easy reading. 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 1 1 1 Tempo No. Jump bit Pitch data Note data Control bit Main data No. End mark (It cannot be omitted.
CHAPTER 11: MELODY ASSEMBLER (2-4) Pitch data The range for selecting pitches differs according to the reference frequency that can be selected from the [Generate] dialog box of winmla. The frequency should be selected according to the the OSC1 oscillation circuit. Table 11.4.4.4 shows the correspondence between pitches and HEX codes (example) for each reference frequency. In melody data, pitch data should be described. Table 11.4.4.4 Pitch Data (example) Reference frequenc: 38.
CHAPTER 11: MELODY ASSEMBLER (3) Control data In the control data field, the jump destinations (main data numbers) from the main data in which the jump bit is set are described here. The control data should be described after the main data field. The following shows the control data corresponding to the main data. MAIN ; no.
CHAPTER 11: MELODY ASSEMBLER 11.5 Error Messages The error messages of winmla are listed below. The "Dialog" in the Display column means that messages are displayed in the dialog box, and "Message" means that messages are displayed in the [MLA] window message area. Table 11.5.
CHAPTER 11: MELODY ASSEMBLER 11.6 Error Symbols When an error occurs during assembling, the error symbols listed below or an error message is output to the assembly list file (ELG file). The error symbol is placed at the beginning of the statement in which an error occurred. If two or more errors occur, all the error statements have an error symbol. Example: S (Syntax Error) LISTING OF ERRORLOG zzzzzzzz.
CHAPTER 11: MELODY ASSEMBLER 11.7 Sample Files For Elize Original title: For Elize Composer: Beethoven Score TEMPO =.. 80 8va Fine D.C.
CHAPTER 11: MELODY ASSEMBLER 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 END 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 5 7 7 7 5 7 7 7 6 7 7 7 7 5 7 7 7 5 7 7 7 5 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 A4 C4 E4 A4 B4 E4 C5 B4 A4 RR B4 C5 D5 E5 G4 F5 E5 D5 F4 E5 D5 C5 E4 D5 C5 B4 E4 E4 E4 E4 E4 E4 E5 E5 D5# E5 D5# E5 D5# E5 D5# RR 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
CHAPTER 11: MELODY ASSEMBLER Example of output file (Melody ROM option document file) S21400000000000000000000000000000000000000EB Melody address ROM HEX data S804000000FB S21400000008000000000000000000000000000000E3 S21400001000000000000000000000000000000000DB Melody tempo ROM HEX data S804000000FB S214000000A39D819489710A3F665FA64800000000A0 Melody scale ROM HEX data S804000000FB S21400000000000000000000000000000000000000EB : : : : S214000050000000000000000000000000000000009B S804000000FB Melody control
CHAPTER 11: MELODY ASSEMBLER Example of output file (Melody ROM option HEX file) S21400000000000000000000000000000000000000EB S21400001008000000000000000000000000000000D3 S21400002000000000000000000000000000000000CB S214000030A39D819489710A3F665FA6480000000070 S21400004000000000000000000000000000000000AB S214000050000000000000000000000000000000009B S214000060000000000000000000000000000000008B S214000070000000000000000000000000000000007B S214000080000000000000000000000000000000006B S214000090000000000000000
CHAPTER 12: MASK DATA CHECKER CHAPTER 12 MASK DATA CHECKER 12.1 Outline of the Mask Data Checker winmdc The Mask Data Checker winmdc is the software tool for checking the format of each generated file and creating the files necessary to generate mask patterns.
CHAPTER 12: MASK DATA CHECKER Segment option document file (zzzzzzzz.sdc) This is a text format file in which the contents of segment options set are stored. It is created by the segment option generator winsog. This file is available for only microcomputers with set segment options. Pack file (c63xxx··yyy.paN, N = 0 and over) This is a text format file which contains the above data files combined into one. We would like to have this file presented to Seiko Epson as the mask data file.
CHAPTER 12: MASK DATA CHECKER 12.3.2 Menus and Toolbar Buttons This section explains each menu item and toolbar button. [File] menu End Terminates winmdc. [Tool] menu Pack Packs the ROM data file and option document file to create a mask data file for presentation to Seiko Epson. The [Pack] button has the same function. [Pack] button Unpack Restores files in the original format from a packed file. The [Unpack] button has the same function.
CHAPTER 12: MASK DATA CHECKER 12.3.3 Operation Procedure The following shows the basic operation procedure. (1) Loading the Device information definition file First, select a device information definition file (s1c63xxx.ini) and load it. Select [Device INI Select] from the [Tool] menu or click the [Device INI Select] button. [Device INI Select] button The dialog box shown below appears. Enter a file name including the path in the text box or select a file by clicking the [Ref] button.
CHAPTER 12: MASK DATA CHECKER 2. Select the files to be entered. [Pack Input Files] lists the files of the type specified in the device information definition file by their default file names. If the data files to be entered are represented by different names in this list, replace the file names following the procedure below. a. Select a file name to be changed by clicking on it from the list box. b. Click the [Ref] button and select the data file to be entered. Do this for all files listed.
CHAPTER 12: MASK DATA CHECKER (3) Unpacking 1. Select [Unpack] from the [Tool] menu or click the [Unpack] button on the tool bar to bring up the [Unpack] dialog box. [Unpack] button 2. Select the file you want to unpack. In the [Packed Input File] text box, specify the pack file name you want to enter. Use the names displayed by default to specify this file name after changing one, or select another file using the [Ref] button. 3. Set the output file name.
CHAPTER 12: MASK DATA CHECKER 12.4 Error Messages The error messages of winmdc are listed below. The "Dialog" in the Display column means that messages are displayed in the dialog box, and "Message" means that messages are displayed in the message area of the [Pack] or [Unpack] dialog box. Table 12.4.
CHAPTER 12: MASK DATA CHECKER 12.5 Example Output File Note: The configuration and contents of data vary with each type of microcomputer. Example of a pack file (mask data file) * * S1C63xxx MASK DATA VER x.xx * \PROM S1C63xxxyyy PROGRAM ROM S224000000................................ : : : : : S804000000FB S224000000................................ : : : : : S804000000FB \END \CHROM S1C63xxxyyy CHARACTER ROM S224000000................................
CHAPTER 12: MASK DATA CHECKER \MOPTION * S1C63xxx MELODY OPTION DOCUMENT Vx.xx * * FILE NAME Samp3V1.mdc * USER'S NAME * INPUT DATE 2000/12/13 * COMMENT * * *** OPTION NO.jj *** * --- CHANGE MELODY IN OPERATION MODE --* CHANGE ---------//--------- SELECTED OPTjj01 01 : : : : : OPTkk01 01 * *EOF \END \SEGMENT * S1C63xxx SEGMENT OPTION DOCUMENT Vx.xx * * FILE NAME zzzzzzzz.SDC * USER'S NAME * INPUT DATE 2000/9/1 * COMMENT * * * OPTION NO.
S1C63 Family Assembler Package Quick Reference
Memory Map S1C63000 Core CPU Program Memory Map Data Memory Map Address 0xFFFF Address 0xFFFF I/O memory area Program area CMOS 4-bit Single Chip Microcomputer S1C63 Family Assembler Package 0xFF00 0xFEFF 0x0140 0x013F Software interrupt vectors Quick Reference for Development 0x0111 0x0110 0x010F Data area Program start address 0x0400 0x03FF Hardware interrupt vectors 0x0101 0x0100 0x00FF 0x0000 Data and SP1 stack area NMI vector 0x0100 0x00FF Program area Common subroutines, etc.
Instruction List (1) S1C63000 Core CPU Symbols in the Instruction List Registers/Register Data Functions %A, A: %B, B: %BA, BA: %X, X: %XH, XH: %XL, XL: %Y, Y: %YH, YH: %YL, YL: %F, F: %EXT, EXT: %SP1, SP1: %SP2, SP2: PC: ←: ↔: +: -: ∧: ∨: ∀: Data register A or the contents of the register (4 bits) Data register B or the contents of the register (4 bits) Data register BA or the contents of the register (8 bits, the B register is high-order 4 bits) Index register X or the contents of the register (16 b
Instruction List (2) Classification 4-bit data transfer Remarks Mnemonic Opcode Operand LD %A,%A %A,%B %A,%F %A,imm4 %A,[%X] %A,[%X]+ %A,[%Y] %A,[%Y]+ LD %B,%A %B,%B %B,imm4 %B,[%X] %B,[%X]+ %B,[%Y] %B,[%Y]+ LD %F,%A %F,imm4 LD [%X],%A [%X],%B [%X],imm4 [%X],[%Y] [%X],[%Y]+ [%X]+,%A [%X]+,%B [%X]+,imm4 [%X]+,[%Y] [%X]+,[%Y]+ LD [%Y],%A [%Y],%B [%Y],imm4 [%Y],[%X] [%Y],[%X]+ [%Y]+,%A [%Y]+,%B [%Y]+,imm4 [%Y]+,[%X] [%Y]+,[%X]+ S1C63000 Core CPU Basic function A←A A←B A←F A ← imm4 A ← [X] A ← [X], X ← X+1
Instruction List (3) Classification 4-bit data transfer Arithmetic operation Remarks Mnemonic Opcode Operand EX %A,%B EX %A,[%X] %A,[%X]+ %A,[%Y] %A,[%Y]+ EX %B,[%X] %B,[%X]+ %B,[%Y] %B,[%Y]+ ADD %A,%A %A,%B %A,imm4 %A,[%X] %A,[%X]+ %A,[%Y] %A,[%Y]+ ADD %B,%A %B,%B %B,imm4 %B,[%X] %B,[%X]+ %B,[%Y] %B,[%Y]+ ADD [%X],%A [%X],%B [%X],imm4 [%X]+,%A [%X]+,%B [%X]+,imm4 ADD [%Y],%A [%Y],%B [%Y],imm4 [%Y]+,%A [%Y]+,%B [%Y]+,imm4 S1C63000 Core CPU Basic function A↔B A ↔ [X] A ↔ [X], X ← X+1 A ↔ [Y] A ↔ [Y], Y
Instruction List (4) Classification Arithmetic operation Remarks Mnemonic Opcode Operand ADC %A,%A %A,%B %A,imm4 %A,[%X] %A,[%X]+ %A,[%Y] %A,[%Y]+ ADC %B,%A %B,%B %B,imm4 %B,[%X] %B,[%X]+ %B,[%Y] %B,[%Y]+ ADC [%X],%A [%X],%B [%X],imm4 [%X]+,%A [%X]+,%B [%X]+,imm4 ADC [%Y],%A [%Y],%B [%Y],imm4 [%Y]+,%A [%Y]+,%B [%Y]+,imm4 SUB %A,%A %A,%B %A,imm4 %A,[%X] %A,[%X]+ %A,[%Y] %A,[%Y]+ SUB %B,%A %B,%B %B,imm4 S1C63000 Core CPU Basic function A ← A+A+C A ← A+B+C A ← A+imm4+C A ← A+[X]+C A ← A+[X]+C, X ← X+1 A ←
Instruction List (5) Classification Arithmetic operation Remarks Mnemonic Opcode Operand SUB %B,[%X] %B,[%X]+ %B,[%Y] %B,[%Y]+ SUB [%X],%A [%X],%B [%X],imm4 [%X]+,%A [%X]+,%B [%X]+,imm4 SUB [%Y],%A [%Y],%B [%Y],imm4 [%Y]+,%A [%Y]+,%B [%Y]+,imm4 SBC %A,%A %A,%B %A,imm4 %A,[%X] %A,[%X]+ %A,[%Y] %A,[%Y]+ SBC %B,%A %B,%B %B,imm4 %B,[%X] %B,[%X]+ %B,[%Y] %B,[%Y]+ SBC [%X],%A [%X],%B [%X],imm4 [%X]+,%A [%X]+,%B [%X]+,imm4 S1C63000 Core CPU Basic function B ← B-[X] B ← B-[X], X ← X+1 B ← B-[Y] B ← B-[Y], Y ← Y
Instruction List (6) Classification Arithmetic operation Remarks Mnemonic Opcode Operand SBC [%Y],%A [%Y],%B [%Y],imm4 [%Y]+,%A [%Y]+,%B [%Y]+,imm4 CMP %A,%A %A,%B %A,imm4 %A,[%X] %A,[%X]+ %A,[%Y] %A,[%Y]+ CMP %B,%A %B,%B %B,imm4 %B,[%X] %B,[%X]+ %B,[%Y] %B,[%Y]+ CMP [%X],%A [%X],%B [%X],imm4 [%X]+,%A [%X]+,%B [%X]+,imm4 CMP [%Y],%A [%Y],%B [%Y],imm4 [%Y]+,%A [%Y]+,%B [%Y]+,imm4 INC [00addr6] DEC [00addr6] ADC %B,%A,n4 %B,[%X],n4 S1C63000 Core CPU Basic function [Y] ← [Y]-A-C [Y] ← [Y]-B-C [Y] ← [Y]-imm
Instruction List (7) Classification Arithmetic operation Remarks Mnemonic Opcode Operand ADC %B,[%X]+,n4 %B,[%Y],n4 %B,[%Y]+,n4 ADC [%X],%B,n4 [%X],0,n4 [%X]+,%B,n4 [%X]+,0,n4 ADC [%Y],%B,n4 [%Y],0,n4 [%Y]+,%B,n4 [%Y]+,0,n4 SBC %B,%A,n4 %B,[%X],n4 %B,[%X]+,n4 %B,[%Y],n4 %B,[%Y]+,n4 SBC [%X],%B,n4 [%X],0,n4 [%X]+,%B,n4 [%X]+,0,n4 SBC [%Y],%B,n4 [%Y],0,n4 [%Y]+,%B,n4 [%Y]+,0,n4 INC [%X],n4 [%X]+,n4 INC [%Y],n4 [%Y]+,n4 DEC [%X],n4 [%X]+,n4 DEC [%Y],n4 [%Y]+,n4 S1C63000 Core CPU Basic function B ← N's adju
Instruction List (8) Classification Logic operation Remarks Mnemonic Opcode Operand AND %A,%A %A,%B %A,imm4 %A,[%X] %A,[%X]+ %A,[%Y] %A,[%Y]+ AND %B,%A %B,%B %B,imm4 %B,[%X] %B,[%X]+ %B,[%Y] %B,[%Y]+ AND %F,imm4 AND [%X],%A [%X],%B [%X],imm4 [%X]+,%A [%X]+,%B [%X]+,imm4 AND [%Y],%A [%Y],%B [%Y],imm4 [%Y]+,%A [%Y]+,%B [%Y]+,imm4 OR %A,%A %A,%B %A,imm4 %A,[%X] %A,[%X]+ %A,[%Y] %A,[%Y]+ OR %B,%A %B,%B S1C63000 Core CPU Basic function A ← A∧A A ← A∧B A ← A∧imm4 A ← A∧[X] A ← A∧[X], X ← X+1 A ← A∧[Y] A ← A∧[
Instruction List (9) Classification Logic operation Remarks Mnemonic Opcode Operand OR %B,imm4 %B,[%X] %B,[%X]+ %B,[%Y] %B,[%Y]+ OR %F,imm4 OR [%X],%A [%X],%B [%X],imm4 [%X]+,%A [%X]+,%B [%X]+,imm4 OR [%Y],%A [%Y],%B [%Y],imm4 [%Y]+,%A [%Y]+,%B [%Y]+,imm4 XOR %A,%A %A,%B %A,imm4 %A,[%X] %A,[%X]+ %A,[%Y] %A,[%Y]+ XOR %B,%A %B,%B %B,imm4 %B,[%X] %B,[%X]+ %B,[%Y] %B,[%Y]+ XOR %F,imm4 XOR [%X],%A [%X],%B [%X],imm4 S1C63000 Core CPU Basic function B ← B∨imm4 B ← B∨[X] B ← B∨[X], X ← X+1 B ← B∨[Y] B ← B∨[Y],
Instruction List (10) Classification Logic operation Remarks Mnemonic Opcode Operand XOR [%X]+,%A [%X]+,%B [%X]+,imm4 XOR [%Y],%A [%Y],%B [%Y],imm4 [%Y]+,%A [%Y]+,%B [%Y]+,imm4 BIT %A,%A %A,%B %A,imm4 %A,[%X] %A,[%X]+ %A,[%Y] %A,[%Y]+ BIT %B,%A %B,%B %B,imm4 %B,[%X] %B,[%X]+ %B,[%Y] %B,[%Y]+ BIT [%X],%A [%X],%B [%X],imm4 [%X]+,%A [%X]+,%B [%X]+,imm4 BIT [%Y],%A [%Y],%B [%Y],imm4 [%Y]+,%A [%Y]+,%B [%Y]+,imm4 S1C63000 Core CPU Basic function [X] ← [X]∀A, X ← X+1 [X] ← [X]∀B, X ← X+1 [X] ← [X]∀imm4, X ← X+
Instruction List (11) Classification Logic operation Shift and rotate 8/16-bit transfer and operation Remarks Mnemonic Opcode Operand CLR [00addr6],imm2 [FFaddr6],imm2 SET [00addr6],imm2 [FFaddr6],imm2 TST [00addr6],imm2 [FFaddr6],imm2 SLL %A %B [%X] [%X]+ [%Y] [%Y]+ SRL %A %B [%X] [%X]+ [%Y] [%Y]+ RL %A %B [%X] [%X]+ [%Y] [%Y]+ RR %A %B [%X] [%X]+ [%Y] [%Y]+ LDB %BA,%XL %BA,%XH %BA,%YL %BA,%YH %BA,%EXT %BA,%SP1 %BA,%SP2 S1C63000 Core CPU Basic function [00addr6] ← [00addr6]∧not (2imm2) [FFaddr6] ← [F
Instruction List (12) Classification 8/16-bit transfer and operation LDB LDB LDB ADD CMP INC DEC Stack operation PUSH POP Remarks S1C63000 Core CPU Mnemonic Opcode Operand LDB %BA,imm8 %BA,[%X]+ %BA,[%Y]+ LDB %XL,%BA %XL,imm8 %XH,%BA LDB %YL,%BA %YL,imm8 %YH,%BA LDB %EXT,%BA %EXT,imm8 %SP1,%BA %SP2,%BA [%X]+,%BA [%X]+,imm8 [%Y]+,%BA %X,%BA %X,sign8 %Y,%BA %Y,sign8 %X,imm8 %Y,imm8 %SP1 %SP2 %SP1 %SP2 %A %B %F %X %Y %A %B %F %X %Y Basic function Extended function (when "LDB %EXT, imm8" is executed)
Instruction List (13) S1C63000 Core CPU Mnemonic Classification Opcode Operand Branch control JR sign8 JR %A %BA JR [00addr6] JRC sign8 JRNC sign8 JRZ sign8 JRNZ sign8 JP %Y CALZ imm8 CALR sign8 CALR [00addr6] INT imm6 RET RETS RETD RETI System control HALT SLP NOP imm8 Basic function PC ← PC+sign8+1 (sign8=-128~127) PC ← PC+A+1 PC ← PC+BA+1 PC ← PC+[00addr6]+1 If C=1 then PC ← PC+sign8+1 (sign8=-128~127) If C=0 then PC ← PC+sign8+1 (sign8=-128~127) If Z=1 then PC ← PC+sign8+1 (sign8=-128~127) I
Software Development Flowchart Development Tools Work Bench wb63 file.MAK Make file file.S or file.MS Assembly source file(s) S1C63xxx Development Tool file.par Assembler Function Option Generator winfog as63 Assembly list file(s) file.LST Linker command file file.O Object file(s) file.CM file.MS file.FSA Preprocessed source file(s) lk63 file.ABS Link map file file.MAP Absolute object file file.ALS Absolute list file Cross file.
Work Bench wb63 (1) Development Tools Outline The work bench provides an integrated development environment with Windows GUI. Creating/editing source files, selecting files and major startup options, and the startup of each tool can be made with simple Windows operations. Windows [Project] window This window shows the currently opened work space folder and lists all the source files in the project, with a structure similar to Windows Explorer.
Work Bench wb63 (2) Development Tools Tool bars [Standard] tool bar [Build] tool bar [New] button Creates a new document (source, header or project). [HEX Convert] button Invokes the HEX converter. [Open] button Opens a document (source, header or project). [Disassemble] button Invokes the disassembler. [Save] button Saves the document in the active [Edit] window to the file. The file will be overwritten. [Debug] button Invokes the debugger with the specified ICE parameter file.
Work Bench wb63 (3) Development Tools Menus [File] menu The file names listed in this menu are recently used source and project files. Selecting one opens the file. [Edit] menu New... ([Ctrl]+[N]) [View] menu Creates a new document (source, header or project). Open... ([Ctrl]+[O]) Opens a document (source, header or project). Close Closes the active [Edit] window. Open Workspace... Opens a project. Close Workspace Closes the currently opened project.
Work Bench wb63 (4) Menus Development Tools Short-Cut Key List [Tools] menu HEX Converter... Invokes the HEX converter. Disassembler... Invokes the disassembler. WinFOG Invokes the function option generator. WinSOG Invokes the segment option generator. WinMLA Invokes the melody assembler. WinMDC Invokes the mask data checker. Options... Displays a dialog box for setting work bench options. [Window] menu This menu appears when an [Edit] window is opened. Cascade Cascades the opened [Edit] windows.
Assembler as63 (1) Development Tools Outline Pseudo-instructions Converts the mnemonic of the source files into object codes (machine language) of the S1C63000. The results are output in a relocatable object file. This assembler includes preprocessing functions such as macro definition/call, conditional assembly, and file-include functions. #include #define #defnum #macro #endm #ifdef Flowchart Assembly source file [] [par] [,par] .
Assembler as63 (2) Operators () + ~ ^H ^L * / % (%%) + << >> == != < <= > >= & ^ | && || Parenthesis Plus sign Minus sign Negation Acquires 8 high-order bits Acquires 8 low-order bits Multiplication Division Residue Addition Subtraction Shifting to left Shifting to right Equal (relational operator) Not equal (relational operator) Less than (relational operator) Less than or equal (relational operator) Greater than (relational operator) Greater than or equal (relational operator) Bit AND Bit XOR Bit OR AND
Linker lk63 Development Tools Outline Error Messages Links the relocatable objects created by the assembler by fixing the memory locations, and creates executable absolute object codes. The linker also provides a branch optimization function that automatically inserts, deletes or corrects extension codes for branch instructions. Flowchart from Assembler Linker Relocatable ICE command file object file(s) parameter file file.cm file.o file.par Linker lk63 file.map file.sym file.abs file.
HEX Converter hx63 Development Tools Outline Error Messages Cannot create file Cannot open file Cannot read file Cannot write file Illegal file name specified with option Illegal ICE parameter at line of Illegal file name Illegal option Illegal absolute object format No ICE parameter file specified Out of memory Converts an absolute object in
Disassembler ds63 Development Tools Outline Error Messages Disassembles an absolute object file in IEEE-695 format or a hex file in Motorola-S format, and restores it to a source format file. The restored source file can be processed in the assembler/linker/hex converter to obtain the same object or hex file. Flowchart IEEE-695 absolute object file from Linker from Hex converter file.hsa file.lsa or file.csa file.abs Motorola-S file ds63 file.ms ds63.
Debugger db63 (1) Outline This software performs debugging by controlling the ICE hardware tool. Commands that are used frequently, such as break and step, are registered on the tool bar, minimizing the necessary keyboard operations. Moreover, sources, registers, and command execution results can be displayed in multiple windows, with resultant increased efficiency in the debugging tasks. Development Tools Start-up Command Usage -Usagedb63.exe parameter Options: command file: ... -comX(X:1-4) ... -b ...
Debugger db63 (2) Development Tools Buttons Menus Tool bar [File] menu Load File... Reads an object file in the IEEE-695 format into the debugger. Load Option... Reads a program or optional HEX file in Motorola-S format into the debugger. Flash Memory Operation... Reads/writes data from/to the Flash memory or erases the Flash memory. Exit Terminates the debugger. [Run] menu Go Executes the target program from the address indicated by the current PC.
Debugger db63 (3) Development Tools Menus [Trace] menu [View] menu Trace Mode Set... Sets a trace mode and conditions. Trace Search... Searches trace information from the trace memory. Trace File... Saves the specified range of the trace information displayed in the [Trace] window to a file. Cascade Cascades the opened windows. Tile Tiles the opened windows. This menu shows the currently opened window names. Selecting one activates the window. Command Activates the [Command] window.
Debugger db63 (4) Development Tools Debug Commands Program memory operation a (as) [ []] pe [ [..]] pf [ ] pm [ ] Program display Assemble mnemonic Input program code Fill program area Copy program memory u [] sc [] m [] Unassemble display Source display Mix display Symbol information Data memory operation dd [ []] de [ [..
Debugger db63 (5) Development Tools Debugger Messages ICE status Break by PC break Break by data break Break by register break Break by sequential break Key Break Break by accessing no map program area Break by accessing no map data area Break by accessing ROM area Out of SP1 area Out of SP2 area Break by external break Command errors Break caused by PC breakpoint Break caused by data break condition Break caused by register break condition Break caused by sequential break condition Break caused by press
Function Option Generator winfog (1) Development Tools Outline The function option generator winfog is the software tool for creating the file necessary to generate mask patterns of several hardware specifications such as I/O port functions. In addition, simultaneously with this file, winfog can create a mask option setup file that are required when debugging programs with the ICE. Windows Option list area Lists mask options set in the device information definition file (s1c63xxx.ini).
Function Option Generator winfog (2) Development Tools Buttons Error Messages Tool bar File name error Illegal character Please input file name Can't open File : xxxx INI file is not found INI file does not include FOG information Function Option document file is not found Function Option document file does not match INI file A lot of parameter Making file(s) is completed [xxxx is no data exist] Can't open File: xxxx Making file(s) is not completed Can't write File: xxxx Making file(s) is not completed
Segment Option Generator winsog (1) Development Tools Outline The segment option generator winsog is the software tool for creating the file necessary to generate mask patterns of LCD output specifications and LCD output pin assignments. In addition, simultaneously with this file, winsog can create a mask option setup file that are required when debugging programs with the ICE. Windows Option setup area Comprised of a display memory map, a segment decode table, and buttons to select pin specifications.
Segment Option Generator winsog (2) Development Tools Buttons Error Messages Tool bar File name error Illegal character Please input file name Can't open File : xxxx INI file is not found INI file does not include SOG information Function Option document file is not found Function Option document file does not match INI file Segment Option document file is not found Segment Option document file does not match INI file Segment assignment data file is not found Segment assignment data file does not match
Melody Assembler winmla (1) Development Tools Outline Some S1C63 models have a built-in melody generator that outputs the sound converted from the melody ROM data. The Melody Assembler winmla is the software tool for converting the melody data created using an editor into the melody ROM data and melody option setup data. In addition, simultaneously with this file, winmla can create a HEX file that is required when debugging programs with the ICE.
Melody Assembler winmla (2) Development Tools Buttons Error Messages Tool bar File name error Illegal character Please input file name Can't open File : xxxx INI file is not found INI file does not include MLA information Melody Data file is not found Melody ROM Option document file is not found Melody ROM Option document file does not match INI file A lot of parameter MDT file error [Open] button Opens a melody ROM option document file.
Melody Assembler winmla (3) Development Tools Melody Data Sample melody Data ; melody sample file ← Comment TEMPO ← Start mark of tempo data ; m0-tempo 0,1 TEMPO 0 0 = 4 TEMPO 0 1 = 10 Tempo data (0–15) Tempo No. (0, 1) Melody No. (0–15) END ← End mark of tempo data MAIN ← Start mark of main data ;no. cntl note scale jump tempo ;m0 test 0 1 7 G5 0 0 (a) 1 1 6 F5 0 0 (b) 2 1 5 D5# 0 0 (c) 3 2 4 RR 1 0 (d) 4 0 3 E5 0 1 (e) 5 1 2 E5 0 1 (f) 6 1 1 D5 0 1 (g) 7 1 0 C5 0 1 (h) 8 3 0 RR 1 1 (i) Tempo No.
Mask Data Checker winmdc (1) Development Tools Outline The Mask Data Checker winmdc checks the format of the code/data ROM HEX files generated by the HEX converter hx63 and the option document files generated by the function option generator winfog, segment option generator winsog and melody assembler winmla, and create a file necessary to generate mask patterns. winmdc also has a function for restoring the created mask data file into the original file format.
Mask Data Checker winmdc (2) Development Tools Buttons I/O Error Messages Tool bar File name error [Pack] button Packs the ROM data file and option document file to create a mask data file for presentation to Seiko Epson. [Unpack] button Restores files in the original format from a packed file. [Device INI Select] button Loads the device information definition file (s1c63xxx.ini). [Help] button Displays the version of winmdc. Menus [File] menu End Terminates winmdc.
International Sales Operations AMERICA ASIA EPSON ELECTRONICS AMERICA, INC. EPSON (CHINA) CO., LTD. - HEADQUARTERS - 23F, Beijing Silver Tower 2# North RD DongSanHuan ChaoYang District, Beijing, CHINA Phone: 64106655 Fax: 64107319 150 River Oaks Parkway San Jose, CA 95134, U.S.A. Phone: +1-408-922-0200 Fax: +1-408-922-0238 SHANGHAI BRANCH 4F, Bldg., 27, No. 69, Gui Jing Road Caohejing, Shanghai, CHINA Phone: 21-6485-5552 Fax: 21-6485-0775 - SALES OFFICES West 1960 E.
In pursuit of “Saving” Technology, Epson electronic devices. Our lineup of semiconductors, liquid crystal displays and quartz devices assists in creating the products of our customers’ dreams. Epson IS energy savings.
S5U1C63000A Manual (S1C63 Family Assembler Package) ELECTRONIC DEVICES MARKETING DIVISION EPSON Electronic Devices Website http://www.epson.co.