Home

as308ue. - Renesas Electronics

image

Contents

1. A character or a string of characters can be written in the operand after enclosing it with single quotations or double quotations In this case data is stored in ASCII code representing the characters The length of a character string you can write in the operand is less than four characters When defining a label be sure to write the label name before the direc tive command Always be sure to insert a colon after the label name SECTION value ROMDATA LWORD 1 LWORD 1 LWORD data LWORD symbol LWORD data LWORD symbol 1 LWORD 1 2 3 4 5 END 266 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands MACRO Defines macro name and beginning of macro body Function This command defines a macro name This command indicates the beginning of macro definition Description format Macro definition macro name MACRO formal parameter formal parameter body ENDM Macro call macro name actual parameter actual parameter Rules for writing command d Always be sure to write a macro name To write a macro name follow the rules for writing name in Section 1 Rules for Writing Program Formal parameters can be defined in the operand Always be sure to insert space or tab between this directive command and the macro formal parameter Space or tab can be written between this directive command and the macro name 26
2. SECTION area DATA ORG OOH EQU 0 BLKB 1 ALIGN PAGE newpage ALIGN Comment 199 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Assembly source line Refer to the M16C 80 Series Software Manual for details on how to write mnemonics Here the following explains rules you need to follow to write the assembly source lines that can be processed by as308 Function Mnemonics available for the M16C 80 Series can be written in this line Rules for writing Always be sure to insert a space or tab between the mnemonic and its operand When writing multiple operands always be sure to insert a comma between each operand A space or tab can be inserted between the operand and comma Some mnemonics are not accompanied by an operand Mnemonics can be written starting immediately from the top of a line A space or tab can be inserted at the beginning of an assembly source line When defining a label in the assembly source line always be sure to write the label name in columns preceding the mnemonic Be sure to enter a colon before and after the label name A space or tab can be inserted between the label name and the mne monic When writing a comment in the assembly source line insert a semico lon after the mnemonic and operand and write your comment in columns following the semicolon 200 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program
3. Be sure to insert a space or tab between this directive command and ON or OFF Description example SJMP ON Generation of short jump is enabled JMP lab NOP SJMP OFF JMP lab Generation of short jump is disabled NOP lab 284 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands SUBSTR Extracts specified number of characters Function This command extracts a specified number of characters from the speci fied position of a character string M The value is rendered 0 if the extract start position is as signed a value greater than the length of the character string itself The value is rendered 0 if the number of characters to be extracted is greater than the length of the character string itself The value is rendered 0 if you specify O for the num ber of characters to be extracted Description format SUBSTR CS ES NC SUBSTR CS ES NC CS character string ES extract start position NC number of characters to be extract 285 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Rules for writing command Always be sure to enclose the operand with Always be sure to write the character string extract start position and the number of characters to be extracted Separate the character string extract start position and the number of characters to be extracted with commas as you write them A symbol can be written in the
4. T is not entered Write the right bracket corresponding to the Addressing mode specifier is not appropriate 2 The addressing mode specifier is written incorrectly Make sure that the addressing mode is written correctly Bit symbol is in expression 2 A bit symbol is entered in an expression Bit symbols cannot be written in an expression Check the symbol name Can t create Temporary file 2 Temporary file cannot be generated Specify a directory in environment variable TMP308 so that a tempo rary file will be created in some place other than the current directory Can t create file filename The filename file cannot be generated Check the directory capacity 95 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 Can t open ASSERT message file xxxx The ASSERT output file cannot be opened Check the file name Can t open file filename The filename file cannot be opened Check the file name Can t open include file xxxx The include file cannot be opened Check the include file name Check the directory where the include file is stored Can t read file filename 2 The filename file cannot be read Check the permission of the file Can t write ASSERT message file xxxx Data cannot be written to the ASSERT output file Check the permission of the file Can t write in file filename 2 Data canno
5. name BYTE numeric value Rules for writing command Description example Write an integral value in the operand Always be sure to insert space or tab between the directive command and the operand A symbol can be written in the operand An expression can be written in the operand When writing multiple operands separate them with a comma A character or a string of characters can be written in the operand after enclosing it with single quotations or double quotations In this case data is stored in ASCII code representing the characters When defining a label be sure to write the label name before the direc tive command Always be sure to insert a colon after the label name SECTION value ROMDATA BYTE 1 01 BYTE data BYTE 1 y me BYTE data BYTE symbol BYTE symbol 1 BYTE 1 2 3 4 59 END 238 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands DEFINE Defines string symbil Function This command defines a character string to a symbol A symbol can be redefined M The symbols defined by this directive command cannot be specified for external reference Description format symbol name DEFINE character string symbol name DEFINE character string symbol name DEFINE character string Description rules When defining a character string that includes a space or tab be sure to enclose the string with single
6. AS308 V 1 00 Directive Commands SB Assigns temporary SB register value Function This command assigns a provisional SB register value When assembling the source program the assembler assumes that the SB register value is one that is defined by this directive command as it generates code for the subsequent source lines SB relative addressing mode can be specified in the subsequent lines The assembler generates code in SB relative addressing mode for the mnemonics that use labels defined by directive command SBSYM Description format SB numeric value Rules for writing command Always be sure to insert space or tab between the directive command and the operand Always make sure that this command is written in the assembly source file Always be sure to write this command before you use the SB relative addressing mode AN integer in the range of 0 to OFFFFH can be written in the operand M This directive command only directs the assembler to take on a provisional SB register value and cannot be used to set a value to the actual SB register To set an SB register value actually write the following instruction immediately before or after this directive command Example LDC 80H SB A symbol can be written in the operand Description example SB 80H LDC 80 SB 278 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands SBBIT Selects SB relative displacement add
7. Absolute List File The absolute list files generated by abs308 are output in a format that can be output to a screen or printer Format of absolute list file The absolute list file is the same format as that of the assembler list file except that location information is converted into absolute address information File name of absolute list file The file name of the absolute list file is derived by changing the extension of the assembler list file Ist to als sample lst gt sample als Directory for absolute list file generated If command option O is specified the absolute list file is generated in that directory Otherwise the file is generated in the current directory 67 ENESAS Renesas Technology Corp AS308 V 1 00 Starting Up Program Starting Up Program This section explains the basic method for operating each program included with AS308 To operate any program included with AS308 always input a command from the prompt of your personal computer or workstation Precautions on Entering Commands When using Windows be sure to use the MS DOS prompt to input a command Although personal computers do not discriminate between uppercase and lowercase letters you input from the prompt workstations are case sensitive Therefore when starting up each AS308 program on a work station always be sure to input program names using lowercase letters Workstations discriminate between uppercase and lowercas
8. Description rule This option can be specified at any position on the command line This option can be set in environment variable AS308COM Refer to Example for using AS308COM for details on how to set Description example The software generates a sample atg file if an error occurs gt as308 T sample 90 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 V Indicates Version Number Function When this option is specified the software indicates the version num bers of all programs included with AS308 and terminates processing M Allother parameters on the command line are ignored when this option is specified Description rule Specify this option only and nothing else Description example gt as308 V 91 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 X Invokes External Program Function After generating an assembler error tag file the software invokes an execution program specified following the option X If this option is specified the software generates an assembler error tag file when an error occurs regardless of whether or not you specified the option T Description rule Input this option using a form like X program name No space or tab can be entered between this option and the program name This option can be specified at any position on the command line Description example The
9. END is not entered Be sure to enter END in the last line of the source program ENDIF statement 2 ENDIF is not entered Check the position where ENDIF is written Write ENDIF as neces sary ENDM statement 2 ENDM is not entered Check the position where ENDM is written Write ENDM as neces sary 100 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 No No No No No No No ENDR statement 2 ENDR is not entered Check the position where ENDR is written Write ENDR as necessary FB statement FB is not entered When using the 8 bit displacement FB relative addressing mode al ways enter FB to assume a register value SB statement SB is not entered When using the 8 bit displacement SB relative addressing mode al ways enter SB to assume a register value SECTION statement SECTION is not entered Always make sure that the source program contains at least one SEC TION at the top of comment is not entered at the beginning of a comment Enter a semicolon at the beginning of each comment Check whether the mnemonic or operand is written correctly input files specified No input file is specified Specify an input file macro name 2 No macro name is entered Write a macro name for each macro definition 101 ENESAS Renesas Technology Corp AS308 V 1 00 Error message
10. Referencing method ta 20 A bit symbol can be written in the operand of a 1 bit operation instruction Example BCLR flagl BCLR flag2 BCLR flag3 195 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Location symbol Function This symbol indicates the address of a line you wrote By writing the dollar mark in the operand you can indicate the ad dress of the first byte of op code in the line you wrote Rules for writing Write this symbol in the operand of a mnemonic The dollar mark cannot be written at the beginning of a name or reserved word A location symbol can be written in a term of an expression Mi when writing a location symbol make sure that the value of the expression is a valid value when your program is as sembled Description example JMP B 5 M when writing an address in a branch instruction operand using a location symbol for offset be sure to write the ad dressing mode jump distance and instruction format speci fiers for all mnemonics at locations from that instruction to the jump address 196 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Lines The as308 assembler processes the source program one line at a time Lines in the source program are classified into the following types depending on the contents in that line Directive command line
11. Renesas Technology Corp AS308 V 1 00 Directive Commands BTGLB Specifies global bit symbol Function This command declares that the bit symbols specified with it are global symbols If any bit symbols specified with this directive command are not defined within the file the assembler processes them assuming that they are defined in an external file If the bit symbols specified with this directive command are defined in the file the assembler processes them to be referencible from an exter nal file Description format BTGLB bit symbol name BTGLB bit symbol name bit symbol name Rules for writing command Always be sure to insert space or tab between the directive command and the operand Write a bit symbol name in the operand that you want to be a global symbol M No bit symbols can be specified for external reference that are defined by a symbol that is indeterminate when as sembled When specifying multiple bit symbol names in the operand separate each symbol name with a comma as you write them Description example BTGLB flag1 flag2 flag3 BTGLB flag4 SECTION program BCLR flagl 237 ENESAS Renesas Technology Corp AS308 V 1 00 BYTE Directive Commands Stores data in ROM in 1 byte length Function This command stores 1 byte long fixed data in ROM Label can be defined at the address where data is stored Description format BYTE numeric value
12. Renesas Technology Corp AS308 V 1 00 Method for Operating as308 O Specifies Generated File Output Directory Function This option specifies the directory to which the relocatable module file assembler list file and assembler error tag file that are generated by the assembler are output The directory name can be specified including a drive name It can also be specified by a relative path Description rule Write this option in the form of O directory name No space or tab can be entered between this option and the directory name Description example The relocatable module file is generated in the work asmout directory on drive c gt as308 Oc work asmout sample The relocatable module file is generated in the tmp directory that is the parent directory of the current directory gt as308 sample O tmp The relocatable module file assembler error tag file and assembler list file are generated in the work asmout directory on drive c gt as308 Oc work asmout sample L T 88 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 S Specifies Local Symbol Information Output Function The software outputs local symbol information to a relocatable module file System label information can also be output a relocatable module file by adding M to this option Absolute module files generated from the relocatable module file that was generated after specif
13. Specifications of AS308 AS308 has been designed based on the following specifications Make sure AS308 in your system is used within the range of this specification Item Specification Number of files opened simultaneously Maximum 9 files Number of characters in a file name 128 bytes characters on a personal computer 512 bytes characters on a workstation Number of characters in a command line 128 bytes characters on a personal computer 512 bytes characters on a workstation Number of characters that can be set in environment variables 256 bytes characters Number of characters in a name 32 bytes characters Total number of names Depends on the memory capacity of the host computer by which tasks are processed Number of macro definitions 65535 10 ENESAS Renesas Technology Corp AS308 V 1 00 Specifications of AS308 Detail of Specifications Character Set You can use the following characters when writing an assembly program to be assembled by AS308 Uppercase aplphabets ABCDEFFGHIJKLMNOPQRS TUVWXYZ Lowercase alphabets absdefoahijgklmnaopaqarstuvwxzyz Numerals 01234567809 Special characters MA E RA ON A j Blank Space Tab New paragraph or line Carriage return Line feed E Aways be sure to use en size characters when writing in structions and operands You cannot use multi byte char acters e g kanji unless you are writing comments 11 ENESAS Renesas Technology
14. This line is where as308 s directive command is written Only one directive command can be written in one line Comments can be written in the directive command line M You cannot write a directive command and a mnemonic in the same line Assembly source line This line is where a mnemonic is written Comments can be written in the assembly source line A label name can be written at the beginning of the assembly source line You cannot write two or more mnemonics in one line You cannot write a directive command and a mnemonic in the same line Label definition line This line is where only a label is written Comment line This line is where only a comment is written 197 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Blank line This line contains only space tab or line feed code Rules for Writing Lines Separation of lines Lines are separated by the line feed character and an interval from a character immediately after a line feed character to the next line feed character is as sumed to be one line Length of line Up to 255 characters can be written in one line The as308 assembler does not process the characters in any line exceeding this limit Mi when writing lines of statements make sure that your de scription is entered within each line The following describes rules on each type of line you need to follow when writing statements Directive
15. BLKW numeric value name BLKW numeric value Rules for writing command This directive command must always be written in a DATA type section Section types can be made the DATA type simply by writing DATA following the section name when you define a section Always be sure to insert space or tab between the directive command and the operand Write an integral value in the operand A symbol can be written in the operand An expression can be written in the operand The expression in the operand must have its values determined when assembling the source program When defining a label name in the allocated area be sure to write the label name before the directive command Always be sure to insert a colon after the label name Description example symbol EQU T SECTION area DATA workl BLKW 1 work2 BLKW symbol BLKW symbol 1 234 ENESAS Renesas Technology Corp AS308 V 1 00 BTEQU Defines bit symbol Directive Commands Function This command defines a bit position and memory address The symbol defined by this directive command is called a bit symbol By defining a bit symbol with this directive command you can write a bit symbol in the operand of a 1 bit operating instruction The defined bit position is a bit whose position is offset from the LSB of a specified address value of memory by a value that indicates the bit position Bit symbols can be used in symbolic debu
16. Indicates end of macro body Function This command indicates that the body of one macro definition is termi nated here Rules for writing command Always make sure that this command corresponds to directive com mand MACRO as you write it Description format macro name MACRO body ENDM Description example lda MACRO value MOV W value AO ENDM lda 0 MOV W 0 A0 245 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands ENDR Indicates end of repeat macro body Function This command indicates the end of a repeat macro Description format label MREPEAT numeric value body ENDR Rules for writing command Always make sure that this command corresponds to directive com mand MREPEAT as you write it Description example rep MACRO num MREPEAT num IF num gt 49 EXITM nop ENDR 246 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands EQU Defines symbol Function This command defines a value in the range of signed 32 bit integers 32768 to 32767 to a symbol Symbolic debug function is made available for use by defining symbols with this directive command Description format name EQU numeric value Rules for writing command The value that can be defined to a symbol must be determined when assembling the source program Always be sure to insert space or tab between the directive comm
17. To all our customers Regarding the change of names mentioned in the document such as Mitsubishi Electric and Mitsubishi XX to Renesas Technology Corp The semiconductor operations of Hitachi and Mitsubishi Electric were transferred to Renesas Technology Corporation on April 1st 2003 These operations include microcomputer logic analog and discrete devices and memory chips other than DRAMs flash memory SRAMs etc Accordingly although Mitsubishi Electric Mitsubishi Electric Corporation Mitsubishi Semiconductors and other Mitsubishi brand names are mentioned in the document these names have in fact all been changed to Renesas Technology Corp Thank you for your understanding Except for our corporate trademark logo and corporate statement no changes whatsoever have been made to the contents of the document and these changes do not constitute any alteration to the contents of the document itself Note Mitsubishi Electric will continue the business operations of high frequency amp optical devices and power devices Renesas Technology Corp Customer Support Dept April 1 2003 ENESAS Renesas Technology Corp DEV VANCING MITSUBISHI ELECTRIC MSD AS308 UE 990401 Relocatable Assembler for M16C 80 Series AS308 V 1 00 User s Manual EN ESAS as Technology Corp Microsoft MS DOS Windows and Windows NT are registered trademarks of Microsoft Corporation in the U S and other countries IBM AT and OS
18. able module file from assembly source files that contains the relocat able information necessary to link multiple files The In308 editor references section information and global symbol infor mation in the relocatable module file generated by as308 while it deter mines the addresses for the absolute module file section by section Regarding hardware conditions consider the actually used system as you write source statements and perform link pro cessing Hardware conditions refer to 1 RAM size and its address range and 2 ROM size and its address range Programs as308 and In308 have no concern for the physi cal address locations in the actual ROM and RAM of each microcomputer in the M16C 80 series Therefore sections of the DATA type may happen to be allocated in the chip s ROM area depending of how files are linked When linking files be sure to check the addresses in the actual chip to ensure that sections are allocated correctly 18 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Unit of Address Management Section AS308 manages addresses in units of sections Separation of sections are defined as follows An interval from the line in which directive command SECTION is writ ten to a line preceding the line where the next SECTION is written An interval from the line in which directive command SECTION is writ ten to the line where directive command END is written M Sections
19. smp1 name Description example F TYPE 0 yte Proto Type Mode LIF TYPE gt 0 Mass Production Mode yte Debug Mode DIF AO WOW OH KK a oO 257 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands INCLUDE Reads file into specified position Function This command reads the content of a specified file into a line of the source program Nesting level of include files is within 9 When you describe an include file name with an absolute path name AS308 searches the directory described in the operand field for a file An error occurs if no file can be found in the directory When you describe a include file with a relative path name or a file name alone in the operand field of the inclusion directing instruction 1 In an instance in which no directory is designated for the file name des ignated in the command line at the time of starting up AS308 AS308 searches for a file name designated by the inclusion directing instruction In an instance in which a directory is designated for a file name desig nated in the command line at the time of starting up AS308 AS308 searches for a file name resulting from adding a directory name specified in the command line to a file name specified by the inclusion directing instruction 2 AS308 searches the directory designated by the command option I 3 AS308 searches the directory set in the environment variable INC79 Description format I
20. Description example gt 1mc308 O test debug A test mot file is generated gt 1mc308 O tmp test debug A test mot file is generated in the tmp directory 145 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Imc308 V Indicates Version Number Function The software indicates the version number of Imc308 M if this option is specified all other parameters on the com mand line are ignored Description rule Specify this option only and nothing else Description example gt 1mc308 V 146 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Imc308 protect1 Set leveli for ROM code protect function Function For details on the ROM code protect function see the hardware manual of the microcomputer 3F is stored in protect code store address FFFFFF If you filled in protect code sotre address with value when this option is specified the protect code is changed When this option is not speci fied filling value is output When options ID protect1 protect2 to use ROM protect function is specified the following protect code is filled in protect code store ad dress ID protect1 protect2 Protect code Specify Non Non FF Specify Specify Non 3F Specify Non Specify F3 Specify Specify Specify Imc308 error Non Specify Non 3F Non Non Specify F3 Non Non Non Value filling in source program Description rule Always sp
21. Rules for Writing Program AS308 handles the same character strings as directive assemble commands and mnemonics as reserved words These reserved words are not case sen sitive so they are not discriminated between uppercase and lowercase Con sequently ABS and abs are the same reserved words M The reserved words cannot be used in the names described later Types of Reserved Words Directive assemble commands All directive assemble commands explained in this manual and all character strings that begin with one period are the reserved words Mnemonic All assembly language mnemonic of M16C 80 Series are the reserved word Operators All operators explained in this manual are the reserved word System labels The system labels are generated by assembler AS308 handles all character strings that begin with two period as system labels 191 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Names Any desired names can be defined and used as such in your source program Names are classified into the following types each with a different range of descriptions that can be entered in the program Label This name has an address as its value Symbol This name has a constant as its value Bit symbol This name has a constant bit position and address as its values Location symbol This name has an address as its value This symbols are output by as308 Rules for Writing Names
22. edit is name of editor program gt as308 Xedit sample 92 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 Error Messages of as308 is missing is not entered Write an immediate value in this operand ty is missing is not entered Write the right parenthesis corresponding to the is missing LB CELE A CELE is not entered Insert a comma to separate between operands or W is not specified 2 Neither B nor W is specified Neither B nor W can be omitted Write B or W in mnemonic is missing for JELLE IF for ELIF is not found Check the position where ELIF is written is missing for ELSE h IF for ELSE is not found Check the position where ELSE is written is missing for END F IF for ENDIF is not found Check the position where ENDIF is written 93 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 MACRO is missing for ENDM MACRO for ENDM is not found Check the position where ENDM is written MACRO is missing for LOCAL MACRO for LOCAL is not found Check the position where LOCAL is written LOCAL can only be writ ten in a macro block MACRO or MREPEAT is missing for EXITM MACRO or MREPEAT for EXITM is not found Check the position where EXITM i
23. or double quotations as you write it Description example SECTION ram DATA datal BLKB 1 flag DEFINE 01H datal SECTION program CLB flag 239 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands DOUBLE Stores data in ROM in 8 byte length Function This command stores 8 byte long fixed data in ROM Label can be defined at the address where data is stored Description format DOUBLE numeric value name DOUBLE numeric value Rules for writing command Write a floating point number in the operand Refer to Rules for writing operand for details on how to write a floating point number in the operand Always be sure to insert space or tab between the directive command and the operand d When defining a label be sure to write the label name before the direc tive command Always be sure to insert a colon after the label name Description example DOUBLE 5E2 constant DOUBLE 5e2 240 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands ELIF Rexolves the second and the following conditions Function Use this command to write a condition in combination with IF if you want to specify multiple conditions for conditional assemble to be per formed The assembler resolves the condition written in the operand and if it is true assembles the body that follows If condition is true lines are assembled up to and not i
24. section name SECTION section name section type SECTION section name section type ALIGN SECTION section name ALIGN 282 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Rules for writing command Always be sure to write a section name when you define a section When you write an assembly directive command to allocate a memory area or store data in memory or you write a mnemonic always use this directive command to define a section Write the section type and ALIGN after the section name When specifying a section type and ALIGN separate them with a comma as you write Section type and ALIGN can be specified in any desired order Section type can be selected from CODE ROMDATA and DATA The section type can be omitted In this case as308 assumes section type CODE as it processes assembling Description example SECTION program CODE NOP SECTION ram DATA BLKB 10 SECTION dname ROMDATA BYTE abcd END 283 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands SJMP Controls generation of a short jump instruction Function This command controls generation of a short jump instruction No short jump instruction is generated in lines after one in which SJMP OFF is written Short jump instructions are generated in lines after one in which SUMP ON is written Description format SJMP ON SJMP OFF Description rules
25. 2 are registered trademarks of International Business Machines Corporation Intel and Pentium are registered trademarks of Intel Corporation Adobe Acrobat and Acrobat Reader are trademarks of Adobe Systems Incorporated All other brand and product names are trademarks registered trademarks or service marks of their respective holders Precautions to be taken when using this manual The information in this manual does not convey any guarantee or license for the use of the intellectual property rights or any other rights owned by Mitsubishi Electric Corporation Mitsubishi Electric Semiconductor Systems Corporation or third parties Mitsubishi Electric Corporation and Mitsubishi Electric Semiconductor Systems Corporation will not assume any re sponsibility for damage caused by or infringements on third parties proprietary rights arising from the use of the product data drawings tables programs algorithms or other materials in this manual The product data drawings tables programs algorithms and all other materials in this manual reflect the latest information at the time of publication However Mitsubishi Electric Corporation and Mitsubishi Electric Semiconductor Systems Corporation reserve the right to make changes without notice for improvements on characteristics etc Please contact your nearest office of Mitsubishi or its distributor to get the latest information about the product described here before making your final decisio
26. Check the syntax for this option and rewrite it correctly Unknown file extension xxx is specified The specified file extension xxx is incorrect Check the file name 150 ENESAS Renesas Technology Corp AS308 V 1 00 Warning Messages of Imc308 Warning Messages of Imc308 filename does not contain object data The specified file does not contain object data Check the file name Address exceed OFFFFFH The address exceeded OFFFFFh Check the written contents of the source program Check to see how sections are located 151 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Ib308 Method for Operating Ib308 This section explains the method for operating b308 to utilize its functions The primary function of lb308 is to manage multiple relocatable module files as a single library file Command Parameters The table below lists the command parameters available for Ib308 Parameter name Function File name Relocatable module file name to be processed by Ib308 Disable message output to screen Adds module to library file Creates new library file Deletes modules from library file Generates library list file Replaces modules Updates modules Indicates version of librarian Extracts modules Specifies command file 152 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Ib308 Rul
27. Corp AS308 V 1 00 Specifications of AS308 Number of Characters on Command Line The number of characters that can be entered on a command line is 128 char acters bytes for the PC version or 512 characters bytes for the workstation version M The number of characters may be limited below the above specification depending on the operating environment type of OS of AS308 Method for Entering File Name The maximum length of a file name is 128 characters bytes including directory specification for the PC version or 512 characters bytes in cluding directory specification for the workstation version However the number of characters on a command line must not exceed the above mentioned size including the startup program name and all command options Descriptions of file names are subject to the naming conventions of the PC and workstation OS in addition to the above rules Refer to the user s manual of your OS for details Although workstations permit you to use a file name that is separated by the period in two or more places this does not apply when using AS308 AS308 allows use of the pe riod in only one place of a file name Furthermore some AS308 programs restrict file name extensions characters following the period also Refer to the method for starting up each AS308 program for details 12 ENESAS Renesas Technology Corp AS308 V 1 00 Outline of Function Outline of Function AS308 is a s
28. Corp AS308 V 1 00 AS308 Functions Repeat Macro Function The macro body enclosed between directive commands MREPEAT and ENDR is expanded repeatedly into places after the specified line a specified number of times Repeat macros are expanded into the defined line Labels can be written in repeat macro definition lines M This label is not a macro name There is no macro call avail able for repeat macros Conditional Assemble Control The as308 assembler allows you to specify whether or not you want a speci fied range of lines to be assembled by using conditional assemble directive commands Configuration of Conditional Assemble Block The diagram below shows the configuration of a conditional assemble block Conditional assemble block can be written Conditional assemble block can be written Conditional Can be omitted assemble block Can be written for 7 i multiple instances Conditional assemble block can be written Can be omitted CE Conditional expression 43 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Executing Conditional Assemble The following shows examples of how conditional assemble is executed after selecting from three messages Here the assembly source file name is sample a30 Conditional assemble execution examples are shown below Assebly Source File ECTION outdata ROMDATA ALIGN TYPE 0 PROTO TYPE TYPE gt 0 MASS P
29. Error Messages of as308 ccoicconiaonad nato tai 93 Warning Messages Of as308 oooooocccccnnocccccccononcnnonancnnnnnnnnccnnnnnnn cnn 108 5 RENESAS Renesas Technology Corp AS308 V 1 00 Contents Method for Operating IN308 ooococcninccccccnocaccccnanancccnonncnccnnnnnnncnncnnnnns 111 Command Parameters ccccncccinnccccconccinncncnnonccnnnn cnn none ca narran 111 Rules for Specifying Command Parameters 0 ceeeeeee 112 Command FilB acetona di 113 e A REO ao pi 115 leona aire iiod 116 Aisa 117 A adas 118 LD das 119 LLOC ee da aceros Oh 120 Me ir le oe cre 121 MS MS iii 122 NOSTOP cio ita 123 O O OPT 124 ORDER a a dd 125 A e th nots eee fa 126 Mi E ee en 127 Dinastia atada 128 Error Messages of INSO8 ij cocinar 129 Warning Messages Of IN308 oooocccccnocccnncnoccccnnnnoncccnnnannncnonannnnnnnnns 134 Method for Operating IMC308 oooococcconoccccconaoncccnnnannccnnnnancnnnnnn nos 138 Command Parameters incociciniconciananend un nedecdcuestaadedauennndcens 138 Rules for Specifying Command Parameters 0 cceeee 139 Sigh A Lie ahs heen tie Ae aa A a ate dla 140 O EE E 141 A AAA 142 Dia dido 143 dl ei 144 Di cut Site Na At at ate os repar o 145 Md entities i eben he omg ata al 146 PPOlO Ct vives se caves ives eee c 147 POEGA eaa ont ea rE eolica 148 6 ENESAS Renesas Technology Corp AS308 V 1 00 Contents Error Messages Of IMC308 ooooccconoccccccconccoccconancn
30. Files of AS308 The table below lists the types of files input for AS308 and those output by AS308 Any desired file names can be assigned However if the extension of a file name is omitted AS308 adds the extension shown in _ in the table below by default as308 Input Files Source file a30 Include file inc Output Files Relocatable module file r30 Assembler list file Ist Assembler error tag file atg In308 Input Files Relocatable module file r30 Library file lib Output Files Absolute module file x30 Map file map Linkage error tag file Itg Imc308 Input Files Absolute module file x30 Output Files Motorola S format file mot Intel HEX format file hex 54 ENESAS Renesas Technology Corp AS308 V 1 00 10308 Input Files Relocatable mofule file r30 Input Output Files of AS308 Output Files Library file lib Relocatable module file r30 Library list file ls xrf308 Input Files Source file a30 Assembler list file Ist Output Files Cross reference file xrf abs308 Input Files Absolute module file x30 Assembler list file Ist Output Files Absolute list file als 55 ENESAS Renesas Technology Corp AS308 V 1 00 Input Output Files of AS308 Relocatable Module File A relocatable module file is one of the files generated by as308 This file is linked by In308 to generate
31. Length of name A character string can be entered as a name in up to 255 characters Determination of name Names are case sensitive so they are discriminated between uppercase and lowercase Therefore LAB and Lab are handled as different names M You cannot use any name that is identical to one of AS308 s reserved words If this rule is not followed program opera tion cannot be guaranteed The following describes the types of names you can define in your program 192 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Label Function This is a name assigned to a specific address in the range of addresses that can be accessed by the CPU Rules for writing Alphabets numerals and the underline can be used for this name Numerals cannot be used at the beginning of this name When defining a name always be sure to add the colon at the end of the name Defining method There are two methods to define a label 1 Allocate a memory area with a directive command Example flags BLKB 1 work BLKD 1 2 Write a name at the beginning of a source line Example namel _name sym_name Referencing method Write a name in the operand of a mnemonic Example JMP sym_name 193 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Symbol Function This is a name assigned to a constant Rules for writing Numeric values must be a det
32. Library file reference was specified on the command line Condition 2 After all specified relocatable module files have been allocated some global labels remain whose values are depending determination The In308 editor links the entire relocatable module where necessary global labels are defined Rules for referencing library modules The In308 editor determines the relocatable modules to be linked in the order described below A relocatable module that has been determined to be linked is relocated section by section Sections are relocated in the same way as sections are relocated in a relocatable module file 4 The In308 first searches the global label information of relocatable mod ules entered in a library file Relocatable modules are referenced in the order they are entered in the library file The labels searched from the library file are compared with the labels whose values are pending If any labels match In308 links this relocat able module in the library file to the absolute module file After going over the relocatable modules in the library file if there re mains any global label whose value is pending i e a relocatable mod ule in the library file contains an external reference label In308 again searches modules in the library file in the order they are entered 27 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Example of referencing library modules libsmp1 a30 GLB syml Exter
33. an absolute module file Format of relocatable module file The relocatable module file generated by as308 is based on the IEEE 695 format M Since this file comes in a binary format it cannot be output to a display screen or printer nor can it be edited Note that if you open or edit this file with an editor file processing in the subsequent stages will not be performed normally File name of relocatable module file The file name of the relocatable module file is created by changing the exten sion of the assembly source file a308 by default to r30 sample a30 gt sample r30 Directory for relocatable module file generated If you specified the directory with command option O the relocatable mod ule file is generated in that directory If no directory is specified the relocatable module file is generated in the directory where the assembly source file re sides 56 ENESAS Renesas Technology Corp AS308 V 1 00 Assembler List File Input Output Files of AS308 Only when you specified command option L or LM as308 generates source line information and relocatable information as a file in text format that can be output to a display screen or printer Format of assembler list file The information listed below is output to an assembler list file The output format of this assembler list file is shown in Example of Assembler List File 1 1 List line information SEQ Outputs the line numbers
34. any point in the command line Description example The structured commands in the assembly source file are processed and the developed part is output to an assembler list file gt as308 mod60p LS sample 85 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 M Generate Structured Description Command Variables in Byte Type Function The software processes variables in structured description commands whose types are indeterminate as the byte type Description rule This option can be specified at any position of the command line Make sure this option is specified along with a command option P Description example gt as30 P M sample gt as30 M P sample 86 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 N Disables Line Information Output Function The software does not output C language source line information to a relocatable module file The size of the relocatable module file can be reduced M Absolute module files generated from the relocatable mod ule file that was generated after specifying this option can not be debugged at the source line level Description rule This option can be specified at any position on the command line This option can be set in environment variable AS308COM Refer to Example for using AS308COM for details on how to set Description example as308 N sample 87 ENESAS
35. cannot be nested by definition Start and end of a section One section begins from a line where the section is defined and continues to the end of th esource file the line where directibe command END is written or a line where another section is defined SECTION ram DATA start of ram section work BLKB 10 end of ram section SECTION program CODE start of program section JSR subl end of program section SECTION subroutine start of subroutine section subl NOP MOV W work 7 RTS end of subroutine section END End of Source 19 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Type of Section You can set a type for a section in which units addresses are controlled by AS308 The instructions that can be written in a section vary with its type CODE program area This area is where a program is written All commands except directive commands to allocate a memory area can be written here Specify that CODE type sections be located in a ROM area in the abso lute module Example SECTION program CODE DATA variable data area This area is where memory where contents can be modified is located Directive commands to allocate a memory area can be written here Specify that DATA type sections be located in a RAM area in the abso lute module Example SECTION mem DATA ROMDATA fixed data area This area is where fixed data other than program
36. command line Function Directive command of assembler can be written in this line Rules for writing Always be sure to insert a space or tab between the directive command and its operand When writing multiple operands always be sure to insert a comma between each operand A space or tab can be inserted between the operand and comma Some directive commands are not accompanied by an operand Directive commands can be written starting immediately from the top of a line A space or tab can be inserted atthe beginning of a directive command 198 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program When writing a comment in the directive command line insert a semico lon after the directive command and operand and write your com ment in columns following the semicolon Comments are output to an assembler list file The as308 assembler processes anything written in columns after the semicolon as a comment Consequently the assembler does not generate code for the mnemonics and directive commands written in columns after the semicolon Therefore be careful with the position where you enter the semicolon If a semicolon is enclosed with double quota tions or single quotation AS308 does not assume it to be the first character of a comment A space or tab can be inserted between a directive command s operand and a comment Description example sym work
37. contents of the command file Command line is too long The character string on the command line is excessively long Create a command file Illegal file format filename 2 The file format of filename is incorrect Check the file name 167 ENESAS Renesas Technology Corp AS308 V 1 00 Error Messages of Ib308 Invalid option option is used 2 An invalid option option is used Specify the option correctly again MCU informatino mismatch in file xx r30 2 The file information does not match the MCU information Specify a relocatable module file generated by as308 No public symbol is in filename There is no public symbol in the file filename Check the contents of the relocatable file Not enough memory 2 Memory is insufficient Increase the memory capacity Symbol name characters exceed 500 2 The symbol name consists of more than 500 characters Divide the library file Too many modules There are too many registered modules Divide the library file into two or more files Unknown file extension xxx is used 2 The file extension xxx is incorrect Check the file name 168 ENESAS Renesas Technology Corp AS308 V 1 00 Warning Messages of Ib308 Warning Messages of Ib308 module is not registered in library The module module is not registered in the library Therefore no mod ules of the specified name were extracted Check the module name mod
38. extract start position and the number of characters to be extracted If you specify 1 for the extract start position it means the beginning of the character string The 7 bit ASCII code characters including a space and tab can be used to write a character string Kanji and other 8 bit code are not processed correctly How ever the as308 assembler does not output errors Always be sure to enclose the character string with quotations as you write it If you want a macro argument to be expanded as a charac ter string enclose the parameter name with single quota tions as you write it Note that if you enclose a character string with double quotations the character string itself is expanded 286 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Description example name MACRO data MREPEAT LEN data BYTE SUBSTR data MACREP 1 ENDR ENDM name ABCD BYTE A BYTE B BYTE E BYTE D The length of the character string that is given as actual parameter of the macro is given to the operand of MREPEAT MACREP is incremented 1 gt 2 gt 3 gt 4 each time the BYTE line is executed Consequently the character string that is given as actual parameter of the macro is given successively to the operand of BYTE one character at a time beginning with the first character in that charac ter string 287 ENESAS Renesas Technology Corp AS308 V 1 00 Direc
39. for writing command This directive command must always be written in a DATA type section Section types can be made the DATA type simply by writing DATA following the section name when you define a section Always be sure to insert space or tab between the directive command and the operand Write an integral value in the operand A symbol can be written in the operand An expression can be written in the operand The expression in the operand must have its values determined when assembling the source program When defining a label name in the allocated area be sure to write the label name before the directive command Always be sure to insert a colon after the label name Description example symbol EQU T SECTION area DATA workl BLKA 1 work2 BLKA symbol BLKA symbol 1 229 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands BLKB Allocates RAM area in units of 1 bytes Function This command allocates a specified bytes of RAM area in units of 1 byte Label name can be defined at the allocated RAM address Description format BLKB numeric value name BLKB numeric value Rules for writing command This directive command must always be written in a DATA type section Section types can be made the DATA type simply by writing DATA following the section name when you define a section Always be sure to insert space or tab between the directive comman
40. is processing Error messages are output to screen Description rule This option can be specified at any position on the command line Description example xrf308 sample a30 182 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating abs308 D Specifies File Search Directory Function Specify the directory in which you want assembler list files to be searched If this directory is not specified abs308 searches assembler list files from the current directory Description rule d Input this option using a form like D directory name No space or tab can be entered between this option and the directory name Description example abs308 sample Ddir Assembler list files in dir under the current directory are searched abs308 sample Ddir listl File list1 Ist is searched in dir under the current directory is searched 183 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating abs308 O Specifies File Output Directory Function Specify the directory in which you want the absolute list file to be gener ated If this directory is not specified the absolute list file is generated in the current directory Description rule Input this option using a form like O directory name No space or tab can be entered between this option and the directory name Description example abs308 sample Oabslist The absolute list file is generated i
41. name in the allocated area be sure to write the label name before the directive command Always be sure to insert a colon after the label name Description example symbol EQU I SECTION area DATA workl BLKD 1 work2 BLKD symbol BLKD symbol 1 231 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands BLKF Allocates RAM area in units of 4 bytes Function This command allocates a specified bytes of RAM area in units of 4 bytes Label name can be defined at the allocated RAM address Description format BLKF numeric value name BLKF numeric value Rules for writing command This directive command must always be written in a DATA type section Section types can be made the DATA type simply by writing DATA following the section name when you define a section Always be sure to insert space or tab between the directive command and the operand Write an integral value in the operand A symbol can be written in the operand An expression can be written in the operand The expression in the operand must have its values determined when assembling the source program When defining a label name in the allocated area be sure to write the label name before the directive command Always be sure to insert a colon after the label name Description example symbol EQU T SECTION area DATA workl BLKF 1 work2 BLKF symbol BLKF symbol 1 232 ENES
42. not appropriate 2 The format specifier is written incorrectly Make sure that the format specifier is written correctly Illegal directive command is used 2 An illegal instruction is entered Rewrite the instruction correctly Illegal file name The file name is illegal Specify a file name that conforms to file name description rules Illegal macro parameter The macro parameter contains some incorrect description Check the written contents of the macro parameter Illegal operand is used 2 The operand is incorrect Check the syntax for this operand and rewrite it correctly Include nesting over Include is nested too many levels Rewrite include so that it is nested within the valid levels Including the include file in itself 2 An attempt is made to include the include file in itself Check the include file name and rewrite correctly Invalid bit symbol exist 2 An invalid bit symbol is entered Rewrite the bit symbol definition 98 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 Invalid label definition 2 An invalid label is entered Rewrite the label definition Invalid operand s exist in instruction The instruction contains an invalid operand Check the syntax for this instruction and rewrite it correctly Invalid option xx is in environment data 2 The environment variable contains invalid command option xx Set the env
43. of macro call 1 name name address BYTE name address Example of macro call 2 name name address BYTE name address Description example mac MACRO pl p2 p3 ond E MACPARA JIE p1 byte MOV B p2 p3 ELSE MOV W p2 p3 ENDIF ELIF MACPARA IF p1 byte MOV B p2 ROL ELSE MOV W p2 R0 ENDIF ELSE MOV W RO R1 ENDIF ENDM mac word 10 R0 IF 3 3 ELSE MOV W 10 RO ENDIF ENDIF ENDM 270 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands MREPEAT Indicates beginning of repeat macro bady Function This command indicates the beginning of a repeat macro The macro body is expanded repeatedly a specified number of times The maximum number of repetitions that can be specified is 65 535 Repeat macros can be nested in up to 65 535 levels The macro body is expanded into the line in which this directive com mand is written Description format label MREPEAT numeric value body ENDR Rules for writing command Always be sure to write the operand Always be sure to insert space or tab between this directive command and the operand A label can be written at the beginning of this directive command A symbol can be written in the operand M Forward referenced symbols cannot be used here An expression can be written in the operand Macro definition and macro call can be written in the body D
44. of the assembler list 2 Location information Loc Outputs the location addresses of a range of object code that can be deter mined when assembling 3 Object code information OBJ Outputs the object code corresponding to mnemonics 4 Line information OXMSDA Outputs information on the results of source line processing performed by as308 Specifically this information contains the following O XMSDA Contents 0 9 Indicates the include file s nest lebel x Indicates that this line was not assembled in condition asemble M Indicates that this is a macro expansion line Indicates that jump distance specifier S was selected Indicates that jump distance spedifier B was selected Indicates that jump distance spedifier W was selected Indicates that jump distance spedifier A was selected N PISI 0 0u Indicates that zero form Z was selected for the instruction for mat Indicates that short form S was selected for the instruction for mat Indicates that quick form Q was selected for the instruction for mat Indicates that 8 bit displacement SB relative addressing mode was selected 57 ENESAS Renesas Technology Corp AS308 V 1 00 Input Output Files of AS308 5 Source line information SOURCE STATEMENT Outputs the assembly source line File name of assembler list file The file name of the assembler list file is cre
45. or less Too many nesting level of condition assemble Condition assembling is nested too many levels Check the syntax for this condition assemble statement and rewrite it correctly 106 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 Too many macro local label definition 2 Too many macro local labels are defined Make sure that the number of macro local labels defined in one file are 65 535 or less Too many macro nesting The macro is nested too many levels Make sure that the macro is nested no more than 65 535 levels Check the syntax for this source statement and rewrite it correctly Too many operand 2 There are extra operands Check the syntax for these operands and rewrite them correctly Too many operand data There are too many operand data The data entered in the operand exceeds the size that can be written in one line Divide the instruction Too many temporary label There are too many temporary labels Replace the temporary labels with label names Undefined symbol exist 2 An undefined symbol is used Define the symbol Value is out of range 2 The value is out of range Write a value that matches the register bit length WHILE not associates with DO No corresponding DO is found for WHILE Check the source description 107 ENESAS Renesas Technology Corp AS308 V 1 00 Warning Message of as308 Warning Messages of as308 A
46. relocatable file Check the file name Check to see that the file is one that was gener ated by as308 module already registered in filename 2 The module module has already been registered in the library filename Check the library file name and the relocatable file name module does not match with filename The module name module and the relocatable file name filename do not match The module name has been modified Check the relocatable file name module is multiple specified 2 Multiple modules of the same name module are specified Specify the module name correctly again module is not registered in filename The module module is not registered in the library file filename Speci fied processing to delete or update module cannot be performed Check the module name 165 ENESAS Renesas Technology Corp AS308 V 1 00 Error Messages of Ib308 symbol is multiple defined at modulel and module2 in filename Externally defined symbols of the same name symbol are defined in two places of the library filename one in module1 and another in mod ule2 Check the relocatable file name symbol is multiple defined in filename 2 The symbol symbol is defined twice in the file filename If this error occurs please contact tool support personnel at Mitsubishi symbol is multiple defined in modulel and module2 2 Externally defined symbol sy
47. search character string and search start position with commas as you write them No space or tab can be inserted before and after the comma A symbol can be written in the search start position 259 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands If you specify 1 for the search start position it means the beginning of the character string The 7 bit ASCII code characters including a space and tab can be used to write a character string Kanji and other 8 bit code are not processed correctly How ever the as308 assembler does not output errors Always be sure to enclose the character string with quotations as you write it If you want a macro argument to be expanded as a charac ter string enclose the parameter name with single quota tions as you write it Note that if you enclose a character string with double quotations the character string itself is expanded This directive command can be written as a term of an expression Description example top EQU 1 point_set MACRO source dest top point EQU INSTR source dest top ENDM point_set japanese se 1 point EQU 7 This example extracts the position 7 of the character string se from the beginning top of the specified character string japanese 260 ENESAS Renesas Technology Corp AS308 V 1 00 LEN Directive Commands Indicates length of specified character string Function This command indicates the
48. the absolute module file into Itg sample x30 gt sample ltg Directory for link error tag file generated The link error tag file is generated in the directory where the absolute module file resides 61 ENESAS Renesas Technology Corp AS308 V 1 00 Input Output Files of AS308 Motorola S Format The Imc308 generates a Motorola S format file that can be programmed into EPROM Format of Motorola S file The following can be specified when generating a Motorola S format file Set the length of one data record to 16 bytes or 32 bytes e Set the start address of a program File name of Motorola S file The file name of the Motorola S file is created by changing the extension x30 of the absolute module file into mot sample x30 gt sample mot Directory for Motorola S file generated The files are generated in the current directory Intel HEX Format Only when you specify command option H Imc308 generates an Intel HEX format file that can be programmed into EPROM Format of Intel HEX file The following can be specified when generating an Intel HEX format file Set the length of one data record to 16 bytes or 32 bytes MF the address value exceeds 1Mbytes of machine language file the file of Original HEX format for Mitsubishi microcom puters is generated This file can not be program into EPROM 62 ENESAS Renesas Technology Corp AS308 V 1 00 Input Output Files of AS308 File name of Int
49. the comma Description example gt 1n308 samplel sample2 L libl The lib1 lib file in the current directory or the directory specified in environ ment variable LIB308 is referenced as necessary gt 1n308 samplel sample2 L work libl The lib1 lib file in the work directory that resides below the current directory gt 1n308 samplel sample2 L lib1 1ib2 The lib1 lib and lib2 lib files in the current directory or the directory specified in environment variable LIB308 are referenced as necessary 118 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 LD Specifies Library File Directory Function Specify the directory name in which you want a library file to be refer enced Even when you specify this option you need to specify the library file name The directory name specified by this option remains valid until another directory is specified by this option next time If you have specified a path in the library file name the directory in which library files are referenced by In308 is one that is located by linking the library file path to the directory specified by this option Description rule Input this option using a form like LD directory name Always be sure to insert a space between this option and the directory name This option can be specified at any position on the command line Description example The work lib lio1 file is referenced gt 1n308
50. to follow when writing a source program that can be assembled by AS308 Precautions on Writing Program Pay attention to the following when writing a program to be assembled by AS308 Do not use the reserved words of AS308 for names in your source pro gram The character strings consisting of AS308 directive commands which have had the periods removed can be used for names without causing an error However avoid using these character strings because some of them affect processing performed by AS308 System labels the character strings that begin with written in your source program may not result in generating an error However avoid using system labels because some of them may be used for AS308 extension in the future 189 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Character Set You can use the following characters when writing an assembly program to be assembled by AS30 Uppercase alphabets ABCDEFGHIJKLMNOPQRS TUVWXYZ Lowercase alphabets abcdefghigjgkimnopgqrstuvwxyz Numerals 012345678 9 Special characters Ma gape ee AO O BE AS E A O oe Blank Space Tab New parabraph or line Carriage retrn Line feed M Always be sure to use en size characters when writing in structions and operands You cannot use multi byte char acters e g Kanji unless you are writing comments 190 ENESAS Renesas Technology Corp AS308 V 1 00 Reserved Words
51. to insert space or tab between this directive command and the operand Make sure that macro local label declaration by this directive command is entered before you define the label name To write a macro local label name follow the rules for writing name in Section 1 Rules for Writing Program Multiple labels can be written in the operand of this directive command providing that they are separated with a comma In this case up to 100 labels can be entered 264 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands M The maximum number of macro local labels that can be writ ten in one assembly source file including the contents of include files is 65 535 Description example name MACRO LOCAL m1 m1 is the macro local label ml NOP JMP ml ENDM 265 l ENESAS Renesas Technology Corp AS308 V 1 00 LWORD Directive Commands Stores data in ROM in 4 byte length Function This command stores 4 byte long fixed data in ROM Label can be defined at the address where data is stored Description format LWORD numeric value name LWORD numeric value Rules for writing command Description example Write an integral value in the operand Always be sure to insert space or tab between the directive command and the operand A symbol can be written in the operand An expression can be written in the operand When writing multiple operands separate them with a comma
52. written in the lines immediately following this directive command are determined The memory addresses to be allocated by an area allocating directive command that is written in the lines immediately following this directive command are determined Description format ORG numeric value SECTION program SECTION _ram DATA ORG 8000H FORG 800H main rrr work VBERBUUUUUTT 30 NOP NOP code 04H is stored at address 8000H 3 byte area is allocated beginning with address 800H RAM work 800 801 802 275 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Rules for writing command This directive command must always be written immediately after a sec tion directive command If directive command ORG is not found in the line immedi ately following description of SECTION the section is as signed relative attribute This directive command cannot be written in relative attribute sections Always be sure to insert space or tab between the directive command and the operand The values that can be written in the operand are a numeric value in the range of 0 to OFFFFFH An expression can be written in the operand However this expression must have its values determined when assembling the source program A symbol can be written in the operand However this symbol must have its values determined when assembling the source program This directive command can not be w
53. 00 Contents AS308 V 1 00 User s Manual Contents SPSCHICAUONS Ol ASSUS ds REE 10 Detail of Specifications cccceecceeeeeceeeeeeeeeeeeeeeeetaeeeeeeeees 11 SA E tee 13 CONTIGUA ION ai aia lee 13 A a o 15 Outline of as308 FUNCTIONS oooonccccnnnnicnnncccnnonnnnnnccononrnnnnnnncnnnnos 16 Outline Of In308 fUNCHIONS ooooocccnnnncccccnnononancnnnononnncnnnnnonnnnnnno 17 Outline of Imc380 FUNCTIONS ooooooccnnncicnnncconncccnancccnonannnann coca 17 Outline of Ib308 FUNCTIONS oooniccinnnncnnncccnnnononnnncccnnarnn narco 17 Outline of xrf308 FUNCTIONS oooooccccnnnoooccnonononcncnnnnnonncnnnonononcnnno 17 Outline of abs308 FUNCTIONS oooooocinnncicnncccnnoninnancccnonrnnnnnnnnnnno 17 AS308 Functions Aaa RS emmediaetaediraa 18 Relocatable Assemble ccceececeeeeesceeeeeeeeeeeeeeeeenaeeeeeeeaaes 18 Unit of Address Management Section cececeeeeeeeees 19 Rules on Section Management cccceceeeeeeeeeeceeeeeeeeeees 21 Label and SYMbOI reran aa e EAE AEA ANIE 25 Management of Label and Symbol Addresses 008 25 Library File Referencing Function ccoooiocccccnnnocccccncnnanccnncnanos 27 Management of Include File oooonoccccnnnnocccccnnanaccccnnnnacnncnnnnnn 29 Code Selection by AS308 oocccicocccinccccncccccooncncnnnaccnnnnnn nana cnn 30 Optimized Selection by AS308 0ooooncccccnccconnccccnoccccononanannnccnnns 31 Example of Optimization Selection by as308B o oco
54. 7 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Rules for writing formal parameter To write a macro formal parameter name follow the rules for writing name in Section 1 Rules for Writing Program When defining a macro formal parameter use a name that is unique including nested macro definitions When defining multiple formal parameters separate the formal param eters with a comma as you write them Always make sure that the formal parameters written in the operand of directive command MACRO are written within the macro body All character strings enclosed with double quotations indi cate the character strings themselves and nothing else Therefore do not enclose the formal parameters with double quotations Up to 80 formal parameters can be entered This means that you can enter up to 80 formal parameters within the range of the number of characters that can be written in one line Rules for writing actual parameter Always be sure to insert space or tab between the macro name and the actual parameter Make sure that the actual parameters you write are corresponded one for one to the formal parameters when the macro is called When using a special character to write a actual parameter be sure to enclose the character with double quotations as you write it Labels global labels and symbols can be used to write actual param eters An expression can be entered in a actual paramete
55. 8 as308 INC308 as308 LIB308 In308 TMP308 as308 In308 1b308 AS308COM The as308 assembler adds the command options set in the environment vari ables as it processes a file The command options set in this environment variable can be nullified by us ing two consecutive hyphens The command options listed below can be set to this environment variable 46 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions How to set up AS308COM PC version SET AS308COM L N S T Workstation version setenv AS308COM L N S T M When setting a character string containing spaces to this environment variable while operating on a workstation al ways be sure to enclose the character string with quotations as you enter it How to clear the settings on AS308COM PC version SET AS308COM Workstation version unsetenv AS308COM Example for using AS308COM When environment variable AS308COM is set as308 sets the command op tions in the following order 1 as308 first sets the command options set in AS308COM 2 as308 sets the command options entered from a command line The following shows an example for setting an option to AS308COM an ex ample for entering a command option from a command line and an example of a valid command option Example for setting up AS308COM SET OPT308 L N S L Command input example 1 as308 Dsym 0 N Option that becomes valid when executing as308 1 as308 Dsym 0 L S
56. AS Renesas Technology Corp AS308 V 1 00 Directive Commands BLKL Allocates RAM area in units of 4 bytes Function This command allocates a specified bytes of RAM area in units of 4 bytes Label name can be defined at the allocated RAM address Description format BLKL numeric value name BLKL numeric value Rules for writing command This directive command must always be written in a DATA type section Section types can be made the DATA type simply by writing DATA following the section name when you define a section Always be sure to insert space or tab between the directive command and the operand Write an integral value in the operand A symbol can be written in the operand An expression can be written in the operand The expression in the operand must have its values determined when assembling the source program When defining a label name in the allocated area be sure to write the label name before the directive command Always be sure to insert a colon after the label name Description example symbol EQU T SECTION area DATA workl BLKL 1 work2 BLKL symbol BLKL symbol 1 233 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands BLKW Allocates RAM area in units of 2 bytes Function This command allocates a specified bytes of RAM area in units of 2 bytes Label name can be defined at the allocated RAM address Description format
57. Comments are output to an assembler list file The as308 assembler does not generate code for the mne monics or directive commands written in columns after the semicolon Therefore be careful with the position where you enter the semicolon If a semicolon is enclosed with double quotations or single quotation AS308 does not assume it to be the first character of a comment A space or tab can be inserted between a mnemonic s operand and a comment Description example main MOV W 0 RO RTS MOV W 0 A0 RTS End of subroutine 201 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Label definition line Function Any desired name can be written in this line Rules for writing Always be sure to enter the colon immediately after a label name Do not write anything between the label name and the colon Label names can be written starting immediately from the top of a line A space or tab can be inserted at the beginning of a line When writing a comment in the label definition line insert a semicolon after the directive command and operand and write your comment in columns following the semicolon Comments are output to an assembler list file M The as308 assembler does not generate code for the mne monics or directive commands written in columns after the semicolon Therefore be careful with the position where you enter the semicolon If a semicolon is enclose
58. DD 1 2 ELSE ADD RO f1 ENDIF ENDM name mem ELSE ADD RO mem ENDIF ENDM 220 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands MACREP Indicates how many times repoeat macro body is expanded Function This command indicates how many times the repeat macro is expanded This command can be written in the body of a macro definition defined by MREPEAT E if this command is written outside the macro body its value is made 0 This command can be written in the conditional assemble operand Description format MACREP Rules for writing command This directive command can be written as a term of an expression 221 ENESAS Renesas Technology Corp AS308 V 1 00 Description example MREPEAT 3 MOV W RO MACREP ENDR MOV W RO 1 MOV W RO 2 MOV W RO 3 GLB mem mclr MACRO value name MREPEAT value MOV W 0 name MACREP ENDR ENDM mclr 3 mem MREPEAT 3 MOV W 0 mem 1 MOV W 0 mem 2 MOV W 0 mem 3 ENDR ENDM 222 ENESAS Renesas Technology Corp Directive Commands AS308 V 1 00 ADDR Directive Commands Stores data in ROM in 3 byte length Function This command stores 3 byte long fixed data in ROM Label can be defined at the address where data is stored Description format ADDR numeric value name ADDR numeric value Rules for writing command Write an integral value in the operand Alwa
59. E 990401 1999 MITSUBISHI ELECTRIC CORPORATION 1999 MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION ENESAS Renesas Technology Corp MITSUBISHI ELECTRIC CORPORATION MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION ENESAS Renesas Technology Corp
60. E type to the section written mnemonic Moved between address registers as byte size Transfers between address registers are performed in bytes Rewrite the mnemonic correctly Statement has not effect 2 The statement does not have any effect as a command line Check the correct method for writing the command Too many actual macro parameters There are too many actual macro parameters Extra macro parameters will be ignored Too many structured label definition There are too many labels to be generated Divide the file into smaller files before assembling Unnecessary BREAK is found 2 Found two or over BREAK statement in a SWITCH block Check the source program 110 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 Method for Operating In308 This section describes how to use the functions of In308 The basic function of In308 is to generate one absolute module file from two or more relocatable module files Command Parameters The table below lists the command parameters available for In308 Parameter name Function File name Relocatable module filename to be processed by In308 Disable message output to screen Spedifies start address of absoluute module Outputs source debug information to absolute module file Specifies library file to be referenced Specifies section allocation sequence Specifies directory of library to be referen
61. IF and ELIF Evaluates that value on right side of operator is greater than value left side This operator can only be written in operand of directive commands AF and ELIF Evaluates that value no left side of operator is equal to or greater than value on right side This operator can only be written in operand of direc tive commands IF and ELIF Evaluates that value no right side of operator is equal to or greater than value on left side This operator can only be written in operand of direc tive commands IF and ELIF Evaluates that value on left side and right side of operator are equal This operator can only be written in operand of directive commands IF and ELIF Evaluates that value on left side and right side of operator are not equal This operator can only be written in operand of directive commands IF and ELIF 210 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Operators to priorities operation Operation enclosed with is performed first befor any other operation If oneexpression contains multiple parentheses leftmost pair is giben priority Parenthesezed operations can be nested Operation Priority in Expression The as308 assembler follows the order of priority shown below as it performs arithmetic operation on the expression written in an operand and handles the value resulting from this operation as an operand value 1 Operation is performed in order of operat
62. LIGN with not ALIGN specified relocatable section 2 Directive command ALIGN is written in a section that does not have an ALIGN specification Check the position where directive command ALIGN is written Write an ALIGN specification in the section definition line of a section in which directive command ALIGN is written definition is after DEFAULT CASE is preceded by a DEFAULT description Make sure all DEFAULT commands are written after the CASE state ment CASE CASE not exist in SWITCH statement No CASE description is found in the SWITCH statement Make sure the SWITCH statement contains at least one CASE state ment END statement is in include file 2 The include file contains an END statement END cannot be written in include files Delete this statement The software will ignore END as it executes Actual macro parameters are not enough The number of actual macro parameters is smaller than that of formal macro parameters The formal macro parameters that do not have corresponding actual macro parameters are ignored 108 ENESAS Renesas Technology Corp AS308 V 1 00 Warning Message of as308 Addressing is described by the numerical value 2 Addressing is specified with a numeric value Be sure to write in numeric values Control register differ size The control register is a different size than that of the M16C 80 Series and other MCU s of t
63. M The assembler does not care whether the operation has re sulted in overflow or underflow A symbol can be written in the left and right sides of the relational opera tor E Symbols cannot be forward referenced only the symbols that are defined after this directive command are referenced Forward referenced symbols or undefined symbols written here are assumed to be 0 in value as the assembler re solves the conditional expression 256 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands An expression can be written on the left and right sides of the relational operator To write an expression follow the rules for writing expres sion in Section 1 Rules for Writing Program A character string can be written on the left and right sides of the rela tional operator Always be sure to enclose the character string with single quotations or double quotations as you write it Which character string is larger or smaller than the other is resolved by the value of char acter code ABC lt CBA gt 414243 lt 434241 therefore condition is true non lt man gt 43 lt 41 therefore condition is false Space or tab can be written before or after the relational operator A conditional expression can be written in the operands of directive com mands IF and ELIF Description example of conditional expression sym lt 1 sym lt 1 sym 2 lt datal sym 2 lt datal 2
64. NCLUDE file name Rules for writing command Always be sure to insert space or tab between the directive command and the operand Always be sure to write a file extension in the operand file name A character string that includes directive command FILE or can be written E Donot specify INCLUDE the file itself within the include file Description example INCLUDE initial a30 258 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands INSTR Detects specified character string Function This command indicates a position in the character string specified in the operand at which a search character string begins A position can be specified at which you want the assembler to start searching a character string M The value is rendered 0 if a search character string is longer than the character string itself The value is rendered 0 if a search character string is not included in the character string The value is rendered 0 if the search start position is as signed a value greater than the length of the character string Description format INSTR CS SC SP INSTR CS SC SP CS character string SC search character string SP search start position Rules for writing command Always be sure to enclose the operand with Always be sure to write the character string search character string and search start position Separate the character string
65. RODUCTION TYPE K H ti DEBUG MODE S IE B B B Command Input 1 gt as308 sample Dtype 0 Assembled Result 1 SECTION outdata ROMDATA ALIGN BYTE PROTO TYPE END 44 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Command Input 2 gt as308 sample Dtype 1 Assembled Result 2 SECTION outdata ROMDATA ALIGN BYTE MASS PRODUCTION TYPE END Command Input 3 gt as308 sample Dtype 1 Assembled Result 3 SECTION outdata ROMDATA ALIGN BYTE DEBUG MODE END Next the following shows an example of how to set a value to TYPE in the assembly source file EQU 0 SECTION outdata ROMDATA ALIGN IF TYPE PROTO TYPE TYPE gt 0 MASS PRODUCTION TYPE DEBUG MODE 45 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Source Line Information Output The as308 assembler outputs to a relocatable module file the information that is necessary to implement source debugging of NC308 and Macro descrip tion of AS308 Symbol Definition The as308 assembler allows you to define symbols by entering command op tion D when starting up the program This function can be used in combina tion with a condition assemble function etc Environment Variables of as308 The as308 assembler references the environment variables listed below Environment Variables Program AS308COM as308 BIN30
66. STE commands are replaced with the MOV command before processing 1 bit operating commands are replaced with commands for AS308 be fore processing Bit operating commands BAND BCLR BNAND BNOR BNOT BNTST BNXOR BOR BTST BTSTC BTSTS BXOR and BMcnd are replaced in the same way as BSET See the replacement command list 52 ENESAS Renesas Technology Corp Replacement command list AS30 source format gt gt LDINTB imm20 AS308 Functions Format when replaced LDC imm24 INTB LDE B W abs 20 dest MOV B W_abs dest LDE B W dsp 20 A0 dest MOV B W dsp A0 dest STE B W src abs 20 MOV B W src abs STE B W src dsp 20 A0 MOV B W src dsp A0 BSET G bit RO BSET bit ROL BSET bit ROH BSET G bit R1 BSET bit RIL BSET bit R1H BSET G bit AO Assembly is possible for bits 0 7 BSET G bit A1 Assembly is possible for bits 0 7 BSET G A0 BITINDEX B A0 BSET 0 0 BSET G A1 BITINDEX B A1 BSET 0 0 BSET G base 8 A0 BITINDEX B A0 BSET 0 base BSET G base 16 A0 BITINDEX B A0 BSET 0 base BSET G base 8 A1 BITINDEX B A1 BSET 0 base BSET G base 16 A1 BITINDEX B A1 BSET 0 base BSET G bit base 8 SB BSET S bit base 11 SB BSET G bit base 16 SB BSET bit base SB BSET G bit base 8 FB BSET bit base FB BSET G bit base 16 BSET bit base 53 ENESAS Renesas Technology Corp AS308 V 1 00 Input Output Files of AS308 Input Output
67. T Command input example 2 as308 O tmp T SM IM Option that becomes valid when executing as308 2 as308 Oltmp N SM LM 47 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions BIN308 The assembler driver as308 invokes the macro processor and assembler processor residing in the directory you have set If this variable is set always make sure that macroprocessor and assembler processor are placed in the directory you have set INC308 The assembler as308 retrieves include files written in the assembly source file from the directory set in INC308 Multiple directories can be specified If mul tiple directories are specified as308 searches the directories sequentially from left to right in the order they are written How to set INC308 Personal computer version Separate the directory names with a semicolon as you write them SET INC308 C COMMON C PROJECT Workstation version Separate the directory names with a colon as you write them setenv INC308 usr common usr project TMP308 Programs generate a work file necessary to process files in the directory that is set in this environment variable The work file normally is erased after as308 finishes its processing 48 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Output messages The programs are included this products output informations of process to screen Error Messages This chapter describes the error
68. a calculation resulted in the address exceeding the range of 8 to 7 Overflow is discarded Check whether the value is all right signed value is out of range 128 127 address address 2 Relocation data calculation resulted in the address exceeding the range of 128 to 127 Overflow is discarded Check whether the value is all right unsigned value is out of range 0 255 address address Relocation data calculation resulted in the address exceeding the range of 0 to 255 Overflow is discarded Check whether the value is all right value is out of range 128 255 address address Relocation data calculation resulted in the address exceeding the range of 128 to 255 Overflow is discarded Check whether the value is all right Absolute section is written after the absolute section section The absolute attribute section section is followed by an absolute at tribute of the same name The source program may be allocated at noncontinued addresses Linkage will be executed Check the address specification of the source program Absolute section is written before the absolute section section The absolute attribute is concatenated before the absolute attribute sec tion section Concatenation will be executed Check address specification in the source program 136 ENESAS Renesas Technology Corp AS308 V 1 00 Warning Messages of In308 Address information mismatch in file fi
69. a description to specify an offset address from the SB register value Function Operation is performed on the address value specified by the directive command SB plus a specified offset value Code is generated in SB relative addressing mode Rules for writing command This description can be entered for an operand where the SB relative addressing mode can be written A label symbol or numeric value can be used to write the offset Description example syml EQU 1200H SECTION P SB 1000H MOV B 0 syml SB MOV B 0 syml SB END SB register value AAA sym1 SB add 1000H to 200H IIS TT sym1 SBregister value 1200H 1000H meek symi SB add 1200H to 1000 Hees we ee AA NO 36 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Special Page Branch The M16C 80 series assembly language allows you to branch at a special page using a special page vector table by writing a JMPS mnemonic Special Page Subroutine The M16C 80 series assembly language allows you to call a special page sub routine using a special page vector table by writing a JSRS mnemonic Special Page Vector Table The following outlines the special page vector table The special page vector table is allocated in addresses OFFFEOOH to OFFFFDBH One vector table consists of two bytes Each vector table is assigned a special page number The special page number decreases from 255 to 254 and
70. a screen and printer By referencing this file it is possible to get approximate information about the relocatable modules entered in the library file The format of a typical library list file is shown in Example of Library List File The following shows the information output to a library list file 1 Library file information This information is output one for each library file The library file information contains the following Library file name Library file name Indicates the library file name File update date and time Last update time Indicates the date and time the library file was updated last Number of modules Number of module s Indicates the total number of modules entered in the library file Number of global symbols Number of global symbol s Indicates the total number of global labels and global symbols entered in the library file 64 ENESAS Renesas Technology Corp AS308 V 1 00 2 Input Output Files of AS308 Module information This information is output one for each module entered in the library file The module information contains the following Module name module name Indicates the module names entered in the library file Version information ver Indicates a character string that is specified by the directive command VER Entered date and time pate Indicates the date and time when each module is entered in the library file Module size size Indicates t
71. address of your desired special page vector table Rules for writing command When specifying a special page number always be sure to write at the beginning of the number When specifying the address of a special page vector table always be sure to write at the beginning of the address Description example SECTION p main JSRS subl JSRS sub2 JSRS sub3 SECTION special ORG OFFOOOOH label_0 OV B 0 ROH RTS label_1 OV B 0 ROL The content of SECTION p in the above example can be written differently like the one shown below SECTION p main JSRS 255 JSRS 254 JMPS 253 39 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Macro Function This section describes the macro functions that can be used with AS308 The following lists the macro functions available for AS308 Macro function To use a macro function define it with directive commands MACRO and ENDM and call up the defined macro Repeat macro function To use a repeat macro function use directive commands MREPEAT and ENDR to define it Each macro function is described below Macro Function A macro function can be used by defining a macro name macro defini tion and calling up the macro macro call A macro function cannot be made available for use by macro definition alone Macro definition and macro call have the following relationship Example of source program A
72. an 8 bit SB relative ad dressing mode hereafter called SB relative or 8 bit FB relative address ing mode hereafter called FB relative is selected depending on condi tion The next page shows the condition under which one of the two addressing modes above is selected Selection of SB relative SB relative is selected when the following conditions are met The SB register value must always be set using directive command SB before SB relative addressing can be used When an operand value is determined when assembling the source pro gram and the determined value is in an addressing range in which SB relative can be selected The SB relative selectable address range is a range in the 64 Kbyte address space and range in the result added 0 to 255 to value of the 16 bit register SB Optimization is not performed unless the SB register value is defined by an expression in which it will be determined when assembling the source program When the symbol declared by directive command SBSYM is written in the op code 33 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions For 1 bit operation instructions the addressing mode is selected in the following manner When the mnemonic has a short format in its instruction format Short format SB relative is selected When the mnemonic does not have a short format in its instruction for mat A 16 bit SB relative addressing mode is selected Select
73. and and the operand A symbol can be written in a symbol defined operand M However symbol names cannot be entered that are forward referenced An expression can be written in a symbol defined operand Symbols can be specified as global Description example symbol EQU 1 symbol1 EQU symbol symbol symbol2 EQU 2 247 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands EXITM Stop expansion of macro body Function This command stops expanding the macro body and transfers control to the nearest ENDM Description format macro name MACRO body EXITM body ENDM Rules for writing command Make sure that the command is written within the body of a macro defi nition Description example datal MACRO value IF value 0 EXITM ELSE BLKB value ENDIF ENDM datal 0 IF 0 0 EXITM ENDIF ENDM 248 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands FB Assigns temporary FB register value Function This command assigns a provisional FB register value When assembling the source program the assembler assumes that the FB register value is one that is defined by this directive command as it generates code for the subsequent source lines FB relative addressing mode can be specified in the subsequent lines The assembler generates code in FB relative addressing mode for the mnemonics that use labels defined by
74. assuming values 0 Check the symbol values Absolute section section is relocated Absolute section section is going to be relocated Correct the section locating specification Address is overlapped in CODE section section Addresses are overlapping in a CODE section named section Relocate the section so that its addresses will not overlap Address is overlapped in ROMDATA section section 2 Addresses are overlapping in a ROMDATA section named section Relocate the section so that its addresses will not overlap Can t close file file 2 The file file cannot be closed Check the directory information Can t close temporary file 2 The temporary file cannot be closed Check the remaining storage capacity of the disk Can t create file file The file file cannot be created Check the directory information 130 ENESAS Renesas Technology Corp AS308 V 1 00 Error Messages of In308 Can t create temporary file 2 A temporary file cannot be created Check to see if the directory is write protected Can t open file file The file file cannot be opened Check the file name Can t open temporary file 2 The temporary file cannot be opened Check the directory information Can t remove file file 2 The file file cannot be deleted Check the permission of the file Can t remove temporary file 2 The temporary file cannot be deleted Check th
75. ated by changing the extension of the assembly source file a30 by default to Ist sample a30 gt sample st Directory for assembler list file generated If you specified the directory with command option O the assembler list file is generated in that directory If no directory is specified the assembler list file is generated in the directory where the assembly source file resides Assembler Error Tag File Only when you specified command options T and X as308 outputs to a file the errors that were encountered when assembling the assembly source file Format of assembler error tag file The assembler error tag file is output in a format that allows you to use an editor s tag jump function This file is output in order of the assembly source file name error line number and error message as shown below sample err 21 Error asp308 Operand value is not defined sample err 72 Error asp308 Undefined symbol exist work2 File name of assembler error tag file The file name of the assembler error tag file is created by changing the exten sion of the assembly source file a30 by default to atg sample a30 gt sample atg Directory for assembler error tag file generated If you specified the directory with command option O the assembler error tag file is generated in that directory If no directory is specified the assembler error tag file is generated in the directory where the assembly source file r
76. aximum number of temporary files you can enter 65 535 includes those in the include file The temporary labels generated by the assembler are output to a list file The temporary labels are changed into tl0001 tI0002 and tIFFFF Description format Ta mnemonic mnemonic F 291 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Rules for writing command Write in the line where you want it to be defined as a temporary label If you want to reference a temporary label that is defined immediately before an instruction write in the instruction operand If you want to reference a temporary label that is defined immediately after an instruction write in the instruction operand Description example JMP FF JMP q T3 JMP g 292 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands O Concatenates character strings Function This command concatenates macro arguments macro variables re served symbols expanded file name of directive command FILE and specified character strings Description format character string character string character string character string character string Rules for writing command Spaces and tabs entered before and after this directive command are concatenated as a character string A character string can be written before and after this directive com ma
77. bsolute module file name Library file name Use command option L to specify the library file to be referenced A path can be specified in the file name d Library files are searched from the directory that is set in environment variable LIB308 If the relevant file cannot be found In308 searches the current directory Or if a directory is specified by command option LD In308 searches it and if no relevant file is found in this directory In308 searches the current directory 112 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 Command option When you specify a command option always be sure to insert a space or tab between the command option and other specifications on the command line Address specification The In308 editor determines absolute addresses section by section as it generates an absolute module file When invoking In308 you can specify the start address of a section from the command line Use hexadecimal notation when specifying address values If an ad dress value begins with an alphabet add 0 to the value as you specify it Example FERE 64 0a57 Command File The In308 editor allows you to write command parameters in a file and execute the program after reading in this file Method for specifying command file name Add at the beginning of the command file name as you specify it Example gt 1n308 cmdfile A directory path can be specified in t
78. can be speci fied in a section definition line Section type is not appropriate The section type is written incorrectly Rewrite the section type correctly Size or format specifier is not appropriate 2 The size specifier or format specifier is written incorrectly Rewrite the size specifier or format specifier correctly Size specifier is missing No size specifier is entered Write a size specifier Source files number exceed 80 The number of source files exceeds 80 Execute assembling separately in two or more operations Source line is too long 2 The source line is excessively long Check the contents written in the source line and correct it as neces sary 104 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 Statement not preceded by CASE or DEFAULT CASE or DEFAULT is preceded by a command line in the SWITCH state ment Always be sure to write a command line after the CASE or DEFAULT statement String value exist in expression 2 A character string is entered in the expression Rewrite the expression correctly Symbol defined by external reference data is defined as global symbol The global symbol used here is a symbol that is defined by external reference data Check symbol definition and symbol name Symbol definition is not appropriate The symbol is defined incorrectly Check the method for defining this symbol and rewrite it corr
79. ced Generates map file MS Generates mapfile that includes symbol information MSL Generates mapfile that includes fullname of symbol more than 16 characters NOSTOP Outputs all encounterds errors to screen O Specifies absolute module file name ORDER Specifies section address and allocation sequence T Generates link error tag file V Indicates version number of linkage editor Specifies command file 111 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 Rules for Specifying Command Parameters Follow the rules described below when you specify command parameters for In308 Order in which to specify command parameters Relocatable module file names and command options can be specified in any desired order gt 1n308 command options relocatable module file gt 1n308 relocatable module file command options Relocatable module file name essential Always be sure to specify at least one relocatable module file name A path can be specified in the file name When specifying multiple relocatable module files always be sure to insert a space or tab between each file name Absolute module file name Normally In308 creates the file name of an absolute module file from the relocatable module file that is specified first as it generates the absolute module file Use command option O to specify an a
80. cement addressing mode INCLUDE Reads file into specified position 214 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Link control SECTION Defines section name GLB Specifies global label BTGLB Specifies global bit symbol VER Transfers specified information to map file List control LIST Controls outputting of line data to list file PAGE Breaks page at specified position of list file FORM Specifies number of columns and lines in 1 page of list file Branch instruction optimization control OPTJ Controls optimization of branch instruction and subroutine call in struction Extended Function Directive Commands ASSERT Outputs a character string written in the operand to a standard error output device or file Specifies defining and referencing a temporary label FILE Indicates the assembly source file name being processed by as308 Concatenates character strings entered before and after into a single character string Conditional Assemble Control AF Indicates the beginning of a conditional assemble block Condi tions are resolved ELIF Resolves the second and the following conditions ELSE Indicates the beginning of a block to be assembled ENDIF Indicates the end of a conditional assemble block 215 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Macro directive commands MACRO D
81. ctory in which to search files O Specifies directory in which to output files V Indicates version of absolute lister Rules for Specifying Command Parameters Follow the rules described below when specifying command parameters Order in which to specify command parameters Always be sure to specify command parameters in the order given be low 1 Command option 2 Absolute module file name 3 Assembler list file name gt abs308 command option absolute module file name assembler list file name File name of absolute module file essential Always be sure to specify the absolute module file name A path can be specified in the absolute module file name The extension x30 can be omitted 180 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating abs308 File name of assembler list file Multiple assembler list files can be specified by separating them with a space or tab A path can be specified in the assembler list file name The file attribute can be omitted The assembler list file name can be omitted Command options Command options are not case sensitive so they can be entered in uppercase or lowercase Always be sure to enter a space or tab between the command option and its argument 181 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating abs308 Disables Message Output to Screen Function The software does not output messages when xrf308
82. d and the operand Write an integral value in the operand A symbol can be written in the operand An expression can be written in the operand The expression in the operand must have its values determined when assembling the source program When defining a label name in the allocated area be sure to write the label name before the directive command Always be sure to insert a colon after the label name Description example symbol EQU T SECTION area DATA workl BLKB 1 work2 BLKB symbol BLKB symbol 1 230 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands BLKD Allocates RAM area in units of 8 bytes Function This command allocates a specified bytes of RAM area in units of 8 bytes Label name can be defined at the allocated RAM address Description format BLKD numeric value name BLKD numeric value Rules for writing command This directive command must always be written in a DATA type section Section types can be made the DATA type simply by writing DATA following the section name when you define a section Always be sure to insert space or tab between the directive command and the operand Write an integral value in the operand A symbol can be written in the operand An expression can be written in the operand The expression in the operand must have its values determined when assembling the source program When defining a label
83. d to be macro local labels are allowed to be written in places outside the macro with the same name The labels you want to be used as macro local labels must first be de clared to be a macro local label before you define the label 41 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Macro Call Macro call can be accomplished by writing a macro name that has been defined with directive command MACRO Code for the macro body is generated by macro call Macro names cannot be forward referenced i e you cannot call a macro name that is defined somewhere after the line where macro call is writ ten Always make sure that macro definition is written in places before the macro call line Macro names cannot be externally referenced i e you cannot call a macro name that is defined in some other file If you want to call the same macro from multiple files define the macro in an include file and include it in your source file The content of the macro defined macro body is expanded into the line from which the macro is called Actual parameters corresponding to macro defined formal parameters can be written Formal parameter Macro definition p1 and work correspond one for one 0 and p2 correspond one for one Macro call work 0 Real parameter In this example a warning message is output because there is no real argument corresponding to p3 42 ENESAS Renesas Technology
84. d with double quotations or single quotation AS308 does not assume it to be the first character of a comment A space or tab can be inserted between a label and a comment Description example start label BLKB 1 main nop loop Comment 202 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Comment line Function Any desired character string can be written in this line Rules for writing Always be sure to insert a semicolon at the beginning of a comment A space or tab can be inserted at the beginning of a comment Any desired characters can be written in a comment Description example Comment line MOV W 0 A0 Comment can be written in other lines too Blank line Function Nothing apparently is written in this line Rules for writing Lines can be entered that do not contain any meaningful characters as may be necessary to improve the legibility of your source program No characters other than the space tab return and line feed charac ters can be written in a blank line Description example loop JMP loop JSR subl 203 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Line concatenation If a line is ended with the next line is concatenated to the position where the is written A comment can be written in a line where is written However no comment is output in the result
85. deNo1 ID code 436F64654E6F31 Address FEFFDF FFFFE3 FFFFEB FFFFEF FFFFF3 FFFFF7 FEFFEB data 43 6F 64 65 4E 6F 31 E E E E E xample 2 IDCode D code 436F6465000000 xample 3 1D1234567 D code 31323334353637 xample 4 ID 495621378561 32 D code 49562137856132 xample 5 ID 1234567 D code 12345670000000 xample 6 ID D code FFFFFFFFFFFFFFE 143 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Imc308 L Selects Maximum Length of Data Record Area Function The data record length of the Motorola S format is set to 32 bytes The data record length of the Intel HEX format is set to 32 bytes Description rule Specify this option before entering a file name Description example gt 1mc308 L debug 144 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Imc308 O Specifies Output File Name Function Specify the file name of the machine language file generated by Imc308 A path can be specified in the file name Description rule Input this option using a form like O file name Always be sure to insert a space between this option and the file name Specify this option before entering a file name The file name cannot be specified with an extension A default exten sion is used for the generated file mot for the Motorola S format and hex for the Intel HEX format
86. directive command FBSYM Description format FB numeric value Rules for writing command Always be sure to insert space or tab between the directive command and the operand Always make sure that this command is written in the assembly source file Always be sure to write this command before you use the FB relative addressing mode An integer in the range of 0 to OFFFFFH can be written in the operand M This directive command only directs the assembler to take on a provisional FB register value and cannot be used to set a value to the actual FB register To set an FB register value actually write the following instruction immediately before or after this directive command Example LDC 80H FB A symbol can be written in the operand Description example FB 80H LDC 80H FB 249 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands FBSYM Selects FB relative displacement addressing mode Function The assembler selects the FB relative addressing mode for the name specified in the operand of this directive command The assembler selects the FB relative addressing mode for the operand in absolute 16 bit addressing mode that includes the name specified in the operand of this directive command Description format FBSYM name FBSYM name name Rules for writing command Always be sure to insert space or tab between the directive command and the operand A
87. e gt as308 LIM sample gt as308 CDLSMI sample 83 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 mode60 To specify AS308 programs Function Always specify this option to assemble programs written for AS30 as sembler for the M16C 60 Series with AS308 When this option is specified AS308 replaces some of the commands in the program written for AS30 M For details see Compatibility with M16C 60 commands and AS308 processing when option command mode60 is speci fied Description rule M Always input this option in small letters The option can be specified at any point in the command line Description example The program written for AS30 is reassembled as as308 gt as308 mod60 sample 84 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 mode60p To process structured commands for AS30 Function Always specify this option to structured command and assemble pro grams written for AS30 assembler for the M16C 60 Series with AS308 Mi when this option is specified AS308 converts structured command into assemble program for AS30 and then replace some of the commands in the program written for AS30 For details see Compatibility with M16C 60 commands and AS308 processing when option command mode60 is speci fied Description rule M Always input this option in small letters The option can be specified at
88. e sides 58 ENESAS Renesas Technology Corp AS308 V 1 00 Input Output Files of AS308 Absolute Module File The In308 editor generates one absolute module file from multiple relocatable module files Format of absolute module file This file is output in the format based on IEEE 695 M Since this file comes in a binary format it cannot be output to a screen or printer nor can it be edited Note that if you open or edit this file with an editor file processing in the subsequent stages will not be performed normally File name of absolute module file The file name of the absolute module file normally is created by changing the extension r30 of the relocatable module file that is entered first from the command line into x30 sample r30 gt sample x30 If you specify a file name using command option O the file is generated in specified name Directory for absolute module file generated The absolute module file normally is generated in the current directory If you specify a path in the file name of command option O the absolute module file is generated in the directory of that path 59 ENESAS Renesas Technology Corp AS308 V 1 00 Input Output Files of AS308 Map File Only when you specify command option M MS or MSL In308 outputs link information on last allocated section address and symbol information to a map file Symbol information is output only when you specify command opti
89. e Module File Name Function This option allows you to specify any desired name for the absolute module file generated by In308 If you do not specify an absolute module file name using this option the file name of absolute module file is created by changing to x30 the extension of the relocatable module file name that is specified first on the command line Description rule Input this option using a form like O file name Always be sure to insert a space between this option and the file name The extension of a file name can be omitted If omitted the extension is x30 A path can be specified in the file name Description example A abssmp x30 file is generated gt 1n308 samplel sample2 O abssmp A abssmp x30 file is generated in the work absfile directory gt 1n308 O work absfile abssmp samplel sample2 124 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 ORDER Specifies Section Address and Relocation Order Function Specify the order in which you want sections to be allocated and the start address of sections M ifthe start address is specified for an absolute section In308 outputs an error If you do not specify the start address In308 allocates addresses begin ning from 0 If sections of the same name exist in the specified relocatable files sec tions are allocated in the order the files are specified In this case if a sectio
90. e assembly source file it means that the symbol is redefined at that description position If multiple files are specified on the command line the symbols defined by this option are handled as being defined in all of these files Description rule Specify this option in the form of D symbol name numeric value This option can be specified at any position on the command line Do not enter a space or tab between the command option and the sym bol name Values can be defined to multiple symbols When defining values to multiple symbols separate each symbol with the colon while you enter them in a form like D symbol name value symbol name value and so on No space or tab can be entered in front or after the colon 78 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 Description example This example sets 1 to symbol name gt as308 Dname 1 sample This example sets 1 to symbols name and symbol gt as308 Dname 1 symbol 1 sample This example defines a symbol named name for files sample1 and sample2 gt as308 Dname 1 samplel sample2 79 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 F Controls FILE Expansion Function This option fixes the file name to be expanded by the directive com mand FILE to the assembly source file name that is specified from the command line Description rule d This option can be spec
91. e letters in file names as they process files Structure of Command Line Input the following information on a command line Program Name This is the name of a program you want to use M when operating on a workstation always be sure to input a program name using lowercase letters 68 ENESAS Renesas Technology Corp AS308 V 1 00 Starting Up Program Command Parameter All information necessary to execute a program correctly is called command parameters For example command parameters include the file names to be processed by the program you are going to start up and the command options that indicate program functions using symbols Command parameters include the following information File name This means the name of a file to be processed by the program started up When operating on a workstation use uppercase and low ercase letters correctly as you input a file name Command option Specify command options on the command line to use the functions of AS308 programs Rules for Entering Command Line When starting up each AS308 program observe the rules for entering a com mand line described below Number of Characters on Command Line The number of characters that can be entered on a command line is 128 characters bytes for the PC version or 512 characters bytes for the workstation version The number of characters may be limited below the above specification depending on the operating env
92. e permission of the file Can t registered symbol in the list Symbols cannot be registered in a list If this error occurs please contact tool support personnel at Mitsubishi Command file line characters exceed 255 2 The number of characters per line in the command file exceeds 255 Check the contents of the command file Command line is too long The command line contains too many characters Create a command file 131 ENESAS Renesas Technology Corp AS308 V 1 00 Error Messages of In308 U EBUG information mismatch in file 2 Some file whose format version of relocatable module file does not match that of other file is included Redo assembling using the latest assembler Illegal file extension xxx is used The file extension xxx is illegal Specify a correct file extension Illegal format file 2 The format of the file file is illegal Check to see that the relocatable file is one that was created by as308 Illegal format file expression error occurred 2 The format of the file file is illegal Check to see that the relocatable file is one that was created by as308 Illegal format file it s not library file 2 The format of the file file is illegal That is not a library file Check to see that the library file is one that was created by Ib308 Illegal format file it s not relocatable file The format of the file file is i
93. e range of 20 to 255 This command specifies the number of columns per page of the assem bler list file in the range of 80 to 295 The contents specified by this directive command become effective be ginning with the page next to one where the command is written How ever if this directive command is written in the first line of the assembly source file the specified contents become effective beginning with the first page If this directive command is not specified the assembler list file is output with the number of lines 66 and the number of columns 140 Description format FORM number of lines number of columns FORM number of lines FORM number of columns ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Rules for writing command This command can be written for multiple instances in one assembly source file A symbol can be used to describe the number of lines and the number of columns Z Symbols cannot be used that are forward referenced An expression can be used to describe the number of lines and the number of columns If you specify only the number of columns in the operand be sure to enter a comma immediately before the numeric value you write for the number of columns Description example FORM 20 80 FORM 60 FORM 100 FORM line culmn 253 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands GLB Specifies globa
94. e specified by the loc option here has already been defined before Check the section name loc section section is not found 2 The section specified by the loc option cannot be found Check the section name order section section is multiple defined The section name specified with order is defined twice or more Make sure that sections are defined only once order section section is not found 2 The section specified with order cannot be found Check the section name and re run CODE section section 1 is overlapped on the section 2 The CODE sections section 1 and section 2 are overlapping Relocate the sections so that they will not overlap ROMDATA section section 1 is overlapped on the section 2 The ROMDATA sections section 1 and section 2 are overlapping Relocate the sections so that they will not overlap section is written after the same name of relocatable section A relative attribute section is followed by an absolute attribute section of the same name section Make sure that relative attribute is located after absolute attribute 129 ENESAS Renesas Technology Corp AS308 V 1 00 Error Messages of In308 symbol is multiple defined 2 The symbol symbol is defined twice or more Check external symbol names symbol value is undefined The value of the symbol symbol is not defined yet The program will be processed
95. ecify this command option in small letters The protect2 option cannot be specified at the same time as the pro tect1 option Description example gt 1mc308 protectl sample 147 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Imc308 protect2 Set level2 for ROM code protect function Function For details on the ROM code protect function see the hardware manual of the microcomputer F3 is stored in protect code store address FFFFFF If you filled in protect code sotre address with value when this option is specified the protect code is changed When this option is not speci fied filling value is output When options ID protect1 protect2 to use ROM protect function is specified the following protect code is filled in protect code store ad dress ID protect1 protect2 Protect code Specify Non Non FF Specify Specify Non 3F Specify Non Specify F3 Specify Specify Specify Imc308 error Non Specify Non 3F Non Non Specify F3 Non Non Non Value filling in source program Description rule Always specify this command option in small letters The protect1 option cannot be specified at the same time as the pro tect2 option Description example gt 1mc308 protect2 sample 148 ENESAS Renesas Technology Corp AS308 V 1 00 Error Messages of Imc308 Error Messages of Imc308 e option is too long The array of e option parameters is exces
96. ectly Symbol has already defined as another type 2 The symbol has already been defined in a different directive command with the same name You cannot define the same symbol name in di rective commands EQU and BTEQU Change the symbol name Symbol has already defined as the same type 2 The symbol has already been defined as a bit symbol Bit symbols cannot be redefined Change the symbol name Symbol is missing 2 Symbol is not entered Write a symbol name 105 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 Symbol is multiple defined 2 The symbol is defined twice or more The macro name and some other name are duplicates Change the name Symbol is undefined The symbol is not defined yet Undefined symbols cannot be used Forward referenced symbol names cannot be entered Check the symbol name Syntax error in expression 2 The expression is written incorrectly Check the syntax for this expression and rewrite it correctly Temporary label is undefined 2 The temporary label is not defined yet Define the temporary label The value is not constant 2 The value is indeterminate when assembled Write an expression symbol name or label name that will have a deter minate value when assembled Too many formal parameter 2 There are too many formal parameters defined for the macro Make sure that the number of formal parameters defined for the macro is 80
97. ed that are represented by a floating point number 32 bits long 1 17549435 x 107 to 3 40282347 x 10 64 bits long 2 2250738585072014 x 10 to 1 7976931348623157 x 10 M Floating point numbers can only be entered for the oper ands of directive commands DOUBLE and FLOAT Example 3 4E35 3 4x10 3 4e 35 3 4x10 5E20 0 5x10 5e 20 5 0x1072 Expression An expression consisting of a combination of numeric value name and opera tor can be entered A space or tab can be inserted between the operator and numeric value Multiple operators can be used in combination When writing an expression as a symbol value make sure that the value of the expression will be a valid value when your program is assembled The range of values that derive from an expression as a result of opera tion is 2147483648 to 2147483648 Even if the operation results in exceeding the range of 2147483648 to 2147483648 the assembler does not care whether it is an overflow or underflow Floating point numbers cannot be written in an expression Character constants cannot be used in any terms of an ex pression 208 ENESAS Renesas Technology Corp AS308 V 1 00 Operators Rules for Writing Program The table below lists the operators that can be written in as308 s source pro grams M When writing operators SIZEOF and TOPOF always be sure to insert a space or tab between the operator and oper and MM Relati
98. ed with command option O the tag file name is derived from the specified file name by changing its extension to ltg Error information in the link error tag file is output with the number of assembly source lines Description rule This option can be specified at any position on the command line Description example A sample1 Itg file is generated if an error occurs gt 1n308 samplel sample2 T 126 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 V Indicates Version Number Function The software indicates the version number of In308 M Ali other parameters on the command line are ignored when this option is specified Description rule Specify this option only and nothing else Description example gt 1n308 V 127 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 O Specifies Command File Function The software starts up In308 by using the contents of the specified file as the command parameters Description rule Input this option using a form like file name No space or tab can be entered between this option and the file name No other parameters can be written on the command line Description example gt 1n308 cmdfile 128 ENESAS Renesas Technology Corp AS308 V 1 00 Error Messages of In308 Error Messages of In308 loc section section is multiple defined 2 The section nam
99. efines macro name Indicates beginning of macro body EXITM Stops expansion of macro body LOCAL Declares local label in macro ENDM Indicates end of macro body MREPEAT Indicates beginning of repeat macro body ENDR Indicates end of repeat macro body Macro symbols MACPARA Indicates number of actual parameter of macro call MACREP Indicates how many times repeat macro body is expanded Character string functions LEN Indicates length of specified character string INSTR Indicates start position of specified character string in specified character string SUBSTR Extracts specified number of characters from specified character string beginning with specified position 216 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands FILE Indicates the assembly source file name being processed by as308 Function This command expands a file name into the one that is being processed by as308 i e assembly source file or include file M The file name that can be read in by this directive command is a file name with its extension and path excluded M if command option F is specified FILE is fixed to an assembly source file name that is specified in the command line If this option is not specified the command denotes the file name where FILE is written Description format FILE Rules for writing command This command can be written in
100. el HEX file The file name of the Intel HEX file is created by changing the extension x30 of the absolute module file into hex sample x30 gt sample hex Directory for Motorola S file generated The files are generated in the current directory Library File The Ib308 librarian generates one library file from the relocatable module files generated by as308 by integrating them as modules into a single file Format of library file The library file is based on the IEEE 695 format M Since this file comes in a binary format it cannot be output to a screen or printer nor can it be edited If you open or edit this file with an editor file processing in the subsequent stages will not be performed normally File name of library file The library file is generated using the file name specified on the command line The extension is lib A library file name cannot be omitted on the command line Directory for library file generated If a path is specified on the command line the library file is generated in that directory If no path is specified the library file is generated in the current directory 63 ENESAS Renesas Technology Corp AS308 V 1 00 Input Output Files of AS308 Library List File The Ib308 librarian generates a list file indicating library files and the relocat able modules entered in each library file Format of library list file This file is output in a text format that can be output to
101. en when entering a command option 70 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 Method for Operating as308 This section explains the method for operating as308 to utilize its functions The basic function of as308 is to generate a relocatable module file from the assembly source file Command Parameters The table below lists the command parameters of as308 Parameter name Function Source file name Source file name to be processed by as308 Disables message output to a display screen abs16 To specify the 16 bit absolute addressing mode Indicates contents of command lines when as308 has in voked macro processor and assemble processor Sets constants to symbols Fixes the file nameof FILE expansion to the source file name Header information is not output to an assembler list file Generates an assembler list file mode60 To specify AS308 programs mode60p To process structured commands for AS30 Generates structured description command variables in byte type Disables output of macro command line information Specifies a directory to which the generated file is output Specifies that localsymbol information be output Generates an assembler error tag file Indicates the version of the assembler system program Invokes an external program as a tag file argument 71 ENESAS Renesas Tec
102. er 1 OFF Branch instructions are not optimized ON Branch instructions are optimized Default 2 JMPW Unconditional branch instructions not subject to optimiza tion processing are generated with JMP W JMPA Unconditional branch instructions not subject to optimiza tion processing are generated with JMP A Default 3 JSRWSubroutine call instructions not subject to optimization process ing are generated with JSR W JSRA Subroutine call instructions not subject to optimization pro cessing are generated with JSR W Default Each parameter can be specified in any desired order Each parameter can be omitted If any parameter is omitted the jump distance does not change beginning with the default value or previously specified content Description example A combination of operands shown below can be entered Y O O O O O OOO Q PTJ PTJ PTI OFF JMPW IMPW JSRW IMPW JSRA IMPA MPA JSRW MPA JSRA JSRW ISRA 274 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands ORG Specifies address value Function Sections in which this directive command is written are assigned abso lute attribute M Absolute attribute sections cannot have their addresses re located when linking programs The addresses of a section in which this directive command is written take on absolute values The addresses where code is stored for mnemonics that are
103. ermined value when assembling the source program Alphabets numerals and the underline can be used for this name Numerals cannot be used at the beginning of this name This name can be defined outside the range of sections Defining method To define a symbol use a directive command that is used for defining numeric values Example valuel EQU 1 value2 EQU 2 Referencing method Write a symbol in the operand of an instruction Example MOV W RO valuel value3 EQU value2 1 194 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Bit symbol Function This is a name assigned to a specific bit position in specific memory If this name is assigned to each individual bit in 8 bit long memory one byte memory can have 8 pieces of information The bit position thus specified is offset from the least significant bit of memory specified in the address part by a value specified in the bit number part Rules for writing Numeric values must be a determined value when assembling the source program Alphabets and the underline can be used for this name Numerals cannot be used at the beginning of this name This name can be defined outside the range of sections Defining method To define a bit symbol use a directive command that is used for defining bit symbols 92 tag Example Small address flagl BTEQU 1 flags e ae flag2 BTEQU ay tlags flag3 BTEQU 20 flags
104. error Description rule Input this option using a form like A library file name relocatable mod ule file name Always be sure to insert a space between this option and the library file name and between the library file name and the relocatable module file name Description example 105308 A new lib sample3 r30 A sample3 module is added to the new lib file 156 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Ib308 C Creates New Library File Function The software creates a new library file W ifa library file of the same name as one you have specified in this command option already exists the contents of the old library file are replaced with those of the new library file Description rule Input this option using a form like C library file name relocatable mod ule file name Always be sure to insert a space between this option and the library file name and between the library file name and the relocatable module file name Description example 105308 C new samplel sample2 A new library file named new lib is created that contains sample1 and sample2 157 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Ib308 D Deletes Modules from Library File Function The software deletes a specified relocatable module from the library file Once deleted the module is nonexistent anywhere Description rule Input this option u
105. es for Specifying Command Parameters Follow the rules described below when you specify command parameters for 10308 Order in which to specify command parameters Always specify the command parameters for Ib308 in the following order If the command parameters are specified in an incorrect order lb308 cannot pro cess files correctly 1 Command option 2 Library file name 3 Relocatable module file name 16308 command option library file name relocatable module file name Library file name essential Always be sure to specify the library name A directory path can be specified in the file name The extension lib can be omitted on the command line Relocatable module file name relocatable module name Always be sure to specify a relocatable module file name The extension of a relocatable module file name is r30 The extension can be omitted on the command line Multiple relocatable module files can be specified In this case always be sure to insert a space between each file name A directory path can be specified in the file name If no directory is specified the files residing in the current directory are processed 153 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Ib308 Command options Command options are not case sensitive They can be entered in up percase or lowercase At least one of the command options A C D L R U or X mu
106. esas Technology Corp AS308 V 1 00 Contents Error Messages Of abs308 cooooocccccccocccccononccccnonnncccnnnnnnncncnnnnncnnnannneos 186 Warning Messages Of abs308 oooccccconoccccnccocccccnnonancnnnnannncnnrnnnnnnnnos 188 Rules tor Writing Prod MMMiictiarntan nio toas 189 Precautions on Writing Program ooccconnocccccnononnncccnanancnnnnnanns 189 Character edi Pelee eee ee ada 190 Reserved WordS cocoococccccconcoccccconononcccnnnnoncnnnnnnnnnnnnnnnnnncnnnnnnnns 191 Nadia A A Aen eat ac 192 A A EE EE ro OT 197 Line CONCATENATION eiside aea aa canario 204 OPS ci tidad 206 Rules for Writing Operands ocococcccinniconnccccnnnocnnnnancnancnnnnnncnos 206 Operador ec i eee its 209 Character String c oooocccnnnnncnnncccnnoninonncnnccnnncnanannnnano nc nnnna nana cana 212 Directive Commandos ininaions sil 213 List of Directive Commands oocccconocccnnccccononannnnccnannnn nan nnnanno 214 A ce vevbleec tind Pebeectesteas A T 217 MACPARA a dsc Na 219 MACREP unitarias Rival pete 221 ADD Raimi a 223 ALIGN e rococ 225 ASSERT estriado led didarad 227 21 S ERA ei 229 BLKB heann tala 230 BED a a Aiea eaten 231 B KE arnan e errr OE ED 232 Blois ee aiia 233 BEKW a aoao tarandi dadas 234 egia EEA EE A CTE 235 EIRENE EEE E E A AE EE E 237 BATE E E A OE E A TE 238 DEFINE sui ds 239 DOUBLE ccoo 240 8 ENESAS Renesas Technology Corp AS308 V 1 00 ENESAS Renesas Technology Corp Contents AS308 V 1 00 Specifications of AS308
107. fter expansion Macro definition SECTION SECTIO program SECTION program main i main Macro call 53777 Expanded macro END position 40 ENESAS Renesas Technology Corp AS308 V 1 00 Macro AS308 Functions Definition Macro definition means defining a collection of more than one line of instructions to a single macro name by using directive command MACRO Macro names and macro arguments are case sensitive so that lower case and uppercase letters are handled differently End of macro definition is indicated by directive command ENDM Lines enclosed with directive commands MACRO and ENDM are called the macro body Macro definition can have formal parameters defined Recursive definition is allowed for macro definition Macros can be nested in up to 65 535 levels including both macro defi nition and macro call Macros of the same name can be redefined Macro definition can be entered outside the range of a section Any instructions you can write in source programs can be written in the macro body Bit symbols cannot be written in the macro body Macro formal parameters up to 80 arguments can be written Macro local labels can be written for up to a total of 65 535 labels in one assembly source file Local Labels The labels defined with directive command LOCAL are made macro local labels Macro local labels can be used in only macro definition The label names declare
108. g Bit symbols can be specified as global Description format name BTEQU bit position address value Rules for writing command Always be sure to insert space or tab between the directive command and the operand Separate between the bit position and the bit s memory address with a comma as you enter them Always be sure to write the bit position first and then the address value An integer in the range of O to 65535 can be written to indicate the bit position Always make sure that the value you specify for the bit position is deter mined when assembling the source program A symbol can be written to specify the address value of an operand A label or symbol that is indeterminate when assembled can be written to specify the address value of an operand 235 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands No bit symbols can be externally referenced written in the operand of directive command BTGLB that are defined by a symbol that is indeterminate when assembled A bit symbol can be written in the operand However a bit symbol name in the operand cannot be for ward referenced Also for the operand bit symbol be sure to write a bit symbol name whose value is fixed when as sembled An expression can be written in the operand Description example bito bitl bit2 bit3 bit4 BTEQU 0 0 BTEQU 1 flag BTEQU 2 flag 1 BTEQU one flag BTEQU onetone flag 236 CENESAS
109. g the range of 32 768 to 32 767 Overflow is discarded Check whether the value is all right 16 bits unsigned value is out of range 0 65535 address address Relocation data calculation resulted in the address exceeding the range of 0 to 65 535 Overflow is discarded Check whether the value is all right 16 bits value is out of range 32768 65535 address address Relocation data calculation resulted in the address exceeding the range of 32 768 to 65 535 Overflow is discarded Check whether the value is all right 24 bits signed value is out of range 8388608 8388607 address address Relocation data calculation resulted in the address exceeding the range of 8 388 608 to 8 388 607 Overflow is discarded Check whether the value is all right 24 bits unsigned value is out of range 0 16777215 address address Relocation data calculation resulted in the address exceeding the range of 0 to 16 777 215 Overflow is discarded Check whether the value is all right 24 bits value is out of range 8388608 16777215 address address Relocation data calculation resulted in the address exceeding the range of 8 388 608 to 16 777 215 Overflow is discarded Check whether the value is all right 135 ENESAS Renesas Technology Corp AS308 V 1 00 Warning Messages of In308 4 bits 8 bits 8 bits 8 bits signed value is out of range 8 7 address address Relocation dat
110. guage file in the Motorola S format from the abso lute module files generated by In308 Command Parameters The table below lists the command parameters available for Imc308 Parameter name Function File name Absolute mdoule file name to be processed by Imc308 Disables message output to screen E Sets the starting address H Converts file into Intel HEX format ID Set ID code for ID check function L Selects maximum length of data record area O Specifies output file name V Indicates version of load module converter protect1 Set leveti for ROM code protect function protect2 Set level2 for ROM code protect function 138 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Imc308 Rules for Specifying Command Parameters Follow the rules described below when you specify the command parameters for Imc308 Order in which to specify command parameters Always be sure to specify command parameters in the following order 1 Command option 2 Absolute module file name essential gt 1mc308 command option absolute module file name Absolute module file name essential Specify the absolute module file generated by In308 Specify only one absolute module file name d The file extension x30 can be omitted No file names can be specified unless their extension is x30 Command options Specify command options as necessary Multiple command opt
111. hat is output to a cross reference file 1 Label name This indicates a label name 2 File name This indicates a file name in which the above label is written 3 Reference line number and classification symbol This indicates a line number in which the label is defined and declared and a symbol denoting its classification as follows d Definition line j Reference line for branch instruction S Reference line for subroutine call instruction Example of Cross Reference File btsym0 sample a30 00023 d btsyml sample a30 00024 d bt sym2 sample a30 00025 d btsym20 sample a30 00033 d 66 ENESAS Renesas Technology Corp AS308 V 1 00 Input Output Files of AS308 File name of cross reference file The file name of the cross reference file is created by changing the extension of the assembler list file Ist or assembly source file a30 to xrf sample Ist gt sample xrf sample a30 gt sample xrf However if multiple file names are specified the cross reference file name is derived from the first specified file name by changing its extension to xrf Directory for cross reference file generated If a path is specified on the command line the cross reference file is generated in that directory If a directory is specified with command option O the cross reference file is generated in that directory If a directory is not specified in neither way the file is generated in the current directory
112. he M16C 60 Family Match the data size of the operand to the control register size of the M16C 80 Series Destination address may be changed 2 The jump address can be a position that differs from an anticipated des tination When writing an address in a branch instruction operand using a loca tion symbol for offset be sure to write the addressing mode jump dis tance and instruction format specifiers for all mnemonics at locations from that instruction to the jump address Fixed data in CODE section 2 Found directive command BYTE WORD ADDR LWORD in the section type is CODE Specify ROMDATA type the section written any directive command BYTE WORD ADDR LWORD Floating point value is out of range 2 The floating point number is out of range Check whether the floating point number is written correctly Values out of range will be ignored Invalid FBSYM declaration it s declared by SBSYM The symbol is already declared in SBSYM The FBSYM declaration will be ignored Rewrite the symbol declaration correctly 109 ENESAS Renesas Technology Corp AS308 V 1 00 Warning Message of as308 Invalid SBSYM declaration it s declared by FBSYM The symbol is already declared in FBSYM The SBSYM declaration will be ignored Rewrite the symbol declaration correctly Mnemonic in ROMDATA section 2 Found mnemonic in the section type is ROMDATA Specify COD
113. he code and data sizes of the modules entered in the library file These sizes differ from the file sizes of the relocatable mod ule files Global symbol name Global symbol s Indicates the global symbol and global label names defined in the modules External reference symbol name Indicates the global symbol and global label names externally referenced by the module Example of Library List file Librarian 1b308 for M16C 80 Series Version 1 00 00 Library file name libsmp lib Last update time 1995 Jul 7 15 44 Number of module s 1 Number of global symbol s 12 Module name sample VER sample program file Date 1995 Jul 7 15 43 Size 00894H Global symbol s btsym5 btsym6 btsym7 btsym8 btsym9 subl sub2 sym5 sym6 sym7 sym8 sym9 65 ENESAS Renesas Technology Corp AS308 V 1 00 Input Output Files of AS308 Cross Reference File The xrf308 generates from the assembly source file a file that contains sum mary information on lines where symbols and labels are defined and refer enced Format of cross reference file This file is output in a text format that can be output to a screen and printer Therefore you can print this file to a printer during debugging and check posi tions in the assembly source file where symbols are defined The format of a typical cross reference file is shown in Example of Cross Reference File Information in cross reference file The following explains the information t
114. he command file name If no file exists in the specified directory path In308 outputs an error 113 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 Rules for writing command file The following explains the rules you need to follow when writing a command file to ensure that it can be processed by In308 The name of the command file s own cannot be written in the command file Multiple lines of command parameters can be written in a command file The comma cannot be entered at the beginning and end of lines written in a command file If you want to write specification for section allocation in multiple lines be sure to enter the ORDER option at the beginning of each new line The maximum number of characters that can be written on one line in the file is 255 characters If this limit is exceeded In308 outputs an error Comments can be written in a command file When writing comments be sure to enter the symbol at the beginning of each comment Char acters from to Carriage Return or Line Feed are handled as com ments Example of command file description samplel sample2 sample3 ORDER ram 80 ORDER prog sub datasub and data M 114 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 Disables Message Output to Screen Function The software does not output messages when In308 is processing Error messages are output to sc
115. hen executing as308 in batch processing Error messages warning messages and messages deriving from the directive command ASSERT are output however Description rule This command option can be specified at any position on the command line Description example gt as308 sample If processing of sample resulted in generating an error the following output will be obtained gt as308 sample sample a30 2 Error as308 Section type is not appropriate 75 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 abs16 To specify the 16 bit absolute addressing mode Function When the below conditions are satisfied AS308 selects 16 bit absolute addressing ee When the operand is a label or external reference symbol ee When addressing mode is not specified ee When the absolute addressing mode is the selected mnemonic state ment Unless this option is specified 24 bit absolute addressing is selected Description rule M Always input this option in small letters The option can be specified at any point in the command line Description example gt as308 abs16 sample 76 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 C Indicates Command Invocation Line Function In cases when a command option is specified in environment variable AS308COM if this option is specified you can confirm the command options set when invoking
116. hnology Corp AS308 V 1 00 Method for Operating as308 Rules for Specifying Command Parameters Follow the rules described below to specify the command parameters of as308 Order in which to specify command parameter Command parameters can be specified in any desired order as308 assembly source file command option Assembly source file name essential Always be sure to specify one or more assembly source file names A path can be specified for the assembly source file name Up to 80 assembly source file names can be specified If any of the multiple assembly source files thus specified contains an error that file is not processed in the subse quent processing stages Assembly source files with extension a30 can have their extensions omitted when you specify them Command options Command options can be omitted Multiple command options can be specified Some command options allow you to specify a character string or a numeric value Do not enter a space or tab between the command option and the character string or numeric value If you want a subsequent command option to be nullified add two con secutive hyphens when entering that command option Command options can only be nullified in as308 There fore this function cannot be used when starting up any other program 72 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 Example Option L only is valid a
117. hnology Corp AS308 V 1 00 Error Message of xrf308 No input files specified 2 No input file is specified Specify a file name Not enough memory 2 Memory is insufficient Increase the memory capacity Option xxx is not appropriate The command option is specified incorrectly Check the syntax for this command option and specify it correctly again 178 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating abs308 Method for Operating abs308 Precautions using abs308 If two or more same section declarations exist and the sec tion is not output to the assembler list file by the directive command LSIT OFF in one assembly sourcefile a correct actual address might not be generated Specify command option LM when the assembler as308 processed the source file that contains macro directive com mand Specify command option LS when the assembler as308 processed the source file that contains structured directive command for AS30 It is needed that header lines are output to assembler list file Operate as308 without command option H 179 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating abs308 Command Parameters The table below lists the command parameters available for abs308 Parameter name Function File name Assembler list or absolute modulefile name to be processed by abs308 Disables message output to screen D Specifies dire
118. ified at any position on the command line Description example gt as308 F sample The file name to be expanded by the directive command FILE described in the include inc file that is included by the sample a308 assembly source file is fixed to sample If this option is not specified the file name to be expanded by FILE becomes include 80 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 H Disable header output to an assembler list file Function Header information is not output to an assembler list file M when generating an assembler list file to be processed by as308 do not specify this option Description rule This option can be written at any desired position in a command line Specify this option simultaneously with the command option L Description example Header information is not output to the sample Ist file gt as308 L H sample 81 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 Specify an include file search directory Function The include file specified by INCLUDE that is written in the source file is searched from a specified directory Description rules This option can be written at any desired position in a command line Specify a directory path immediately after l No space or tab can be inserted between this option and a directory path name Description example The include fi
119. ing xrf308 N Specifies Output of System Label Information Function Information on system labels output by as30 also is output to a cross reference file System labels are one that begins with two periods Description rule d This option can be specified at any position on the command line Description example xrf308 N sample lst A sample xrf file is generated from a sample lst file xrf308 N sample a30 A sample xrf file is generated from a sample a30 file 173 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating xrf308 O Specifies File Output Directory Function Specify a directory in which you want the cross reference file to be out put Description rule Input this option using a form like O directory name No space or tab can be entered between this option and the directory name This option can be specified at any position on the command line Description example xrf308 O work list sample a30 A sample xrf file is generated in a work list directory xrf308 O work list sample lst 174 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating xrf308 V Indicates Version Number Function The software indicates the version number of the cross referencer M if this option is specified all other parameters on the com mand line are ignored Description rule Specify this option only and nothing else Descript
120. ion example xrf308 V 175 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating xrf308 O Specifies Command File Function The software uses the contents of a specified file as command param eters as it invokes xrf308 Description rule No space or tab can be entered between this option and the file name No other parameters can be entered on the command line Description example xrf308 cmdfile 176 ENESAS Renesas Technology Corp AS308 V 1 00 Error Message of xrf308 Error Messages of xrf308 Can t create temporary file 2 The temporary file cannot be created Check the directory information Can t open file xxxx 2 The xxxx file cannot be opened Check the file name Command file is included in itself An attempt is made to include the command file in itself Check the written contents of the command file Command file line characters exceed 255 2 The number of characters per line in the command file exceeds 255 characters Check the contents of the command file Command line is too long 2 The character string on the command line is excessively long Create a command file Input files exceed 80 The number of input files exceeds 80 Re input the command Divide the contents of the command file Invalid option xxx is used An invalid option option is specified Specify the command option correctly again 177 ENESAS Renesas Tec
121. ion of FB relative FB relative is selected when the following conditions are met The FB register value must always be set using directive command FB before FB relative addressing can be used When an operand value is determined when assembling the source pro gram and the determined value is in an addressing range in which FB relative can be selected This address range is a range in the 64 Kbyte address space and range in the result added 128 to 127 to value of the 16 bit register FB When the symbol declared by directive command FBSYM is written in the op code When the following expression that includes a symbol defined by direc tive command FBSYM is written in the op code symbol value determined when assembled symbol value determined when assembled Value determined when assembled symbol 34 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Example of Optimization Selection by as308 The examples below show the addressing modes optimum selected by as308 and how they are written in the source file Address register relative with 8 bit displacement Example syml EQU 11H ABS B sym1 1 A0 SB relative Example 1 sym2 EQU 2 sym3 EQU 3 SB 0 SBSYM sym3 ABS B sym3 sym2 Example 2 SB 100H sym4 EQU 108H ABS B sym4 35 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions SB Register Offset Description Programming with AS308 allows you to enter
122. ions can be specified When specifying multiple command options the command options can be entered in any order 139 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Imc308 Disables Message Output to Screen Function The software does not output messages when Imc308 is processing Error messages are output to screen Description rule Always be sure to specify this option before the file name Description example gt 1mc308 debug 140 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Imc308 E Sets the Starting Address Function Set the starting address Output to a Motorola S format file beginning with the address you have set The Motorola S format file is output with the setting starting address Description rule Input this option using a form like E address value Always be sure to insert a space between this option and the value Always be sure to use hexadecimal notation when specifying an ad dress value If the address value begins with an alphabet a to f always be sure to add 0 at the beginning of the value as you enter it MM This option cannot be specified simultaneously with H Description example gt 1mc308 E 0f0000 debug A debug mot file is generated that starting address is Of000H gt 1mc308 E 8000 debug A debug mot file is generated that starting address is 8000H 141 ENESAS Re
123. irective command EXITM can be written in the body 271 ENESAS Renesas Technology Corp AS308 V 1 00 Description example rep MACRO num M sI REPEAT num F num gt 49 EXITM DIF p DR DM NOP NOP NOP 272 ENESAS Renesas Technology Corp Directive Commands AS308 V 1 00 Directive Commands OPTJ Controls optimization Function This command controls optimization of unconditional branch instructions A jump distance can be specified for unconditional branch instructions or subroutine call instructions where the jump distance specifier is omit ted and the operand is not subject to optimization processing The specified contents become effective beginning with the line follow ing one in which this directive command is written Optimization specification by this directive command can be entered for multiple instances in one assembly source file Description format OPTJ OFF ON JMPW JMPA JSRW JSRA Rules for writing command The following three parameters can be written in the operand of this directive command 1 Optimization control of branch instruction 2 Selection of unconditional branch instruction excluded from optimiza tion processing 3 Selection of subroutine call instruction excluded from optimization pro cessing 273 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands The following contents can be written in each paramet
124. ironment type of OS of AS308 69 ENESAS Renesas Technology Corp AS308 V 1 00 Starting Up Program Method for Entering Command Line Always be sure to enter space between the startup program name and the file name Always be sure to enter space between the file name and each com mand option File Name The maximum length of a file name is 128 characters bytes including directory specification for the PC version or 512 characters bytes in cluding directory specification for the workstation version However the number of characters on a command line must not exceed the above mentioned size including the startup program name and all command options Descriptions of file names are subject to the naming conventions of the PC and workstation OS in addition to the above rules Refer to the user s manual of your OS for details Although workstations permit you to use a file name that is separated by the period in two or more places this does not apply when using AS308 AS308 allows use of the pe riod in only one place of a file name Furthermore some AS308 programs restrict file name extensions characters following the period also Refer to the method for starting up each AS308 program for details Command Options Command options are not case sensitive regardless of whether you are operating on a PC or workstation Therefore they can be entered in either uppercase or lowercase Always be sure to add a hyph
125. ironment variable correctly back again The options that can be set in environment variables are L N S and T Invalid reserved word exist in operand The operand contains a reserved word Reserved words cannot be written in an operand Rewrite the operand correctly Invalid symbol definition 2 An invalid symbol is entered Rewrite the symbol definition Invalid option xx is used 2 An invalid command option xx is used The specified option is nonexistent Re input the command correctly Location counter exceed OFFFFFH The location counter exceeded OFFFFFh Check the operand value of ORG Rewrite the source correctly z EXT not associates with FOR No corresponding FOR is found for NEXT Check the source description 99 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 No No No No No No No ENDIF statement 2 No corresponding ENDIF is found for the IF statement in the source file Check the source description ENDS statement 2 No corresponding ENDS is found for the SWITCH statement in the source file Check the source description NEXT statement 2 No corresponding NEXT is found for the FOR statement in the source file Check the source description WHILE statement No corresponding WHILE is found for the DO statement in the source file Check the source description END statement
126. is not selected for the sym bols that are defined by using the label name specified by this directive command Description format SBSYM name SBSYM name name Rules for writing command Always be sure to insert space or tab between the directive command and the operand A label and symbol can be written in the operand Always be sure to set the SB register value with directive command SB before you write this directive command When specifying multiple names be sure to separate the names with a comma as you write them 280 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Description example SB 80H LDC 80H SB SBSYM syml sym2 In the following case the SB relative addressing mode is not selected for sym2 SBSYM syml sym2 EQU syml 1 281 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands SECTION Defines section name Function This command defines a section name This command defines the beginning of a section An interval from one section directive command to the next section directive command or directive command END is defined as one section This command defines a section type If ALIGN is specified In308 allocates the beginning of a section to an even address Directive command ALIGN can be written in a ALIGN specified sec tion or an absolute attribute section Description format SECTION
127. l label Function This command declares that the labels and symbols specified with it are global If any labels or symbols specified with this directive command are not defined within the file the assembler processes them assuming that they are defined in an external file If the labels or symbols specified with this directive command are de fined in the file the assembler processes them to be referencible from an external file Description format GLB name GLB name name Rules for writing command Always be sure to insert space or tab between the directive command and the operand Write a label name in the operand that you want to be a global label Write a symbol name in the operand that you want to be a global sym bol When specifying multiple symbol names in the operand separate each symbol name with a comma as you write them Description example GLB namel name2 name3 GLB name4 SECTION program MOV W 0 namel 254 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands IF Conditional assemble control Function This command indicates the beginning of a conditional assemble block The assembler resolves the condition written in the operand and if it is true assembles the body that follows If condition is true lines are assembled up to and not including the line where directive command ELIF ELSE or ENDIF is written Any instructio
128. le 2 The address information in the relocatable file file does not match the addresses information Check to see that the relocatable file is one that was generated by as308 Address is overlapped in the same DATA section section Addresses are overlapping in the DATA sections of the same name sec tion The sections are located overlapping one another Check to see if the sections can be located at overlapping addresses JMP S instruction exist at end of bank address xxxxx 2 The jump address of a short jump instruction overlaps a bank boundary Use the directive command SJMP to control code generation so that short jump instructions will not be generated at such a position Object format version mismatch in file file The version information in the relocatable file or library file file does not match the version information Check to see that the relocatable file or library file is one that was gener ated by the AS308 program Regenerate the file as necessary If this error occurs please contact tool support personnel at Mitsubishi Section type mismatch section Sections of the same name section have different section types Check the section types in the source file 137 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Imc308 Method for Operating Imc308 This section explains how to operate Imc308 The primary function of Imc308 is to generate a machine lan
129. le written in the operand of a directive command INCLUDE is searched from the work include directory gt as308 I work include 82 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 L Generates Assembler List File Function The software generates an assembler list file in addition to a relocatable module file The generated list files are identified by the extension Ist If a directory is specified by command option O the assembler list file is generated in the specified directory Description rule This option can be specified at any position on the command line This option allows you to specify the l M and S file format specifiers No space or tab can be entered between the file format specifier and L d Multiple file format specifiers can be specified simultaneously File format specifiers can be entered in any desired order This option can be set in environment variable AS308COM Format specifier Function C Line concatenation is output directly as is to a list file D Information before DEFINE is replaced is output to a list file Even program sections in which condition assemble resulted in false conditions are output to the assembler list file M Even macro description expansion sections are output to the assembler list file S Even structured description for AS30 expansion sections are output to the assembler list file Description exampl
130. length of the character string that is written in the operand Description format character string character string Rules for writing command Always be sure to enclose the operand with Space or tab can be written between this directive command and the operand The 7 bit ASCII code characters including a space and tab can used to write a character string Kanji and other 8 bit code are not processed correctly How ever the as308 assembler does not output errors Always be sure to enclose the character string with quotations as you write it If you want a macro parameter to be expanded as a charac ter string enclose the macro name with single quotations as you write it If enclosed with double quotations the charac ter string length of the formal parameter written in macro definition is assumed This directive command can be written as a term of an expression 261 ENESAS Renesas Technology Corp AS308 V 1 00 Description example bufset MACRO Fl EZ buffer fl BLKB LEN f2 ENDM bufset 1 Printout_data bufset 2 Sample bufferl BLKB 13 buffer2 BLKB 6 buf MACRO fl buffer BLKB LEN f1 ENDM buf 1 data data is not expanded buffer BLKB 2 ENESAS Renesas Technology Corp Directive Commands AS308 V 1 00 LIST Directive Commands Controls outputting of line data to list file Function This command allows you to stop OFF outputting lines to the asse
131. level language information for programs developed in M16C 80 series s high level languages File generation Each program in AS308 generates a relocatable module file absolute module file error tag file list file and others IEEE 695 format file generating function The binary files generated by AS308 are output in IEEE 695 format There fore AS308 can be shared with other M16C 80 series development tools us ing formats based on the IEEE 695 format IEEE Institute of Electrical and Electronics Engineers USA 15 ENESAS Renesas Technology Corp AS308 V 1 00 Outline of Function Outline of as308 functions Generates relocatable module files Generates assembler list files Structure of as308 The name as308 represents a program to control these two programs EE As308 uses the assembler driver to control the macro pro cessor and assembler processor Therefore neither macro processor nor assembler processor can be invoked directly from your command line Outline of macro processor functions This program processes macro directive commands written in the source file The processed file is available in a file format that can be processed by assembler processor Outline of assembler processor functions This program converts the assembly languages written in the source file and those that derive from processing by macro processor into a relo catable module file 16 ENESAS Renesas Technology Cor
132. llegal That is not a relocatable file Check to see that the relocatable file is one that was created by as308 Invalid option option is used 2 An invalid option option is used Specify a correct option MCU information mismatch in file file 2 The MCU information in the file file does not match the actual chip Check to see that the relocatable file is one that was created by as308 132 ENESAS Renesas Technology Corp AS308 V 1 00 Error Messages of In308 MCU information mismatch in file xx r30 2 A file generated by as30 is being used Reassemble the file with as308 before linking No input files specified 2 No input file is specified Specify a file name Not enough memory 2 Memory capacity is insufficient Increase the memory capacity Option option is not appropriate 2 The option option is used incorrectly Check the syntax for this option and rewrite it correctly Option parameter address exceed OFFFFFH The address specified with an option exceeds OFFFFFh Re input the command correctly symbol type of floating point is not supported Floating point representation of the symbol type is not supported If this error occurs please contact tool support personnel at Mitsubishi Zero division exists in the expression Expression for relocation data calculations contain a divide by O opera tion Rewrite the expression correctly 133 ENESAS Renesas Techn
133. llocate an absolute attribute after a relative attribute in sections of the same name In308 outputs an error If section names are the same and information on section attribute or type is inconsistent In308 outputs a warning 22 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Example of section allocation by In308 The following shows an example of how sections are actually allocated Section definition of file1 a30 SECTION program SECTION subroutine ORG 10000H Section definition of file2 a30 SECTION subroutine SECTION interrupt END Section definition of file3 a30 SECTION interrupt SECTION program 23 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions The example below shows how sections are located when their start addresses are not specified by a link command Example 1 gt 1n308 filel file2 file3 Result of section location program 000000 000003 000003 000003 subroutine 001000 000003 001003 000002 interrupt 001005 000002 001007 000003 Example 2 gt 1n308 filel file2 file3 order interrupt 0f000 Result of section location interrupt CODE 00F000 000002 CODE 00F002 000003 program CODE 00F005 000003 CODE 00F008 000003 subroutine CODE 001000 000003 CODE 001003 000002 file2 24 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Label and symbol The as308 assembler determines the va
134. lues of labels and symbols defined in the absolute attribute section These values are not modified even when link ing Furthermore the label and symbol information of the following conditions are output as relocatable information Global label and global symbol Information on global labels and global symbols are output to relocatable infor mation Local label and local symbol Information on local labels and local symbols are output to relocatable informa tion providing that they are defined in the relative attribute section However if command options S and SM are specified when assembling information on all local labels and local symbols are output to a relocatable file Management of Label and Symbol Addresses This section describes how the label symbol and bit symbol values are man aged by AS308 AS308 divides the label symbol and bit symbol values into global local relo catable and absolute as it handles them The following explains the definition of each type Global The labels and symbols specified with directive command GLB are made the global labels and global symbols respectively The bit symbols specified with directive command BTGLB are made the global bit symbols The names defined in a file if specified to be global are made referencible from an external file The names not defined in a file if specified to be global are made the external reference labels symbols or bit symbols that refe
135. lways be sure to insert space or tab between the directive command and the operand A symbol can be written in the operand An expression can be written in the operand When writing multiple operands separate them with a comma A character or a string of characters can be written in the operand after enclosing it with single quotations or double quotations In this case data is stored in ASCII code representing the characters The length of a character string you can write in the operand is less than two characters When defining a label be sure to write the label name before the direc tive command Always be sure to insert a colon after the label name 289 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Description example SECTION value ROMDATA WORD 1 WORD da ta WORD symbol WORD symbol 1 WORD 1 2 3 4 5 END WORD 1 WORD da 290 ENESAS Renesas Technology Corp AS308 V 1 00 Temporary label Directive Commands Function This command defines a temporary label The assembler references a temporary label that is defined immediately before or after an instruction The labels that can be referenced are only the label defined before or after an instruction A temporary file can be defined and referenced within the same file Up to 65 535 temporary files can be defined in a file In this case if INCLUDE is written in the file the m
136. lways be sure to set the FB register value with directive command FB before you write this directive command When specifying multiple names be sure to separate the names with a comma as you write them Be careful that the symbol you specify with this directive command is not a duplicate of the symbol specified by SBSYM Description example FB 80H LDC 80 FB FBSYM syml sym2 250 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands FLOAT Stores data in ROM in 4 byte length Function This command stores 4 byte long fixed data in ROM Label can be defined at the address where data is stored Description format FLOAT numeric value name FLOAT numeric value Rules for writing command Write a floating point number in the operand Refer to Rules for writing operand for details on how to write a floating point number in the operand Always be sure to insert space or tab between the directive command and the operand d When defining a label be sure to write the label name before the direc tive command Always be sure to insert a colon after the label name Description example FLOAT 5E2 constant FLOAT 5e2 251 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands FORM Specifies number of columns and lines in 1 page of list file Function This command specifies the number of lines per page of the assembler list file in th
137. m bler list file Lines in error are output to the list file regardless of whether they are within the list output disabled range This command allows you to start ON outputting lines to the assem bler list file All lines are output to the list file if you do not specify this directive com mand Description format LIST ON OFF Rules for writing command Always be sure to insert space or tab between the directive command and the operand To stop outputting lines write OFF in the operand To start outputting lines write ON in the operand Description example LIST ON LIST OFF Example of source fil le Example of assembler list file output 0 ROL 263 ENESAS Renesas Technology Corp AS308 V 1 00 LOCAL Directive Commands Declares local label in macro Function This command declares that the label written in the operand is a macro local label Macro local labels are allowed to be written for multiple instances with the same name providing that they differently macro defined or they are written outside macro definition If macro definitions are nested macro local labels in the macro that is defined within macro definition are not allowed to be used in the same name again Description format LOCAL label name label name Rules for writing command Always make sure that this directive command is written within the macro body Always be sure
138. macroprocessor and assembler processor from as308 as the software indicates them on the screen Description rule This option can be specified at any position on the command line Description example If L T is set in AS308COM the following output will be obtained gt as308 C N sample This information is displayed beginning with the next line following All Rights Reserved that is output when AS308 starts up normally gt as308 C N sample sample a30 mac308 L T sample a30 macro processing now asp308 L T sample a30 assembler processing now TOTAL ERROR S 00000 gt as308 C N sample If this command option is combined with an option to disable message output to a screen the following output will be obtained gt as308 C sample mac308 L T sample a30 asp308 L T sample m30 77 ENESAS Renesas Technology Corp AS308 V 1 00 D Method for Operating as308 Sets Symbol Constant Function The software sets values to symbols The value is handled as an absolute value The symbols defined by this option are processed in the same way as those symbols that are defined in the start positions of the source program However these symbols are not output to an assembler list file The symbols defined by this option are handled in the same way as the symbol definitions described in the assembly source file Namely if a symbol definition of the same name is described in th
139. mbol is defined in two places of the library filename one in module1 and another in module2 Check the relocatable file name xxx and xxx are used The option xxx and the option xxx are used simultaneously Options cannot be specified simultaneously Re input the command correctly Can t close file filename 2 The file filename cannot be closed Check the directory information Can t close temporary file 2 The temporary file cannot be closed Check the directory information Can t create file filename 2 The file filename cannot be created Check the directory name 166 ENESAS Renesas Technology Corp AS308 V 1 00 Error Messages of Ib308 Can t Can t Can t Can t create temporary file 2 The temporary file cannot be created Check the directory information open file filename The file filename cannot be opened Check the file name open temporary file 2 The temporary file cannot be opened Check the directory information write in file filename Data cannot be written to the file filename Memory is insufficient Increase the memory capacity Command file is include in itself 2 An attempt is made to include the command file in itself Check to see if the command file is written correctly Command file line characters exceed 255 2 The number of characters per line in the command file exceeded 255 characters Check the
140. messages output by each AS308 program Types of Errors There are following two types of error messages Error message This refers to an error encountered during program execution that renders the program unable to perform its basic function Warning message This refers to an error encountered during program execution that presents some problem even though it is possible to perform the basic function of the program Please try to solve all problems that have caused genera tion of a warning message Some warnings may result in a fault when operating your system on the actual chip although no problem might have been encountered during debugging 49 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Return Values for Errors When terminating execution each AS308 program returns a numeric value to the OS indicating its status at termination The table below lists the values that are returned when an error is encoun tered Return value Content 0 Program terminated normaly 1 Program was forciby terminated by input of control C 2 Error relating ro the OS s file system or memory system occured 3 Error attributeable to the file being processed occured 4 Error in input form the command line occured 50 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Compatibility with M16C 60 commands AS308 supports the mode60 command option This option assembles pro grams develo
141. n the abslist directory under the current directory 184 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating abs308 V Indicates Version Number Function The software indicates the version number of the absolute lister M if this option is specified all other parameters on the com mand line are ignored Description rule Specify this option only and nothing else Description example abs308 V 185 ENESAS Renesas Technology Corp AS308 V 1 00 Error Message of abs308 Error Messages of abs308 Can t create file filename 2 The file filename cannot be created Check the directory information Can t open file filename 2 The file filename cannot be opened Check the file name Can t write in file filename 2 Data cannot be written to the file filename Check the permission of the file Command line is too long 2 The command line contain too many characters Re input the command correctly Error information is in filename 2 The file filename contains error information Regenerate the assembler list file Illegal file format filename The file format of filename is illegal Check the file name Input files number exceed 80 The number of input files exceeds 80 Re input the command 186 ENESAS Renesas Technology Corp AS308 V 1 00 Error Message of abs308 Not enough disk space 2 Disk capacit
142. n the directive command and the operand Always be sure to enclose the character string in the operand with double quotations If you want the character string to be output to a file specify the file name after gt or gt gt The symbol gt directs the assembler to create a new file and output a message to that file If there is an existing file of the same name that file is overwritten The symbol gt gt directs the message is added to the contents of the specified file If the specified file cannot be found the assembler cre ates a new file in that name Space or tab can be inserted before and after gt or gt gt Directive command FILE can be written in the file name 227 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Description example ASSERT string gt sample dat Message is output to file sample dat ASSERT string gt gt sample dat Message is added to file sample dat ASSERT string gt FILE Message is output to a file bearing the same name as the currently processed file except the extension 228 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands BLKA Allocates RAM area in units of 3 bytes Function This command allocates a specified bytes of RAM area in units of 3 bytes Label name can be defined at the allocated RAM address Description format BLKA numeric value name BLKA numeric value Rules
143. n to purchase as necessary Using technical information shown in the product data drawings and tables programs and algorithms contained in this manual you must evaluate not only technological contents programs and algorithms by stand alone but also the overall system and judge whether they are applicable or not on the your own responsibility Mitsubishi Electric Corpo ration and Mitsubishi Electric Semiconductor Systems Corporation shall have no liability for whether they are appli cable or not Mitsubishi semiconductors products are neither designed nor manufactured with any intention or whatsoever to cause hindrance to social systems or a threat to human life When you plan to use the product described here in special applications such as transport or moving vehicles medical aerospace or nuclear control or submarine repeaters or systems please consult your nearest office of Mitsubishi or its distributor This manual may not be copied in whole or part without the written consent of Mitsubishi Electric Corporation and Mitsubishi Electric Semiconductor Systems Corporation For inquiries about the contents of this manual or software send an e mail or fax using a text file the installer gener ates in the following directory to your nearest Mitsubishi office or its distributor SUPPORT Product name SUPPORT TXT Mitsubishi Tool Homepage _http www tool spt mesc co jp index_e htm ENESAS Renesas Technology Corp AS308 V 1
144. n when one of the following con ditions applies Operands that have a valid value when assembling in which however no addressing mode is specified Operands in which symbols declared in SBSYM or FBSYM are used Outline of Mnemonic Description The M16C 80 series allows you to write the specifiers listed below and an addressing mode in its mnemonics and operands The specifiers and ad dressing modes you can specify differ with each mnemonic Refer to the M16C 80 Series Software Manual for details on how to write mnemonics Size specifier Specify the size of the data to be operated on by the mnemonic You cannot omit this specifier it must always be entered Jump distance specifier Specify the distance to the jump address of a branch instruction or subroutine call instruction You normally do not need to specify this Instruction format specifier Specify the format of op code The code lengths of op code and operand differ with each op code format You normally do not need to specify this Addressing mode Specify the addressing mode of operand data You can omit this specification The section to specify the address range of relative addressing in AS308 is referred to as an addressing mode specifier Here 16 and 8 are the addressing mode specifiers MOV W work1 16 SB work2 8 SB 30 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Optimized Selection by AS308 The as308 assembler ge
145. n with absolute attribute is arranged after a section with relative attribute an error results Description rule Input this option using a form like ORDER section name section name or ORDER section name start address Always be sure to insert a space between this option and the section name Separate between two section names or between an address value and a section name with a comma as you specify them There must be no space or tab before or after the comma This option can be specified at any position on the command line Description example Sections are allocated in order of main sub and dat beginning from address 0H gt 1n308 samplel sample2 ORDER main sub dat Sections are allocated in order of main sub and dat beginning from address Of000H gt 1n308 samplel sample2 ORDER main 0f0000 sub dat 125 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 T Generates Link Error Tag File Function The software generates a link error tag file when a link error occurs This file is output in a format that allows you to use an editor s tag jump function Even when you specify this option this error file will not be generated if no error is encountered The error tag file name is created from the relocatable module file that is specified at the beginning of the command line by changing its exten sion to Itg If an absolute module file name is specifi
146. nal reference symbol SECTION progrl libsmp lib libsmp2 a30 GLB EQU SECTION ibsmp3 a30 GLB syml GLB sym2 External reference symbol EQU pi SECTION prog3 Input command to link Result to link processing libsmp1 r30 processing libsmp lib libsmp3 r30 processing libsmp lib libsmp2 r30 28 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Management of Include File The as308 assembler can read an include file into any desired line of the source program This facility can be used to improve the legibility of your program Rules for Writing Include File To write an include file follow the same rules that you follow for writing a source program M Directive command END cannot be written in an include file Reading Include File into Source Program Write the file name you want to be read in the operand of directive command INCLUDE All contents of the include file are read into the position of this line Example INCLUDE initial inc 29 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Code Selection by AS308 The as308 assembler is designed to choose the shortest code possible from the M16C 80 series s addressing modes This section outlines the M16C 80 series s addressing modes and explains how to write mnemonics in the source program Optimized Code Selection The as308 assembler optimizes code selectio
147. nanancnn nana 59 Map File oxida tas ae dia 60 LinKk Eror Tag File viii ii 61 Motorola S Format oococcccnnnnciccnccccnnonnnnnnocononnn cnn nana rra 62 Intel HEX Forimatt cccceecccceeeeseececeeeeseeeeeeeesseeeeeesneeneeeeeesennaes 62 Library Fl a 63 Library ListiFile rada 64 Cross Reference File c ccccccceesesceeceeeeeseaeeeeeeeeeeeaeeeseneeeeaas 66 Absolute List File ieena a a 67 a O each cael ae 68 Precautions on Entering Commands cccesceeeeeeeeeeteeees 68 Structure of Command Line cceeeceeeeeeeeeeeeeeeeteeeeeneeeteaes 68 Rules for Entering Command Line oococnccccnncccnnoccccnonananancnnnno 69 Method for Operating ASSO8 oooocccnocccccnoconcccnncannncnnnonannnnnnannncn nana nnos 71 Command Parameters siii il iia 71 Rules for Specifying Command Parameters oooccccnncccnnccnnnnns 72 Include File Search Directory ccccceeceeeseeeeeeeeeeeeeeeeeneeeees 74 4 ENESAS Renesas Technology Corp AS308 V 1 00 Contents as308 Command Options ccccccoccconocccccnccnnnnnnnnnncc nono na nnnnn cnn 74 O ce rr rerore reer rere 75 el LAK A AAO bi ate OF ae oa tea 76 O O Er 77 Dhaene Ria eee ie a ee A 78 aa eiii 80 a dl e lle 81 Mitra 82 SUE ae Ot onan AE E eat mii tes cota Co eme aes tas 83 MOC CGO iia cabida 84 MOJEG OD arr ee ve cevhicoid swan E SEERE Tee aE 85 Mis E T ada 86 Nidia 87 DA A e Poe ih ee 88 in irc abaad d 89 MA AA A ee a 90 tri rn dt cd 91 E EE rod 92
148. ncluding the line where directive command ELIF ELSE or ENDIF is written Description format IF conditional expression body ELIF conditional expression body ENDIF Rules for writing command Always be sure to write a conditional expression in the operand of this directive command Always be sure to insert space or tab between the directive command and the operand This directive command can be written for multiple instances in one con ditional assemble block Description example LE TYPE 0 byte Proto Type Mode ELIF TYPE gt 0 I b E byte Mass Production Mode E byte Debug Mode E 241 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands ELSE Indicates the biginnig of ablock to be assembled Function When all conditions are false this command indicates the beginning of the lines to be assembled In this case lines are assembled up to and not including the line where directive command ENDIF is written Description format IF conditional expression body ELSE conditional expression body ENDIF IIE conditional expression body ELIF conditional expression body ELSE body ENDIF Rules for writing command This directive command can be written less than once in a conditional assemble block This directive command does not have an operand Description example IF TYPE 0 byte Proto Type Mode LIF TYPE g
149. nction The software compares the created date of a relocatable module in the library file with that of a relocatable module file with which you want to be updated Then if the date of the relocatable module file is newer than that of the module the software updates it Description rule Input this option using a form like U library file name relocatable mod ule file name Always be sure to insert a space between this option and the library file name and between the library file name and the relocatable module file name Multiple relocatable module names can be specified In this case al ways be sure to insert a space between each module name Description example 1b308 U new samplel Only when the created date of module sample in the new lib file is older than that of the sample1 r30 file of the same name the content of sample1 is up dated with the content of the sample1 r30 file 161 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Ib308 V Indicates Version Number Function The software outputs the version number of Ib308 to the screen M if this option is specified all other parameters on the com mand line are ignored Description rule Specify this option only and nothing else Description example 15308 V 162 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Ib308 X Extracts Module Function The software extracts a
150. nd When you use for character data 40H be sure to enclose with double quotations When a string including is enclosed with single quotation strings before and after are concatenated This command can be written for multiple instances in one line M if you want a concatenated character string to be a name do not insert spaces and tabs before and after this directive command 293 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Description example ASSERT sample gt FILE dat If the currently processed file name is sample1 a30 a message is output to the sample dat file A macro definition like the one shown below can be entered mov_nibble MACRO pl src p2 dest MOV p1 p2 src dest ENDM mov_nibble L ROL H A0 MOVLH ROL A0 294 ENESAS Renesas Technology Corp Technical Support Communication Sheet To Distributor Contact Address Date _ Total Pages Product Information Company Product name Department Version number Responsible person Serial number Phone Host Machine name FAX OS name E mail OS version Address Message If this form does not have sufficient space use another sheet of paper to write your information 1 ENESAS Renesas Technology Corp AS308 V 1 00 User s Manual Second Edition April 1 1999 Document No MSD AS308 U
151. nerates optimum selected or most suitable code for the source statements shown below When jump distance specifier is omitted The jump distance specifier cannot be omitted if the oper and is indirect addressing An error is generated if this speci fier is omitted When instruction format specifier is omitted When addressing mode specifier is omitted For an addressing mode with displacement be sure to specify the displacement Combination of the above The following explains optimum selection by as308 for each case listed above When jump distance specifier is omitted normally omitted The as308 assembler performs optimum selection when all of the following conditions are met When the operand is written with one label When the operand is written with an expression that contains one label Label value determined when assembled Label value determined when assembled Value determined when assembled label When operand labels are defined in the same section The section where the instruction is written and the section where the operand label is defined both are absolute attribute sections and are written in the same file If conditions to perform optimum selection are not met as308 generates code as directed by directive command OPTJ 31 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions The following shows instructions selected by as308 Unconditional branch instruction The shorte
152. nesas Technology Corp AS308 V 1 00 Method for Operating Imc308 H Converts File into Intel HEX Format Function The Imc308 generates an Intel HEX format file The Imc308 generates an Original HEX format for Mitsubishi microcom puters if the address value exceeds 1Mbytes Description rule Specify this option before entering a file name This option cannot be specified simultaneously with option E Description example gt 1mc308 H debug 142 ENESAS Renesas Technology Corp AS308 V 1 00 ID Method for Operating Imc308 Set ID code for ID check function Function E For details on the ID code check see the hardware manual of the micro computer The specified ID code is stored as 8 bit data in ID store addresses FFFFDF FFFFE3 FFFFEB FFFFEF FFFFF3 FFFFF7 and FFFFFB And FF is stored in address FFFFFF Refer to protect1 If you filled in ID store addresses with value in your source prograam when this option is specified the data of ID store addresses are always changed Without this option the filling data are output When this option alone is specified ID code is FFFFFFFFFFFFFF An ID file extension id is created to display ID codes set with this option The specified ID code is stored as an ASCII code Always specify this command option in capital letters Add ID to the ID code To directly specify an ID code specify ID followed by a number xample 1 IDCo
153. ng 2 No reserved word is entered Write a reserved word SB FB A1 A0 SP or A1A0 Reserved word is used as label or symbol 2 Reserved word is used as a label or symbol Rewrite the label or symbol name correctly Right quote is missing 2 A right quote is not entered Enter the right quote Same items are multiple specified Multiple same items of operand are specified Check the syntax for this operand and rewrite it correctly Same kind items are multiple specified 2 Multiple operand items of the same kind are specified Check the syntax for this operand and rewrite it correctly Section attribute is not defined Section attribute is not defined Directive command ALIGN cannot be written in this section Make sure that directive command ALIGN is written in an absolute attribute section or a relative attribute section where ALIGN is specified 103 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 Section has already determined as attribute 2 The attribute of this section has already been defined as relative Direc tive command ORG cannot be written here Check the attribute of the section Section name is missing No section name is entered Write a section name in the operand Section type is multiple specified Section type is specified two or more times in the section definition line Only one section type CODE DATA or ROMDATA
154. nging the extension of the absolute module file to map Description rule This option can be specified at any position on the command line Description example Files sample1 x30 and sample1 map are generated gt 1n308 M samplel sample2 121 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 MS MSL Outputs Symbol Information to Map File Function The fullname of symbolmore than 16 characters are output to mapfile when MSL is specified The software generates a map file that contains address mapping infor mation and symbol information The file name of the map file is created by changing the extension of the absolute module file to map Description rule This option can be specified at any position on the command line Description example gt 1n308 samplel sample2 MS A samplel x30 and samplel map files are generated 122 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 NOSTOP Outputs All Errors Function The software outputs all encountered link errors to the screen If this operation is not specified the software outputs up to 20 errors to the screen Description rule d This option can be specified at any position on the command line Description example gt 1n308 samplel sample2 NOSTOP 123 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 O Specifies Absolut
155. nnonancnnnnnnnrncnnnannnnos 149 Warning Messages Of IMC308 oooccccoooccccnnccoccccnnonanccnnnnancncnnnannncnnnns 151 Method for Operating IbB08 oooooccccnonocccccnnooncccnnnnnccnnnnnnancnnnnnnns 152 Command Parameters coooccccnonoccccnnoononcnnnnnonnonononnnnnnnnncnnnnnnns 152 Rules for Specifying Command Parameters ococccconncicnncncco 153 Waialua aad een aioe ld ae ees eae 155 SA Steet GA ae ia AeA Det do ee at atest A 156 E EEEE E EE EE EE OE 157 Dee aaa A Ha 158 A E A RE 159 A e ai 160 Uca de erat eo dd 161 Mo o gee cet ee ei 162 A deci eed ce aaan 163 Ds Dev idascbe iba ii dianas 164 Error Messages of ID808 isch cestadicdascchedeaeianciaine 165 Warning Messages Of ID308 ooooooccccnnocccccccocccccconancccnnnancccnnnanancncnnns 169 Method for Operating Xrf308 oooonocccnnnnnccccconooncccnnnannccnnnnnancnnnnnnnos 170 Command Parameters noooccccnonoccccnnocooncnononnnnnnnnonnnnononnnnnnnn nn 170 Rules for Specifying Command Parameters ceeeeeee 170 Siig bite e tLe Bee A ee Nd tls 172 MN ica rie ao 173 O A 174 aaa 175 Dt EE EET ETT da ERECT ET Daiana EA 176 Error Messages Of xrf308 cooooocccconoocccccononcccnonannnnnnnnnnnnnnnnnannrn ranma 177 Method for Operating abs30B ooconoocccccococcccnonaccncnnnncncncnnnnancnncnnnnos 179 Precautions USING abs308 oooccccincocccccconoccccconnannnnnonanancncnnnnns 179 A O 182 Di AA AA Dt 183 Oia eiii datada 184 a NT 185 7 ENESAS Ren
156. nocncccnnn 35 SB Register Offset Description onocccccnnnnnncnnnccccnnrnnnnannnnnnos 36 Special Page BraMCh ooocccinicccnncccinnocnnnnccccononnnn acc conan na nnn cnn 37 Referencing Special Page Vector Table oooooooccccnnnoccccccconn ns 39 Macro FUNCION i a araa maaa a aa aa aaa Ae a aE aAA 40 Repeat Macro Function cooooccccccnnnoccncnnnncnnnncnnnnoncnnnnnnnnnnnrnnnnanos 43 Conditional Assemble Control oooonccccnncccnnocconnnccccnonrnnanannnnnor 43 3 ENESAS Renesas Technology Corp AS308 V 1 00 Contents Source Line Information Output cconccccnnccccnnocicnnncccnonnnnnnnnnccnnnos 46 Symbol Definition ocoooonnncnnnninnnnccnnnncann cocaina narran 46 Environment Variables Of AS308 oocooccocccccccccccccccccoccnonananoncnnnnns 46 NA cece cece eeeeeeeeeeaeeeeeeeeeseaeeeseaeeeseeeeenaeessaes 49 Compatibility with M16C 60 Commands ooooooccccnonoccccnnnononcnnnnns 51 AS308 processing when option command mode60 is specified 52 Replacement command liSt eee eee eeeteeeeeeenteeeeeeentaeteeeeenaes 53 Input Output Files of ASSO8 eves che cede veel ae eos scccacseddeintvsataeteabenase 54 Relocatable Module File eeececceeeeesneeeeeeeenneeeeeeeneeeeeeeaaes 56 Assembler List File 2 0 2 cccccceecsseceeeeeeeeneeeeeeeeeeeeeeeneeneeeeeenenees 57 Assembler Error Tag File eccccceeesecceeeeeseeceeeeeeseeeeeeeeneeeees 58 Absolute Module File ooonooccccnnnnncccnnonnccccccnnncncccnnnnn
157. ns that can be written in a as308 source program can be written in the conditional assemble block Description format IF conditional expression body ENDIF Rules for writing command Always be sure to write a conditional expression in the operand of this directive command Always be sure to insert space or tab between the directive command and the operand Function of conditional expression Conditional assemble is performed based on the result of the condi tional expression 255 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Rules for writing conditional expression Only one conditional expression can be written in the operand of the directive command Always be sure to write a relational operator in the conditional expres sion The operators listed below can be used Relational operators Contents gt True if value on left side of operator is greater than value on right side lt True if value on right side of operator is greater than value on left side gt True if value on left side of operator is equal to or greater than value on right side lt True if value on right side of operator is equal to or greater than value on left side True if values on left and right sides of operator are equal True if values on left and right sides of operator are not equal Arithmetic operation of a conditional expression is performed in signed 32 bits
158. ntered in a library file named new lib are output to a library list file named new IIs 10308 L new samplel Information on module sample1 entered in the new lib library file is output to a new IIs list file 105308 L new lib samplel sample3 Information on modules sample1 and sample3 entered in the new lib library file are output to a new lls list file 159 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Ib308 R Replaces Modules Function The software updates a relocatable module in the library file by replac ing it with the content of a specified relocatable module file The module that is updated in this way is one that has the same name as the speci fied relocatable module file name Description rule Input this option using a form like R library file name relocatable mod ule file name Always be sure to insert a space between this option and the library file name and between the library file name and the relocatable module file name Multiple relocatable module file names can be specified In this case always be sure to insert a space between each module file name Description example 10308 R new samplel The content of module sample1 in the new lib library file is replaced with the content of the sample1 r30 file of the same name 160 ENESAS Renesas Technology Corp AS308 V 1 00 U Updates Modules Method for Operating Ib308 Fu
159. of as308 No space after mnemonic or directive 2 The mnemonic or assemble directive command is not followed by a blank character Enter a blank character between the instruction and operand Not enough memory Memory is insufficient Divide the file and re run Or increase the memory capacity Operand expression is not completed The operand description is not complete Check the syntax for this operand and rewrite it correctly Operand number is not enough The number of operands is insufficient Check the syntax for these operands and rewrite them correctly Operand size is not appropriate 2 The operand size is incorrect Check the syntax for this operand and rewrite it correctly Operand type is not appropriate The operand type is incorrect Check the syntax for this operand and rewrite it correctly Operand value is not defined An undefined operand value is entered Write a valid value for operands Option xx is not appropriate 2 Command option xx is written incorrectly Specify the command option correctly again 102 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 Questionable syntax The structured description command is written incorrectly Check the syntax and write the command correctly again Quote is missing 2 Quotes for a character string are not entered Enclose a character string with quotes as you write it Reserved word is missi
160. of concatenation If an error occurs in a line where is written the error is output in the last line concatenated M The upper limit for the maximum number of characters in all lines that are concatenated is 512 characters However this limit does not include the spaces and tabs at the begin ning of concatenated lines M ifa is written immediately after a 2 byte code character it may be mistaken for So be careful Description examples for line concatenation and concatenation results are shown below Example 1 BYTE 1 2 AN 3 4 Concatenation result 204 ENESAS Renesas Technology Corp AS308 V 1 00 Example 2 BYTE 1 comment 25 comment 3 comment Concatenation result BYTE 1 2 comment 3 comment Example 3 BYTE 1 DANY 3y 4 Concatenation result BYTE 1 2 3 4 205 ENESAS Renesas Technology Corp Rules for Writing Program AS308 V 1 00 Operands Rules for Writing Program Operands can be written in a mnemonic or directive command to indicate the object to be operated on by that instruction There are following types of oper ands Some instructions do not have an operand If you want to know whether or not the instruction has an operand please refer to the rules for writing each command Numeric value A numeric value includes an integral and a floating point number Name A label name and symbol name can be used Expression An exp
161. oftware system that assists you at the assembly language level in developing control programs for the M16C 80 series of single chip microcom puters It converts source programs written in assembly language into files of source level debuggable format AS308 also includes a program that converts source programs into files of M16C 80 series ROM programmable format Further more AS308 can be used in combination with the C complier NC308 of sepa rate product Configuration AS308 consists of the following programs Assembler driver as308 This program starts up macro processor and assembler processor in succes sion The assembler driver can process multiple assembly source files Macro processor This program processes macro directive commands in the assembly source and performs preprocessing for the assembler processor to generate an as sembly source file MM The assembly source files generated by macro processor are erased after assembler processor finishes its process ing This does not modify the assembly source files written by the user 13 ENESAS Renesas Technology Corp AS308 V 1 00 Outline of Function Assembler processor This program converts the assembly source file preprocessed by the macro processor into a relocatable module file Linkage editor In308 This program links the relocatable module files generated by the assembler processor to generate an absolute module file Librarian 10308 This p
162. ology Corp AS308 V 1 00 Warning Messages of In308 Warning Messages of In308 e option parameter symbol is undefined The symbol symbol specified with e is not defined yet Define symbol in the source program The program will be processed assuming values 0 CODE section section 1 is overlapped on the section 2 The CODE section section 1 overlaps section 2 The sections have been allocated overlapping each other Check to see if these sections are allowed to overlap DATA section section 1 is overlapped on the section 2 The DATA sections section 1 and section 2 are overlapping Sections are located overlapping each other Check to see if the sections can be located at overlapping addresses ROMDATA section section 1 is overlapped on the section 2 The ROMDATA section section 1 overlaps section 2 The sections have been allocated overlapping each other Check to see if these sections are allowed to overlap label value exceed OFFFFFH 2 The value of the label label exceeds OFFFFFh Check the allocated addresses of sections section data exceed OFFFFFH The section data exceeds address OFFFFFH Check the allocated addresses of sections 134 ENESAS Renesas Technology Corp AS308 V 1 00 Warning Messages of In308 16 bits signed value is out of range 32768 32767 address address Relocation data calculation resulted in the address exceedin
163. on MS or MSL Format of map file The information below is output to a map file sequentially in a list form The output format of a typical map file is shown in Example of Map File 1 Link information This information includes command lines relocatable module file names and the dates when the relocatable module files were created 2 Section information This information includes the relocated section names attributes types store addresses section sizes whether or not sections are aligned and module names relocatable module file names 3 Global label information This information includes global label names and addresses This information is output only when you specify command option MS MSL 4 Global symbol information This information includes global symbol names and numeric values This infor mation is output only when you specify command option MS MSL 5 Global bit symbol information This information includes global bit symbol names bit positions and memory addresses This information is output only when you specify command option MS MSL 6 Local label information This information includes module names relocatable module file names local label names and addresses This information is output only when you specify command option MS MSL 7 Local symbol information This information includes module names relocatable module file names local symbol names and numeric values This informa
164. onal operators can only be written in the operand of directive commands IF and ELIF Unary operators Handles value that follows as a ositive value gt Handles value that follows as a negative value 5 Logivally NOT s value that follows SIZEOF Handles section size bytes specified in operand as value TOPOF Handles start address of section specified in operand as a value 209 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Binary operators gt gt lt lt Adds values on left and right sides of operand together Subtracts value on right side of operand from value on left side Multiples values on left and right sides of operand together Divides value on left side of operand by value on right side Handles remainder derived by dividing value on left side of operand by valueon right side Bit shifts value on left side operand to right as many times as the value on right side Bit shifts value on left side operand to left as many times as the value on right side Logically OR s values on left and right side of operand for each bit Logically AND s values on left and right sides of operand for each bit Exclusive OR s values on left and right sides of operand for each bit Relational operators gt Evaluates that value on left side of operator is greater than value on right side This operator can only be written in operand of directive com mands
165. or priorities highest priority first Operator priorities are listed in the table below The smaller the value shown in this table the greater the priority 2 Operators of the same priority are operated on sequentially beginning from the left side 3 The priority of operation can be changed by enclosing a given operator with parentheses Priority Type Operator Operator 1 Operator to change priority 2 Unary operator SIZEOF TOPOF 3 Binary operator 1 L 4 Binary operator 2 5 Binary operator 3 gt gt lt lt 6 Binary operator 4 amp 7 Binary operator 5 A 8 Rlational operator gt lt gt lt l 211 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Expression and lts Value The following shows a description example of an expression and the value that results from operations performed by as308 Expression Result of operation 2 6 2 2 6 2 1 lt lt 3 1 1 lt lt 3 1 3 2 4 2 3 2 4 2 8 4 2 814 2 8 amp 8 2 8 amp 8 2 6 3 6 3 6 3 Oy ss O OY AO RO RS O o PF o o He Character String A character string can be entered in the operand of some directive commands This character string can be comprised of 7 bit ASCII code characters When writing a character string in the operand of a directive command be sure to enclose it with single or double quotations unless otherwise specified Example string
166. p AS308 V 1 00 Outline of Function Outline Processing by as308 After interpreting the input command lines as308 activates each pro gram of macroprocessor and assembler processor as308 controls the command options added when each program starts up and the file names to be processed Each program is started up sequentially in the following order 1 Macro processor 2 Strucured processor 3 Assembler processor Outline of In308 functions Generates an absolute module file Generates an map file Assigns sections Utilizes relocatable modules in library file Outline of Imc380 functions Generates Motorola S format file Generates Intel HEX format file Outline of Ib308 functions Generates a new library file Renewal a library file Generates a library list file Outline of xrf308 functions Generates a cross reference file Controls output information of symbol Outline of abs308 functions Generates absolute list files 17 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions AS308 Functions The as308 assembler converts an assembly source file into a relocatable module file that can be read in by the linkage editor lttherefore allows you to process assembly source files that include macro directive commands Relocatable Assemble The as308 assembler is capable of relocatable assembling necessary to develop a program in separated multiple files lt generates a relocat
167. ped with AS30 M The below commands cannot be replaced even when using the mode60 command option Change the source program MOVA MOVA MOVA MOVA JMPI A JSRI A PUSHG PUSHC POPC POPC MUL W MULU W LDC STC LDE B W STE B W BSET G BSET G src RO src R1 src R2 src R3 src dsp A0 dsp A1 dsp SB dsp FB abs16 A1A0 A1A0 INTBL INTBH INTBL INTBH generic AO generic AO generic RO R1 R2 R3 A0 A1 A0 A1 dsp SB dsp FB dsp A0 dsp A1 abs16 A1A0 generic generic A1 AO generic ROL RO ROH R1 R1L R2 R1H R3 A0 A1 A0 A1 dsp SB dsp FB dsp A0 dsp A1 abs16 bit R2 bit R3 BAND BCLR BNAND BNOR BNOT BNTST BNXOR BOR BTST BTSTC BTSTS BXOR and BM are not replaced in the same way as BSET 51 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions AS308 processing when option command mode60 is specified When the command option mode60 is specified processing with AS308 is as follows Format specifiers of the MOV CMP OR SUB AND NOT PUSH and POP commands are ignored Addressing mode specifiers of the JMPI and JSRI commands are ig nored Format specifiers of the ADD command are ignored When adding to the stack pointer SP using the ADD command the size specifier is processed as L LDINTB is replaced with LDC before processing The STZ STNZ and STZX commands are processed by byte size The LDE and
168. r 268 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Expanding actual parameter Formal parameters are replaced with actual parameters sequentially from left to right in the order they are written If no actual parameter is written in macro call that corresponds to a defined formal parameter the assembler does not generate code for this formal parameter part If there are more formal arguments than the actual arguments and some formal arguments do not have the corresponding actual arguments the assembler does not generate code for this formal argument part If a formal parameter written in the body is enclosed with single quota tions the assembler encloses the corresponding actual parameter with single quotations as it is output If one actual parameter contains a comma while at the same time the argument is enclosed with parentheses the assembler converts the argument along with its parentheses If there are more actual parameters than the formal parameters the assembler does not process the actual parameters that do not have the corresponding formal parameters If the number of actual parameters does not match that of formal parameters the as308 assembler outputs a warning message 269 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Example of actual parameter expansion Example of macro definition name MACRO string BYTE string ENDM Example
169. rce program written in mul tiple files into a single executable file 21 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Section Management by as308 Absolute attribute section have their absolute addresses determined se quentially beginning with the specified address Relative attribute section have their relocatable addresses determined sequentially beginning with 0 section by section All start addresses relocatable of relative attribute sections are 0 Section Management by In308 Sections of the same names in all files are arranged in order of files specified Absolute addresses are determined sequentially beginning with the first section thus sorted Start addresses of sections are determined sequentially beginning with O unless otherwise specified Sections that differ each other are located at contiguous addresses un less otherwise specified Sections of the same name are allocated in order of files specified Sections are allocated in the order they are entered in the file that is specified first If an attempt is made to allocate an absolute attribute after another ab solute attribute In308 outputs a warning For section type DATA if addresses overlap in two or more sections In308 outputs a warning Sections will be allocated overlapping each other For section type CODE or ROMDATA if addresses overlap in two or more sections In308 outputs an error If an attempt is made to a
170. reen Description rule This option can be specified at any position on the command line Description example 1n308 samplel sample2 115 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 E Specifies Start Address of Program Function This option sets the entry address of an absolute object module This address is used to indicate the start address to the debugger Numeric values or label names can be used to specify an address value However local label names cannot be specified Description rule Input this option using a form like E numeric value or label name Always be sure to insert a space between this option and the numeric value or label name Always be sure to use hexadecimal notation when entering a numeric value If the numeric value begins with an alphabet a to f always be sure to add 0 at the beginning of the value as you enter it This option can be specified at any position on the command line Description example The address value in global label num is specified for the entry ad dress of sample1 x30 1n308 samplel sample2 E num f0000 is specified for the entry address of sample1 x30 1n308 samplel sample2 E 0 0000 116 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 G Outputs Source Debug Information Function The software outputs information on C language or macro description so
171. relocatable module from the library file as a relocatable module file The library file is not modified by this operation The created date of the relocatable module file thus extracted is the date when it was extracted from the library file If a file of the same name as the extracted relocatable module file al ready exists the existing file is overwritten Description rule Always be sure to insert a space between this option and the library file name Description example 10308 X new sample3 Module sample3 is extracted from the new lib library file to generate a relocat able module file named sample3 r30 163 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Ib308 Specifies Command File Function The software uses the contents of a specified file as command param eters as it invokes Ib308 Description rule Input this option using a form like file name No space or tab can be entered between this option and the file name No other parameters can be entered on the command line Description example 105308 cmdfile 164 ENESAS Renesas Technology Corp AS308 V 1 00 Error Messages of Ib308 Error Messages of Ib308 filename is not library file The file filename is not a library file Check the file name Check to see that the file is one that was gener ated by Ib308 filename is not relocatable file The file filename is not a
172. rence the names defined in an external file 25 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Local All names specified with neither directive command GLB nor BTGLB are made the local names Local names can be referenced within the file in which they are defined Local names can have the same label name used in other files Relocatable The values of local labels symbols and bit symbols in a relative at tribute section are made the relocatable values The values of the externally referencible global labels symbols and bit symbols become relocatable values Absolute The values of the local labels symbols and bit symbols defined in an absolute attribute section become absolute values The diagram below shows the relationship of labels explained above Converting Relocatable Values The In308 editor converts the relocatable values in the relocatable module file into absolute values in the following manner Addresses determined after relocating sections are made the absolute address In the following cases In308 outputs a warning If the determined actual address lies outside the range of branch instructions and addressing modes determined by as308 26 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Library File Referencing Function If all of the following conditions are met In308 links relocatable modules en tered in a library file Condition 1
173. ressing mode for bit symbol Function The 8 bit SB relative displacement addressing mode is selected by speci fying a bit symbol of undefined value for the operand of this command Description format SBBIT name SBBIT name name Rules for writing command Always be sure to enter a space or tab between the directive command and operand A bit symbol defined by BTEQU or BTGLB can be written in the oper and A forward referenced bit symbol can be written in the operand Before writing this directive command be sure to set the SB register value by directive command SB When specifying multiple names separate them with a comma Description example BTGLB extbit SB 80H LDC 80H SB SBBIT bsym extbit BCLR bsym Select 8 bits SB BAND bsym Select 8 bits SB BSET extbit Select 8 bits SB 279 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands SBSYM Selects SB relative displacement addressing mode Function The assembler selects the SB relative addressing mode for the name specified in the operand of this directive command The assembler selects the SB relative addressing mode for the expres sion in absolute 16 bit addressing mode that includes the name speci fied in the operand of this directive command The SB relative addressing mode can be selected for the operand that contains a relocatable value M The SB relative addressing mode
174. ression with its terms containing a numeric value and a name can be entered Character string Characters or a character string can be handled as ASCII code Rules for Writing Operands Position to write an operand Always be sure to insert a space or tab between the operand and the instruc tion that has the operand The following describes rules on each type of operand you need to follow when writing an operand 206 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Numeric value A numeric value includes an integral and a floating point number Integer An integer can be written in decimal hexadecimal binary or octal notation The table below shows how to write each type of integer Binary Write a number using numerals O to 1 and add B or b at the end of the number Example 10010001B 10010001b Octal Wtite a number using numerals 0 to 7 and add O or o at the end of the number Example 607020 607020 Decimal Write a number using numerals 0 to 9 Example 9423 Hexadecima Write a number using numerals 0 to 9 and alphabets A to F and add H or h at the end of the number However if the number begins with an alphabet be sure to add a zero 0 at the beginning of the number Example OA5FH 5FH Oa5fh 5fh 207 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Floating point number The following range of values can be enter
175. ritten in sections that are specified to be relative attribute This directive command can be written for multiple instances within an absolute attribute section Description example SECTION value ROMDATA ORG OFFQOOH BYTE abcdefghijklmnopqrstuvwxyz ORG OFF80H BYTE ABCDEFGHIJKLMNOPORSTUVWXYZ E The following statement results in an error SECTION value ROMDATA BYTE abcdefghijklmnopqrstuvwxyz ORG OFF80H BYTE ABCDEFGHIJKLMNOPORSTUVWXYZ 276 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands PAGE Breaks pages at specified position of list file Function This command causes pages in the assembler list file to break The character string written in the operand is output to the header sec tion in the new page of the assembler list file M The maximum number of characters that can be output to the header is value subtracted 65 from the number of col umns in the list file Use directive command FORM to set the number of columns in the list file Description format PAGE character string PAGE character string Rules for writing command Always be sure to insert space or tab between the directive command and the operand Enclose the operand with single quotations or double quotations as you write it The operand can be omitted Description example PAGE PAGE strings PAGE strings 277 ENESAS Renesas Technology Corp
176. rogram reads in a relocatable module file and generates a library file and manages it Load module converter Imc308 This program converts the absolute module file generated by the linkage edi tor into a machine language file that can be programmed into ROM Cross referencer xrf308 This program generates a cross reference file that contains definitions of vari ous symbols and labels in the assembly source files created by the user Absolute lister abs308 This program generates an absolute list file that can be output to a printer This file is generated based on the address information in the absolute module file 14 ENESAS Renesas Technology Corp AS308 V 1 00 Outline of Function Functions Relocatable programming function This function allows you to write a program separately in multiple files A sepa rately written program can be assembled file by file By allocating absolute addresses to a single file you can debug that part of program independently of all other parts You can also combine multiple source program files into a single debug file Optimized code generation function AS308 has a function to select the addressing mode and branch instruction that are most efficient in generating code for the source program Macro function AS308 has a macro function to improve a program s readability Source level debug information output in high level lan guage AS308 outputs source level debuggable high
177. rules described below when specifying the command parameters of xrf308 Order in which to specify command parameters The command parameters of xrf308 can be specified in any order gt xrf308 file name command option gt xrf308 command option file name ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating xrf308 Assembly source file name or assembler list file name Always be sure to specify at least one file name A path can be specified in the file name Up to 600 files can be specified Always be sure to enter the file extension Always be sure to specify assembler list file whose extension is Ist When specifying multiple files insert a space or tab to separate be tween file names Command options Multiple command options can be specified Command File The xrf308 referencer allows you to specify a command file name that contains input parameters Refer to the Method for Operating In308 for details on how to specify a command file 171 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating xrf308 Disables Message Output to Screen Function The software does not output messages when xrf308 is processing Error messages are output to screen Description rule This option can be specified at any position on the command line Description example xrf308 sample a30 172 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operat
178. s is written Directive commands to set data can be written here All commands except directive commands to allocate a memory area can be written here Specify that ROMDATA type sections be located in a ROM area in the absolute module Example SECTION const ROMDATA 20 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Section Attributes Attribute is assigned to a section in which units addresses are controlled by AS308 when assembling the source program Relative Addresses in the section become relocatable values when assembled The values of labels defined in a relative attribute section are relocat able Absolute Addresses in the section become absolute values when assembled The values of labels defined in an absolute attribute section are abso lute If you want to assign a section an absolute attribute specify its address with directive command ORG in a line following the line where direc tive command SECTION is written Example SECTION program CODE ORG 1000H Alignment of sections Relative attribute sections can be adjusted for alignment so that their start addresses always fall on even addresses as addresses are determined when linked If you want sections to be aligned this way specify ALIGN in the operand of directive command SECTION Example SECTION program CODE ALIGN Rules on Section Management This section describes how AS308 converts the sou
179. s written MREPEAT is missing for ENDR MREPEAT for ENDR is not found Check the position where ENDR is written VER is duplicated VER is specified more than once in the file VER can be written only once in a file Delete extra VER s ALIGN is multiple specified in SECTION 2 Two or more ALIGN s are specified in the SECTION definition line Delete extra ALIGN specifications BREAK is missing for FOR DO or SWITCH 2 BREAK is used in an inappropriate location Make sure the BREAK command is written within the FOR DO or SWITCH statement CASE has already defined as same value The same value is written in the operands of multiple CASE statements Make sure the values written in the operands of CASE are unique and not the same 94 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 CONTINUE is missing for FOR or DO CONTINUE is used in an inappropriate location Make sure the CONTINUE command is written within the FOR or DO statement DEFAULT has already defined There are multiple instances of DEFAULT in SWITCH Remove unnecessary DEFAULT statements JMP S operand label is not in the same section Jump address for JMP S is not specified in the same section JMP S can only branch to a jump address within the same section Re write the mnemonic is missing
180. s308 sample L Option S only is valid as308 sample S Option S only are valid as308 sample L S L Options L only are valid as308 sample S L S Method for specifying numeric value Always be sure to use hexadecimal notation when entering a numeric value If a numeric value begins with an alphabet always be sure to add 0 to the numeric value when you enter it Example 55 5A OAS 73 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 Include File Search Directory Include files do not need to be specified from the command line If a path is described in the operand of the directive command INCLUDE the software searches that directory to find the include file If the directive command operand does not have a path specification the soft ware searches the current directory In this case if the specified file cannot be found in the current directory and environment variable INC308 is set the software also searches the directory that is set in INC308 as308 Command Options The following pages describe rules you need to follow when specifying com mand options 74 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 Disables Message Output to Screen Function The software does not output messages when as308 is processing This command option disables unnecessary messages such as copy right notes from being output to the screen w
181. samplel sample2 LD work lib L libl The work lib lio1 and work tmp lib2 files are referenced gt 1n308 samplel sample2 LD work lib L libl LD work tmp L lib2 The work lib lib1 file is referenced gt 1n308 samplel LD work L lib libl 119 ENESAS Renesas Technology Corp AS308 V 1 00 LOC Method for Operating In308 Specify the assignment of section Function Specifies the address in which the specified section is written Value of symbols in specified section are generated from the address specified by directive command ORG or specified by command op tion ORDER Use this option if you write the section on address other than executing it Description rule A space is required between the option name and parameter No space is allowed before and after the The address cannot be omitted When writing multiple section names and location addresses separate each entry with a comma Description example This example describes writing PROG1 section executed from 400h address on OFE000h address of ROM gt 1n308 ORDER PROG1 00400 LOC PROG1 0FE000 PROG1 section is executed after moved it address 00400h FE000h 120 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 M Generates Map File Function The software generates a map file that contains address mapping infor mation The file name of the map file is created by cha
182. sing a form like D library name relocatable module name Always be sure to insert a space between this option and the library file name and between the library file name and the relocatable module name Multiple relocatable modules you want to be deleted can be specified In this case always be sure to insert a space between each module name Description example 105308 D new sample2 A relocatable module sample2 is deleted from the new lib library file 158 ENESAS Renesas Technology Corp AS308 V 1 00 L Method for Operating Ib308 Generates Library List File Function The software generates a library list file that contains information on a specified library file The extension of generated library list file is Ils A library list file can also be generated that contains information on only the necessary modules in the library file If a library list file of the same name already exists this existing file is overwritten by a new library list file Description rule Input this option using a form like L library file name relocatable module name Always be sure to insert a space between this option and the library file name and between the library file name and the relocatable module file name Multiple relocatable module names can be specified In this case al ways be sure to insert a space between each module name Description example 105308 L new Information on all modules e
183. sively long Check the syntax for this option and rewrite it correctly xxx option multiple specified 2 The option xxx is specified twice or more Check the syntax for this option and rewrite it correctly Address specified by e option exceed OFFFFH The address specified with e option exceeds OFFFFFh Rewrite the address value correctly Can t close file filename 2 The file filename cannot be closed Check the directory information Can t create file filename The file filename cannot be created Check the directory information Can t open file filename The file filename cannot be opened Check the file name Command line is too long 2 The character string on the command line is excessively long Re input the command correctly 149 ENESAS Renesas Technology Corp AS308 V 1 00 Error Messages of Imc308 Illegal file format filename is used 2 The file format of filename is incorrect Check the file name Regenerate the file Invalid option option is used 2 An invalid option option is specified Specify the option correctly again MCU information mismatch in file xx x30 2 The file information does not match the MCU information Specify an absolute module file generated by as308 or In308 Not enough memory 2 Memory is insufficient Increase the memory capacity Option option is not appropriate The option is used incorrectly
184. so on every 2 bytes beginning with address OFFFEOOH For details about the special page vector table refer to the M16C 80 Series Software Manual This manual only shows how to set and reference the special page vector table 37 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Setting Special Page Vector Table The special page vector table is used to store the 16 low order bits of an ad dress in the special page Rules for writing command Always be sure to define a section Use the directive command ORG to define the absolute address M The address you set here must be an even numbered ad dress Use the directive command WORD to store the 16 low order bits of an address in the special page in ROM Description example SECTION sp_vect ROMDATA ORG OFFFEOOH subl WORD label_0 OFFFFH Special page number 255 sub2 WORD label_1 amp OFFFFH Special page number 254 sub3 WORD label_2 OFFFFH Special page number 253 i ORG OFFFFDAH sub238 WORD label_237 OFFFFH AAA H F i Pereo 00 _ subi 00 ereo o gt je m FFFE04 i OE E H F F rra r r A E a a a a 38 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions Referencing Special Page Vector Table There are two methods to reference the special page vector table as described below Specify your desired special page number Specify the
185. st always be specified when executing the librarian If none of these options is specified on the command line or two or more of them are specified simultaneously Ib308 outputs an error Command File The librarian allows you to specify a command file name that contains description of input parameters Refer to the Method for Operating In308 for details on how to specify a command file 154 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Ib308 Disables Message Output to Screen Function The software does not output messages when Ib308 is processing Error messages are output to screen Description rule This option alone can be specified in combination with some other op tions This option and other options can be specified in any order Description example 106308 A new sample2 155 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating Ib308 A Adds Modules to Library File Function The software adds a relocatable module to an existing library file If the specified library file is nonexistent lb308 creates a new library file If a relocatable module bearing the same name as one you are going to add is already entered in the library file Ib308 outputs an error If the relocatable module file you are going to add contains a definition of the same global symbol name as in the module that is already en tered in the library file Ib308 outputs an
186. st instruction possible to branch is selected from jump distances A W B and S Mi Size S is selected only when the branch instruction and the jump address label are present in the same section Subroutine call instruction The shortest instruction possible to branch is selected from jump distances A and W Conditional branch instruction Jump distance B or alternative instruction is generated M The source line information in a list file is output directly as written in the source lines Code of alternative instruction is output to the code information section M Optimum selection is not performed for the ADJNZ instruc tion When instruction format specifier is omitted normally omit ted The instruction format specifier normally is omitted The as308 assembler performs optimum selection for mnemonics where in struction format specifiers are omitted If instruction format specifiers are omitted as308 first determines the address ing mode before it selects the instruction format 32 ENESAS Renesas Technology Corp AS308 V 1 00 AS308 Functions When addressing mode specifier is omitted If addressing mode specifiers are omitted as308 selects the most suitable code in the following manner In cases of addressing with displacement if the displacement value is determined when assembled the most suitable addressing mode is selected If directive command SB or FB is defined
187. string 212 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Directive Commands AS308 allows you to write directive commands in addition to the M16C 80 series mnemonics in the source programs that can be assembled by AS308 There are following types of directive commands available Address control directive commands These commands allow you to specify address determination when assembling the source program Assemble control directive commands These commands allow you to specify how operation is executed by as308 Link control directive commands These commands allow you to define information necessary to control address relocation List control directive commands These commands allow you to control the format of list files generated by as308 Branch optimization control directive commands These commands allow you to specify that as308 selects the most suitable branch instruction Conditional assemble control directive commands These commands allow you to select blocks for which code is generated ac cording to conditions set when assembling the source program Extended function directive commands These commands allow you to control the operations that are not listed above Directive commands output by M16C 80 series tool software These directive commands and operands all are output by the M16C 80 series tool software The directive commands output by the M16C 80 series tool software cannot be writ
188. t 0 byte Debug Mode I b E byte Mass Production Mode E b E 242 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands END Declares end of assemble source Function This command declares the end of the source program The assembler only outputs the contents written in the subsequent lines after this directive command to a list file and does not perform code generation and other processing Description format END Rules for writing command There must always be at least one of this directive command in one assembly source file M The as308 assembler does not detect errors in the subse quent lines after this directive command either Description example END 243 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands ENDIF Indicates the end of a conditional assemble block Function This command indicates the end of the conditional assemble block Description format IF conditional expression body ENDIF Rules for writing command Always make sure that there is at least one instance of this directive command in a conditional assemble block This directive command does not have an operand Description example IF TYPE 0 byte Proto Type Mode ELIF TYPE gt 0 byte Debug Mode E b E byte Mass Production Mode E b E 244 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands ENDM
189. t be written to the filename file Check the permission of the file CASE not inside SWITCH 2 CASE is written outside a SWITCH statement Make sure the CASE statement is written within a SWITCH statement Characters exist in expression Extra characters are written in an instruction or expression Check the rules to be followed when writing an expression 96 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 Command line is too long 2 The command line has too many characters Re input the command DEFAULT not inside SWITCH 2 DEFAULT is written outside a SWITCH statement Make sure the DEFAULT statement is written within a SWITCH state ment Division by zero A divide by 0 operation is attempted Rewrite the expression correctly ELSE not associates with IF 2 No corresponding IF is found for ELSE Check the source description ELIF not associates with IF 2 No corresponding IF is found for ELIF Check the source description ENDIF not associates with IF No corresponding IF is found for ENDIF Check the source description ENDS not associates with SWITCH 2 No corresponding SWITCH is found for ENDS Check the source description Error occurred in executing xxx An error occurred when executing xxx Rerun Xxx 97 ENESAS Renesas Technology Corp AS308 V 1 00 Error message of as308 Format specifier is
190. ten in a source program by the user 213 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands List of Directive Commands The table below lists the directive commands available with AS308 The following pages explains rules for writing directive commands for each type of directive command Address control ORG Declares address BLKB Allocates RAM area in units of 1 bytes BLKW Allocates RAM area in units of 2 bytes BLKA Allocates RAM area in units of 3 bytes BLKL Allocates RAM area in units of 4 bytes BLKF Allocates RAM area in units of 4 bytes BLKD Allocates RAM area in units of 8 bytes BYTE Stores data in ROM in 1 byte length WORD Stores data in ROM in 2 byte length ADDR Stores data in ROM in 3 byte length LWORD Stores data in ROM in 4 byte length FLOAT Stores data in ROM in 4 byte length DOUBLE Stores data in ROM in 8 byte length ALIGN Corrects odd addresses to even addresses Assemble control EQU Defines symbol BTEQU Defines bit symbol END Declares end of assemble source SB Assigns temporary SB register value SBSYM Selects SB relative displacement addressing mode SBBIT Selects SB relative displacement addressing mode for bit sym bol FB Assigns temporary FB register value FBSYM Selects FB relative displa
191. the address in which this com mand is written is an even address Description format ALIGN Rule for writing command This directive command can be written in a section that falls under the conditions below A relative attribute section in which address correction is directed when defining the section SECTION program CODE ALIGN An absolute attribute section SECTION program CODE ORG Oe000H 225 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Description example SECTION program CODE ALIGN MOV W 0 RO ALIGN END SECTION program CODE ORG Of000H MOV W 0 RO ALIGN END Address Code count ROMDATA ALIGN 00000 010000 226 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands ASSERT Output a character string written in the operand Function This command outputs a character string written in the operand to a standard error output device when assembling the source program If a file name is specified the character string written in the operand is output to the file If the file name does not have directory specification the assembler generates the file in the current directory Description format ASSERT character string ASSERT character string gt file name ASSERT character string gt gt file name Rules for writing command Always be sure to insert space or tab betwee
192. the operands of directive commands ASSERT and INCLUDE 217 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Description example ASSERT sample gt FILE If the assembly source file name is sample a30 a message is output to the sample file INCLUDE FILEG inc If the assembly source file name is sample a30 the sample inc file is in cluded INCLUDE sample gt FILE mes If the above line is written in incl inc that is included with the sample a30 file a character string normally is output to incl mes If command option F is specified a character string is output to the sample mes file 218 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands MACPARA Indicates number of actual parameter of macro call Function This command indicates the number of macro call actual parameters This command can be written in the body of a macro definition defined by MACRO M if this command is written outside the macro body defined by MACRO its value is made 0 Description format MACPARA Rules for writing command This directive command can be written as a term of an expression 219 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Description example The assembler checks the number of macro actual parameters as it executes conditional assemble GLB mem name MACRO f1 f2 IF MACPARA 2 A
193. tion is output only when you specify command option MS MSL 8 Local bit symbol information This information includes module names relocatable module file names local bit symbol names bit positions and memory addresses This information is output only when you specify command option MS MSL 60 ENESAS Renesas Technology Corp AS308 V 1 00 Input Output Files of AS308 File name of map file The file name of the map file is created by changing the extension x30 of the absolute module file into map sample x30 gt sample map Directory for map file generated The map file is generated in the directory where the absolute module file re sides Link Error Tag File Only when you specify command option T In308 outputs link error informa tion to a file In this case locations in error are output with the assembly source lines Format of link error tag file This file is output in the same format as an assembler error tag file An editor s tag jump function can be used The link error tag file is output in order of the assembly source file name error line number and error message as shown below smp inc 2 Warning 1n308 smp2 r30 Absolute section is written after the absolute section ppp smp inc 2 Error 1n308 smp2 r30 Address is overlapped in CODE section ppp File name of link error tag file The file name of the link error tag file is created by changing the extension x30 of
194. tive Commands VER Transfers specified information to map file Function This command outputs the specified character string to a relocatable module file so it will be output to a map file when it is generated by In308 All of the specified character strings are output to a map file The user specified information can be output to a map file for each relo catable module file Description format VER character string VER character string Rules for writing command Always be sure to insert space or tab between the directive command and the operand Write the character string in the operand that you want to be output to a map file after enclosing it with single quotations or double quotations Make sure that the operand is written within the range of one line This command can be written only once in one assembly source file This command can be written in any desired line providing that it is en tered before directive command END Description example VER strings VER strings 288 ENESAS Renesas Technology Corp AS308 V 1 00 WORD Directive Commands Stores data in ROM in 2 byte length Function This command stores 2 byte long fixed data in ROM Label can be defined at the address where data is stored Description format WORD numeric value name WORD numeric value Rules for writing command Write an integral value in the operand A
195. ule is not registered in library can t output list file 2 The module module is not registered in the library Information on this module was not output to a list file Check the module name module was created in the current directory 2 The module module was created in the current directory Check the directory name you have specified Can t replace module is older than module in library The module module is older than the module in the library Therefore the library module was not replaced with it Check the created date of the relocatable file 169 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating xrf308 Method for Operating xrf308 This section explains the method for operating xrf308 to utilize its functions The basic function of xrf308 is to generate from the assembly source file or assembler list file a cross reference file that contains a list for referencing branch instructions and subroutine call instructions Command Parameters The table below lists the command parameters available for xrf308 Parameter name Function File name Source or assembler list file name to be processed by xrf308 Disables message output to screen N Specifies that system label information be output O Specifies directory in which to output a file V Indicates version of cross referencer Specifies command file Rules for Specifying Command Parameters Follow the
196. urce lines to an absolute module file The absolute module files generated without specifying this option can not be debugged at the source line level M if the absolute module file is derived by linking the relocat able module files that were generated by specifying option N to disable line information output when executing as308 it cannot be debugged at the source line level even when you have specified this option G when executing In308 Source debug information is output to an absolute module file Description rule This option can be specified at any position on the command line Description example 1n308 G samplel sample2 117 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating In308 L Specifies Library File Name Function Specify the library file name to be referenced when linking files The In308 editor reads global symbol information from the specified li brary file as it links the necessary relocatable modules Description rule d Input this option using a form like L library file name Always be sure to insert a space between this option and the file name This option can be specified at any position on the command line A path can be specified in the file name Multiple library files can be specified When specifying multiple library files separate each file name with the comma as you specify file names There must be no space or tab before or after
197. y is insufficient Check the disk information Not enough memory 2 Memory capacity is insufficient Increase the memory capacity Section information is not appropriate in filename 2 The section information in filename is incorrect Check the file name 187 ENESAS Renesas Technology Corp AS308 V 1 00 Warning Message of abs308 Warning Messages of abs308 Address area exceed OFFFFFH The address range exceeds OFFFFFh Check the absolute module file name Fil l filename is missing corresponding to module in a filename The file I filename corresponding to the module in a filename cannot be found The absolute list file for this module was not created Regenerate the assembler list file Check the directory where the as sembler list file resides Lines num num are relocatable address in filename 2 The lines num num in filename not converted to absolute addresses Check to see if the directive command LIST OFF is written in the assembly source file No information of l filename in a filename 2 The file a filename does not contain information on I filename Check the file name Overwrite in filename The file filename will be overwritten The contents of the old file are not saved anywhere 188 ENESAS Renesas Technology Corp AS308 V 1 00 Rules for Writing Program Rules for Writing Program This section describes the basic rules you need
198. ying this option can be symbolic debugged even for local symbols M The map file map output by In308 provides information on symbolic debuggable symbols and labels so you can con firm Description rule If you want system label information and local label information to be output simultaneously be sure to input this option as SM This option can be specified at any position on the command line This option can be set in environment variable AS308COM Refer to Example for using AS308COM for details on how to set Description example Local symbol information in sample a30 is output to sample r30 gt as308 S sample Local symbol information and system label information in sample a30 is output to sample r30 gt as308 SM sample 89 ENESAS Renesas Technology Corp AS308 V 1 00 Method for Operating as308 T Generates Assembler Error Tag File Function The software generates an assembler error tag file when an assembler error is found The file is output in a format where you can use an editor s tag jump function Even when you have specified this option no file will be generated if there is no error The software does not generate a relocatable module file if an error is encountered However it does generate a relocatable module file in cases when only a warning has occurred The error tag file name is created from the assembly source file name by changing its extension to atg
199. ys be sure to insert space or tab between the directive command and the operand A symbol can be written in the operand An expression can be written in the operand When writing multiple operands separate them with a comma A character or a string of characters can be written in the operand after enclosing it with single quotations or double quotations In this case data is stored in ASCII code representing the characters The length of a character string you can write in the operand is less than three characters When defining a label be sure to write the label name before the direc tive command Always be sure to insert a colon after the label name 223 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands Description example SECTION value ROMDATA ADDR 1 ADDR dat a ADDR symbol ADDR symbol 1 ADDR 1 2 3 4 5 END ADDR dat 224 ENESAS Renesas Technology Corp AS308 V 1 00 Directive Commands ALIGN Corrects odd addresses to even addresses Function This command corrects the address to an even address at which code in the line immediately following description of the command is stored If the section type is CODE or ROMDATA the NOP code 04H is writ ten into an address that has been emptied as a result of address correc tion If the section type is DATA the address value is incremented by 1 Address correction is not performed if

Download Pdf Manuals

image

Related Search

Related Contents

Guía de calidad de color  Owners Manual • Bedienungsanleitung Manuel de  S.I.C. 仮面ライダーオーズ エフェクトセット 取扱説明書 629.3 KB  Endurance T6iHRC Treadmill  Origin Storage KB-4XJCD notebook spare part  PDFファイル  Enrobeuse 1320EH (fr)  CUDA C Programming Guide  SICODELIA & PACK EX  

Copyright © All rights reserved.
Failed to retrieve file