Home

RA78K0R Ver. 1.00 Assembler Package Operation UM

image

Contents

1. Classification Option Explanation Device type specification C Specifies the device type of the target device Object module file output 0 Specifies the output of an object module file specification nO Forced object module file output j Forces output of an object module file specification 7 NJ Debug data output specification g Outputs debugging data local symbol data to an object module file ng ga Outputs assembler source debugging data to an object module file nga Include file read path specification i Reads from the path specified in an include file Assemble list file output p Specifies output of an assemble list file specification Np Assemble list file data specification ka Outputs an assemble list into an assemble list file nka ks Outputs a symbol list into an assemble list file nks kx Outputs a cross reference list into an assemble list file nkx Assemble list file format Iw Changes the number of characters that can be specification printed in 1 line in an assemble list file Il Changes the number of lines that can be printed in 1 page in an assemble list file Ih Outputs the character string specified in the header of an assemble list file It Changes the number of spaces in a tab If Inserts a line feed code at the end of an assemble list file nif Error list file output specification Outputs an error list file ne
2. Classification Option Explanation Load module file output 0O Specifies the output of a load module file specification no Forced load module file output j Forces output of a load module file specification nj Debug data output specification g Outputs debugging data to a load module file ng Generation of stack decision S Automatically generates public symbols for stack symbols specification t decision Directive file specification d Inputs the specified file as a directive file Link list file output specification p Specifies output of a link list file np Link list file data specification km Outputs a map list into a link list file nkm kd Outputs a link directive file into a link list file nkd kp Outputs a public symbol list into a link list file nkp kl Outputs a local symbol list into a link list file nkl Link list format specification Il Changes the number of lines that can be printed in 1 page in a link list file If Inserts a page feed code at the end of a list file nlf Error list file output specification Outputs an error list file ne Library file specification b Inputs the specified file as a library file Library file read path specification i Reads a library file from a specified path Parameter file specification f Inputs file names and options from a specified file User s Manual U17836EJ1VOUM CHAPTER 5
3. ToU E Error Message E5105 Message Module not found module file name Cause Specified module does not exist in library file E5106 Message Module already exists module file name Cause A module of the same name already exists in the updated library file or another input file E5107 Message Master library file is not specify Cause Updated library file is not specified in a previous operation but the library file name is replaced with E5108 Message Multiple transaction file file file name Cause Input object module files overlap E5109 Message Public symbol already exists symbol symbol name Cause An externally defined symbol name already exists in an updated library file or other input file E5110 Message File specification conflicted file file name Cause Specified input file name is same as output file name E5111 Message Illegal file format file file name Cause Format of an updated library file or other input file is incorrect E5112 Message Library file not found file file name Cause Specified library file is not found E5113 Message Object module file not found file file name Cause Specified object module file is not found E5114 Message No free space for temporary file Cause Sufficient space does not exist in the disk to create a temporary file E5115 Message Not enough memory Cause Sufficient memory is not available to operate the program E5116 Me
4. 78KOR Series Linker Vx xx Date XX XXX XXXX Page 1 Command kOrmain rel kOrsub rel s pkO0r map km 1120 Para file Out file kOrmain lmf Map file kOr map Direc file Directive Link information 4 output segment s 5FH byte s real data 41 symbol s defined 78KOR Series Linker Vx xx Date XX XXX XXXX Page 2 Memory map SPACE REGULAR MEMORY RO BASE ADDRESS 00000H SIZE 40000H OUTPUT INPUT INPU BASE SIZE SEGMENT SEGMENT MODULE ADDRESS CODE 00000H 00002H CSEG AT CODE SAMPM 00000H 00002H gap 00002H 000BEH CSEGOBO 000COH O0004H CSEG OPT BYTE CSEG 000C4H 00059H CSEG CSEG SAMPM 000C4H 00017H 78KOR Series Linker Vx xx Date XX XXX XXXX Page 3 CSEG SAMPS 000DBH 00042H gap 0011DH 3FEE3H MEMORY RA BASE ADDRESS FCF00H SIZE 03100H OUTPUT INPUT INPU BASE SIZE SEGMENT SEGMENT MODULE ADDRESS gap FCFOOH 02F20H DATA FFE20H 00003H DSEG AT DATA SAMPM FFE20H 00003H gap FFE23H 000DDH gap Not Free Area FFFOO0H 00100H Target chip uPD78xxx Device file VX XX User s Manual U17836EJ1V0UM 143 CHAPTER 5 LINKER 2 If nIf Syntax 1f nlf Default assumption nlf Function The lf option inserts a form feed FF code at the end of a link list file The nlf option makes the the lf option unavailable Application f you wish to add a page break after the contents of a link list file are printed spec
5. DEFAULT ASSIGNMENT oO p n km kd nkp nkl 110 nlf ns g nj w1 directive file usag EMORY memory area nam origin value size memory space name ERGE segment name location type definition merge type definition memory area name memory space name example MEMORY ROM OH 4000H MEMORY RAMA OFEFOOH 100H MERGE CSEG1 RO MERGE DSEG1 AT OFFOOOH User s Manual U17836EJ1VOUM 163 CHAPTER 5 LINKER 5 7 Option Settings in PM This section describes the method for setting linker options from PM 5 7 1 Option setting method The Linker Options dialog box is opened if Linker Options is selected from the Tools menu of PM or if the LK button on the toolbar is clicked Linker options can be set by inputting the required options in this dialog box Figure 5 1 Linker Options Dialog Box Linker Options Dutputl Qutput2 Library Others Load Module File o Output File Name Er Muri Browse MV Output Symbol Information a Create Error List File e On Chip Debug Option Bytes go Security ID ai v Allow 64Kbytes Boundary ccza Command Line Options oa Imf pa map DK Cancel Help OK 164 User s Manual U17836EJ1VOUM CHAPTER 5 LINKER 5 7 2 Explanation of dialog box The various tabs in the Linker Options dialog box are described below 1 Output tab Figure
6. 22 22 gt CSEG 23 23 00000 START 24 24 25 25 chip initialize 26 26 00000 RCBF80000 MOVW SP _ STBEG 2s 4 2 28 28 00004 CD201A MOV HDTSA 1AH 29 29 00007 3620FE MOVW HL LOWW HDTSA set hex 2 code data in HL regigtor 30 30 3l 32 0000A RFD0000 CALL CONVAH convert ASCII HEX 32 32 output BC register ASCII code 33 33 0000D 3421FE MOVW DE LOWW STASC Set DE store ASCII code table 34 34 00010 63 MOV A B 35 35 00011 99 MOV DE A 36 36 00012 A5 INCW DE 37 37 00013 62 MOV A C 38 38 00014 99 MOV DE A 39 39 40 40 00015 EFFE BR 41 41 42 42 END lt Absolute assemble list gt 22 225 jess CSEG 23 23 000D2 START 24 24 29 25 chip initialize 26 26 000D2 RCBF820FE MOVW SP _ STBEG 27 27 28 28 000D6 CD201A MOV HDTSA 1AH 29 29 000D9 3620FE MOVW HL LOWW HDTSA set hex 2 code data in HL regigtor 30 30 3 3l 000DC RFDE900 CALL CONVAH convert ASCII HEX 32 32 output BC register ASCII code 33 33 000DF 3421FE MOVW DE LOWW STASC Set DE store ASCII code table 34 34 000E 2 63 MOV A B 35 35 000E 3 99 MOV DE A 36 36 000E4 A5 INCW DE 37 37 000E5 62 MOV A C 38 38 000E6 99 MOV DE A 39 39 40 40 000E7 EFFE BR 41 41 42 42 END User s Manual U17836EJ1V0UM 253 Example 2 CHAPTER 8 LIST CONVERTER The object codes are embedded as shown below Assemble lis
7. TUR Error Message F4902 Message Can t read file file name Cause File cannot be correctly read F4903 Message Can t access file file name Cause File cannot be correctly read or written to F4904 Message Can t write file file name Cause Data cannot be correctly written to an output file F4905 Message Can t open overlay file file name Cause The overlay file cannot be opened Action by User Check if the overlay file is in the same folder as the execution format C4999 Message Object Converter internal error Cause This is an internal error Action by User Contact NEC Electronics or an NEC Electronics distributor 324 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES 11 5 Librarian Error Messages Table 11 4 Librarian Error Messages E Error Message F5001 Message Missing input file Cause Only options are specified No input files are specified F5002 Message Too many input files Cause Total number of input files exceeds the limit F5003 Message Unrecognized string Cause iL other than an option is specified on a conversational format command ine F5004 Message Illegal file name file name Cause File name includes character s not permitted by the operating system or exceeds the limit for number of characters F5005 Message Illegal file specification file name Cause An ille
8. Button OK Creates a folder and closes the message box Cancel Closes the message box Message Not make folder Cause The specified folder could not be created 344 Action by User Specify another folder Button OK Closes the message box User s Manual U17836EJ1VOUM APPENDIX A SAMPLE PROGRAMS This chapter is an introduction to the sample lists attached to the RA78KOR A 1 kOrmain asm NAME SAMPM ck ck ck ck ck Ck ck ck 0k ck kk ck Ck Ck ck Ck ck ck ck ck ck ck ck Ck ck ck o ckock kk ck ko ck ck Mk Sk ko Sk kv Mk ko ko ko ko HEX ASCII Conversion Program A main routine Ck Ck ck ck ck ck Ck Ck ck Ck Sk ck Ck Sk ck KKK KKK ck ck kk ck kk kk ck kk ko kk Sk kc k ko kc KKK KKK PUBLIC MAIN START EXTRN CONVAH EXTRN _ STBEG DATA DSEG AT OFFE20H HDTSA DS dl STASC DS 2 CODE CSEG A OH MAIN DW START CSEG START chip initialize MOVW SP _ STBEG MOV HDTSA 1AH MOVW HL LOWW HDTSA set hex 2 code data in HL registor CALL CONVAH convert ASCII HEX output BC register ASCII code OVW DE LOWW STASC Set DE store ASCII code table OV A B OV DE A INCW DE OV Ap C OV DE A BR END User s Manual U17836EJ1VOUM 345 APPENDIX A SAMPLE PROGRAMS A 2 kOrsub asm NAME SAMPS ck ck ck ck ck Ck Ck KKK kk ck Ck ck ck ck ck kk ck Ck ck ck
9. Default assumption It8 Function The It option performs tabulation processing by specifying a number of characters for any type of list for which to substitute and output a number of blank spaces for the HT horizontal tabulation code in a source module Application When specifying a small number of characters per line for any type of list using the Iw option specify the It option to insert a tab instead of a series of blank spaces thus saving on the number of characters used Explanation The range of number of characters that can be specified with the It option is shown below 0 number of characters that can be specified 8 An abort error occurs if a numerical value outside this range or something other than a numerical value is specified If t0 is specified tabulation processing will not be performed and a tabulation code will be output If the np option is specified the It option is unavailable Notice A control instruction TAB with the same function as the It option can also be written at the beginning of a source module ASATABAnumber of tabs For information on control instructions refer to RA78KOR Assembler Package Language User s Manual 84 User s Manual U17836EJ1V0UM CHAPTER 4 ASSEMBLER Example of use To reference an assemble list file sample prn when the It option is omitted describe as C ra78kO0r cf1166a0 sample asm lt Con
10. Classification Option Explanation HEX format object module file 0 Specifies the output of a HEX format object module output specification file no Symbol table file output S Specifies output of a symbol table file specification ns Specification of sort by object r Sorts HEX format objects in the order of their address order addresses nr Object complement specification u Outputs a specified complement value as an object code for an address area to which no HEX format qu object is output Error list file output specification Outputs an error list file ne Parameter file specification f Inputs an input file name and options from a specified file HEX format specification ki Intel standard HEX format kie Intel extended HEX format kt Extended Tech format km Motorola S type format standard address kme Motorola S type format 32 bit address Device file search path y Reads a device file from a specified path specification File separate output specification zf Outputs the boot area and other areas to separate for flash memory model HEX format files Help specification zx Displays a help message on the display 196 User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER HEX format object module file output specification 1 o no Syntax o output file name no Default assumption oinput file name HEX Function The o option specifies th
11. ne Makes the the e option unavailable specified last takes precedence User s Manual U17836EJ1VOUM 351 APPENDIX C LIST OF OPTIONS Table C 1 Assembler Options Interpretation Classification Format Function Relation to Other Options When Omitted Parameter ffile Inputs assembler Independent Options and file name options and the input input file names specification file name from a can only be specified file input from the command line Specification tpath Creates a temporary Independent Path specified of path for mame file in a specified by temporary path environmental file creation variable TMP Kanji code zs Kanji described in the If the zs ze and zn ZS 2 byte code comment is options are specified at the specification interpreted as shift same time the one JIS code specified later takes priority ze Kanji described in the comment is interpreted as EUC code zn Characters described in the comment are not interpreted as kanji Device file ypath Reads a device file Independent Note search path name from the specified specification path Symbol dsymbol Defines a symbol Independent None definition name ee specification E symbo name valu e Series common Specifies output of an Independent The object file common object module file supporting the object common to the specified specification 78KOR Series device is outpu
12. Users Manual U17836EJ1VOUM 313 CHAPTER 11 ERROR MESSAGES Error Number Error Message F3101 Message file name invalid input file or made by different hostmachine Cause File other than object module file was input or link was attempted with object module file created on an incompatible host machine E3102 Message Directive syntax error Cause Specification of directive is incorrect F3103 Message file name Illegal processor type Cause Target device of assemble or compile is not a target device of this linker Action by User Check to ensure that the object module file is correct Check to ensure that the target device for the assemble or compile can be handled by the linker Also check that the overlay file is the correct version The linker references part of the overlay file of the assembler to obtain characteristic data on the target device F3104 Message file name Different processor type from first input file first input file name Cause An object module file is input whose target device is different from that of the first input object module file W3105 Message Library file file name has no public symbol Cause Library file has no public symbol Therefore an object module included in the library file cannot be linked F3106 Message Can t create temporary file file name Cause Cannot create temporary file E3107 Message Name
13. User s Manual U17836EJ1VOUM 61 62 CHAPTER 4 ASSEMBLER Classification Option Explanation Parameter file specification f Inputs the input file name and assembler options from a specified file Specification of path for temporary t Creates a temporary file in a specified path file creation Kanji code 2 byte code ZS Kanji described in the comment is interpreted as shift specification JIS code ze Kanji described in the comment is interpreted as EUC code zn Characters described in the comment are not interpreted as kanji Device file search path y Reads a device file from a specified path specification Symbol definition specification d Defines a symbol Series common object specification common Specifies output of an object module file common to the 78KOR Series Self programming specification self Specifies when using self programming 78K0 Series compatible macro compati Enables assembly of assembler source files generated by the 78K0 Series assembler ncompati Help specification Displays a help message on the display User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER 4 4 2 Order of precedence of assembler options The following table indicates which assembler option takes precedence when two assembler options are specified at the same time Table 4 3 Order of Precedence of Assembler Options no np nka nks
14. Classification Option Explanation List file format specification Iw Changes the number of characters that can be printed in 1 line in a list file Il Changes the number of lines that can be printed in 1 page in a list file If Inserts a page feed code at the end of a list file nlf Specification of path for temporary file creation Creates a temporary file in a specified path Help specification Displays a help message on the display User s Manual U17836EJ1VOUM 225 CHAPTER 7 LIBRARIAN List file format specification 1 Iw Syntax l1w number of characters Default assumption lw132 80 characters in the case of display output Function The Iw option changes the number of characters that can be printed in 1 line in a list file Application Specify the lw option to change the number of characters that can be printed in 1 line in a list file Explanation The range of number of characters that can be specified with the lw option is shown below In the case of display output this number is 80 72 number of characters printed on 1 line 260 An abort error occurs if a numerical value outside this range or something other than a numerical value is specified f number of characters is omitted 132 will be specified If the list file is output to the display 80 is specified The specified number of characters does not include the terminator CR
15. m1 m2 m3 lt After deletion gt kOr lib m2 234 Users Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN replace Syntax replaceAlibrary file nameAtransaction Default assumption r Function The replace subcommand replaces module in a library file with the module in other object module files Explanation An abort error occurs if no module in the library file has the same name as the replacement module An abort error occurs if a public symbol contained in the replacement module is the same as a public symbol in the library file The file name of the replacement object module must be the same as the file name used in registration If an error occurs processing is interrupted and the condition of the library file will not be changed Example of use To replace a module m2 in a library file kOr lib describe as replace kOr lib m2 rel Before replacement kOr lib m1 m2 m2 m3 lt After replacement gt kOr lib m1 m3 m2 User s Manual U17836EJ1VOUM 235 CHAPTER 7 LIBRARIAN Because the new module m2 is registered after the module m2 in the library file is deleted m2 is last in order in the library file 236 User s Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN pick Syntax pickAlibrary file nam
16. CODE CSEG AT OH MAIN DW START Remark The number of blanks entered by the HT code is 1 User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER 5 If nlf Syntax 1f nlf Default assumption nlf Function The lf option inserts a form feed FF code at the end of an assemble list file The nlf option makes the the If option unavailable Application If you wish to add a page break after the contents of an assemble list file are printed specify the If option to add a form feed code Explanation If the np option is specified the lf option is unavailable If both the lf and nlf options are specified at the same time the option specified last takes precedence Notice Acontrol instruction FORMFEED NOFORMFEED with the same function as the If nlf option can also be written at the beginning of a source module ASAFORMFEED ASANOFORMFEED For information on control instructions refer to RA78KOR Assembler Package Language User s Manual Example of use To add a form feed code at the end of an assemble list file kOrmain prn describe as C gt ra78kOr cf1166a0 kOrmain asm p lf Users Manual U17836EJ1VOUM 87 CHAPTER 4 ASSEMBLER Error list file output specification 1 e ne Syntax e output file name ne Default assumption ne Function The e option outputs an error list f
17. If the output file name is omitted when the p option is specified the assemble list file name becomes input file name prn If the drive name is omitted when the p option is specified the assemble list file will be output to the current drive If both the p and np options are specified at the same time the option specified last takes precedence Example of use To output an assemble list file sample prn describe as C ra78kO0r cf1166a0 kOrmain asm psample prn Users Manual U17836EJ1VOUM 71 CHAPTER 4 ASSEMBLER Assemble list file data specification 1 ka nka Syntax ka nka Default assumption ka Function The ka option outputs an assemble list into an assemble list file The nka option makes the ka option unavailable Application Specify the ka option to output an assemble list Explanation If both the ka and nka options are specified at the same time the option specified last takes precedence If the nka nks and nkx options are all specified the assemble list file cannot be output If the np option is specified the ka option is unavailable 72 User s Manual U17836EJ1VOUM Example of use CHAPTER 4 ASSEMBLER To output an assembly list file into an assemble list file KOrmain prn describe as C ra78kO0r cf1166a0 kOrmain asm ka lt Contens of kOrmain prn gt ALNO AAA 01 4 CO Or oO i000 10 01 4S WN S
18. Output Path Name Y Browse Iv Output Assemble List ka Output Symbol List ks Output Cross Reference List kx Add Form Feed at End of Print File If Colums per Line lw 132 Lines per Page ll 0 Expand TAB Character lt List Header Strina Ih Command Line Options Cancel Help Create Print File p Select this option to output an assemble list file When specified by common option Output Path Name Specify the path of the assemble list file by using the Browse button or directly inputting a path name When specified by individual option Output File Name Specify the path and file name of the assemble list file by using the Browse button or directly inputting a path and file name Output Assemble List ka Select this option to output an assemble list in the assemble list file Output Symbol List ks Select this option to output a symbol list file following the assemble list in the assemble list file Output Cross Reference List kx Select this option to output a cross reference list following the assemble list in the assemble list file 104 Users Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER Add Form Feed at End of Print File If Select this option to suffix a form feed code FF to the assemble list file Colums per Line lw Specify the number of characters on one line of the assemble list file in a range
19. Action by User Specify a number of paths within the limit range and retry Button OK Closes the message box Message library file read path Too many characters for Library File Search Path Cause The library file read path is described with a number of characters outside the limit input range Action by User Specify the library file read path with a number of characters within the limit range Button OK Closes the message box Message library file read path Multiple Library File Search Path definition Cause Library file read paths are described in duplicate Action by User Delete the duplicate path s and retry Button OK Closes the message box User s Manual U17836EJ1VOUM 339 CHAPTER 11 ERROR MESSAGES 11 7 3 Object Converter OC78KOR Table 11 8 Error Messages Displayed by Object Converter OC78KOR DLL Error Type Error Message x Message Cannot find OC78KOR EXE shown in environmental variable PATH Cause The OC78KOR EXE execution format is not in the specified folder Action by User Re install the RA78KOR assembler package Button OK Closes the message box Message Invalid description format with object complement Cause The object complement value is specified in an illegal format Action by User Specify a format that can be described Button OK Closes the message box Message Invalid
20. aS Show this message User s Manual U17836EJ1VOUM 265 CHAPTER 8 LIST CONVERTER 8 5 Option Settings in PM This section describes the method for setting list converter options from PM 8 5 1 Option setting method The List Converter Options dialog box is opened if List converter Options is selected from the Tools menu of PM or if the LC button on the toolbar is clicked List converter options can be set by inputting the required options in this dialog box Figure 8 2 List Converter Options Dialog Box List Converter Options Output Others Command Line Options 266 User s Manual U17836EJ1VOUM CHAPTER 8 LIST CONVERTER 8 5 2 Explanation of dialog box The various tabs in the List Converter Options dialog box are described below 1 Output tab Figure 8 3 List Converter Options Dialog Box When Output Tab Is Selected List Converter Options Output Others Command Line Options Cancel Help Operate List Converter Select this option to start the list converter Absolute Assemble List Path o Specify the path of the absolute assemble list by using the Browse button or directly inputting a path Create Error List File e Select this option to output an error list file Output Path Specify the path of the error list file by using the Browse button or directly inputting a path Command Line Options This edit box is read only The curren
21. message on the display unavailable 1 2 3 4 Current folder Path registered in the device file installer Path by which OC78KOR was started up The environmental variable PATH Note Device files will be read from the path determined in the following order User s Manual U17836EJ1VOUM 359 APPENDIX C LIST OF OPTIONS C 4 List of Librarian Options Table C 4 List of Librarian Options Classification Format Function Relation to Other Options Interpretation When Omitted List file Changes the number Unavailable if the list lw132 format SRL MEE of characters that can subcommand is not m QuE H H m specification S aracters be printed in 1line in specified a list file Changes the number IIO ll number of lines that can be of lines printed in 1 page in a list file 1f Inserts a form feed If both options lf and nlf FF code at the end nlf are specified at the of a list file same time the option specified last takes nlf Makes the the If precedence option unavailable Specification tpath Creates a temporary Independent Created in the of path for name file in a specified path specified temporary path by the file creation environmental variable TMP Help x Displays a help All other options are No display specification message on the display unavailable Note Device files wi
22. Button OK Closes the message box Message Out of range The range of Start Address for On Chip Debug Option Bytes is from Oh to OFFFFFh Cause The start address specified for on chip debug option byte is out of the specifiable Action by User range Specify the start address within the specifiable range Button OK Closes the message box Message Invalid Start Address for On Chip Debug Option Bytes Missing parameter Cause The start address for on chip debug option byte has not been input Action by User Input the start address for on chip debug option byte Button OK Closes the message box Message Invalid Start Address for On Chip Debug Option Bytes Start Address for On Chip Debug Option Bytes is specified in hexadecimal numbers Cause The specification format of the start address specified for on chip debug option byte is illegal Action by User Specify the start address in the correct format Button OK Closes the message box Message Invalid value The range of Size for On Chip Debug Option Bytes is from 256 to 1024 Cause The size specified for on chip debug option byte is outside the input limit range Action by User Specify a value within the limit range and retry Button OK Closes the message box User s Manual U17836EJ1VOUM 337 CHAPTER 11 ERROR MESSAGES Error Type Error Message Message Invalid
23. Enclose a path that includes a space in a pair of double quotation marks e Object module file to be linked A maximum of 1 024 items can be input in an input module Specify the file name of a path that includes a space by enclosing it in a pair of double quotation marks n Example To add debug data to a load module file kOr Imf describe as C IK78kO0r kOrmain rel kOrsub rel okOr Imf g 120 Users Manual U17836EJ1VOUM CHAPTER 5 LINKER 2 Startup from a parameter file Use the parameter file when the data required to start up the linker will not fit on the command line or when repeating the same linker option for two or more assembly operations To start up the linker from a parameter file specify the parameter file specification option f on the command line Start up the linker from a parameter file as follows X 1k78k0r Aobject module file A fparameter file nam a b c d a Current drive name b Current folder name b c Parameter file specification option d d Afile which includes the data required to start up the linker Remark Create the parameter file using an editor The rules for writing the contents of a parameter file are as follows A option Aoption A A If the object module file name is omitted from the command line specify the object module file name in the parameter file The object module file name can
24. 144 87 363 Ih RA78KOR 81 lib 109 217 LIB78KOR 290 Librarian 27 216 Link Directive 112 Link list file 279 Linker 25 109 list 238 List converter 28 250 Il LB78KOR 227 Il LK78KOR 142 Il RA78KOR 79 mf 109 174 251 Load module file 109 174 251 Local symbol list 283 dst 217 It RA78KOR 84 lw LB78KOR 226 lw RA78KOR 77 M map 109 Map list 280 MEMORY 113 Memory Area 111 Memory directive 115 Memory Space 111 MERGE 113 mi LK78KOR 160 N ncompati RA78KOR ne LC78KOR 262 ne LK78KOR 145 ne OC78KOR 203 ne RA78KOR 88 ng LK78KOR 129 ng RA78KOR 68 nga RA78KOR 69 nj LK78KOR 128 nj RA78KOR 67 nka RA78KOR 72 nkd LK78KOR 136 nkl LK78KOR 140 nkm LK78KOR 134 nkp LK78KOR 138 nks RA78KOR 74 nkx RA78KOR 75 nlf LB78KOR 228 nlf LK78KOR 144 nlf RA78KOR 87 no LK78KOR 127 no OC78KOR 197 no RA78KOR 66 np LK78KOR 133 np RA78KOR 71 nr OC78KOR 199 ns LK78KOR 130 ns OC78KOR 198 nu OC78KOR 200 364 98 o LC78KOR 261 o LK78KOR 127 o OC78KOR 197 o RA78KOR 66 Object converter 26 173 P p 251 p LK78KOR 133 p RA78KOR 71 Par
25. Default assumption nlf Function The If option inserts a form feed FF code at the end of a list file The nlf option makes the If option unavailable Application If you wish to add a page break after the contents of a list file are printed specify the lf option to add a form feed code Explanation If the list subcommand is not specified the If option is ignored If both options lf and nlf are specified at the same time the option specified last takes precedence Example of use To add a page feed code to a list file describe as C 1b78kOr If 228 Users Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN Specification of path for temporary file creation 1 t Syntax tpath name Default assumption Path specified by environmental variable TMP Current path if no path is specified Function The t option creates a temporary file in a specified path Application Use the t option to specify the location for creation of a temporary file Explanation Only apath can be specified as a path name path name cannot be omitted Even if a previously created temporary file exists if the file is not protected it will be overwritten As long as the required memory size is available the temporary file will be expanded in memory If not enough memory is available the contents of the temporary file being created will be written to disk Such temporary files
26. Function Specifies format of a HEX format object module file to be output Application Use these options to specify the format of a HEX format object module file to be output from among Intel standard HEX format Intel extended HEX format Extended Tech format Motorola S type format standard address and Motorola S type format 32 bit address Explanation The address ranges specified by each of these options are as follows Options Output Format Range ki Intel standard HEX format OH to FFFFH up to 64 KB kie Intel extended HEX format OH to FFFFFH up to 1 MB kt Extended Tech format OH to FFFFFFFFH up to 4 GB km Motorola S type format standard address OH to FFFFFFH up to 16 MB kme Motorola S type format 32 bit address OH to FFFFFFFFH up to 4 GB Example of use To specify a HEX format object module file to be output as the Motorola S format standard address describe as C 0c78k0r kOr Imf km 206 User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER Device file search path specification 1 y Syntax ypath name Default assumption Device files will be read from the path determined in the following order i Path registered in the device file installer ii Path by which OC78KOR was started up iii Current folder iv The environmental variable PATH Function The y option reads a device file from the spec
27. The nr option outputs HEX format objects in the order in which they were stored in the load module file Application Specify the nr option if the HEX format objects do not have to be sorted in address order Explanation If both options r and nr are specified at the same time the option specified last takes precedence Ifthe no option is specified the r nr option becomes unavailable Example of use To sort HEX format objects in order of address describe as C gt oc78k0r kOr Imf r User s Manual U17836EJ1VOUM 199 CHAPTER 6 OBJECT CONVERTER Object complement specification 1 u nu Syntax ucomplement value start address size nu Default assumption UOFFH filled with OFFH Function The u option outputs a specified complement value as an object code for an address area to which no HEX format object has been output The nu option makes the u option unavailable Application Address areas to which no HEX format object has been output may become written with unnecessary code When such addresses are accessed by the program for any reason their action may be unpredictable By specifying the u option code can be written in advance to address areas to which no HEX format object has been output Explanation The range of values that can be specified as complement values is as follows OH lt complement values lt OFFH complement value can be
28. iii iv v vi i Record mark Indicates beginning of record ii Code number Fixed to 02 ii OFixed to 0000 iv Record type Fixed to 02 v The paragraph value of the segment The paragraph value of the segment is shown as a 4 digit hexadecimal vi Check sum 2 digits A value is input subtracting in order from 0 which counts down the data from the code number to the higher 8 bit value of the address 178 Users Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER 2 Data record i ii iii iv v vi i Record mark Indicates beginning of record ii Code number 2 digits Number of bytes in the code stored in the record A maximum of 16 bytes can be stored iii Location address offset The start address offset of the code displayed in the record is shown as a 4 digit hexadecimal iv Record type 2 digits Fixed to OOH v Code Max 32 digits The object code is shown one byte at a time with the higher 4 bits and lower 4 bits separated A maximum of 16 bytes can be expressed in the code vi Check sum 2 digits A value is input subtracting in order from 0 which counts down the data from the code number to the code 3 Start address code 1 ii iii iv v vi vii i Record mark Indicates beginning of record ii Fixed to 04 iii Fixed to 0000 iv Fixed to 03 v Fixed to 0000 vi Fixed to 0000 vii Fixed to F9 Users Manual U178
29. outputs a message to the display cancels linking and returns control to the operating system Example A non existent object module file is specified C IK78k0r samp1 rel samp2 rel 78KOR Series Linker Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx RA78KOR error F3006 File not found sampl REL RA78KOR error F3006 File not found samp2 REL Program Aborted In the above example a non existent object module file is specified An error occurs and the linker aborts the link A non existent linker option is specified C gt lk78k0r kOrmain rel kOrsub rel z 122 User s Manual U17836EJ1VOUM CHAPTER 5 LINKER 78KOR Series Linker Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx RA78KOR error F3018 Option is not recognized z Please enter LK78KOR if you want help messages Program Aborted In the above example a non existent linker option is specified An error occurs and the linker aborts the link When an error message is displayed and link is aborted look for the cause in CHAPTER 11 ERROR MESSAGES and take action accordingly Users Manual U17836EJ1VOUM 123 CHAPTER 5 LINKER 5 6 Linker Options 5 6 1 Types of linker options The linker options are detailed instructions for the operation of the linker The types and explanations for linker options are shown below Table 5 3 Linker Options
30. program with a notice that a fatal error has occurred specify the j option to output the load module file Explanation When the j option is specified the load module will be output even if a fatal error occurs If both options j and nj are specified at the same time the option specified last takes precedence If the no option is specified the j option is unavailable Example of use To output a load module file kOrsub Imf even if a fatal error occurs describe as C gt Ik78kOr kOrmain rel kOrsub rel j 128 Users Manual U17836EJ1VOUM CHAPTER 5 LINKER Debug data output specification 1 g ng Syntax g ng Default assumption 9 Function The g option specifies that debugging data local symbol data is to be added to a load module file The ng option makes the g kp and kl option unavailable Application Be sure to use the g option when performing symbolic debugging with a source debugger Explanation When the ng option is specified the public symbol list and local symbol list cannot be output If both options g and ng are specified at the same time the option specified last takes precedence If the no option is specified the g option is unavailable Example of use To add debug data to a load module file kOrsub Imf describe as C IK78kO0r kOrmain rel kOrsub rel g User s Manual U17836EJ1VOUM 129 CHAPTER 5 LINKER Ge
31. 19 20 21 22 23 24 25 26 27 28 29 ST 1 DATA 014 CO 0r OO 000 10 01 4 WN 19 20 21 22 23 24 25 26 27 28 29 Assemble list NO ADRS 00000 00004 00007 2 code data in HL OBJECT MI R0000 RCBF8 CD201A 3620F 0000 P regis COr SOURCE STATEMENT NAME SAMPM kCkckckckckckckckckckck kck ck ck KKK HEX gt ASCII main Ckckckckckckckckckckckckckck ck KKK PUBLIC MAIN START EXTRN CONVAH EXTRN _ STBEG DATA DSEG AT HDTSA DS 1 STASC DS 2 CODE CSEG A MAIN DW START CSEG START chip initia MOVW SP MOV HDTSA MOVW HL User s Manual U17836EJ1VOUM KKK KKK KKK KKK KKK KKK ckck ck kk ck Conversion Program routine CkCkckckckck ck ckckckckckckck ck ckck ck ck ck KKK OFFE20H OH lize _ STB ral Q 1AH LOWW HDTSA set hex 73 CHAPTER 4 ASSEMBLER 2 ks nks Syntax ks nks Default assumption nks Function The ks option outputs an assemble list followed by a symbol list into an assemble list file The nks option makes the ks option unavailable Application Specify the ks option to output a symbol list Explanation If both the ks and nks options are specified at the same time the option specified last takes precedence If the ks and kx options are specified at
32. 232 Users Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN add Syntax addAlibrary file nameAtransaction Default assumption a Function The add subcommand adds a module to a library file Explanation Amodule can be added to a library file even if no modules are currently stored in the library An abort error occurs if a module with the same name as the module to be added already exists in the library file An abort error occurs if the module to be added carries the same public symbol as the public symbol in the library file Example of use To add a module m3 to a library file kOr lib describe as add kOr lib m3 rel Before addition kOr lib m1 m3 m2 lt After addition gt kOr lib m1 m2 m3 User s Manual U17836EJ1VOUM 233 CHAPTER 7 LIBRARIAN delete Syntax deleteAlibrary file nameA Amodule name A A Default assumption d Function The delete subcommand deletes a module from a library file Explanation If the specified module does not exist in the library file an error occurs If an error occurs processing is interrupted and the condition of the library file will not be changed Example of use To delete modules m1 m3 from a library file kOr lib describe as delete kOr lib m1 rel m3 rel Before deletion kOr lib
33. 41 symbol s real data defined 78KOR Series Linker Vx xx SPACE REGULAR MEMORY ROM BASE ADDRESS 00000H SIZE 40000H OUTPUT INPUT INPUT BASE SEGMENT SEGMENT MODULE ADDRESS CODE 00000H CODE SAMPM 00000H gap 00002H CSEGOBO 000COH CSEG 000C4H CSEG SAMPM 000C4H CSEG SAMPS 000DBH gap 0011DH MEMORY LRAM BASE ADDRESS FCFOOH SIZE 03100H OUTPUT INPUT INPUT BASE SEGMENT SEGMENT MODULE ADDRESS gap FCFOOH DATA FFE20H DATA SAMPM FFE20H gap FFE23H gap Not Free Area FFFOOH SIZE 00002 00002H OOOBEH 00004 00059H 00017 00042 3FEE3H SIZE 02F20H 00003H 00003H 000DDH 00100H Date kOrmain rel kOrsub rel s pkOr map km CSI CS CS DS ti i Q Q XX XXX XXXX Page AT OPT BYTE Map list AT User s Manual U17836EJ1VOUM 135 CHAPTER 5 LINKER 2 kd nkd Syntax kd nkd Default assumption kd Function The kd option outputs a link directive file into a link list file The nkd option makes the kd option unavailable Application Specify the kd option to output a link directive file into a link list file Explanation If the nkm nkp and nkl options are all specified a link list file cannot be output fthe nkm option is specified a link directive file cannot b
34. 78KOR Series Librarian Vx xx xx xxx xx Copyright C NEC Electronics Corporation XXXxx XXXxx 2 Execution end message The librarian does not output an execution end message When the user enters the exit subcommand after all processing is complete the librarian returns control to the operating system create kOr lib add kOr lib kOrmain rel kOrsub rel exit If the librarian detects a fatal error which makes it unable to continue librarian processing the librarian outputs a message to the display and returns control to the operating system Example A non existent librarian option is specified C 1b78k0r a 78KOR Series Librarian Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx RA78KOR error F5018 Option is not recognized z Usage LB78KOR options In the above example a non existent librarian option is specified An error occurs and the librarian aborts librarian execution When an error message is displayed and library formation is aborted look for the cause in CHAPTER 11 ERROR MESSAGES and take action accordingly 224 User s Manual U17836EJ1VOUM 7 4 Librarian Options CHAPTER 7 LIBRARIAN 7 4 4 Types of librarian options The librarian options provide detailed directions for the operation of the librarian The types and explanations for librarian options are shown below Table 7 2 Librarian Options
35. 8 8 9 9 0 10 1 LI 2 12 3 13 4 14 5 15s LAZER 6 16 FFE20 7 17 FFE21 8 18 19 ROS see 20 20 00000 R0000 21 21 22 22 vczsv 23 23 00000 24 24 2 5 25 26 26 00000 RCBF80000 27 27 28 28 00004 CD201A 29 29 00007 3620FE hex 2 code data in HL registor SOURCE STATEMENT NAME SAMPM KKK KKK kk ck KKK kk kk ck kk ck kk Sk kk ko kc KKK KKK KKK HEX ASCII Conversion Program main routine KKK ck ck ck ck ck ck kk kk ck kk ck kk kk Sk KKK KKK KKK KKK PUBLIC AIN START RN CONVAH EXTRN _ STBEG DATA DSEG AT OFFE20H HDTSA DS 1 STASC DS 2 CODE CSEG A OH MAIN DW START CSEG START chip initialize MOVW SP _ STBEG MOV HDTSA 1AH MOVW HL LOWW HDTSA User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER 2 II Syntax ll number of lines Default assumption llO No page breaks Function The ll option changes the number of lines that can be printed in 1 page in an assemble list file Application Specify the Il option to change the number of lines that can be printed in 1 page in an assemble list file Explanation The range of number of lines that can be specified with the Il option is shown below 20 lt number of lines printed on 1 page lt 32 767 An abort error occurs if a numerical value outside this range or somethin
36. Cause An I O file name has been specified in duplicate Action by User Specify different I O file names F2009 Message Unable to make file file name Cause The specified file is write protected Action by User Release the write protection on the specified file F2010 Message Directory not found file name Cause A non existent drive and or folder has been included in the output file name Action by User Specify an existent drive and or folder F2011 Message Illegal path option Cause Other than a path name has been specified in the option that specifies the path for the parameter Action by User Specify a correct path name F2012 Message Missing parameter option Cause A necessary parameter has not been specified Action by User Specify the parameter 298 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES E Error Message F2013 Message Parameter not needed option Cause An unnecessary parameter has been specified Action by User Delete the unnecessary parameter F2014 Message Out of range option Cause The specified numerical value is outside the range Action by User Specify a correct numerical value F2015 Message Parameter is too long option Cause The number of characters in the parameter exceeds the limit Action by User Specify a parameter whose character number is within the limit F2016 Message
37. Il NG NG If NG NG Items marked with an NG When the option in the horizontal axis is specified the option shown in the vertical axis option is unavailable lt Example gt C gt 1k78k0r kOrmain rel kOrsub rel np km The km option is unavailable Items marked with a A When all three of the options in the horizontal axis are specified the option shown in the vertical axis option is unavailable Example C 1k78k0r kOrmain rel kOrsub rel p nkm nkp nkl The nkm nkp and nkl options are all specified at the same time so p option is unavailable When an option and its n counterpart are specified at the same time for example both o and no only the last specified of the 2 options is available Example C 1k78kO0r kOrmain rel kOrsub rel o no The no option is specified after o so o option is unavailable and no is available Options not specified in Table 5 4 have no particular effect on other options However when the help option is specified all other options become unavailable 126 Users Manual U17836EJ1VOUM CHAPTER 5 LINKER Load module file output specification 1 o no Syntax o output file name no Default assumption oinput file name mf Function The o ption specifies the output of a load module file It also specifies the location to which it is output and the file nam
38. Library file Object module file RA78 Load module file KOR Assemble list file Absolute assemble list file Debugger Dedicated PROM In circuit parallel interface 4 programmer emulator HEX format object module Symbol file table file Integrated debugger Flash programmer 22 User s Manual U17836EJ1VOUM CHAPTER 1 GENERAL 1 2 1 Creating a source module file using an editor A single program can be divided into two or more modules according to function A single module can be used as a coding unit or an assembler input unit A module which is used as an input unit for the assembler is called a source module After the coding of each source module is finished the source module is written to a file using an editor The file created in this way is called a source module file A source module file is used as an assembler input file Figure 1 9 Creating Source Module File Program Source module Source module Source module Source module Writing to file editor Source module file Users Manual U17836EJ1VOUM 23 CHAPTER 1 GENERAL 1 2 2 Assembler The assembler is a program which inputs the source module file and converts the assembly language into a collection of binary instructions machine language If the assembler discovers errors in the descriptions in the source module it outputs an assembly error If no assembly errors are found the assembler outputs an object module file w
39. file name Cause An illegal file has been specified Action by User Specify a legal file F3006 Message File not found file name Cause The specified file does not exist Action by User Specify an existent file F3007 Message Input file specification overlapped file name Cause The input file name has already been specified elsewhere Action by User Input a unique file name F3008 Message File specification conflicted file name Cause An I O file name has been specified in duplicate Action by User Specify different I O file names F3009 Message Unable to make file file name Cause The specified file is write protected Action by User Release the write protection on the specified file F3010 Message Directory not found file name Cause A non existent drive and or folder has been included in the output file name Action by User Specify an existent drive and or folder F3011 Message Illegal path option Cause Other than a path name has been specified in the option that specifies the path for the parameter Action by User Specify a correct path name 312 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES E Error Message F3012 Message Missing parameter option Cause A necessary parameter has not been specified Action by User Specify the parameter F3013 Message Parameter not needed option Cause An unnece
40. line Action by User Specify a value within the range Button OK Closes the message box Message Invalid value The range of line per page is from 0 or 20 to 32767 Cause A value outside the limit range is specified as the number of lines on one page Action by User Specify a value within the limit range Button OK Closes the message box User s Manual U17836EJ1VOUM 333 CHAPTER 11 ERROR MESSAGES Error Type Error Message Message Invalid value The range of TAB character is from 0 to 8 Cause A value outside the input limit range is described as the number of tabs up to an operand Action by User Specify a value within the limit range Button OK Closes the message box Message Too many Include Search Path Up to 64 can be specified for Include Search Path Cause A number of include file paths outside the input limit range is specified Action by User Specify a number within the limit range Button OK Closes the message box Message Too many characters for Include Search Path Cause The length of the include file path is specified as a number of characters exceeding the input range Action by User Specify a number of characters in the input range Button OK Closes the message box Message Multiple Include Search Path definition Include file path
41. name in directive already defined Cause Attempted to define a reserved word or a previously defined name as the memory area of a directive This name reserved word memory space name memory area name is already defined E3108 Message Overlapped memory area Memory area 1 and Memory area 2 Cause The memory area addresses defined in the memory directive are overlapped E3109 Message Memory area Memory area name too long name up to 31 characters Cause The memory area name specified in the directive is too long The memory area name specified in the directive is 32 characters or longer E3110 Message Memory area Memory area name already defined Cause The memory area specified in the memory directive is already registered E3111 Message Memory area Memory area name redefinition out of range Cause The range of the memory area specified in the memory directive is outside the redefinable range E3112 Message Segment symbol name wrong allocation type Cause Wrong allocation type is specified for the segment in the merge directive 314 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES TUR Error Message C3113 Message Linker internal error Cause Internal error Action by User Contact NEC Electronics or an NEC Electronics distributor E3114 Message Illegal number Cause Specification of a numerical value in a directive is incorrect E3115 Messag
42. nka nks and nkx nks Makes the ks option Options are all specified the unavailable p option is unavailable kx Outputs an assemble nkx list followed by a cross reference list into an assemble list file nkx Makes the kx option unavailable Assemble list Changes the number If the np option is specified Iw132 file format LE of characters that can the Iw option is m QUE H H specification odi dieu Aa in 1line in unavailable a list file Changes the number If the np option is specified I0 ll number of lines that can be the Il option is unavailable prclgsesy printed in 1 page in an assemble list file Specifies the If the np option is specified None lhcharacte character string the Ih option is unavailable Poss printed in the title column of the header of an assemble list file Specifies a number of If the np option is specified It8 lt number characters to be the It option is unavailable Bc developed in a tab characters 1f Inserts a form feed If both options If and nif FF code at the end nlf are specified at the of an assemble list same time the option file specified last takes precedence nlf Makes the the If If the np option is specified option unavailable the If option is unavailable Error list file e output Outputs an error list If both options e and ne ne output file name file are specified at the specification same time the option
43. sample hex describe as C 0c78ko0r kOr Imf osample hex 192 Users Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER 2 Startup from a parameter file Use the parameter file when the data required to start up the object converter will not fit on the command line or when the same object converter option is specified repeatedly each time object conversion is performed To start up the object converter from a parameter file specify the specify parameter file option f on the command line Start up the object converter from a parameter file as follows X oc78k0r Aload module file A fparameter file nam a b c d a Current drive name b Current folder name b c Specify parameter file option d d Afile which includes the data required to start up the object converter Remark Create the parameter file using an editor The rules for writing the contents of a parameter file are as follows A loption Aoption A A If the load module file name is omitted from the command line only one load module file name can be specified in the parameter file The load module file name can also be specified after the option Write in the parameter file all object converter options and output file names that should be specified in the command line For a detailed explanation of parameter files refer to 3 4 Using Parameter File Example 1 Create the parameter fi
44. 81 CHAPTER 4 ASSEMBLER The character set that can be written in the title column is as follows Character In Command Line In Parameter File 2 gt lt Can be written if enclosed in Can be written us Interpreted in the same way as in the command line even if enclosed in Can be written if enclosedin Cannot be written ups Assumed to be a comment Can be written Cannot be written Assumed to be a comment double quotation mark Cannot be written as an effective character Cannot be written as an effective character 00H Cannot be written Can be written However it is interpreted as the end of the character string 03H 06H 08H ODH OEH 10H 15H 17H 18H 1BH 7FH Cannot be written Can be written However these will appear in the assemble list file as l A single ODH will not be output to the list 01H 02H 04H 05H 07H OBH OCH OFH 11H 12H 13H 14H 16H 19H 1CH 1DH 1EH 1FH Can be written However these will appear in the assemble list file as Can be written However these will appear in the assemble list file as 1AH Can be written However this will appear in the assemble list file as Cannot be written end of file Alphabetic characters Uppercase and lowercase characters are input as is Uppercase and lowercase characters are input as is Other Can be written Can
45. CHAPTER 11 ERROR MESSAGES TRUE Error Message F6904 Message File seek error has occurred file name Cause File seek error has occurred C6999 Message Internal error Cause Program internal error 332 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES 11 7 PM Error Messages This section explains error messages that are not contained in the online help of PM For information on other PM error messages please refer to PM Online Help 11 7 1 Assembler RA78KOR Table 11 6 Error Messages Displayed by Assembler RA78KOR DLL Error Type Error Message x Message Cannot find RA78KOR EXE shown in environmental variable PATH Cause The RA78KOR EXE execution format is not in the specified folder Action by User Re install the RA78KOR assembler package Button Ok Closes the message box Message Cannot find folder Will you create Cause The specified folder does not exist Action by User Create a folder or select another folder Button OK Creates a folder and closes the message box Cancel Closes the message box Message Not make folder Cause The specified folder could not be created Action by User Specify another folder Button OK Closes the message box Message Invalid value The range of columns per line is from 72 to 2046 Cause A value exceeding the limit range is specified as the number of characters on one
46. Converter Options 196 I O Files of Librarian 217 Librarian Options 225 Subcommands 231 LIST subcommand Dialog Box 249 I O Files of List Converter 251 List Converter Options 258 Lists Output by Assembler 271 Lists Output by Linker 278 Explanation of Object Converter Output Items 285 List Output by Librarian 286 Lists Output by List Converter 287 EXIT Statuses 288 Environmental Variables 290 Assembler Error Messages 298 Linker Error Messages 312 Object Converter Error Messages 321 Librarian Error Messages 325 List Converter Error Messages 329 Error Messages Displayed by Assembler RA78KOR DLL 333 Error Messages Displayed by Linker LK78KOR DLL 336 Error Messages Displayed by Object Converter OC78KOR DLL 340 Error Messages Displayed by Librarian LB78KOR DLL 341 Error Messages Displayed by Execution Format DLL lb78kOrp exe for Starting Librarian in Standalone Mode 342 Error Messages Displayed by List Converter LC78KOR DLL 344 Assembler Options 350 List of Linker Options 354 List of Object Converter Options 358 List of Librarian Options 360 List of List Converter Options 361 Users Manual U17836EJ1VOUM 13 D 1 List of Subcommands 362 14 Users Manual U17836EJ1V0UM CHAPTER1 GENERAL This chapter describes the role of the RA78KOR in microcontroller software development and the feature
47. END statement processing User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES PUR Error Message W2708 Message Already declared LOCAL symbol symbo name Cause This symbol is already declared LOCAL Action by User Declare 1 symbol LOCAL only once per macro W2709 Message Few count of actual parameter Cause Fewer actual parameters are set than formal parameters Program Formal parameters are handled as null strings where actual parameters are processing insufficient W2710 Message Over count of actual parameter Cause More actual parameters are set than formal parameters Program Surplus actual parameters are ignored processing W2711 Message Too many errors to report Cause Too many errors exist to report in a single line i e 6 or more errors Program 6th and subsequent error messages are not output but processing continues processing W2712 Message Insufficient cross reference work area Cause Memory is insufficient to process output of cross reference list Program Cross reference list is not output but processing continues processing W2717 Message Normal callt and callf functions must be described together respectively Cause Debugging information may be illegal because normal callt and callf functions are not described together Program Describe normal and callt functions together processing E2801 Message Illegal debug information Cause Th
48. Illegal parameter option Cause The syntax of the parameter is incorrect Action by User Specify a correct parameter F2017 Message Too many parameters option Cause The total number of parameters exceeds the limit Action by User Specify parameters within the number limit F2018 Message Option is not recognized option Cause The option name is incorrect Action by User Specify a correct option name F2019 Message Parameter file nested Cause The f option has been specified inside a parameter file Action by User Do not specify the f option inside a parameter file F2020 Message Parameter file read error file name Cause The parameter file cannot be read Action by User Specify a correct parameter file F2021 Message Memory allocation failed Cause There is insufficient memory Action by User Secure the necessary memory F2101 Message Source file size 0 file name Cause A source module with file size 0 has been input F2102 Message Illegal processor type specified Cause A mistake was made in the specification of the target device F2103 Message Syntax error in module header Cause A mistake was made in format for a control instruction that can be written in a source module header User s Manual U17836EJ1VOUM 299 CHAPTER 11 ERROR MESSAGES 300 E Error Message F2104 Message Can t use this control outside module
49. LF Ifthe list subcommand is not specified the Iw option is ignored Ifthe Iw option is specified 2 or more times the last specified item will take precedence Example of use To specify 80 as the number of characters per line in a list file describe as C gt lb78k0r Iw80 226 Users Manual U17836EJ1VOUM 2 Il CHAPTER 7 LIBRARIAN Syntax ll number of lines Default assumption IlO No page breaks Function The Il option specifies the number of lines that can be printed in 1 page in a list file Application Specify the Il option to change the number of lines that can be printed in 1 page in a list file Explanation The range of number of lines that can be specified with the Il option is shown below 20 lt number of lines printed on 1 page lt 32 767 An abort error occurs if a numerical value outside this range or something other than a numerical value is specified If number of lines is omitted 0 will be specified If the number of lines specified is 0 no page breaks will be made If the list subcommand is not specified the Il option is ignored If the Il option is specified 2 or more times the last specified item will take precedence Example of use To specify 20 as the number of lines per page in a list file describe as C gt lb78k0r II20 Users Manual U17836EJ1VOUM 227 CHAPTER 7 LIBRARIAN 3 If nIf Syntax 1f nlf
50. LINKER Classification Option Explanation Specification of path for temporary t Creates a temporary file in a specified path file creation Device file search path y Reads a device file from a specified path specification Warning message output W Specifies whether or not to output a warning message specification to the console Link specification of boot area zb Specifies the first address of the flash memory area ROM program of flash memory model On chip debug option byte go Specifies the on chip debug option byte specification Security ID specification gi Specifies a security ID User option byte specification gb Specifies the value set for the user option byte Mirror area specification mi Specifies the location destinations of segments in the mirrored area 64 KB boundary location ccza Specifies whether to locate a segment to the last byte specification of each 64 KB boundary area Help specification Displays a help message on the display User s Manual U17836EJ1VOUM 125 CHAPTER 5 LINKER 5 6 2 Order of precedence of linker options The following table indicates which linker option takes precedence when two linker options are specified at the same time Table 5 4 Order of Precedence of Linker Options no ng np nkm nkp nkl j NG NG g NG NG p A NG km NG NG kd NG NG NG kp NG NG NG kl NG NG NG
51. LINKER Link specification of boot area ROM program of flash memory model 1 zb Syntax zb Default assumption No limitation for the location range Function The zb option specifies the first address of the flash memory area Explanation Specifies linking of the boot area ROM program of a flash memory model and the first address of the flash memory area f no address is specified an error occurs No codes can be located at addresses higher than the specified address Caution Do not specify this option for a device that does not have a flash memory area self programming function Example of use To specify 2000h as the start address of flash memory area describe as C gt lk78k0r kOrmain asm zb2000h User s Manual U17836EJ1VOUM 153 CHAPTER 5 LINKER On chip debug option byte specification 1 go Syntax gocontrol value start address size Default assumption On chip debug is not used Address C3H is the initial value specified the device file Function Specifies whether on chip debug is used or not Application Use the go option to specify the control value the start address and the program size for on chip debug operation Explanation 154 For the control value specify the control value for on chip debug operation An abort error occurs if a value that cannot be specified for the control value is specified For the start address specify the location st
52. Library tab Figure 5 4 Linker Options Dialog Box When Library Tab Is Selected Linker Options Output Qutput2 Library Others Library File b Edit Library File Search Path i I Ed Command Line Options oa Imf pa map Cancel f Help Library File b Specify a file to be input as a library file by using the Edit button opens the Edit Option dialog box or directly inputting a path and file names Up to 64 items can be specified by using commas as delimiters Library File Search Path i Specify the path via which the library file is to be read by using the Edit button opens the Edit Option dialog box or directly inputting a path and file name Up to 64 items can be specified by using commas as delimiters Command Line Options This edit box is read only The currently set option character string is displayed User s Manual U17836EJ1VOUM 169 CHAPTER 5 LINKER 4 Others tab Figure 5 5 Linker Options Dialog Box When Others Tab Is Selected Linker Options Dutputl Output Library Others Directive File d Y Browse Temporary Directory t Create Stack Symbol s Area Name zl Warning Level w 1s Flash Start Address for the Product with Flash ROM zb H Use Command File Parameterfile f Y Browse Other options Reset Option data read Option data save Command Line Opti
53. Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN The general procedure for creating library files is as follows Creation of library fle create subcommand tc add subcommand acm MEC ILS add subcommand Update or retrieval of object delete subcommand module file replace subcommand pick subcommand list subcommand Users Manual U17836EJ1VOUM 219 CHAPTER 7 LIBRARIAN 7 3 Librarian Startup 7 3 1 Methods to start librarian The following two methods can be used to start up the librarian 1 Startup from the command line X path name lb78k0r Aoption a b c d a Current drive name b Current folder name c Librarian command file name d This contains detailed directions for the action of the librarian If more than one librarian option is specified separate the options with a space Uppercase characters and lowercase characters are not distinguished for the librarian options For a detailed explanation of librarian options refer to 7 4 Librarian Options Enclose a path that includes a space in a pair of double quotation marks Example C gt lb78k0r 1120 Iw80 When the librarian is started up the following startup message appears on the display 78KOR Series Librarian Vx xx xx xxx xx Copyright C NEC Electronics Corporation XXXx XXXX After an asterisk specify a librarian subcommand create k
54. Parameter File If two or more options are input when the assembler or linker is started the information necessary for starting cannot be completely specified on the command line or the same specification may be repeatedly made In this case the parameter file is used To use the parameter file specify the parameter file specification option on command line Caution The parameter file cannot be specified on PM Assembler or linker is started by the parameter file as follows path name ra78k0rA fparameter file nam path name lk78k0rA fparameter file nam path name oc78k0rA fparameter file nam Here is an example of its use C ra78k0r fpara pra C gt 1k78k0r fpara plk C gt oc78k0r fpara poc The parameter file is created with an editor All the options and output file names that should be specified on the command line can be written in the parameter file Here is an example of creating a parameter file with an editor Contents of para1 pra cfl1l66a0 kOrmain asm e Contents of para1 plk gt kOrmain rel kOrsub rel bmylib lib osample lmf s Contents of para1 poc gt sample lmf u0FFH osample hex r User s Manual U17836EJ1VOUM 53 CHAPTER4 ASSEMBLER The assembler inputs source module files written in the assembly language for 78KOR Series microcontrollers and converts them into machine language coding The assembler al
55. RAM FDOOOH FCFOOH om FCFOOH ED7FFH d ROM 3FFFFH ROM 00000H 00000H 6 As the result of the assembly the output object module files kOrmain rel and kOrsub rel are linked Enter kOr dr as the directive file Enter the following on the command line C gt Ik78k0r kOrmain rel kOrsub rel dkor drNete okor Imf pkOr map sNote 2 Note 1 Not necessary if a directive file is not specified Note2 Stack resolution symbol OSTBEG creation option 50 User s Manual U17836EJ1VOUM CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR The following message is output to the display 78KOR Series Linker Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx Target chip uPD78F1166 A0 Device file Vx xx Link complete 0 error s and 0 warning s found 7 Check the contents of drive C The linker outputs the load module file kOr Imf and the link list file KOr map If the e option is specified during linking the linker outputs an error list file 8 As the result of linking the output load module file kOr Imf is converted to a HEX format file Enter the following on the command line C 0c78ko0r kOr Imf r uOFFH The following message is output on the display 78KO0R Series Object Converter Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx Target chip uPD78F1166 A0 Device file Vx xx Object Conversion Complete 0 error s and 0 warning s
56. Specify the path and file name of the link list file by using the Browse button or directly inputting a path and file name a map is set as an initial value Output Map List km Select this option to output a map file in the link list file Output Directive File Image kd Select this option to output a link directive file in the link list file Output Public Symbol List kp Select this option to output a public symbol list in the link list file Output Local Symbol List kl Select this option to output a local symbol list in the link list file Users Manual U17836EJ1VOUM 167 168 CHAPTER 5 LINKER Add Form Feed at End of List File If Select this option to add a form feed code FF to the link list file Lines per Page ll Specify the number of lines on one page of the link list file in a range of 20 to 32 767 Select mirror area Select the area in which segments that mirrored to the RAM space are to be located MAA 0 mi0 Locate the segment in the area to be mirrored when MAA 0 MAA 1 mi1 Locate the segment in the area to be mirrored when MAA 1 For details on the mirror area refer to the user s manual of the device User Option Bytes gb Select this option to specify the value to set a user option byte value Command Line Options This edit box is read only The currently set option character string is displayed User s Manual U17836EJ1VOUM CHAPTER 5 LINKER 3
57. Tab Is Selected 102 Assembler Options Dialog Box When Output2 Tab Is Selected 104 Assembler Options Dialog Box When Others Tab Is Selected 106 Edit Option Dialog Box 108 Add Option Dialog Box 108 Linker Options Dialog Box 164 Linker Options Dialog Box When Output1 Tab Is Selected 165 Linker Options Dialog Box When Output2 Tab Is Selected 167 Linker Options Dialog Box When Library Tab Is Selected 169 Linker Options Dialog Box When Others Tab Is Selected 170 Edit Option Dialog Box 172 Add Option Dialog Box 172 I O Files of Object Converter 173 Intel Standard Format 176 Intel Extended Format 178 Motorola S Type Format 186 Symbol Table File Formats 190 Symbol Value Formats 191 Object Converter Options Dialog Box 210 Object Converter Options Dialog Box When Output1 Tab Is Selected 211 Object Converter Options Dialog Box When Output2 Tab Is Selected 213 Object Converter Options Dialog Box When Others Tab Is Selected 214 I O Files of Librarian 216 Librarian Options Dialog Box 242 Librarian Options Dialog Box When Output Tab Is Selected 243 Librarian Options Dialog Box When Cthers Tab Is Selected 245 Library File Name Dialog Box 247 Subcommang Dialog Box 248 I O Files of List Converter 250 List Converter Options Dialog Box 266 Lis
58. The specified operand is out of the specifiable range for operand addr of directives BR CALL Action by User Specify the operand in a specifiable range E2337 Message Illegal mnemonic use another mnemonic or option COMPATI Cause A 78KO0 instruction that cannot be used for the 78KOR is used Action by User Describe another instruction or use the compati option E2338 Message Operand out of range EQU operand Cause The specified operand is out of the specifiable range 0H to OFFFFFH for operand addr of directives EQU Action by User Specify the operand in a specifiable range E2339 Message Operand out of range word ADDRESS Cause The specified operand is out of the specifiable range for word ADDRESS attribute symbol Action by User Change the operand to one of the following within the specifiable area 1 F0000H to FFFFFH 2 Area mirrored when MAA 0 or area mirrored when MAA 1 For details on the mirror area refer to the user s manual of the device E2340 Message Operand out of range ES word ADDRESS Cause The specified operand is out of the specifiable range for ES word ADDRESS attribute symbol Action by User Specify the operand in a specifiable range E2341 Message Illegal size for Option Bytes Cause The segment that specifies the user option byte and on chip debug option byte is not specified with 4 bytes Action by User Specify with 4 bytes the segment that specifies these bytes E2342 Message Illegal value f
59. U17836EJ1VOUM 139 1 CHAPTER 5 LINKER kl nkl Syntax k1 nkl Default assumption nkl Function The kl option outputs a local symbol list into a link list file The nkl option makes the kl option unavailable Application Specify the kl option to output a local symbol list into a link list file Explanation 140 If the nkm nkp and nkl options are all specified the link list file cannot be output If ng option is specified the local symbol list cannot be output If both options kl and nkl are specified at the same time the option specified last takes precedence If the np option is specified the kl option is unavailable User s Manual U17836EJ1VOUM Example of use CHAPTER 5 LINKER To output a local symbol list into a link list file KOr map describe as C IK78kO0r kOrmain rel kOrsub rel s g pkOr map kl Contents of kOr map gt 78KOR Series Linker Vx xx Date XX XXX XXXX Page Command kOrmain rel kOrsub rel s g pkOr map k1 Para file Out file kOrmain lmf Map file k0r map Direc file Directive Link information 6 output segment s 9DH byte s real data 40 symbol s defined Memory map SPACE REGULAR 1 78KOR Series Linker Vx xx Local symbol list MODULE ATTR VALUE NAME SAMPM MOD SAMPM DSEG DATA ADDR FFE20H HDTSA ADDR FFE21H STASC CSEG
60. a segment name The segment name must be specified in the same way as in the source Start address The start address allocates a segment to the area specified by start address The reserved word AT must be specified entirely in either uppercase or lowercase characters It cannot be specified in a mixture of uppercase and lowercase characters The start address specifies a numerical constant Segment is located in the Start address specified start address Segment Caution 1 When a segment is located in the specified start address if it exceeds the memory area range for the memory area in which it is located an error occurs Caution 2 A link directive cannot be used to specify a start address for a segment whose location address is specified by the AT instruction of a segment directive or by an ORG directive Merge attribute If two or more segments with the same name exist in the source specify COMPLETE in order not to merge the segments and generate an error To merge the segments specify SEQUENT default in the directive SEQUENT Merges the segments in the order in which they appear so that no gaps are created BSEG merges the segments in bit units in the order in which they appear COMPLETE An error occurs if two or more segments with the same name exist Users Manual U17836EJ1VOUM 117 CHAPTER 5 LINKER Example MERGE DSEG1 COMPLETE RAM 4 Memory space names A memory space n
61. also be written after the option Write in the parameter file all linker options and output file names that should be specified in the command line For a detailed explanation of parameter files refer to 3 4 Using Parameter File Example 1 Create the parameter file kOr plk using an editor parameter file kOrmain rel kOrsub rel ok0r lmf pkOr map e tC Ntmp 2 Use parameter file kOr plk to start up the linker C gt Ik78kOr fkOr plk Users Manual U17836EJ1VOUM 121 CHAPTER 5 LINKER 5 5 2 Execution start and end messages 1 Execution start message When the linker is started up an execution startup message appears on the display 78KOR Series Linker Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx 2 Execution end message If it detects no link errors resulting from the link the linker outputs the following message to the display and returns control to the operating system Target chip uPD78xxx Device file Vx xx Link complete 0 error s and 0 warning s found If it detects a link error resulting from the link the linker outputs the error number to the display and returns control to the operating system Target chip uPD78xxx Device file Vx xx Link complete 1 error s and 0 warning s found If the linker detects a fatal error during linking which makes it unable to continue link processing the linker
62. as addr16 bit Action by User Describe the operand with SFR bit 302 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES Fa ue Error Message E2326 Message Illegal SFR access in operand Cause An SFR symbol that cannot access an operand is described E2327 Message Operand out of range addr20 Cause The specified operand is out of the specifiable range for addr20 00000H to OFFFFFH or out of the range 128 to 127 as a result of calculation of its relative displacement from the address next to the branch directive Action by User Specify the operand in a specifiable range E2328 Message Operand out of range n Cause The specified operand is out of the range of n 1 to 7 Action by User Specify the operand in a specifiable range E2329 Message Operand out of range n Cause The specified operand is out of the range of n 1 to 15 Action by User Specify the operand in a specifiable range E2330 Message Operand out of range addr16 BR or CALL Cause Operand is outside the specifiable range OH to FFFFH for addr16 Action by User Specify the operand in a specifiable range E2331 Message Operand out of range addr16 NUMBER Cause The specified operand is out of the specifiable range 0H to FFFFH for addr16 numeric constant and NUMBER attribute symbol Action by User Specify the operand in a specifiable range E2332 Message Operan
63. but Renesas Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein Renesas Electronics products are classified according to the following three quality grades Standard High Quality and Specific The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application categorized as Specific without the prior written consent of Renesas Electronics Further you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of Renesas Electronics Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as Specific or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets or data books etc Standard Computers offi
64. comments Example of use Start up list converter using a parameter file kOr plv Contents of the kOr plk parameter file kOrmain lkOr lmf ekOr elv User s Manual U17836EJ1VOUM 263 CHAPTER 8 LIST CONVERTER Enter the following on the command line C Ic78kO0r fkOr plv 264 Users Manual U17836EJ1VOUM CHAPTER 8 LIST CONVERTER Help specification 1 Syntax Default assumption No display Function The option displays a help message on the display Application The help message is a list of explanations of the list converter options Refer to these when executing the list converter Explanation When the option is specified all other options are unavailable Caution This option cannot be specified on PM To reference PM help click the Help button in the List Converter Options dialog box Example of use To output a help message on the display describe as C gt Ic78k0r List Conversion Program for RA78KOR Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx usage LC78K0R option input file option The option is as follows means omissible R fil Specify object module file L fil Specify load module file O fil Specify output list file absolute assemble list file Ffile Input option or input file name from specified file E fil Creat rror list file
65. common modules can be created enabling efficient file management and operation User s Manual U17836EJ1VOUM 295 CHAPTER 11 ERROR MESSAGES This chapter explains the causes of error messages output by the RA78KOR s programs assembler linker object converter and librarian and the action to be taken by the user 11 1 Overview of Error Messages Error messages output by the RA78KOR are divided into the following 4 levels 1 296 Abort error Fxxxx An error has occurred which makes the program unable to continue processing The program quits interrupts immediately If the abort error is found on the command line processing ends when another command line error is found Fatal error Exxxx An execution error has occurred When another error is found the program quits interrupts without generating an output object When a fatal error occurs to clarify that an output object is not generated if an object with the same name exists that object is deleted Internal error Cxxxx Processing is immediately terminated aborted because an internal error has occurred Warning Wxxxx An output object is generated which may not be the result the user intended Remark In a program executed in conversational format the execution ends normally unless an abort error occurs User s Manual U17836EJ1VOUM The error messages of the assembler package are classified as follows T
66. definition field Base address 2 to 17 This is a section start address Number of characters is variable Length 2 to 17 Indicates the section length Number of characters is variable and is calculated by the following 1 higher address base address Table 6 10 Symbol Block Symbol Definition Fields for Extended Tech No of ASCII Field Characters Explanation Type 1 1 digit hexadecimal indicating global local symbol specification and type of value displayed 1 Global address 2 Global scalar 3 Global code address 4 Global data address 5 Local address 6 Local scalar 7 Local code address 8 Local data address Symbol 2to17 Indicates the symbol length Variable Numerical 2to17 Value corresponding to a symbol Number of characters is value variable User s Manual U17836EJ1VOUM 185 CHAPTER 6 OBJECT CONVERTER Motorola S type format Motorola S type format files are converted from 5 records into 3 types The composition of the entire file is shown in Figure 6 4 Types of records are shown below Table 6 11 Motorola HEX File Record Types Item Record Type Header record optional So Data record S2 Standard 24 bits S3 32 bits End record S8 Standard 24 bits S7 32 bits Figure 6 4 Motorola S Type Format Header record Data record Data record End record Motorola HEX format files are divided into standard 24 bit addresses and 32 bit a
67. error file name Cause The parameter file cannot be read Action by User Specify a correct parameter file F4021 Message Memory allocation failed Cause There is insufficient memory Action by User Secure the necessary memory F4100 Message file name Illegal processor type Cause Target device of the assembler or compiler is different from the target device of this program Action by User Check whether the load module file is correct and check target device of the assemble or compile Also check whether the version of the device file is correct 322 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES Error Number Error Message F4101 Message file name invalid input file or made by different hostmachine Cause Attempted to input a file other than a load module file or to convert a load module file created on an incompatible host machine F4103 Message Symbol symbol name Illegal attribute Cause A mistake exists in the symbol attribute of the input file F4104 Message file name Illegal input file not linked Cause Attempted to input an object module file F4105 Message Insufficient memory in hostmachine Cause Memory is not sufficient to operate the program F4106 Message Illegal symbol table Cause A mistake exists in the symbol table of the input load module file Action by User If the source is written in C make sure that the asse
68. file Note Obtain the device file by downloading it from the following Website ODS http www necel com micro ods eng index html Users Manual U17836EJ1VOUM 27 CHAPTER 1 GENERAL 1 2 6 List converter The list converter inputs the object module files and assemble list file output by the assembler and the load module file output by the linker and outputs an absolute assemble list file Relocatable assemble list files have the disadvantage that addresses and relocatable values in the list may be different from their actual values An absolute assemble list file determines these values making debugging and program maintenance easier Figure 1 14 Function of List Converter Assemble list file Object module file Load module file Input Input dx List Converter Output Absolute assemble list file 28 User s Manual U17836EJ1VOUM CHAPTER 1 GENERAL 1 2 7 Debugger The debugger for the 78KOR Series is a software tool which displays the data from source programs registers and memories in their respective windows and performs debugging The debugger downloads the load module file output by the linker to the in circuit emulator IE of the target System It can also perform debugging at the source level by reading the source program file The debugger and IE are separate packages and are sold separately from the RA78KOR Figure 1 15 Function of Debugger Source program Load module file Assembler Object module file
69. for any errors that may appear in this document NEC Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of NEC Electronics products listed in this document or any other liability arising from the use of such products No license express implied or otherwise is granted under any patents copyrights or other intellectual property rights of NEC Electronics or others e Descriptions of circuits software and other related information in this document are provided for illustrative purposes in semiconductor product operation and application examples The incorporation of these circuits software and information in the design of a customer s equipment shall be done under the full responsibility of the customer NEC Electronics assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits software and information While NEC Electronics endeavors to enhance the quality reliability and safety of NEC Electronics products customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely To minimize risks of damage to property or injury including death to persons arising from defects in NEC Electronics products customers must incorporate sufficient safety measures in their design such as redundancy fire containment and anti failure features e NEC El
70. found 9 Check the contents of drive C The object converter outputs the HEX format object module file kOr hex and the symbol table file KOr sym 10 Create a library file as follows Register the object module file kOrsub rel output by the assembler as a library file Enter the following on the command line C Ib78kO0r lt kOr job The following message is output on the display 78KOR Series Librarian Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx create kOr lib Contents of kOr job add kOr lib kOrsub rel Contents of kOr job exit 11 Check the contents of drive C The librarian outputs the library file kOr lib User s Manual U17836EJ1VOUM 51 CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR 12 Create an absolute assemble list as follows To create the absolute assemble list KOrmain asm input kOrmain rel kOrmain asm and kOr Imf to the list converter Enter the following on the command line C gt lc78k0r main l Imf The following message is output on the display List Conversion Program for RA78KOR Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx Passl start Pass2 start Conversion complete 13 Check the contents of drive C The list converter outputs the absolute assemble list file KOrmain p 52 User s Manual U17836EJ1V0UM CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR 3 4 Using
71. header Cause A control instruction for specification in a source module header is written in an ordinary source F2105 Message Duplicate PROCESSOR control Cause A PROCESSOR control instruction is written more than once in a source module header F2106 Message Illegal source file name for module name Cause Module name cannot be created because the primary name for the source file name has a character that is not a legal symbol structure character F2107 Message Default segment CSEG is already used Cause Attempted to define an undefined segment with a default segment F2108 Message Symbol table overflow symbo name Cause The number of symbols exceeds the definable limit F2109 Message Too many DS Cause Too many gaps have opened between object codes in a segment because too many DS directives are used so data cannot be output to the object file F2110 Message String table overflow Cause Limits of the string table are exceeded Action by User Reduce number of symbols to 9 characters or less F2111 Message Object code more than 128bytes Cause Object code exceeds 128 bytes per line in a source statement F2112 Message No processor specified Cause Target device is not specified in the command line or in the source module file F2114 Message Local symbol name of asm statement must begin with L in C source Cause A local symbol which begins with other than L is described in the asm of the C source F2115 Message Too long source line Cause The
72. ks is ignored If the nka nks and nkx options are all specified the assemble list file cannot be output If the np option is specified the kx option is unavailable Notice Acontrol instruction XREF NOXREF or XR NOXR with the same function as the kx nkx option can also be written at the beginning of a source module ASAXREF ASAXR abbreviated form ASANOXREF ASANOXR abbreviated form For information on control instructions refer to RA78KOR Assembler Package Language User s Manual Users Manual U17836EJ1VOUM 75 CHAPTER 4 ASSEMBLER Example of use To output an assemble list followed by a cross reference list into an assemble list file KOrmain prn describe as C ra78kO0r cf1166a0 kOrmain asm kx Contents of kOrmain prn Cross Reference List NAME VALUE R ATTR RTYP SEGNAME XREFS CSEG CSEG CSEG 22 CODE CSEG CODE 19 CONVAH H E EXT 12Q 31 DATA DSE DATA 15 HDTSA FFE20H ADDR DATA 16 28 29 MAIN OH ADDR PUB CODE 11Q 204 SAMPM MOD 2 START OH R ADDR PUB CSE 11Q 20 234 STASC FFE21H ADDR DATA 17 33 BSTBEG E EXT 13Q 26 76 User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER Assemble list file format specification 1 iw Syntax l1w number of characters Default assumption lw132 80 characters in the case of display output Function The Iw opti
73. kx nkx j NG NG g NG NG p NG ka NG NG ks NG NG NG kx NG NG Iw NG NG Il NG NG Ih NG NG It NG NG If NG NG Items marked with an NG When the option in the horizontal axis is specified the option shown in the vertical axis option is unavailable lt Example gt C gt ra78k0r cf1166a0 kOrmain asm no 1w80 1f The Iw and lf options are unavailable Items marked with a A When all three of the options in the horizontal axis are specified the option shown in the vertical axis option is unavailable Example C ra78k0r cf1166a0 kOrmain asm p nka nks nkx The nka nks and nkx options are all specified at the same time so the p option is unavailable When an option and its n counterpart are specified at the same time for example both o and no only the last of the 2 options is available Example C ra78k0r cf1166a0 kOrmain asm o no The no option is specified after o so the o option is unavailable and no is available User s Manual U17836EJ1VOUM 63 CHAPTER 4 ASSEMBLER Options not described in Table 4 3 have no particular effect on other options However when the help option is specified all other options become unavailable 64 User s Manual U17836EJ1V0UM CHAPTER 4 ASSEMBLER Device type specification 1 c Syntax cdevice type Default assumption Cannot be omitt
74. limit on the length of one line 2048 characters has been exceeded E2201 Message Syntax error Cause An incorrect statement format was used E2202 Message Illegal operand Cause The specified operand is illegal E2203 Message Illegal register Cause A register that cannot be specified was specified E2204 Message Illegal character Cause An illegal character is specified in the source module User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES ME Error Message E2205 Message Unexpected LF in string Cause A carriage return code appears in a character string before the string is closed E2206 Message Unexpected EOF in string Cause An end of file code appears in a character string before the string is closed E2207 Message Unexpected null code in string Cause A null code 00H is written in a character string E2209 Message Too many line number Cause The number of lines described in one file has exceeded the limit E2301 Message Too complex expression Cause Expression is too complex E2302 Message Absolute expression expected Cause A relocatable expression is specified E2303 Message Illegal expression Cause Incorrect format for expression is used E2304 Message Illegal symbol in expression file name Cause An unusable symbol is used in an expression E2305 Message Too long string as constant Cause Limit on string constant length 4 c
75. list file by using the Browse button or directly inputting a path and file name Command Line Options This edit box is read only The currently set option character string is displayed Users Manual U17836EJ1VOUM 213 CHAPTER 6 OBJECT CONVERTER 3 Others tab Figure 6 10 Object Converter Options Dialog Box When Others Tab Is Selected Object Converter Options Output Qutput2 Others Parameterfile f Y Browse Other options x Reset Option data read ption data save Command Line Options Cancel Help Use Command File Select this option to create a command file Parameterfile f Specify the file to be input as a user defined parameter file by using the Browse button or directly inputting a file name Other options To specify an option other than those that can be set in this dialog box enter the option in the input box Caution The help specification option cannot be specified on PM Reset Resets the input contents Option data read Opens the Read Option Data dialog box and after the option data file has been specified reads this file Option data save Opens the Save Option Data dialog box and save the option data to the option data file with a name 214 User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER Command Line Options This edit box is read only The currently set option character stri
76. name Cause An illegal file was specified in the field for specifying the list output file name Action by User Specify the correct output file name Button OK Closes the message box Message Invalid value The range of columns per line is from 72 to 260 Cause A value out of the specifiable range was specified for the number of characters per line in the output list file Action by User Specify the value within the specifiable range Button OK Closes the message box Message Invalid value The range of lines per page is from 0 20 to 32767 Cause A value out of the specifiable range was specified for the number of lines per page in the output list file Action by User Specify the value within the specifiable range Button OK Closes the message box User s Manual U17836EJ1VOUM 343 CHAPTER 11 ERROR MESSAGES 11 7 5 List Converter LC78KOR Table 11 11 Error Messages Displayed by List Converter LC78KOR DLL Error Type Error Message x Message Cannot find LC78KOR EXE shown in environmental variable PATH Cause The LC78KOR EXE execution format is not in the specified folder Action by User Re install the RA78KOR assembler package Button OK Closes the message box Message Cannot find folder Will you create Cause The specified folder does not exist Action by User Create a folder or select another folder
77. plv 256 User s Manual U17836EJ1VOUM CHAPTER 8 LIST CONVERTER 8 3 2 Execution start and end messages 1 Execution start message When the list converter is started up an execution startup message appears on the display List Conversion Program for RA78KOR Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx Passl start Pass2 start 2 Execution end message If it detects no list conversion errors resulting from the list conversion the list converter outputs the following message to the display and returns control to the operating system Conversion complete If the list converter detects a fatal error during list conversion which makes it unable to continue list conversion processing the list converter outputs a message to the display cancels list conversion and returns control to the operating system Example A non existent list converter option is specified C Ic78k0r kOrmain prn a List Conversion Program for RA78KOR Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx RA78KOR error F6018 Option is not recognized a Please enter LC78KOR if you want help messages Program aborted When the list converter outputs an error message and aborts list conversion look for the cause in CHAPTER 11 ERROR MESSAGES and take action accordingly Users Manual U17836EJ1VOUM 257 CHAPTER 8 LIST CONVERTER 8 4 List Converter
78. processing the assembler outputs a message to the display cancels assembly and returns control to the operating system Example A non existent source module file is specified C ra78k0r sample asm 78KOR Series Assembler Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx RA78KOR error F2006 File not found sample asm Program aborted User s Manual U17836EJ1VOUM 59 60 CHAPTER 4 ASSEMBLER In the above example a non existent source module file is specified An error occurs and the assembler aborts assembly A non existent assembler option is specified C ra78k0r kOrmain asm z 78KOR Series Assembler Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx RA78KOR error F2012 Missing parameter z Please enter RA78KO0R if you want help messages Program aborted In the above example a non existent assembler option is specified An error occurs and the assembler aborts assembly When an error message is displayed and assembly is aborted look for the cause in CHAPTER 11 ERROR MESSAGES and take action accordingly User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER 4 4 Assembler Options 4 4 4 Types of assembler options The assembler options are detailed instructions for the operation of the assembler The types and explanations for assembler options are shown below Table 4 2 Assembler Options
79. read only The currently set option character string is displayed Users Manual U17836EJ1VOUM 107 CHAPTER 4 ASSEMBLER 4 5 3 Edit Option dialog box 108 Items are edited in list format in the Edit Option dialog box The Edit Option dialog box is described below Figure 4 6 Edit Option Dialog Box Edit Opiton LIST T Add button Adds a list item If the item to be added is a file or folder the corresponding Browse for Folder dialog box opens In all other cases the Add Option dialog box opens Specify details of the item to be added in this box Figure 4 7 Add Option Dialog Box Add Option Cancel Delete button Deletes the selected list item Up button Moves the selected list item up Down button Moves the selected list item down Add Sub Directory button A subfolder can be added to the selected list item when the item is specified as Include Search Path i on the Others tab User s Manual U17836EJ1VOUM CHAPTER 5 The linker inputs a number of object module files output by the 78KOR assembler determines a location address LINKER and outputs them as a single load module file The linker also outputs list files such as a link list file and an error list file If a link error occurs an error message is output to an error list file to clarify the cause of the error When an error occurs the load module file will not be output 5 1 l OFiles of L
80. segment type and relocation characteristic CSEG UNIT In this example the declared memory area is as follows MEMORY ROM OOOOH 1000H MEMORY MEM1 1000H 2000H When input segment SEG1 is allocated to 500H in memory area ROM refer to the following figure 1 MERGE SEG1 AT 500H When input segment SEG1 is allocated to memory area MEM refer to the following figure 2 MERGE SEG MEM1 118 Users Manual U17836EJ1VOUM CHAPTER 5 LINKER When input segment SEG is allocated to 1500H in memory area MEM refer to the following figure 3 MERGE SEG AT 1500H MEM1 FFFFH FFFFH FFFFH 2000H 2000H 2000H MEMI 1500H 1000H 1000H 1000H 0500H BON 0500H 0000H 0000H 0000H Users Manual U17836EJ1VOUM 119 CHAPTER 5 LINKER 5 5 Linker Startup 5 5 1 Methods to start linker The following two methods can be used to start up the linker 1 Startup from the command line X path name lk78k0r Aoption object module file name Aoption A a b c d e d a Current drive name b Current folder name Linker command file name This contains detailed directions for the action of the linker If more than one linker option is specified separate the options with a space Uppercase characters and lowercase characters are not distinguished for the linker options For a detailed explanation of the linker options refer to 5 6 Linker Options
81. specified in binary octal decimal or hexadecimal numbers An abort error occurs if a value outside the range or a value other than a numerical value is specified Start address specifies the start address area for complement to be performed The range of values that can be specified for start address is as follows OH lt start address lt OFFEFFH start address can be specified in binary octal decimal or hexadecimal numbers An abort error occurs if a value outside the range or a value other than a numerical value is specified If start address is omitted 0 is assumed to be specified size specifies the size of the address area for complement to be performed The range of values that can be specified for size is as follows 1H lt size lt OFFFOOH size can be specified in binary octal decimal or hexadecimal numbers An abort error occurs if a value outside the range or a value other than a numerical value is specified When start address has been specified size cannot be omitted 200 User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER Jf neither a start address nor size is specified the object converter performs processing assuming that the range of the internal ROM is specified If both the u and nu options are specified at the same time the one specified later takes precedence Ifthe no option is specified the u nu option is invalid Two or more address ranges cannot be specified by using the u
82. table list to print file Not kx nkx Output the cross reference list to print file Not lw width Specify print file columns per line 11 length Specify print file lines per pag SIEN it Add Form Feed at end of print file Not lt n Expand TAB character for print file n 1 to 8 Not expand n 0 lhstring Print list header with the specified string g ng Output debug information to object file Not j nj Create object file if fatal error occurred Not idirectory directory Set include search path tdirectory Set temporary directory ydirectory Set device file search path ffile Input option or source module file name from specified file ga nga Output assembler source debug information to object file Not dname data name data Define name with data common Create the common object module file for 78KOR Series self Use Self programming zs ze zn Change source regulation zS SJIS code usable in comment ze EUC code usable in comment zn no multibyte code in comment s Show this message DEFAULT ASSIGNMENT o n p ka nks nkx 1w132 110 nlf 1t8 g nj ga User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER 4 5 Option Settings in PM This section describes the method for setting assembler options from PM 4 5 1 Option setting method The Assembler Options dialog box is opened if Assembler Options is selected from the Too
83. the same time ks is ignored If the nka nks and nkx options are all specified the assemble list file cannot be output If the np option is specified the ks option is unavailable Example of use To output an assemble list followed by a symbol list into an assemble list file KOrmain prn describe as C ra78kO0r cf1166a0 kOrmain asm ks Contents of kOrmain prn gt Symbol Table List VALUE ATTR RTYP NAME VALUE ATTR RIYE NAME CSEG CSEG CSEG CODE m H EXT CONVAH DSEG DATA FFE20H ADDR HDTSA OH ADDR PUB MAI MOD SAMPM OH ADDR PUB START FFE21H ADDR STASC 2 2 H EXT _ STBEG 74 Users Manual U17836EJ1V0UM CHAPTER 4 ASSEMBLER 3 kx nkx Syntax kx nkx Default assumption nkx Function The kx option outputs an assemble list followed by a cross reference list into an assemble list file The nkx option makes the kx option unavailable Application Specify the kx option to output a cross reference list when you wish to know where and to what degree each symbol defined in a source module file is referenced in the source module or when you wish to know such information as which line of the assemble list a certain symbol is referenced on Explanation If both the kx and nkx options are specified at the same time the option specified last takes precedence If the ks and kx options are specified at the same time
84. to support a given application Note 1 NEC Electronics as used in this statement means NEC Electronics Corporation and also includes its majority owned subsidiaries 2 NEC Electronics products means any product developed or manufactured by or for NEC Electronics as defined above M8E 02 11 1 User s Manual U17836EJ1VOUM 3 MEMO 4 User s Manual U17836EJ1VOUM INTRODUCTION This manual is intended to give users who wish to develop software using the RA78KOR an understanding of the functions of each program in the RA78KOR Series Assembler Package hereafter referred to as the RA78KOR and of the correct methods of using the package This manual does not cover the expressions of directives and source programs or language used in the RA78KOR Therefore before reading this manual read the RA78KOR Series Assembler Package Language User s Manual U17835E hereinafter referred to as the Language Manual The contents of this manual are intended for use with Ver 1 00 or later of the RA78KOR Target Readers The RA78KOR is intended for users who understand the functions and instructions of the microcontroller for which software is being developed 78KOR Microcontroller Organization This manual consists of the following eleven chapters and appendixes CHAPTER1 GENERAL Outlines the role of the RA78KOR in microcontroller software development and the features of the RA78KOR CHAPTER2 PRODUCT OUTLINE AND INSTALL
85. umber of bytes in iii plus the number of bytes in iv User s Manual U17836EJ1VOUM 187 188 CHAPTER 6 OBJECT CONVERTER 2 S2 record XX WWWWWW DD DD ZZ ii 233 iv v ii iv v Record type Record length This is the number of bytes in iii plus the number of bytes in iv plus the number of bytes in v Load address This is the 24 bit load address of the data in iv within the range OH to FFFFFFH Data This is the loaded data itself Check sum 3 S3 record WWWWWWWW Record type Record length This is the number of bytes in iii plus the number of bytes in iv plus the number of bytes in v Load address This is the 24 bit load address of the data in iv within the range OH to FFFFFFFH Data This is the loaded data itself Check sum 4 S7 record S17 XX WIWWWWWWW ZZ i ii iii iv i Record type iii iv Record length This is the number of bytes in iii plus the number of bytes in iv Entry address This is the 32 bit entry address within the range OH to FFFFFFFH Check sum User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER 5 S8 record WWWWWWWW iii i Record type ii Record length This is the number of bytes in iii plus the number of bytes in iv iii Entry address This is the 24 bit entry address within the range OH to FFFFFFH iv Check sum User s Manual U17836EJ1
86. using batch file ra bat describe as C ra bat User s Manual U17836EJ1VOUM 289 CHAPTER 10 EFFICIENT USE OF RA78KOR 10 2 Preparing Development Environment Environmental Variables The RA78KOR supports the following environmental variables for preparing the software development environment Table 10 2 Environmental Variables Environmental Expl ihati Variables p PATH Search path for execution format INC78KOR Search path for include file assembler LIB78KOR Search path for library file linker only TMP Path for creating temporary files LANG78K Kanji 2 byte character type specification Example of use lt Contents of autoexec bat gt autoexec bat Verify on break on PATH C bin C bat C ra78k0r 1 SET INC78KO0R C Nra78k0rNinclude 2 SET LIB78KOR C ra78k0r lib 3 SET TMP C tmp lt 4 SET LANG78K SJIS lt 5 1 Because this path is specified execution format files are retrieved from folders in the order C bin C bat Cra78kor The assembler retrieves include files from the folder C ra78kOr include The linker retrieves library files from C ra78kOr lib 4 Each program creates a temporary file in C tmp Kanji 2 byte character in the comment statement is interpreted as shift JIS code 290 User s Manual U17836EJ1VOUM CHAPTER 10 EFFICIENT USE OF RA78KO0R 10 3 Interrupting Program Execution Execution of each
87. 0 error s and 0 warning s found User s Manual U17836EJ1VOUM 45 CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR Clear the screen List Conversion Program for RA78KOR Vx xx xXx xxx xxxx Copyright C NEC Electronics Corporation xxxx Passl start Pass2 start Conversion complete List Conversion Program for RA78KOR Vx xx XX xxx xxxx Copyright C NEC Electronics Corporation xxxx Passl start Pass2 start Conversion complete Clear the screen No error 2 Check the contents of drive C 46 The following files are output kOrmain rel Object module file kOrmain prn Assemble list file kOrsub rel Object module file kOrsub prm Assemble list file rasample Imf Load module file rasample map Link list file rasample hex HEX format object module file rasample sym Symbol table file kOrmain p Absolute assemble list file kOrsu p Absolute assemble list file User s Manual U17836EJ1VOUM CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR 3 Summary of RA78KOR execution procedure The following is a brief summary of the execution procedure of RA78KOR Figure 3 2 RA78KOR Execution Procedure 1 Source module file Source module file Assembler Assembler Object module file Assemble list file Assemble list file Link list file Load module file Object converter Symbol table file HEX format object module file User s Manual U1
88. 0rA lt subcommand file name Aoption a b a Be sure to add this when specifying a subcommand file b File in which subcommands are stored Remark Create the parameter file using an editor The rules for writing the content of a subcommand file are as follows Subcommand name operand data Subcommand name operand data EXIT When repeating one subcommand describe amp at the end of each line to indicate continuation Everything described from a semicolon to the end of the line will be assumed to be a comment and will not be interpreted by the librarian command If the last subcommand in a subcommand file is not the exit subcommand the librarian will automatically interpret an exit subcommand The librarian reads subcommands from the subcommand file and processes them The librarian quits after it completes processing of all subcommands in the subcommand file Example 1 Create the subcommand file kOr slb using an editor library creation command create kO0r lib add kOr lib kOrmain rel amp kOrsub rel exit User s Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN 2 Use subcommand file kOr slb to start up the librarian C gt lb78k0r kOr slb Users Manual U17836EJ1VOUM 223 CHAPTER 7 LIBRARIAN 7 3 2 Execution start and end messages 1 Execution start message When the librarian is started up an execution startup message appears on the display
89. 36EJ1VOUM 179 CHAPTER 6 OBJECT CONVERTER 4 End record i Record mark ii Fixed to 00 ii Fixed to 0000 iv Fixed to 01 v Fixedto FF 180 User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER Extended tech HEX format object module file format HEX files are composed of the following 3 types of block Data block Symbol block This is an unused block Symbol data uses the symbol table file Termination block Each block starts with a header field composed of a common 6 characters and ends with the string end ofline Maximum length of each block is 255 not including the start character and end of line The format for the common header field is shown below Table 6 3 Extended Tech Header Field Item Noon Explanation Characters p 96 1 The percent symbol specifies that the block is in extended tech format Block length 2 This is a 2 digit hexadecimal which indicates the number of characters in the block This number of characters does not include the start character and end of line Block type 1 6 Data block 3 Symbol block 8 Termination block Check sum 2 This is a 2 digit hexadecimal which indicates the remainder produced when the total value of the characters in the block except the start character 96 the check sum and end of line is divided by 256 The total value of the characters is shown in Table 6 4 Table 6 4 Character Value
90. 5 2 Linker Options Dialog Box When Output1 Tab Is Selected Linker Options Dutputl Output Library Others Load Module File o Output File Name m Browse Iv Output Symbol Information a Create Error List File e On Chip Debug Option Bytes go Security ID ai pm Iv Allow B4Kbytes Boundary ccza Command Line Options oa lmf pa map Cancel Help Load Module File o Output File Name Specify the path and file name of the load module file by using the Browse button or directly inputting a path and file name a Imf is set as an initial value Output Symbol Information g Select this option to add debug information local symbol information to the load module file Create Error List File e Select this option to output an error list file Output File Name Specify the path name and file name of the error list file by using the Browse button or directly inputting a path and file name User s Manual U17836EJ1VOUM 165 166 CHAPTER 5 LINKER On Chip Debug Option Bytes go Select this option to use the on chip debug option byte function Control Value Specify the control value for on chip debug operation For details on the control value refer to the document supplied with the ID78KOR Start Address Specify the location start address of the on chip debug program The specifiable value range is as follows 0 start address OFFFFFH
91. 66a0 kOrsub asm The following message is output to the display 78KOR Series Assembler Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx Passl Start Pass2 Start Target chip uPD78F1166 A0 Device file Vx xx Assembly complete 0 error s and 0 warning s found 4 Check the contents of drive C The assembler outputs the object module file kOrsub rel and the assemble list file KOrsub prn During assembly if the e option is specified the assembler outputs an error list file User s Manual U17836EJ1VOUM CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR b Create a directive file A directive file is a file which indicates the location of segments for the linker Create a directive file when you need to expand the default ROM RAM area or define a new memory area You will also need to create a directive file when you wish to locate segments not defined as absolute segments within a source module file to a specific address in memory During linking use the d option to enter the directive file to the linker Example To extend the ROM area 0H to 3FFFFH to OH to ED7FFH and extend the RAM area to FCFOOH to FFEFFH and RAM1 FCFOOH to FCFFFH Write the following to the directive file MEMORY ROM OH OED800H MEMORY RAM1 OFCFOOH 100H MEMORY RAM OFDOOOH 2F00H Default memory space Memory space after specification FFEFFH FFEFFH RAM
92. 7836EJ1VOUM CHAPTER 9 PROGRAM OUTPUT LIST Item Details Segment size 8 digits Segment name RA78KOR target device Device file version no Number of fatal errors Number of warnings Final error line Users Manual U17836EJ1VOUM 273 CHAPTER 9 PROGRAM OUTPUT LIST 9 1 3 Symbol list A symbol list outputs the symbols including local symbols defined in a source module Output format Symbol Table List 1 VALUE 2 ATTR 3 RTYP 4 NAME 1 VALUE 2 ATTR 3 RTYP 4 NAME CSEG CSEG CSEG CODE H EXT CONVAH DSEG DATA FFE20H ADDR HDTSA OH ADDR PUB MAIN MOD SAMPM OH ADDR PUB START FFE21H ADDR STASC H EXT _ STBEG Item Details 1 Symbol value 8 digits 2 Symbol attributes CSEG Code segment name DSEG Data segment name BSEG Bit segment name MAC Macro name MOD Module name SET Symbol defined by SET directive NUM NUMBER attribute symbol ADDR ADDRESS attribute symbol BIT BIT attribute symbol addr bit SABIT BIT attribute symbol saddr bit SFBIT BIT attribute symbol sfr bit RBIT BIT attribute symbol A bit X bit PSW bit SFR Names defined as SFRs by EQU directive SFRP Names defined as SFRPs by EQU directive Blank External reference symbol declared by EXTRN or EXTBIT Undefined symbol 3 Symbol reference format EXT External reference symbol declared by EXTRN SAD
93. 7836EJ1VOUM 47 CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR Figure 3 3 RA78KOR Execution Procedure 2 Source module file Source module file Assembler Assembler Object module file Object module file ES Assemble list file Load module file Link list file y Absolute assemble UN Absolute assemble list file list file Symbol table file HEX format object module file 48 User s Manual U17836EJ1VOUM CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR 3 3 Execution Procedure from Command Line This section explains how to execute assembly and object conversion from the command line 1 Assemble the sample program kOrmain asm Input the following on the command line C ra78kO0r cf1166a0 kOrmain asm The following message is output to the display 78KOR Series Assembler Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx Passl Start Pass2 Start Target chip uPD78F1166 A0 Device file Vx xx Assembly complete 0 error s and 0 warning s found 2 Check the contents of drive C The assembler outputs the object module file kOrmain rel and the assemble list file kOrmain prn If the e option is specified during assembly the assembler outputs an error list file a list of the lines containing assembly errors and the contents of their error messages 3 Assemble the sample program kOrsub asm Input the following on the command line C ra78kO0r cf11
94. 8 Message Option is not recognized option Cause An incorrect option is specified F5019 Message Parameter file nested Cause f option is specified in a parameter file F5020 Message Parameter file read error file name Cause An error occurred in reading a parameter file F5021 Message Memory allocation failed Cause Memory allocation has failed F5022 Message Memory allocation failed Cause Memory allocation has failed F5023 Message Illegal character before file name Cause Necessary exists before the input file F5024 Message Illegal character Cause An illegal character or character string is found F5025 Message Qualifier is not unique Cause The abbreviation type of the modifier is not unique F5026 Message Umbigous input redirect Cause No file name is specified after or file name is specified more than once C5100 Message Internal error Cause An internal error has occurred E5101 Message Invalid sub command Cause Subcommand name is incorrect E5102 Message Invalid syntax Cause Parameter specification in subcommand is incorrect E5103 Message Illegal input file different target chip file file name Cause Specification of target device in input object module file is incorrect E5104 Message Illegal library file different target chip file file name Cause Specification of target device in library file is incorrect 326 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES
95. 9 FOR ICICI RI III ICR I I ICI ICE A I I A ROO 10 10 It 11 PUBLIC MAIN START 12 12 EXTRN CONVAH 13 13 EXTRN _ STBEG 14 14 15 15 AE DATA DSEG AT OFFE20H 16 16 FFE20 HDTSA DS 1 80 User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER 3 Ih Syntax lhcharacter string Default assumption None Function The Ih option specifies the character string printed in the title column of the header of an assemble list file Application Specify the Ih option to display a title that briefly explains the contents of an assemble list file By printing the title on each page the contents of the assemble list file can be understood at a glance Explanation Up to 60 characters can be specified in the title The character string cannot include blank spaces f more than 61 characters are written the first 60 characters will be recognized and no error message will be output A kanji 2 byte character is calculated as two characters If the maximum number of characters per line is 119 or less the length of the effective character string changes as follows Effective length Max number of characters per line 60 An abort error occurs if the length of the character string is not specified If the np option is specified the Ih option is unavailable If the Ih option is omitted the title column of the assemble list file will be blank Users Manual U17836EJ1VOUM
96. ATION Explains the program file names and operating environment provided by the RA78KOR CHAPTER3 EXECUTION PROCEDURE OF RA78KOR Explains the procedure for developing software using a sample program The purpose of this chapter is to provide an opportunity for actual use of each program Those who wish to experience operating the RA78KOR should read this chapter CHAPTER4 ASSEMBLER CHAPTER 5 LINKER CHAPTER6 OBJECT CONVERTER CHAPTER7 LIBRARIAN CHAPTER 8 LIST CONVERTER CHAPTER9 PROGRAM OUTPUT LIST Explains the formats of the lists output by each program CHAPTER 10 EFFICIENT USE OF RA78KO0R Introduces some measures for optimum utilization of the RA78KOR CHAPTER 11 ERROR MESSAGES Explains the error messages output by each program APPENDIXES Introduce a list of program options a list of sample programs and a list of notices on using the RA78KOR The instruction sets are not detailed in this manual For these instructions refer to the user s manual of the microcontroller for which software is being developed User s Manual U17836EJ1VOUM 5 How to Read This Manual Those using an assembler for the first time are encouraged to read from CHAPTER 1 GENERAL of this manual Those who have a general understanding of assembler programs may skip this chapter Before using the RA78KOR read CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR After you have become familiar with the operation of each program you can proceed to utilize the lists in the APPENDI
97. An error has occurred in the contents of the directive file Contents ofkOr elk kOr dr 3 RA78KOR error E3102 Directive syntax error Users Manual U17836EJ1VOUM 145 CHAPTER 5 LINKER Library file specification 1 b Syntax bfile name Default assumption None Function The b option specifies a file to be input as a library file Application The linker retrieves the module referenced by the input module from a library file and joins only that module to the input module The purpose of a library file is to register two or more modules in a single file By creating library files that can be used in common with many programs file management and operation become easier and more efficient Specify the b option to input a library file to the linker Explanation Only adisk type file name can be specified as the file name file name cannot be omitted If a file name which includes a path name is specified a library file will be input from that path If no library file exists in the specified path an error occurs Ifa file name which does not include a path name is specified a library file will be input from a path specified by the i option or from the default search path If the b option is specified two or more times a library file will be input in a specified sequence Up to 64 b options may be specified Caution When specifying two or more libraries in th
98. BER Constant value 4 digits When the symbol attribute is LABEL Address value 4 digits When the symbol attribute is a bit symbol Upper 13 bits Lower 3 bits Upper 13 bits The relative address from OFEOQOH Lower 3 bits Bit position 0 to 7 User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER 191 CHAPTER 6 OBJECT CONVERTER 6 3 Object Converter Startup 6 3 1 Methods to start object converter The following two methods can be used to start up the object converter 1 Startup from the command line X gt path name oc78k0r Aoption load module file name Aoption A a b c d e d a Current drive name b Current folder name c Object converter command file name d This contains detailed directions for the action of the object converter Enclose a path that includes a space in a pair of double quotation marks e File name of the load module to be converted If more than one object converter option is specified separate the options with a space Uppercase characters and lowercase characters are not distinguished for the object converter options For a detailed explanation of object converter options refer to 6 4 Object Converter Options Specify the file name of a path that includes a space by enclosing it in a pair of double quotation marks Example To output a HEX format object module file
99. Browse button or directly inputting a path If a path is specified a file list is displayed Files of type Specify the type of the file to be displayed on the list of files Library file name This edit box is read only It displays the file name of the library currently specified Module list in library A list of the object module files in the library currently specified is displayed ADD Add a module to an existing library file PICK lt Retrieve the specified module from an existing library file REPLACE lt gt Replace an existing library file module with the module of another object module file 248 Users Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN DELETE Delete a module from an existing library file LIST Outputs data on modules in a library file The LIST subcommand dialog box opens Table 7 4 LIST subcommand Dialog Box LIST subcommand Dutput file Output file name o Browse ET rad Output public symbol information public Cancel Help Output file name 0 Specify the path and name of the output file by using the Browse button or by directly inputting the file name Add Form Feed at end of print file If Select this option to add a page feed code FF to the end of an output file Colums per Line Iw Specify the number of characters on one line of an output file Between 76 and 260 characters can be specified Lines per Page
100. C compiler Debugging information Debugger Dedicated parallel interface In circuit emulator Users Manual U17836EJ1VOUM 29 CHAPTER 1 GENERAL 1 3 Reminders Before Program Development 1 3 1 Refer to the following before beginning program development Quantitative limits for RA78KOR 1 Quantitative limits for assembler 30 Item Quantitative Limits Number of symbols local public 65 535 symbols Number of symbols that can be output to cross reference list 65 534 symbolsote 1 Maximum marco body size referenced by one marco 1 M bytes Total size of all macro bodies 10 M bytes Number of segments in 1 file 256 segments Macros and include specifications in 1 file 10 000 Macros and include specifications in 1 include file 10 000 Relocation information ote 65 535 items Line number information 65 535 items BR CALL quasi directives in 1 file Numbers of characters on 1 line of source code Symbol length 32 767 directives 2 048 characters ete 3 256 characters Number of switch name definitiongNete 4 1 000 Character length of switch nameNete 4 31 characters Character length of segment name 8 characters Character length of module name NAME quasi directive 256 characters Number of virtual parameters in MACRO quasi directive Number of actual parameters in macro reference 16 parameters 16 parameters Number o
101. CHAPTER 6 OBJECT CONVERTER The format for the termination block is shown below Table 6 6 Termination Block Format for Extended Tech No of ASCII Field Characters Explanation Header 6 Standard header field Block type 8 Load address 2 to 17 Start address for program execution Number of characters is variable 08 8 1A 2 80 i ii iii iv v vi i Header character ii Block length 8H iii X Block type 8 ivy Check sum 1AH v Number of digits in load address vi Load address 80H User s Manual U17836EJ1VOUM 183 CHAPTER 6 OBJECT CONVERTER 3 Symbol block unused The extended Tech symbol block is data used for symbolic debugging It may be assumed to have the following characteristics Table 6 7 Symbol Block Format for Extended Tech Items Characteristics Symbol 1 to 16 uppercase and lowercase alphabets numerals period and underscore Numerals are not permitted for the start character Value Up to 64 bits 16 hexadecimal digits possible Type Address or scalar a scalar indicates any numerical value other than an address Addresses are divided into code addresses instruction addresses and data addresses addresses of data items Global local specification Indicates whether a symbol is global external reference enabled or local Section membership A section may be considered a range to which a memory name
102. CODE CSEG CSEG SAMPS MOD SAMPS CSEG CSEG ADDR 0015CH SASC ADDR 00162H SASC1 Target chip uPD78xxx Device file Vx xx Date XX XXX XXX Page Local symbol list 2 User s Manual U17836EJ1VOUM 141 CHAPTER 5 LINKER Link list format specification 1 I Syntax ll number of lines Default assumption llO No page breaks Function The ll option changes the number of lines that can be printed in 1 page in a link list file Application Specify the Il option to change the number of lines that can be printed in 1 page in a link list file Explanation The range of number of lines that can be specified with the Il option is shown below 20 lt number of lines printed on 1 page lt 32 767 An abort error occurs if a numerical value outside this range or something other than a numerical value is specified If number of lines is omitted 0 will be specified Ifthe number of lines specified is 0 no page breaks will be made If the np option is specified the Il option is unavailable 142 User s Manual U17836EJ1VOUM CHAPTER 5 LINKER Example of use To specify 20 as the number of lines per page in a link list file KOr map describe as C IK78kO0r kOrmain rel kOrsub rel s pkOr map II20 Contents of kOr map gt
103. Cause Include file paths are described in duplicate Action by User Delete the duplicate path s and retry Button OK Closes the message box Message Too many symbols for Symbol Definition Up to 30 symbols can be specified Cause A number of symbols exceeding the input range is described for the symbol definition Action by User Keep the number of symbols to within the usable range and retry Button OK Closes the message box Message Too many characters for Symbol Definition Up to 31 characters can be described for symbol name Cause The length of the defined symbol is greater than the number of characters in the input range Action by User Keep the number of characters of the symbol to within the range and retry Button OK Closes the message box Message Multiple symbol definition symbol Cause A symbol is described in duplicate for the symbol definition Action by User Delete the duplicate symbol and retry Button OK Closes the message box 334 User s Manual U17836EJ1V0UM CHAPTER 11 ERROR MESSAGES Error Type Error Message Message Invalid word symbol definition symbol Cause An illegal character is used for symbol definition Action by User Define the symbol using an appropriate character Button Message Cause Action by User OK Closes the message box Can t set options to source file name If a common option is reflected on an individual
104. DR attribute EXTB External reference symbol declared by EXTBIT sadar bit PUB External reference symbol declared by PUBLIC Blank Local symbol segment name macro name module name ar Undefined symbol 4 Defined symbol name 274 User s Manual U17836EJ1VOUM CHAPTER 9 PROGRAM OUTPUT LIST 9 1 4 Cross reference list A cross reference list outputs data indicating where on what line symbols are defined in a source module Output format Cross Reference List 1 NAME 2 VALUE 3 R 4 ATTR 5 RTYP 6 SEGNAME 7 XREFS CSEG CSEG CSEG 22 CODE CSEG CODE 19 CONVAH E EXT 12 31 DATA DSEG DATA 15 HDTSA FFE20 ADDR DATA 16 28 29 MAIN 0 ADDR PUB CODE 11Q 204 SAMPM MOD 2 START 0 R ADDR PUB CSEG 11 20 23i STASC FFE21 ADDR DATA 17 33 _ STBEG E EXT 13 26 Item Details Defined symbol name Symbol value 8 digits Relocation attributes R E Blank Relocatable symbol External symbol Absolute symbol Undefined symbol Symbol attributes CSEG DSEG BSEG MAC MOD SET NUM ADDR BIT SABIT SFBIT RBIT SFR SFRP Blank dee Code segment name Data segment name Bit segment name Macro name Module name Symbol defined by SET directive NUMBER attribute symbol ADDRESS attribute symbol BIT attribute symbol addr bit BIT attribute symbol saddr bit BIT attribute sym
105. If the no option is specified object has been u becomes unavailable nu output Error list file e output Outputs an error list If both options e and ne ne output file name file are specified at the same specification time the option specified m Makes the e option last takes precedence unavailable Parameter ffile Inputs options and Independent Options or input file name input file names from file names can specification a specified file only be input from the command line HEX format ki Intel standard HEX Independent kie specification format kie Intel extended HEX format kt Extended Tech for mat km Motorola S type for mat standard address kme Motorola S type for mat 32 bit address 358 User s Manual U17836EJ1VOUM APPENDIX C LIST OF OPTIONS Table C 3 List of Object Converter Options Interpretation Classification Format Function Relation to Other Options When Omitted Device file ypath Reads a device file Independent Note search path ME from the specified specification path File separate zf Adds an option that Independent Not separately output separately outputs output specification the boot area and for flash other areas to memory separate HEX format model files when linking of the boot area ROM program of a flash memory model is specified Help es Displays a help All other options are No display specification
106. If the start address is omitted D8H will be specified Size Specify the on chip debug program size The specifiable value range is as follows 88 size 1 024 If the size is omitted 88 bytes will be specified Caution This option cannot be specified for a device that does not have an on chip debug function Security ID gi Select this option to set a security ID ID Specify a security ID Caution This option cannot be specified for a device that does not have a security ID function Allow 64Kbytes Boundary ccza Select this option if segment relocation to the last byte of a 64 KB boundary area xFFFFH is specified Note x OH to EH Command Line Options This edit box is read only The currently set option character string is displayed User s Manual U17836EJ1VOUM CHAPTER 5 LINKER 2 Output2 tab Figure 5 3 Linker Options Dialog Box When Output2 Tab Is Selected Linker Options Output Output2 Library Others Dutput File Name amp sss Browse V Output Map List km v Output Directive File Image kd Output Public Symbol List kp Output Local Symbol List kl Add Form Feed at End of List File If Lines per Page l 0 Select mirror area M User Option Bytes ab MAA 0 mi0 C MA 1 mil Command Line Options oa Imf pa map Cancel Help Create Link Map File p Select this option to output a link list file Output File Name
107. K78KOR was started up 3 4 The environmental variable PATH User s Manual U17836EJ1VOUM 357 APPENDIX C LIST OF OPTIONS C 3 List of Object Converter Options Table C 3 List of Object Converter Options Interpretation Classification Format Function Relation to Other Options When Omitted HEX format o output Outputs a HEX If both options o and no oinput file object file name format object module are specified at the same name HEX module file file time the option specified output last takes precedence specification no No HEX format object module file is output Symboltable s output Outputs a symbol If both options s and ns sinput file file output file name table file are specified at the same name sym specification time the option specified SB Does not output a last takes precedence symbol table file Specification r Sorts HEX format If both options s and ns r of sort by objects in order of are specified at the same object address time the option specified address last takes precedence order cBE Makes the r option If the no option is specified unavailable the r option becomes unavailable Object Outputs a specified If u and nu are specified at uOFFH complement ucomplemen complement value as the same time the one specification Er gt an object code foran specified later takes address address area to precedence size which no HEX format
108. KK KKK KK SASC SASC1 Remark 1 Remark 2 Remark 3 subroutine convert ASCII code input Acc lower 4bits hex code output Acc lt ASCII code KKK KK KKK KKK ck Ck KKK KKK KK KKK KKK ck kk KKK KKK kk ck kk KK KKK KKK KKK ko kc KKK KK KKK CMP A 0AH check hex code gt 9 BC SASCI ADD A 07H bias 7 ADD A 30H bias 30 RET END This sample program is a reference program prepared for the purpose of teaching you about the functions and operation of the RA78KOR It cannot be used as an application program This sample program does not operate the default settings of the register bank selection flags RBSO RBS1 The settings for these items are therefore as follows Register bank 0 FFEF8H to FFEFFH Since the ROL4 instruction described on line marked a in the above sample program is an instruction for the 78KO Series but not supported by the 78KOR Series specification of an assembler option compati is required For details on the assembler option compati refer to 4 4 Assembler Options User s Manual U17836EJ1VOUM CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR 3 1 2 Configuration of sample program The following describes the sample program that is used as an example for the operations described below kOrmain asm Main module kOrsub asm Sub module mylib lib Library file this is not used here sample dr Directive file User s Manua
109. KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK 4 4 tat i 5 5 MESS HEX ASCII Conversion Program i 6 6 08 7 7 pk main routine 292 Users Manual U17836EJ1VOUM CHAPTER 10 EFFICIENT USE OF RA78KOR 10 5 Reducing Program Startup Time 10 5 1 Specifying control instruction in the source program Control instructions which have the same functions as the options normally specified in assembler startup can be specified in advance in the source program This eliminates the need to specify options every time the assembler is started up Example of use PROCESSOR 1166a0 Control instructions XREF Control instructions AME SAMPM ck ck ck ck ck Ck ck ck ck ck Ck Ck ck Ck Ck ck ck ck ck ck ck Ck ck ck ck ck ck cock ck ocko ck ko ck ck Ck ck ko Sk ck Mk Sk kv k ko ko ko KK r DE HEX ASCII Conversion Program T F po main routine Ck Ck ck ck ck ck ck ck KKK KKK ck Ck ck KKK kk ck kk ck ck ck kk ck kk ck kk Ck kk ko kc KKK KKK KKK 10 5 2 Using PM The options of each program of the RA78KOR are automatically saved to the project file PRJ in PM The saved options will be used for subsequent builds MAKE It is not therefore necessary to specify the options each time User s Manual U17836EJ1VOUM 293 CHAPTER 10 EFFICIENT USE OF RA78KOR 10 5 3 Creating parameter files and subcommand files When executing any of the RA78KOR s programs assembler linker object
110. KOR 146 C c RA78KOR 65 ccza LK78KOR 161 common RA78KOR 96 COMPLETE 113 create 232 Cross reference list 275 D d LK78KOR 132 d RA78KOR 95 delete 234 dr 109 E e LC78KOR 262 e LK78KOR 145 e OC78KOR 203 e RA78KOR 88 elk 109 elv 251 Environmental variable 39 290 eoc 174 era 55 Error list 277 284 285 287 Execution Procedure exit 241 44 INDEX F f LC78KOR f OC78KOR 263 204 90 f RA78KOR Fatal error 296 G g LK78KOR g RA78KOR 129 68 ga RA78KOR 69 gb LK78KOR gi LK78KOR go LK78KOR H help 240 hex 174 i LK78KOR i RA78KOR 158 156 154 147 70 INC78KOR 290 Installation 34 Intel standard HEX format 176 Internal error J j LK78KOR j RA78KOR K 296 128 67 ka RA78KOR 72 Kanji code 39 kd LK78KOR ki OC78KOR 136 206 kie OC78KOR 206 kl LK78KOR 140 km LK78KOR 134 km OC78KOR 206 kme OC78KOR 206 kp LK78KOR ks RA78KOR kt OC78KOR kx RA78KOR L LC78KOR LANG78K 290 If LB78KOR If LK78KOR If RA78KOR User s Manual U17836EJ1VOUM 138 us l4 206 1d 260 228
111. KOR 333 11 7 2 Linker LK78KOR 336 11 7 3 Object Converter OC78KOR 340 11 7 4 Librarian LB78KOR 341 11 7 5 List Converter LC78KOR 344 APPENDIX A SAMPLE PROGRAMS 345 A 1 kOrmain asm 345 A 2 kOrsub asm 346 APPENDIX B NOTES ON USE 347 APPENDIX C LIST OF OPTIONS 349 C 1 Assembler Options 350 C 2 List of Linker Options 354 C 3 List of Object Converter Options 358 C 4 List of Librarian Options 360 C 5 List of List Converter Options 361 APPENDIX D LIST OF SUBCOMMANDS 362 INDEX 363 User s Manual U17836EJ1VOUM LIST OF FIGURES Figure No Title Page 12 RA78KOR Assembler Package 15 Flow of Assembler 16 Development Process of Microcontroller Applied Products 17 Software Development Process 18 RA78KOR Assembly Process 19 Reassembly for Debugging 21 Program Development Using Existing Module 21 Procedure for Program Development Using RA78KOR 22 Creating Source Module File 23 Function of Assembler 24 Function of Linker 25 Function of Object Converter 26 Function of Librarian 27 Function of List Converter 28 Function of Debugger 29 Folder Configuration 36 Structure of Sample Program 40 RA78KOR Execution Procedure 1 47 RA78KOR Execution Procedure 2 48 I O Files of Assembler 54 Assembler Options Dialog Box 101 Assembler Options Dialog Box When Output1
112. M CHAPTER6 OBJECT CONVERTER The object converter inputs the load module file output by the RA78KOR linker all reference address data must be determined at this point It then converts this data into hexadecimal format and outputs it as an object module file The object converter also outputs the symbol data used for symbolic debugging as a symbol table file When an object converter error occurs an error message appears on the display to clarify the cause of the error Figure 6 1 I O Files of Object Converter Load module file Parameter file Object converter Symbol table file HEX format object module file Error list file Users Manual U17836EJ1VOUM 173 6 1 CHAPTER 6 OBJECT CONVERTER I O Files of Object Converter The I O files of the object converter are as shown below Table 6 1 I O Files of Object Converter Type File Name Explanation Default File Type Input files Load module Binary image files of the object codes output Imf files as a result of linking Files output by the linker Parameter files Files containing the parameters for the poc executed programs user created files Output files HEX format Files created by converting load module files hex object module into hexadecimal object format files These files are used during mask ROM development and PROM program use Symbol table Files containing the symbol data included in sym files each module of an input f
113. Manual U17836EJ1VOUM 25 CHAPTER 1 GENERAL 1 2 4 Object converter The object converter inputs the load module file output by the linker and converts the file format The resulting file is output as a HEX format object module file The object converter also outputs symbol data necessary for symbolic debugging as a symbol table file Figure 1 12 Function of Object Converter Note Device file Load module file Input Input Object Converter Output Output HEX format object module file Symbol table file Note Obtain the device file by downloading it from the following Website ODS http www necel com micro ods eng index html 26 User s Manual U17836EJ1VOUM CHAPTER 1 GENERAL 1 2 5 Librarian For convenience and ease of use a general purpose module with a clear interface may be stored in a library By creating a library multiple object modules can be stored in a single file making them easy to handle The linker incorporates a function which retrieves from the library file only the modules necessary When multiple modules are registered in a single library file the module files can be linked without the need to specify each individual module file name The librarian is the program used to create and update the library file Figure 1 13 Function of Librarian Object module files Object module files Device fileNote output by the C compiler output by the assembler Input Input Input Librarian Output Library
114. Message Operand out of range sfr Cause Operands for the SFR SFRP directives are specified exceeding the limit or an odd value is specified for the operand of the SFRP directive E2319 Message Operand out of range word Cause Operand is outside the specifiable range 0000H to OFFFFH for word Action by User Specify the operand in a specifiable range E2320 Message Operand out of range 20bit Cause Operand is outside the specifiable range 00000H to OFFFFFH for 20bit Action by User Specify the operand in a specifiable range E2321 Message Operand out of range addr20 Cause Operand is outside the specifiable range 0000H to OFFFFFH for addr20 Action by User Specify the operand in a specifiable range E2322 Message Illegal operand 2ndSFR is used as addr16 Cause The specified operand is illegal 2ndSFR is used as addr16 Action by User Modify the operand in the same manner as when addr16 is described E2323 Message Illegal operand 2ndSFR bit is used as addr16 bit Cause The specified operand is illegal 2ndSFR bit is used as addr16 bit Action by User Modify the operand in the same manner as when addr16 is described E2324 Message Illegal operand SFR can t be used as addr16 Cause The specified operand is illegal SFR cannot be used as addr16 Action by User Describe the operand with SFR E2325 Message Illegal operand SFR bit can t be used as addr16 bit Cause The specified operand is illegal SFR bit cannot be used
115. OR assembler package can be used from the command prompt User s Manual U17836EJ1VOUM 33 CHAPTER 2 PRODUCT OUTLINE AND INSTALLATION 2 2 Installation The procedure for installing to the host machine the files provided in the RA78KOR s supply media is described below 1 2 34 Starting up Windows Power on the host machine and peripherals and start Windows Set supply media Set the RA78KOR s supply media in the appropriate drive CD ROM drive of the host machine The setup programs will start automatically Perform the installation by following the messages displayed in the monitor Screen Caution If the setup program does not start automatically execute SETUP EXE in the RA78KOR DISK1 folder Confirmation of files Using Windows Explorer etc check that the files contained in the RA78KOR s supply media have been installed to the host machine For the details of each folder refer to 2 4 Folder Configuration User s Manual U17836EJ1VOUM CHAPTER 2 PRODUCT OUTLINE AND INSTALLATION 2 3 Installation of Device Files Obtain the device file by downloading it from the following Website ODS http www necel com micro ods eng index html Use the device file installer to install the device files The device file installer is installed at the same time as the RA78KOR Users Manual U17836EJ1VOUM 35 CHAPTER 2 PRODUCT OUTLINE AND INSTALLATION 2 4 Folder Configuration The standard folder displ
116. ORY RAM BASE ADDRESS 3 FEO000H SIZE 4 01F00H 6 OUTPUT 7 INPUT 8 INPUT 9 BASE 10 SIZE SEGMENT SEGMENT ODULE ADDRESS 5 gap FEOOOH 01E20H DATA FFE20H 00003H 11 DSEG AT DATA SAMPM FFE20H 00003H 5 gap FFE23H 000DDH Target chip 12 uPD78xxx Device File 13 Vx xx Item Details 1 Memory space name 2 Memory area name 3 Memory area start address 5 digits 4 Memory area size 5 digits 5 Output group Displays gap for areas where nothing is located 280 6 Segment names output to load module file 7 Segment names read from object module file 8 Input module name User s Manual U17836EJ1VOUM CHAPTER 9 PROGRAM OUTPUT LIST Details Segment start address 8 digits Output input segment size 8 digits Segment type and reallocation attributes Target device for this assemble Device file version no Users Manual U17836EJ1VOUM 281 CHAPTER 9 PROGRAM OUTPUT LIST 9 2 3 Public symbol list A public symbol list outputs data on public symbols defined in an input module Output format w Public symbol list 1 MODULE 2 ATTR 3 VALUE 4 NAME SAMPM ADDR 00000H MAI ADDR 000D2H START SAMPS ADDR 000E9H CONVAH NUM FFE20H _ STBEG NUM FEOOOH _ STEND Item Details 282 1 Name of module in which public symbols are defined 2 Symbol attribu
117. Options 8 4 1 Types of list converter options The list converter options are detailed instructions for the operation of the list converter The types and explanations for list converter options are shown below Table 8 2 List Converter Options Classification Option Explanation Object module file input r Inputs an object module file specification Load module file input specification l Inputs a load module file Absolute assemble list file output 0 Specifies output of an absolute assemble list file specification Error list file output specification e Outputs an error list file ne Parameter file specification Inputs the input file name and options from a specified file Help specification Displays a help message on the display 258 User s Manual U17836EJ1VOUM CHAPTER 8 LIST CONVERTER Object module file input specification 1 r Syntax r input file name Default assumption rassemble list file name rel Function The r option specifies the input of an object module file Application When the primary name of an object module file is different from the primary name in the assemble list file or if its file type is not rel specify the r option Explanation Ifa fatal error occurs the absolute assemble list file cannot be output If only the primary name of the input file name is specified the list converter will assign the file t
118. Or lib add kOr lib kOrmain rel kOrsub rel exit When input of subcommands is finished processing of each subcommand begins When processing of one subcommand is complete appears again on the screen and the librarian waits for the next subcommand to be entered The librarian repeats this operation until the exit subcommand is entered 220 Users Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN Specify subcommand Subcommand processing Specify subcommand Subcommand processing Specify exit subcommand Exit librarian Up to 128 characters can be specified in 1 line If all the required operand data will not fit on 1 line use amp to continue specification on the next line Specification can be continued up to 15 lines Users Manual U17836EJ1VOUM 221 CHAPTER 7 LIBRARIAN 2 Startup from a subcommand file 222 A subcommand file is a file in which librarian subcommands are stored If a subcommand file is not specified when the librarian is started up multiple subcommands must be specified after the Wwe appears By creating a subcommand file these multiple subcommand files can all be processed at once A subcommand file can also be used when the same subcommand is specified repeatedly each time library formation is performed When using a subcommand file describe before the file name Start up the librarian from a subcommand file as follows X gt 1b78k
119. RAM Internal RAM DSEG BSEG Remark 1 Use a directive file to change the default address of a memory area or to specify the location of each segment written in a program Remark2 For specific examples refer to 3 3 Execution Procedure from Command Line 5 Users Manual U17836EJ1VOUM 111 CHAPTER 5 LINKER 5 4 Link Directives A link directive hereinafter referred to as a directive is a group of instructions used to perform various directions during linking such as file input usable memory area and allocation of segments Two types of directives can be used as follows The role of the directives is to Directive Type Roles Memory directives Declare addresses in the installed memory Divide memory into two or more areas Example CALLT area Internal ROM External ROM SADDR Internal RAM other than SADDR Segment location directives Segment allocation is specified by the linker The following items are specified for each segment Absolute address Specification of memory address only Create a directive file a file which describes directives using an editor and then specify the d option when the linker is started The linker then reads the directives from the file and interprets them to perform linking 112 User s Manual U17836EJ1VOUM CHAPTER 5 LINKER 5 4 1 Directive files The formats for specifying directives in a directive file are as follows Memory dire
120. SEMBLER 54 4 1 I O Files of Assembler 55 4 2 Functions of Assembler 56 4 3 Assembler Startup 57 4 3 1 Methods to start assembler 57 4 3 2 Execution start and end messages 59 4 4 Assembler Options 61 4 4 1 Types of assembler options 61 4 4 2 Order of precedence of assembler options 63 4 5 Option Settings in PM 101 4 5 1 Option setting method 101 4 5 2 Explanation of dialog box 102 4 5 3 Edit Option dialog box 108 CHAPTER 5 LINKER 109 5 1 I O Files of Linker 109 5 2 Functions of Linker 110 5 3 Memory Spaces and Memory Areas 111 User s Manual U17836EJ1VOUM 17 5 4 Link Directives 112 5 4 1 Directive files 113 5 4 2 Memory directives 115 5 4 3 Segment location directives 117 5 5 Linker Startup 120 5 5 1 Methods to start linker 120 5 5 2 Execution start and end messages 122 5 6 Linker Options 124 5 6 1 Types of linker options 124 5 6 2 Order of precedence of linker options 126 5 7 Option Settings in PM 164 5 7 1 Option setting method 164 5 7 2 Explanation of dialog box 165 5 7 3 Edit Option dialog box 172 CHAPTER 6 OBJECT CONVERTER 173 6 1 I O Files of Object Converter 174 6 2 Functions of Object Converter 175 6 2 1 Flash memory self rewriting mode support 175 6 2 2 HEX format object module files 175 6 2 3 Symbol table file 190 6 3 Object Converter Startup 192 6 3 1 M
121. Start Address for On Chip Debug Option Bytes Size for On Chip Debug Option Bytes is specified in decimal numbers Cause The specification format of the size specified for on chip debug option byte is illegal Action by User Specify the size in the correct format Button Message Cause OK Closes the message box Invalid Security ID Security ID is specified in hexadecimal numbers The specified Security ID is not in the correct format Action by User Specify the Security ID in the correct format Button OK Closes the message box Message Invalid Security ID Missing parameter Cause A Security ID has not been input Action by User Input a Security ID Button OK Closes the message box Message Too many figures for Security ID Up to 20 can be specified for Security ID Cause The specification format of the specified Security ID is incorrect Action by User Specify the Security ID in the correct format and retry Button OK Closes the message box Message Out of range The range of User Option Byte is from Oh to OFFFFFFFFh Cause The size specified for user option byte is outside the input limit range Action by User Specify a value within the limit range and retry Button OK Closes the message box Message Invalid User Option Byte Missing parameter Cause The user option byte value has not been input Action by Use
122. Temporary files are deleted when assembly is finished They are also deleted when assembly is aborted by pressing CTRL C The path in which the temporary file is to be created is determined according to the following sequence i The path specified by the t option ii The path specified by environmental variable TMP when the t option is omitted iii The current path when TMP is not set When i or ii is specified if the temporary file cannot be created in the specified path an abort error occurs Example of use To output a temporary file to folder C tmp describe as C ra78kO0r cf1166a0 kOrmain asm tC tmp 92 Users Manual U17836EJ1V0UM CHAPTER 4 ASSEMBLER Kanji code 2 byte code specification 1 zs ze zn Syntax ZzS Ze Zzn Default assumption ZS Function Kanji 2 byte character described in the comment is interpreted as the specified kanji code 2 byte code Kanjicode is interpreted as follows depending on the option ZS Shift JIS code Ze EUC code zn Not interpreted as kanji Application These options are used to specify the interpretation of the kanji code of the kanji in the comment line Explanation Ifthe zs ze and zn options are specified at the same time the one specified later takes priority The control instruction KANJICODE that functions as the zs ze and zn options can be described at the start of the sourc
123. To our customers Old Company Name in Catalogs and Other Documents On April 1 2010 NEC Electronics Corporation merged with Renesas Technology Corporation and Renesas Electronics Corporation took over all the business of both companies Therefore although the old company name remains in this document it is a valid Renesas Electronics document We appreciate your understanding Renesas Electronics website http www renesas com April 1 2010 Renesas Electronics Corporation Issued by Renesas Electronics Corporation http www renesas com Send any inquiries to http www renesas com inquiry 24 NC S AS 10 11 12 Notice All information included in this document is current as of the date this document is issued Such information however is subject to change without any prior notice Before purchasing or using any Renesas Electronics products listed herein please confirm the latest product information with a Renesas Electronics sales office Also please pay regular and careful attention to additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise is
124. VOUM CHAPTER 4 ASSEMBLER Help specification 1 Syntax Default assumption No display Function The option displays a help message Application The help message is a list of explanations of the assemble options Refer to these when executing the assembler Explanation When the option is specified all other options are unavailable To read the next part of the help message press the return key To quit the help display press any key other than the return key and then press the return key Caution This option cannot be specified on PM To reference PM help click the Help button in the Assembler Options dialog box User s Manual U17836EJ1VOUM 99 CHAPTER 4 ASSEMBLER Example of use To output a help message on the display describe as C gt ra78k0r 100 78KOR Series Assembler Vx xx xx xxx xxxx Copyright C NEC Electronics Corporation xxxx usage ra78k0r option input file option The option is as follows means omissible Ccx Select target chip x 1166a0 etc Must be specified o file no Create the object module file with the specified name Not file ne Create th rror list file with the specified name Not p file np Create the print file with the specified name Not ka nka Output the assemble list to print file Not ks nks Output the symbol
125. VOUM 189 CHAPTER 6 OBJECT CONVERTER 6 2 3 Symbol table file The symbol table file output by the object converter is input to a debugger The following is the symbol table file of the sample program 05 FF PUBLIC 1000E9CONVA 100000MAIN 01000D2START H OFFE20 GSTBEG OFCF00 GSTEND FF SAMP 02FFE20HDTSA 02FFE21STASC FF SAMPS 010015CSASC 0100162SASC1 Figure 6 5 Symbol Table File Formats Start of symbol 4 05 CR LF table Start of public FF 5 blank spaces CR LF symbol p PUBLIC Note gt Symbol Symbol Public symbol CR LF attributes value name Public symbols 5 blank spaces y FF 5 blank spaces Module name 1 CR LF Local Start of local E Symbol Symbol Local symbol CR LF symbols symbol attributes value name for each module Symbol Symbol Local symbol CR LF attributes value name FF 5 blank spaces Module name 2 CR LF Repeated in units of object modules Symbol table end mark CR Li Note Symbol attributes are the values shown below For symbol values refer to Figure 6 6 190 User s Manual U17836EJ1VOUM Value Symbol Attribute 00 Constant defined by the EQU directive 01 Label within a code segment 02 Label within a data segment 03 Bit symbol FF Module name Figure 6 6 Symbol Value Formats When the symbol attribute is NUM
126. XES Conventions The following symbols and abbreviations are used throughout this manual ys 4 Note Caution Remark Indicates that the same expression is repeated Item s in brackets can be omitted Characters enclosed in quotation marks will be listed as they appear Names of dialog boxes and Windows Characters enclosed in double quotation marks are titles of chapters paragraphs sections diagrams or tables to which the reader is asked to refer Indicates an important point or characters that are to be input in a usage example Indicates one blank space Indicates one or more blank or TAB Indicates zero or more blanks or TABs i e blanks may be omitted Indicates a break between characters Indicates continuity Indicates pressing of the Return key Indicates a footnote for item marked with Note in the text Indicates information requiring particular attention Indicates supplementary information User s Manual U17836EJ1VOUM Related Documents The documents related to this manual are listed below The related documents indicated in this publication may include preliminary versions However preliminary versions are not marked as such Document related to development tools user s manuals RA78KOR Ver 1 00 Assembler Package CC78KOR Ver 1 00 C Compiler SM System Simulator U18010E PM Ver 6 20 U17990E ID78KOR QB Ver 3 20 Integrated Debugger U17839E Caution The related d
127. achine language instruction Action by User Specify backward reference or EXTBIT declaration for the bit symbol E2406 Message Can t refer to forward bit symbol symbol name Cause Specification refers forward to a bit symbol or refers to a bit symbol in an expression E2407 Message Undefined symbol reference symbol name Cause An undefined symbol is used E2408 Message Multiple symbol definition symbol name Cause Symbol name is defined more than once E2409 Message Too many symbols in operand Cause The number of symbols written in an operand exceeds the number that can be described in 1 line E2410 Message Phase error Cause The value of the symbol changed during assemble for example an EQU symbol label changed by optimum processing of BR directive is defined in an operand E2411 Message This symbol is reserved symbol name Cause The defined symbol is a reserved word E2502 Message Illegal segment name Cause Symbol is written with an illegal segment name E2503 Message Different segment type symbol name Cause Two or more segments are defined with the same name but types are different E2504 Message Too many segment Cause Number of segments defined exceeds limit 256 User s Manual U17836EJ1VOUM 305 CHAPTER 11 ERROR MESSAGES TE Error Message E2505 Message Current segment is not exist Cause An ENDS directive was writte
128. ad module file sample Imf C gt Ic78k0r kOrmain prn Isample Imf User s Manual U17836EJ1VOUM 255 CHAPTER 8 LIST CONVERTER 2 Startup from a parameter file Use the parameter file when the data required to start up the list converter will not fit on the command line or when the same list converter option is specified repeatedly each time list conversion is performed To start up the list converter from a parameter file specify the specify parameter file option f on the command line Start up the list converter from a parameter file as follows C 1c78kO0r Ainput file name A fparameter file nam a b a Parameter file specification option b A file which includes the data required to start up the list converter Remark Create the parameter file using an editor The rules for writing the contents of a parameter file are as follows A loption Aoption A A If the input file name is omitted from the command line only 1 input file name can be specified in the parameter file The input file name can also be written after the option Write in the parameter file all list converter options and output file names that should be specified in the command line Example 1 Create the parameter file KOr plv using an editor parameter file kOrmain l1kO0r lmf ek0r elv 2 Use parameter file kOr plv to start up the list converter C 1Ic78kO0r fkOr
129. address specification E3410 Message Multiple module name definition module name in file file 1 First defined in file file 2 Cause The module name of object module file 1 and the module name of object module file 2 are the same User s Manual U17836EJ1VOUM 317 CHAPTER 11 ERROR MESSAGES Error Number Error Message W3411 Message Different REL type in file name Cause The type version of object module file is different Action by User Re assemble or re compile with the newest version E3415 Message Compiler options are mixed in file file name First defined in file file name2 Cause The same compiler optimization option should have been specified throughout the entire program but an object file with a different optimization specification was input Recompile the program with the same specification W3416 Message Multiple CAP NOCAP are in file file name option Defined first one in file file name option Cause CAP NOCAP assemble or compile options are not identical for all input object module files W3417 Message The version of tool name in file file name are more than one Used the first one in file file name Cause A discrepancy exists between each tool CC78KOR RA78KOR used until the link stage for all input object module files and the device file version W3418 Message File file name is old Can t find TOOL information Cause Thi
130. ailable the temporary file will be expanded in memory If not enough memory is available the contents of the temporary file will be written to a disk Such temporary files may be accessed later through the saved disk file Temporary files are deleted when assembly is finished They are also deleted when assembly is aborted by pressing CTRL C The path in which the temporary file is to be created is determined according to the following sequence i The path specified by the t option ii The path specified by environmental variable TMP when the t option is omitted iii The current path when TMP is not set When i or ii is specified if the temporary file cannot be created in the specified path an abort error OCCUIS Example of use To output a temporary file to folder C tmp describe as C gt Ik78k0r kOrmain rel kOrsub rel tC tmp 150 User s Manual U17836EJ1VOUM CHAPTER 5 LINKER Device file search path specification 1 y Syntax ypath name Default assumption Device files will be read from the path determined in the following order i Path registered in the device file installer ii Path by which LK78KOR was started up iii Current folder iv The environmental variable PATH Function The y option reads a device file from the specified path Application Specify a path where a device file exists Explanation If anything other than a path name is specifie
131. ame specifies the memory area to which a segment is allocated Only REGULAR can be specified as a memory area name Memory space names must be specified entirely in uppercase characters When a memory space name is omitted REGULAR is assumed to be specified Segment location destinations are determined as follows Memory Area Memory Space Segment Location Destination No specification No specification Default memory area in the REGULAR space Memory area name No specification Specified memory area in the REGULAR space This table focuses on defining the memory area to which the segment is located When the actual location address is determined if AT start address is specified the segment is allocated to a location beginning at that address For example if the memory space name REGULAR is specified for a segment with the relocation characteristic CSEG BASE the segment will be located to fit within 0000H to FFFFH Notice The location address of an input segment for which no segment location directive is specified will be determined according to the relocation characteristics specified by a segment definition directive during assembly An abort error occurs if no segment exists for which a segment name has been specified An abort error occurs if more than one segment location directive is specified for the same segment Example of Use Allocate an address for a segment SEG1 which has the
132. ameter file 55 58 109 121 174 193 251 256 PATH 290 pick 237 plk 109 plv 251 PM 101 164 210 242 266 293 333 poc 174 pra 55 prn 55 251 Public symbol list 282 Q Quantitative limits 30 R r LC78KOR 259 r OC78KOR 199 compati 98 RAM 111 REGULAR 116 118 rel 55 109 217 251 replace 235 ROM 111 S s LK78KOR 130 s OC78KOR 198 Sample program 345 Segment location directive 117 self RA78KOR 97 SEQUENT 113 sym 174 T t LB78KOR 229 t LK78KOR 150 t RA78KOR 92 TMP 290 U u OC78KOR 200 WwW w LK78KOR 152 Warning 296 User s Manual U17836EJ1VOUM y LK78KOR y OC78KOR y RA78KOR zb LK78KOR ze RA78KOR zf OC78KOR zn RA78KOR zs RA78KOR 151 207 94 User s Manual U17836EJ1VOUM 365 For further information please contact NEC Electronics Corporation 1753 Shimonumabe Nakahara ku Kawasaki Kanagawa 211 8668 Japan Tel 044 435 5111 http www necel com America NEC Electronics America Inc 2880 Scott Blvd Santa Clara CA 95050 2554 U S A Tel 408 588 6000 800 366 9782 http www am necel com Europe NEC Electronics Europe GmbH Arcadiastrasse 10 40472 D sseldorf Germany Tel 0211 65030 http www eu necel com Hanover Office Po
133. art address of the on chip debug program The range of values that can be specified for the start address is shown below 0 start address OFFFFFH If the start address is omitted D8H will be specified For details on the start address refer to the document supplied with the ID78KOR For the size specify the size of the on chip debug program The range of values that can be specified for the size is shown below 256 size 1 024 If specification of the program size is omitted 88 bytes will be specified For details of the program size refer to the document supplied with the ID78KOR An abort error occurs if anything other than a numeric value is specified for the control value start address or size If the go option is specified the control value will be located at address C3H No segments can be located at addresses 2H 3H and CEH to D7H nor an area of the program size starting from an address specified with the go option because these areas will be filled with FFH Addresses CO to C2H are secured as the user option byte area by specifying the gb option If the go option is not specified no user codes can be located at addresses C3H because these addresses are reserved User s Manual U17836EJ1VOUM including the user option byte starting from address COH CHAPTER 5 LINKER The control value to be located at address C3H can also be specified by defining the segment with relocation attributes shown below in the ass
134. assumption ne Function The e option specifies the output of an error list file The e option also specifies the output destination and output file name The ne option makes the e option unavailable Application Specify the e option to change the output destination and output file name of the error list file Explanation The file name of the error list file can be specified as a disk type file name or as a device type file name When the e option is specified and output file name is omitted the error list file name will be input file name eoc When the e option is specified and the drive name is omitted the error list file will be output to the current drive If both options e and ne are specified at the same time the option specified last takes precedence Example of use To create an error list file KOr eoc describe as C gt oc78k0r kOr Imf ekOr eoc User s Manual U17836EJ1VOUM 203 CHAPTER 6 OBJECT CONVERTER Parameter file specification 1 f Syntax ffile name Default assumption Options and input file names can only be input from the command line Function The f option specifies input of options and input file names from a specified file Application Specify the f option when the data required to start up the object converter will not fit on the command line Specify the f option to repeatedly specify the same options each time object conversion is pe
135. ata g Outputs debugging If both options g and ng g output data to a load module are specified at the same specification file time the option specified last takes precedence ng Makes the g option when the ng option is unavailable specified the public symbol list and local symbol list cannot be output regardless of specification of kp or kl Generation s area Automatically If both options s and ns ns of stack name generates stack are specified at the same decision decision public time the option specified symbols symbols last takes precedence specification ns Makes the s option unavailable Directive file dfile Specifies a particular Independent None specification rame file to be input as a directive file Link list file p output Specifies output of a If both options p and np pinput file output file name link list file are specified at the same name map specification np Makes the p option unavailable time the option specified last takes precedence 354 User s Manual U17836EJ1VOUM APPENDIX C LIST OF OPTIONS Table C 2 List of Linker Options Interpretation Classification Format Function Relation to Other Options When Omitted Link list file km Outputs a map list If both options km and km data into a link list file nkm are specified at the specification same time the option specified last takes p
136. ath name the linker will search paths in the following sequence i Path specified by the i option ii Path specified by environmental variable LIB78KOR iii The current path An abort error occurs if a library file with the specified name is not found in any of these paths Example of use To search for a library file file from path C lib describe as C gt lk78k0r kOrmain rel kOrsub rel bkOr lib iC lib Users Manual U17836EJ1VOUM 147 CHAPTER 5 LINKER Parameter file specification 1 f Syntax ffile name Default assumption Options and input file names can only be input from the command line Function The f option specifies input of linker options and the input file name from a specified file Application Specify the f option when the data required to start up the linker will not fit on the command line When you wish to repeatedly specify the same options each time assembly is performed specify those options in a parameter file and specify the f option Explanation Only a disk type file name can be specified as file name If a device type file name is specified an abort error occurs If file name is omitted an abort error occurs Nesting of parameter files is not permitted If the f option is specified within a parameter file an abort error occurs The number of characters that can be written within a parameter file is unlimited Separate options or file names w
137. ay occur and an abnormal operation may be performed Avoid this conflict by using options and environmental variables 12 When using self programming 348 The following describes notes on the tool options for self programming a Assembler If firmware for self programming is allocated outside the internal ROM area specified in the device file the RA78KO may output an error for the description of CALL 8100H This error is avoided by specifying the self option With the RA78KOR describe CALL addr20 to call firmware for self programming because CALL IxxxxxH can be described in the entire space Linker Use the zb option to create a load module file for the boot area Following the zb option specify the start address in the flash memory area To create a load module file for the flash area input the load module file for the boot area and the object module file for the flash area and relink them Allocate the object module file for the flash area at an address later than the one specified with the zb option Object Converter Input a load module file for the boot area and an object module file for the flash area relink them and input the output load module file to the OC78KOR By specifying the zf option at this time a HEX format file hxb for the boot area and a HEX format file hxf for the flash area can be separately output User s Manual U17836EJ1VOUM APPENDIX C LIST OF OPTIONS In this chap
138. ayed during installation is Program Files NEC Electronics Tools RA78KOR Vx xx on the drive where Windows is installed The configuration of the install folder is as shown below The drive and install folder may be changed during installation Install PM and the RA78KOR in the same folder The explanations in this manual assume installation to the standard folder with the default program folder name Program Files NEC Electronics Tools RA78KOR Vx xx according to the default directions of the setup program Figure 2 1 Folder Configuration Program Files NEC Electronics Tools m RAT78KORWx xbin e Folder storing programs such as the assembler m RA78KOR Vx xx doc seese Folder storing user s manual and supplementary explanations RA78KOR Vx xx hIp _ Folder storing on line help file ss RA78KOR Vx xx inc78kOr Folder storing include files RA78KOR Vx xx smp78kOr ra78kOr Folder storing sample programs 36 User s Manual U17836EJ1VOUM CHAPTER 2 PRODUCT OUTLINE AND INSTALLATION 2 5 File Organization The table below lists the contents of each folder The folder structure and file organization are the ones obtained when the installer was used Table 2 2 File Organization Folder Name File Name Description RA78KORW x xxlbin ra78kOr exe Assembler IK78kO0r exe Linker oc78k0r exe Object converter Ib78kOr exe Librarian Ic78k0r exe Librarian I
139. b78k0re exe Interface tool between library and DLL of PM environment Ib78k0rp exe Standalone start up library ra78kOr is File used by assembler 78kOrp dll DLL tool for PM 78kOr hlp Help file for starting command line text file RA78KORW x xx doc pdf User s manual and supplementary explanations RA78KOR Vx xx hlp 78kOrp chm on line help file RA78KOR Vx xx inc78kOr compati inc Include file for assembler option compati RA78KOR Vx xx ismp78kOr ra78kOr kOrmain asm Assembler sample program main routine kOrsub asm Assembler sample program subroutine ra bat Batch file for assembler sample program readme txt Explanation of sample program and batch file text file Remark Alphanumeric symbols Users Manual U17836EJ1VOUM 37 CHAPTER 2 PRODUCT OUTLINE AND INSTALLATION 2 6 Uninstallation The procedure for uninstalling the files installed to the host machine is described below 1 Windows startup Power on the host machine and peripherals and start Windows 2 Removing RA78KOR Select NEC EL RA78KOR Vx xx in Add or Remove Programs on the Control Panel 3 Confirmation of files Using Windows Explorer etc check that the files installed to the host machine have been uninstalled For the details of each folder refer to 2 4 Folder Configuration 38 User s Manual U17836EJ1VOUM CHAPTER 2 PRODUCT OUTLINE AND INSTALLATION 2 7 Environment Settings 2 7 1 Host machine The assembler package is desig
140. be written Remark If an asterisk on the startup line is not a target for itis not enclosed in Notice 82 A control instruction TITLE or TT with the same function beginning of the startup line Wild Card expansion it can be written even if as the Ih option can also be written at the ASA ITLEA A character string A ASATTA A character string A abbreviated form For information on control instructions refer to RA78KOR Assembler Package Language User s Manual User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER Example of use To print the title RA78KOR_MAINROUTINE in the header of an assemble list file KOrmain prn describe as C gt ra78kOr cf1166a0 kOrmain asm INRA78KOR_MAINROUTINE Contents of kOrmain prn gt 78KOR Series Assembler Vx xx RA78KOR_MAINROUTINE Date XX XXX xxx Page 1 l T Title Command cf1166a0 kOrmain asm 1hRA78KOR_MAINROUTINE Para file In file kOrmain asm Obj file kOrmain rel Prn file kOrmain prn Assemble list ALNO STNO ADRS OBJECT MI SOURCE STATEMENT Ak 1 2 2 NAME SAMPM 3 3 A CKCkCk ck ck ck ck k ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck k ck k k k k kk 4 4 pon i 5 5 PES HEX ASCII Conversion Program 6 6 Pa 7 7 EE main routine T User s Manual U17836EJ1VOUM 83 CHAPTER 4 ASSEMBLER 4 Iit Syntax lt number of characters
141. bed Cause Switch name exceeds limit 5 per module E2604 Message Nesting over of IF classes Cause Nesting of IF IF clauses exceeds limit 8 levels E2605 Message Needless ELSE statement exists Cause An ELSE statement exists where it is not necessary E2606 Message Needless ENDIF statement exists Cause An ENDIF statement exists where it is not necessary 306 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES TUR Error Message E2607 Message Missing ELSE or ENDIF Cause An ELSE or ENDIF statement required by IF IF clause is missing E2608 Message Missing ENDIF Cause An ENDIF statement required by IF IF clause is missing E2609 Message Illegal ELSEIF statement Cause An ELSEIF or ELSEIF statement is written after an ELSE statement E2610 Message Multiple symbol definition MACRO symbol name Cause Symbol used to define a macro name is already defined E2611 Message Illegal syntax of parameter Cause Formal parameter of a macro is incorrect E2612 Message Too many parameter Cause Number of formal parameters for a macro definition exceeds limit 16 E2613 Message Same name parameter described symbol name Cause Symbol is specified with same name as a formal parameter for a macro definition E2614 Message Can t nest macro definition Cause Macro definition cannot be nested in another macro definition E2615 Message Ill
142. bject time the option specified module file by the last takes precedence structured assembler nga Makes the ga option unavailable Include file ipath Specifies input of an Independent Path where the read path name path include file from a source file specification Fir specified path exists more path Path specified names can by the be environmental specified variable INC78KOR Assemble list p output Specifies output of an If both options p and np pinput file file output file name assemble list file It are specified at the same name prn specification also specifies the destination and file name of the output file np Makes the p option unavailable time the option specified last takes precedence User s Manual U17836EJ1VOUM APPENDIX C LIST OF OPTIONS Table C 1 Assembler Options Interpretation Classification Format Function Relation to Other Options When Omitted Assemble list ka Outputs an assemble If ks and KX are specified ka file data list into an assemble at the same time ks is specification list file ignored If both options ka and nka Makes the ka option nka both options ks and unavailable nks or both options kx and ks Outputs an assemble X are specified at the nks list followed by a same time the option symbol list into an Rind fakes le list file f assemble iist iie If the
143. bol sfr bit BIT attribute symbol A bit X bit PSW bit Names defined as SFRs by EQU directive Names defined as SFRPs by EQU directive External reference symbol declared by EXTRN or EXTBIT Undefined symbol Symbol reference format EXT EXTB PUB Blank KKK External reference symbol declared by EXTRN SADDR attribute External reference symbol declared by EXTBIT saddr bit External reference symbol declared by PUBLIC Local symbol segment name macro name module name Undefined symbol Defined symbol name Users Manual U17836EJ1VOUM 275 276 CHAPTER 9 PROGRAM OUTPUT LIST Item Details Definition reference line no Definition line XXXXX Reference line xxxxx A A 1 blank EXTRN declaration EXTBIT declaration PUBLIC declaration xxxxx User s Manual U17836EJ1VOUM CHAPTER 9 PROGRAM OUTPUT LIST 9 1 5 Error list An error list stores the error messages output when the assembler is started up Output format PASS1 Start 1 ERROR AS 2226 RA78KOR 3 error 4 E2202 5 Illegal operand 1 ERROR AS 2232 RA78KOR 3 error 4 E2202 5 Illegal operand PASS2 Start 1 ERROR AS 2226 RA78KOR 3 error 4 E2202 5 Illegal operand 1 ERROR ASM 2 29 RA78KOR 3 error 4 E2407 5 Undefined symbol reference DTSA 1 ERROR AS 2229 RA78KOR 3 error 4 E2303 5 Illegal expre
144. boot area memory area range ROM program of flash memory model On chip Specifies the on chip None Address C3H is debug option aoe debug option byte the initial value byte leone dd specified the specification address device file size Security ID Specifies a Security None A security ID is specification pues ty ID not set User option gbuser Specifies the value None Initial value set byte option set for the user in the device specification P9 41 option byte file Mirror area mi0 or Specifies the location None miO mil destinations of specification segments in the mirrored area User s Manual U17836EJ1VOUM Table C 2 List of Linker Options APPENDIX C LIST OF OPTIONS X P Interpretation Classification Format Function Relation to Other Options When Omitted 64 KB ccza Specifies whether to None ccza when boundary locate a segment to input files are location the last byte of each assembler specification 64 KB boundary output files area only nccza when nccza Makes the ccza None compiler output option unavailable file is included in input files Help Displays a help All other options are No display specification message on the unavailable display Note Device files will be read from the path determined in the following order 1 3 4 Current folder Path registered in the device file installer 1 2 Path by which L
145. box After specifying the path and the file name click the Next button to display the Subcommand dialog box 246 Users Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN 7 7 2 Explanation of dialog boxes The various items in the Library File Name dialog box and Subcommand dialog box are described below 1 Library File Name Dialog Box Figure 7 5 Library File Name Dialog Box Library File Name Library file name Specify the library file name to edit F Program Files NEC Electronics Tools RA 8KOR sample lib Browse Temporary directory t Specify the temporary directory for librarian This part can be omitted Browse Library file name Specify the name of the library file by using the Browse button or by directly inputting the file name Temporary directory t Specify the path where a temporary file is to be created by using the Browse button or directly inputting a path name Users Manual U17836EJ1VOUM 247 CHAPTER 7 LIBRARIAN 2 Subcommand Dialog Box Figure 7 6 Subcommand Dialog Box Subcommand Look in Browse Library file name F Program Files NEC Electronics FAProgram Files NEC Electronics KORMAIN rel Module list in library KORSUB rel ADD gt REPLACE lt gt DELETE Files of type LIST Object module files rel Y teca ne Lookin Specify the path where the object module file to be used as a library exists by using the
146. c Note5 Ifthe maximum number of characters that can be specified in one line of the assemble list file X is 119 this figure will be X 60 or less 2 Quantitative limits for linker Item Quantitative Limits Number of symbols local public 65 535 symbols Line number information of the same segment 65 535 items Number of segments 65 535 segments e 1 Input modules 1 024 modules Character length of memory area name 256 characters Number of memory areas 100 areas Vete Number of library files specifiable by the b option 64 files Number of include file paths specifiable by the i option 64 paths Note Including those defined by default Users Manual U17836EJ1VOUM 31 CHAPTER 1 GENERAL 1 4 Features of RA78KOR The RA78KOR has the following features 1 Macro function When the same group of instructions must be described in a source program over and over again a macro can be defined by giving a single macro name to the group of instructions By using this macro function coding efficiency and readability of the program can be increased 2 Optimize function of branch instructions BR and CALL are available as automatic branch instruction selection directives To create a program with high memory efficiency a byte branch instruction must be described according to the branch destination range of the branch instruction However it is troublesome for the programmer to describe a branch in
147. ce equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems medical equipment or systems for life support e g artificial life support devices or systems surgical implantations or healthcare intervention e g excision etc and any other applications or purposes that pose a direct threat to human life You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under
148. certain use conditions Further Renesas Electronics products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or system manufactured by you Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electr
149. ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ock ck ck ck kk ck kk Sk Sk Sk kv kx ko ko ko kk HEX ASCII Conversion Program sub routine A input condition ES E hex 2 code H output condition BC register lt ASCII 2 code KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KKK KKK KKK PUBLIC CONVAH CSEG CONVAH XOR A A ROL4 HL J hex lower code load CALL SASC OV B A Store result XOR A A ROL4 HL J hex lower code load CALL SASC OV C A Store result RET Ck Ck ck ck ck ck ck ck ck kk ck kk ck KKK KKK KKK KKK ck kk KK KKK ck kk ck kk Ck kk kk Sk kk KKK KKK KKK KKK subroutine convert ASCII code i H input Acc lower 4bits hex code output Acc lt ASCII code KKK KK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KEK KKK KKK KKK KKK KKK SASC CMP A 0AH check hex code gt 9 BC SSASC1 ADD A 07H i bras PTIH Jj SASC1 ADD A 30H bias 30H RET END 346 User s Manual U17836EJ1VOUM APPENDIX B NOTES ON USE In this chapter when using the RA78KOR note the following points 1 Device file A device file is required to execute the RA78KOR The device file is not included in the RA78KOR package and must be obtained separately Obtain the device file by downloading it from the following Website ODS http www necel com micro ods eng index html Object converter Use the object converter by specifyi
150. ck ck ck ck ck ck ck ck ck ck kk ck Sk kk Sk Sk kv kx ko ko PUBLIC MAIN START EXTRN CONVAH EXTRN _ STBEG DATA DSEG saddr HDTSA DS 1 STASC DS 2 CODE CSEG AT OH MAIN DW START CSEG START chip initialize MOVW SP _STBEG MOV HDTSA 1AH MOVW HL HDTSA set hex 2 code data in HL register CALL CONVAH convert ASCII HEX output BC register ASCII code OVW DE STASC set DE store ASCII code table OV A B OV DE A INCW DE OV Ay OV DE A BR END User s Manual U17836EJ1VOUM 41 CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR 42 kOrsub asm Subroutine gt H CONVAH KKK kk ck ck ck ck ck ck Ck KKK KKK KKK KKK KKK KK KKK KK KKK KKK KKK KEK KKK KKK ck kk ko kk ko kk kk ko kc KKK KKK NAME SAMPS ck ck ck ck Ck ck kk ck kk ck 0k ck ck ck ck ck Ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck kk ck kk ck ko ko kv ko ko ko ko ko HEX ASCII Conversion Program 2 sub routine input condition HL lt hex 2 code output condition BC register ASCII 2 code PUBLIC CONVAH CSEG XOR A A ROL4 HL hex upper code load a CALL SASC OV B A Store result OV A A ROL4 HL hex lower code load CALL SASC OV C A Store result RET KKK ck ck ck Ck Ck ck Ck ck Ck Ck KKK Ck ck Ck ck kk KKK kk ck KKK KKK KKK KKK KKK KKK KK KKK K
151. converter and list converter if all the necessary data will not fit on the command line or if the same options are specified every time the program is executed create a parameter file Also subcommands can be registered in a subcommand file in the librarian This makes object module library formation easy Example of use 1 Create a parameter file and perform assembly Contents of parameter file kOrmain pra gt parameter file kOrmain asm osample rel g psample prn Enter the following on the command line C ra78kO0r fkOrmain pra Example of use 2 Create a parameter file and perform assembly Contents of parameter file kOr slb gt library creation command create k0r lib add kOr lib kOrmain rel amp kOrsub rel exit Enter the following on the command line C gt lb78k0r lt kOr slb 294 Users Manual U17836EJ1VOUM CHAPTER 10 EFFICIENT USE OF RA78KOR 10 6 Object Module Library Formation The assembler and linker create 1 file for every 1 output module When there are many object modules therefore the number of files also increases The RA78KOR incorporates a function for collecting a number of object modules in a single file This function is called module library formation A file which forms such a library is called a library file Library files can be input to the linker Therefore when performing modular programming library files containing
152. cord is repeated here 1 Data record i ii iii iv v vi i Record mark Indicates beginning of record ii Code number 2 digits Number of bytes in the code stored in the record A maximum of 16 bytes can be stored iii Location address offset The start address offset of the code displayed in the record is shown as a 4 digit hexadecimal iv Record type 2 digits Fixed at 00 v Code Max 32 digits The object code is shown one byte at a time with the upper 4 bits and lower 4 bits separated A maximum of 16 bytes can be expressed in the code vi Check sum 2 digits A value is input subtracting in order from 0 which counts down the data from the code number to the code 176 Users Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER 2 Endrecord i iii iv Record mark Indicates beginning of record Code number Fixed at 00 Fixed at 0000 Record type Fixed at 01 Check sum Fixed at FF User s Manual U17836EJ1VOUM 177 CHAPTER 6 OBJECT CONVERTER Intel extended HEX format object module file format Figure 6 3 Intel Extended Format Start address record Extended address record Data record 1 Note Extended address record Data record Data record j End record Note The extended address record and data record are repeated here 1 Extended address record i ii
153. correct path name Users Manual U17836EJ1VOUM 321 CHAPTER 11 ERROR MESSAGES Rate Error Message F4012 Message Missing parameter option Cause A necessary parameter has not been specified Action by User Specify the parameter F4013 Message Parameter not needed option Cause An unnecessary parameter has been specified Action by User Delete the unnecessary parameter F4014 Message Out of range option Cause The specified numerical value is outside the range Action by User Specify a correct numerical value F4015 Message Parameter is too long option Cause The number of characters in the parameter exceeds the limit Action by User Specify a parameter whose character number is within the limit F4016 Message Illegal parameter option Cause The syntax of the parameter is incorrect Action by User Specify a correct parameter F4017 Message Too many parameters option Cause The total number of parameters exceeds the limit Action by User Specify parameters within the number limit F4018 Message Option is not recognized option Cause The option name is incorrect Action by User Specify a correct option name F4019 Message Parameter file nested Cause The f option has been specified inside a parameter file Action by User Do not specify the f option inside a parameter file F4020 Message Parameter file read
154. correct path name F6012 Message Missing parameter option Cause A necessary parameter has not been specified Specify the parameter User s Manual U17836EJ1VOUM 329 CHAPTER 11 ERROR MESSAGES Rate Error Message F6013 Message Parameter not needed option Cause An unnecessary parameter has been specified Action by User Delete the unnecessary parameter F6014 Message Out of range option Cause The specified numerical value is outside the range Action by User Specify a correct numerical value F6015 Message Parameter is too long option Cause The number of characters in the parameter exceeds the limit Action by User Specify a parameter whose character number is within the limit F6016 Message Illegal parameter option Cause The syntax of the parameter is incorrect Action by User Specify a correct parameter F6017 Message Too many parameters option Cause The total number of parameters exceeds the limit Action by User Specify parameters within the number limit F6018 Message Option is not recognized option Cause The option name is incorrect Action by User Specify a correct option name F6019 Message Parameter file nested Cause The f option has been specified inside a parameter file Action by User Do not specify the f option inside a parameter file F6020 Message Parameter file read er
155. cro Cause 2 or more segments are found in an include file macro body rept endm block or irp endm block W2701 Message Too long source line Cause Over 2048 characters are described on 1 line of a source statement Program 2049th and subsequent characters are ignored processing W2702 Message Duplicate PROCESSOR option and control Cause Command line specification option for target device c and PROCESSOR directive in source header are both specified Program Command line specification option for target device c is available and processing PROCESSOR directive in source header is ignored W2703 Message Multiple defined module name Cause NAME directive is defined 2 or more times Program NAME directive is unavailable and the already defined module name is available processing W2704 Message Already declared EXTRN symbol symbol name Cause This symbol is already declared EXTRN Action by User Specify EXTRN declaration once in 1 module W2705 Message Already declared EXTBIT symbol symbol name Cause This symbol is already declared EXTBIT Action by User Specify EXTBIT declaration once in 1 module W2706 Message Missing END statement Cause END statement is not written at end of source file Program Assumes that END statement is described at end of source file processing W2707 Message Illegal statement after END directive Cause Item other than comment space tab or CR code is described after END statement Program Ignores everything after
156. ct the HEX format Intel standard HEX format ki Intel extended HEX format kie Extended Tech format kt Motorola S type format standard address km Motorola S type format 32 bit address kme of the object to be output Caution This option cannot be specified for a device that does not have a memory bank function Divide HEX File for the Product with Flash ROM zf Select this option to output the boot area and other areas of a product that contains flash memory to separate HEX format files Caution Do not specify this option for a device that does not have a flash memory area self programming function Command Line Options This edit box is read only The currently set option character string is displayed User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER 2 Output2 tab Figure 6 9 Object Converter Options Dialog Box When Output2 Tab Is Selected Object Converter Options Output Output2 Others V Output File Name O O Browse Create Error List File e Command Line Options Cancel f Help Create Symbol Table File s Select this option to output a symbol table file Output File Name Specify the path and file name of a symbol table file by using the Browse button or directly inputting a path and file name Create Error List File e Select this option to output an error list file Output File Name Specify the path and file name of the error
157. ctives MEMORY memory area name start address value size memory space name Segment allocation directives MERGE segment name ATA Astart addressA memory area name specification memory space name MERGE segment name merge attribute memory area name specification memory space name A number of directives can be specified in a single directive file For details of each directive refer to 5 4 2 Memory directives and 5 4 3 Segment location directives 1 Reserved words The following words are reserved words in a directive file Reserved words cannot be used in a directive file for other meanings segment name memory area name etc Reserved Words Explanation MEMORY Specifies a memory directive MERGE Specifies a segment location directive AT Specifies a relocation attribute of a segment location directive start address SEQUENT Specifies a merge attribute of a segment location directive segments are merged COMPLETE Specifies a merge attribute of a segment location directive segments are not merged Caution Reserved words can be written in uppercase or lowercase characters but not in a mixture of the two Example MEMORY Can be used memory Can be used Memory Cannot be used 2 Symbols Uppercase and lowercase characters are distinguished when specifying segment names memory area names and memory space names 3 Numerical values To specify a numer
158. d 7F No 363 Fu Shing North Road Taipei Taiwan R O C Tel 02 2719 2377 NEC Electronics Singapore Pte Ltd 238A Thomson Road 3112 08 Novena Square Singapore 307684 Tel 6253 8311 http www sg necel com G05 12A
159. d specify the j option to output the object module file Explanation When the j option is specified the object module file will be output even if a fatal error occurs If both the j and nj options are specified at the same time the option specified last takes precedence If the no option is specified the j option is unavailable Example of use To output an object module file kOrmain rel even if a fatal error occurs describe as C gt ra78kOr cf1166a0 kOrmain asm j Users Manual U17836EJ1VOUM 67 CHAPTER 4 ASSEMBLER Debug data output specification 1 g ng Syntax g ng Default assumption 9 Function The g option specifies that debugging data local symbol data is to be added to an object module file The ng option makes the g option unavailable Application Use the g option when performing symbolic debugging of data that includes local symbol data Use the ng option in the following 3 cases i Symbolic debugging of global symbols only ii Debugging without symbols ii When only the object is required evaluation using PROM etc Explanation If both the g and ng options are specified at the same time the option specified last takes precedence The ga option takes precedence over other options regardless of the position in which it is specified If the no option is specified the g option is unavailable Notice Acontrol ins
160. d after the y option an abort error occurs Ifthe path name is omitted after the y option an abort error occurs The path from which the device file is read in the order determined as follows i Path specified by the y option ii Path registered in the device file installer iii Path by which LK78KOR was started up iv Current folder v The environmental variable PATH Example of use To specify the path for the device file as folder C 78kOr dev describe as C gt lk78k0r kOrmain rel kOrsub rel yC 78kOr dev Users Manual U17836EJ1VOUM 151 CHAPTER 5 LINKER Warning message output specification 1 w Syntax w level Default assumption w1 Function The w option specifies whether or not a warning message is output to the console Application Specify the level at which a warning message will be output Explanation If anything other than a level is specified following the w option an abort error occurs Only levels 0 1 and 2 can be specified The following output levels are available 0 No warning message is output 1 Normal warning message is output 2 Detailed warning message is output For a detailed explanation conditions under which warnings are output refer 11 3 Linker Error Messages Example of use To output a detailed warning message describe as C gt lk78k0r kOrmain rel kOrsub rel w2 152 Users Manual U17836EJ1VOUM CHAPTER 5
161. d module Binary image files of the object codes output Imf files as a result of linking Parameter files Files containing the parameters for the plv executed programs user created files Output files Absolute A list file which embeds actual addresses in p assemble list relocatable addresses and symbols in the files input file Error list files Files containing error data generated during elv converting lists 251 CHAPTER 8 LIST CONVERTER 8 2 Functions of List Converter 1 Resolving disadvantages of assemblers relocatable assemblers The list converter offers a solution to disadvantages of relocatable assembler packages by embedding the location and object codes in the assemble list file The absolute assemble list output by the list converter agrees completely with the addresses used in actual program operation The actual values of external symbols are embedded in the list Relocatable values are embedded in the list as actual values For the symbol values in symbol tables or cross reference lists the actual values are embedded in the list Example 1 and Example 2 are examples of the absolute assemble list file that can be acquired by the list converter 252 Users Manual U17836EJ1VOUM CHAPTER 8 LIST CONVERTER Example 1 Relocation data is embedded as shown below Assemble list
162. d out of range laddr16 ADDRESS Cause The specified operand is out of the specifiable range for addr16 ADDRESS attribute symbol Action by User Change the operand to one of the following within the specifiable area 1 F0000H to FFFFFH 2 Area mirrored when MAA 0 or area mirrored when MAA 1 For details on the mirror area refer to the user s manual of the device E2333 Message Operand out of range ES addr16 ADDRESS Cause The specified operand is out of the specifiable range OH to FFFFFH for ES laddr 6 ADDRESS attribute symbol Action by User Specify the operand in a specifiable range E2334 Message Operand out of range laddr16 bit ADDRESS Cause Operand is outside the specifiable range for addr16 bit Action by User Change the operand to one of the following within the specifiable area 1 F0000H to FFFFFH 2 Area mirrored when MAA 0 or area mirrored when MAA 1 For details on the mirror area refer to the user s manual of the device Users Manual U17836EJ1VOUM 303 CHAPTER 11 ERROR MESSAGES Error Number Error Message E2335 Message Operand out of range ES addr16 bit ADDRESS Cause The specified operand is out of the specifiable range OH to FFFFFH for ES laddr16 bit Action by User Specify the operand in a specifiable range E2336 Message Operand out of range addr BR or CALL Cause
163. dbielski Strasse 166 B 30177 Hanover Tel 0 511 33 40 2 0 Munich Office Werner Eckert Strasse 9 81829 M nchen Tel 0 89 92 10 03 0 Stuttgart Office Industriestrasse 3 70565 Stuttgart Tel 0 711 99 01 0 0 United Kingdom Branch Cygnus House Sunrise Parkway Linford Wood Milton Keynes MK14 6NP U K Tel 01908 691 133 Succursale Francaise 9 rue Paul Dautier B P 52180 78142 Velizy Villacoublay C dex France Tel 01 3067 5800 Sucursal en Espa a Juan Esplandiu 15 28007 Madrid Spain Tel 091 504 2787 Tyskland Filial Taby Centrum Entrance S 7th floor 18322 Taby Sweden Tel 08 638 72 00 Filiale Italiana Via Fabio Filzi 25 A 20124 Milano Italy Tel 02 667541 Branch The Netherlands Limburglaan 5 5616 HR Eindhoven The Netherlands Tel 040 265 40 10 Asia amp Oceania NEC Electronics China Co Ltd 7th Floor Quantum Plaza No 27 ZhiChunLu Haidian District Beijing 100083 P R China TEL 010 8235 1155 http www cn necel com NEC Electronics Shanghai Ltd Room 2509 2510 Bank of China Tower 200 Yincheng Road Central Pudong New Area Shanghai P R China P C 200120 Tel 021 5888 5400 http www cn necel com NEC Electronics Hong Kong Ltd 12 F Cityplaza 4 12 Taikoo Wan Road Hong Kong Tel 2886 9318 http www hk necel com Seoul Branch 11F Samik Lavied or Bldg 720 2 Yeoksam Dong Kangnam Ku Seoul 135 080 Korea Tel 02 558 3737 NEC Electronics Taiwan Lt
164. ddresses Standard addresses are composed of records SO S2 and S8 The 32 bit addresses are composed of records SO S3 and S7 Header record SO is optional and is not output A CR character is placed at the end of each S record The general formats and their meanings for each field in each record are shown below Table 6 12 General Format for Each Record Record Type General Format SO SOXXYY YYZZZZ S2 S2XXWWWWWNWDD DDZZ S3 S3XXWWWWWWWWDD DDZZ S7 S7XXWWWWWWWWZZ S8 S8XXWWWWWWZZ 186 User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER Table 6 13 Meanings of Fields Field Meaning Sn Record type XX Length of data record Number of bytes in the address hexadecimal data and check sum YY YY File name ASCII code for the input file name expressed as a hexadecimal WWWWWW WW 24th 82th bit address DD DD Hexadecimal data 1 byte of data is expressed as a 2 digit hexadecimal ZZ Check sum The lower 1 byte of complement 1 for the sum for each byte of the record length address and the hexadecimal data expressed as a 2 digit hexadecimal S2 08 QOFF11 D4520A20 AQ i ii iii iv v i Record type S2 ii Record length 8 bytes iii Load addresses 24 bit address iv Hexadecimal data v Check sum 1 SO record i Record type ii Record leng This is the n ii File name ivy Check sum th
165. does not exist Action by User Create a folder or select another folder Button OK Creates a folder and closes the message box Cancel Closes the message box Message Not make folder Cause The specified folder cannot be created Action by User Specify another folder Button OK Closes the message box Message Out of range The range of Control Value for On Chip Debug Option Bytes is from Oh to OFFh Cause A value that cannot be specified for the target device is specified for the control value for on chip debug option byte Action by User Refer to the user s manual of the device used to check the specifiable value Button OK Closes the message box 336 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES Error Type Error Message Message Invalid Control Value for On Chip Debug Option Bytes Missing parameter Cause The control value for on chip debug option byte has not been input Action by User Input the control value for on chip debug option byte Button OK Closes the message box Message Invalid Control Value for On Chip Debug Option Bytes Control Value for On Chip Debug Option Bytes is specified in hexadecimal numbers Cause The specification format of the control value specified for on chip debug option byte is illegal Action by User Specify the control value in the correct format
166. during assembly era I O files Temporary files Files created automatically by the assembler for assembly purposes Temporary files are deleted when assembly ends User s Manual U17836EJ1VOUM RAxxxxx n n 1 to 4 55 CHAPTER 4 ASSEMBLER 4 2 Functions of Assembler 1 Conversion of assembly language into machine language The assembler reads source module files and converts them from assembly language files into machine language files 56 User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER 4 3 Assembler Startup 4 3 1 Methods to start assembler The following two methods can be used to start up the assembler 1 Startup from the command line X gt path name ra78k0r Aoption source module file name Aoption A l a b c d e d a Current drive name b Current folder name c Command file name of the assembler d Enter detailed instructions for the operation of the assembler When specifying two or more assembler options separate the options with a blank space Uppercase characters and lowercase characters are not distinguished for the assembler options For a detailed explanation of assembler options refer to 4 4 Assembler Options Enclose a path that includes a space in a pair of double quotation marks e File name of source module to be assembled Specify the file name of a path that includes a space by enclosing it in a pair o
167. e The no option makes the o j and g option unavailable Application Use the o option to specify the location to which a load module file is output or to change its file name Specify the no option when performing a link only to output a link list file This will shorten link time Explanation The disk type file name and device type file name NUL and AUX can be specified as output file names Even if the o option is specified if a fatal error occurs the load module file cannot be output If output file name is omitted when the o option is specified the load module file input file name Imf will be output to the current folder If only the path name is specified in output file name input file name mf will be output to the specified path If both options o and no are specified at the same time the option specified last takes precedence Example of use To output a load module file kOr Imf describe as C gt lk78k0r kOrmain rel kOrsub rel okOr Imf Users Manual U17836EJ1VOUM 127 CHAPTER 5 LINKER Forced load module file output specification 1 j nj Syntax me nj Default assumption nj Function The j option specifies that the load module will be output even if a fatal error occurs The nj option makes the j option unavailable Application Normally when a fatal error occurs the load module file cannot be output When you wish to execute the
168. e Linker Options dialog box in PM delimit them with commas Fora detailed explanation of the method of creating library files refer to CHAPTER 7 LIBRARIAN Example of use To input a library file kOr lib describe as C gt Ik78kOr kOrmain rel bkOr lib kOrsub rel is registered in the library file 146 Users Manual U17836EJ1VOUM CHAPTER 5 LINKER Library file read path specification 1 i Syntax ipath name path name two or more path names can be specified Default assumption Path specified by environmental variable LIB78KOR Current path if no path is specified Function The i option specifies input of a library file from a specified path Application Use the i option to retrieve a library file from a certain path Explanation The i option is only available when a library file name is specified by the b option without including a path name Two or more specifications of i are possible Two or more paths can be specified by separating them with A blank space cannot be inserted before or after the Up to 10 path names can be specified per link When two or more path names are specified the linker searches for library files in the specified order Even if no library file exists in the specified path an error will not occur f path name is omitted an abort error occurs Ifa library file is specified by the b option without including a p
169. e Too large value up to 1048575 0FFFFFH Cause A value greater than 1048575 OFFFFFH is described in the directive E3116 Message Memory area Memory area name definition out of range Cause The sum of the start address and size of the memory area specified in the memory directive exceeds 1048575 OFFFFFH E3117 Message Too Many line number data up to 65535 0FFFFH in the same name segment segment Cause The maximum number of line number entries per section 65535 is exceeded E3118 Message Can t find target chip in all modules Cause The target device cannot be identified because the series common object specification option common is specified for all the input object module files Action by User Remove the unnecessary series common object specification options common E3201 Message Multiple segment definition symbol name in merge directive Cause Segment specified in the merge directive is already registered the same segment is attempted to specify allocation using multiple merge directives E3202 Message Segment type mismatch segment 1 in file segment 2 ignored Cause A segment with the same name as this segment but having the reallocation attributes of a different segment type is found F3203 Message Segment symbol name unknown segment type Cause An error exists in the segment data of the input object module file specification of link of output segments is incorrect E3204 Message Memory area space name not defined Cau
170. e debug information in the source file is illegal Action by User Execute the compiler once again F2901 Message Can t open source file file name Cause Source file cannot be opened F2902 Message Can t open parameter file file name Cause Parameter file cannot be opened F2903 Message Can t open include file file name Cause Include file cannot be opened F2904 Message Illegal include file file name Cause A drive name only path name only or a device type file name is specified as an include file name User s Manual U17836EJ1VOUM 309 CHAPTER 11 ERROR MESSAGES MEE Error Message F2905 Message Can t open overlay file file name Cause Overlay file cannot be opened Action by User Make sure the overlay file is in the same folder as the assembler execution format F2906 Message Illegal overlay file file name Cause Contents of overlay file are illegal F2907 Message Can t open object file file name Cause Object file cannot be opened Action by User Use a disk with an open area in its folder F2908 Message Can t open print file file name Cause Assemble list file cannot be opened Action by User Use a disk with an open area in its folder F2909 Message Can t open error list file file name Cause Error list file cannot be opened Action by User Use a disk with an open area in its folder F2910 Message Can
171. e file ne tdirectory km nkm kd nkd kp nkp kl nkl ll page 1f nlf s memory area ns g ng ydirectory j nj w n zbaddress godata address si size size 88 to giid gbdata mi O or 1 ccza nccza length C Electronics Corporation xxxx tion input file option llows means omissible Input option or input file name from specified file Read directive file from specified file Read library file from specified file SPY Set library file search path Create load module file with specified name Not Create link map file with specified name Not Create error list file with specified name Not Set temporary directory Output map list to link map file Not Output directive file image to link map file Not Output public symbol list to link map file Not Output local symbol list to link map file Not Specify link map file lines per pag Add Form Feed at end of the link map file Not Create stack symbol in specified memory area Not Output symbol information to load module file Not Set device file search path Create load module file if fatal error occurred Not Change warning level n 0 to 2 Create Boot file address flash start address ze Change On Chip Debug Option Bytes start address 1024 Set Security ID Set User Option Bytes Select allocation for MIRRORP segment Allocate user code to nFFFFH Not Show this message
172. e headers 271 10 User s Manual U17836EJ1VOUM 9 1 2 Assemble list 272 9 1 3 Symbol list 274 9 1 4 Cross reference list 275 9 1 5 Error list 277 9 2 Lists Output by Linker 278 9 2 1 Link list file headers 279 9 2 2 Map list 280 9 2 3 Public symbol list 282 9 2 4 Local symbol list 283 9 2 5 Error list 284 9 3 List Output by Object Converter 285 9 3 1 Error list 285 9 4 List Output by Librarian 286 9 4 1 Library data output list 286 9 5 Lists Output by List Converter 287 9 5 1 Absolute assemble list 287 9 5 2 Error list 287 CHAPTER 10 EFFICIENT USE OF RA78KOR 288 10 1 Improving Operating Efficiency EXIT Status Function 288 10 2 Preparing Development Environment Environmental Variables 290 10 3 Interrupting Program Execution 291 10 4 Making Assemble List Easy to Read 292 10 5 Reducing Program Startup Time 293 10 5 1 Specifying control instruction in the source program 293 10 5 2 Using PM 293 10 5 3 Creating parameter files and subcommand files 294 10 6 Object Module Library Formation 295 CHAPTER 11 ERROR MESSAGES 296 11 1 Overview of Error Messages 296 11 2 Assembler Error Messages 298 11 3 Linker Error Messages 312 11 4 Object Converter Error Messages 321 11 5 Librarian Error Messages 325 11 6 List Converter Error Messages 329 11 7 PM Error Messages 333 11 7 1 Assembler RA78
173. e list converter is started up are stored in an error list Output format Same as for the error list output by the assembler User s Manual U17836EJ1VOUM 287 CHAPTER 10 EFFICIENT USE OF RA78KOR This chapter introduces some methods that will help you to use the RA78KOR efficiently 10 1 Improving Operating Efficiency EXIT Status Function When any of the programs of the RA78KOR finishes processing the program stores the maximum level of errors occurring during processing as the EXIT status and returns control to the operating system The EXIT statuses are as follows Table 10 1 EXIT Statuses Processing EXIT Statuses Normal operation 0 WARNING occurs 0 FATAL ERROR occurs 1 ABORT 2 The exit status can be used to create a batch file making operation more efficient Example of use Contents of the batch file ra bat gt ra78KOR cfll66a0 kOrmain g e echo off IF ERRORLEVEL 1 GOTO ERR echo echo on ra78KOR cfll66a0 kOrsub asm g e echo off IF ERRORLEVEL 1 GOTO ERR echo echo on 1k78KOR kOrmain rel kOrsub rel ok0r lmf g echo off IF ERRORLEVEL 1 GOTO ERR echo echo on oc78KOR kOr lmf echo off IF ERRORLEVEL 1 GOTO ERR GOTO EXIT ERR echo Error occurred EXIT 288 User s Manual U17836EJ1VOUM CHAPTER 10 EFFICIENT USE OF RA78KOR To perform processing
174. e module The syntax is shown below ASAKANJICODEASJIS ASAKANJICODEAEUC ASAKANJICODEANONE For details of the control instruction refer to RA78KOR Assembler Package Language User s Manual Kanji code can also be specified by using the environmental variable LANF78K For details of the environmental variables refer to 10 2 Preparing Development Environment Environmental Variables Example of use To interprete the kanji code as EUC code describe as C gt ra78k0r kOrmain asm cf1166a0 ze User s Manual U17836EJ1VOUM 93 CHAPTER 4 ASSEMBLER Device file search path specification 1 y Syntax ypath name Default assumption Device files will be read from the path determined in the following order i Path registered in the device file installer ii Path by which RA78KOR was started up ii Current folder ivy The environmental variable PATH Function The y option reads a device file from the specified path Application Specify a path where a device file exists Explanation An abort error occurs if anything other than a path name is specified after the y option An abort error occurs if the path name is omitted after the y option The path from which the device file is read in the order determined as follows i Path specified by the y option ii Path registered in the device file installer iii Path by which RA78KOR
175. e name Cause A file input output error has occurred in the temporary file Action by User Output temporary file to another folder or create an open area in the specified disk C2921 Message Assembler internal error Cause An assembler internal error has occurred Action by User If the error cannot be resolved contact NEC Electronics or an NEC Electronics distributor F2922 Message Insufficient memory in hostmachine Cause System does not have sufficient memory to execute assembler F2923 Message Insufficient memory for macro in hostmachine Cause Memory for macro became insufficient in the middle of macro processing Action by User Reduce number of macros defined Users Manual U17836EJ1VOUM 311 CHAPTER 11 ERROR MESSAGES 11 3 Linker Error Messages Table 11 2 Linker Error Messages T Error Message F3001 Message Missing input file Cause An input file has not been specified Action by User Specify an input file F3002 Message Too many input files Cause Two or more input files have been specified Action by User Specify only one input file F3004 Message Illegal file name file name Cause Either there are illegal characters in the file name or the number of characters exceeds the limit Action by User Input a file name that has legal characters and is within the character number limit F3005 Message Illegal file specification
176. e output into a link list file If both options kd and nkd are specified at the same time the option specified last takes precedence Ifthe np option is specified the kd option is unavailable 136 User s Manual U17836EJ1VOUM CHAPTER 5 LINKER Example of use To output a link directive file into a link list file kOr map describe as C Ik78kO0r kOrmain rel kOrsub rel s dkOr dr pkOr map kd Contents of kOr map Para file Out file kOrmain lmf Map file k0r map 78KOR Series Linker Vx xx Date xx XXX Xxxx Page 1 Command kOrmain rel kOrsub rel s dkOr dr pkOr map kd Direc file kOr dr lt Directive file nam Directive MEMORY ROM E MEMORY RAM OFCFOOH 1100H MEMORY RAM EO000H 1FOOH o nj Link information 6 output segment s 9DH byte s real data 40 symbol s defined Memory map SPACE REGULAR MEMORY ROM BASE ADDRESS 00000H SIZE ED800H OUTPUT INPUT INPU BASE SIZE SEGMENT SEGMENT MODULE ADDRESS CODE 00000H 00002H CSEG ED800H Contents of directive file AT User s Manual U17836EJ1VOUM 137 CHAPTER 5 LINKER 3 kp nkp Syntax kp nkp Default assumption nkp Function The kp option outputs a public symbol list into a link list file The nkp option makes the kp option unavailable Applicatio
177. e output of a HEX format object module file The o option also specifies the output destination and output file name The no option specifies that no HEX format object module file is output Application Specify the o option to change the output destination and output file name of the HEX format object module file Specify the no option when performing an object conversion only to output a symbol table file This will shorten object conversion time Explanation Specify a disk type file name for output file name If a device type file name is specified an abort error occurs df output file name is omitted when the o option is specified the HEX format object module file input file name hex will be output to the current folder f only the path name is specified in output file name input file name hex will be output to the specified path If both options o and no are specified at the same time the option specified last takes precedence When the zf option is specified the file type is as follows File File Type Output file at boot area ROM program side hxb Output file at program side other than boot area ROM hxf Example of use To output a HEX format object module file sample hex describe as C gt oc78k0r kOr Imf osample hex Users Manual U17836EJ1VOUM 197 CHAPTER 6 OBJECT CONVERTER Symbol table file output specification 1 s ns Syntax s output
178. eA Amodule name A A Default assumption p Function The pick subcommand retrieves a specified module from an existing library file Explanation The retrieved module becomes an object module file with the file name under which it was registered in the library file If the specified module name does not exist in the library file an error occurs If an error occurs processing is interrupted However if an error occurs when two or more modules are specified the modules retrieved before the module which caused the error become available and are saved onto disk Example of use To retrieve a module m2 from a library file kOr lib describe as pick kOr lib m2 rel Before pickup kOr lib m1 m2 m3 lt After pickup gt kOr lib m1 m2 m2 m3 Users Manual U17836EJ1VOUM 237 CHAPTER 7 LIBRARIAN list Syntax list Aoption Alibrary file name A Amodule name A A Option public nopublic oAfile name Default assumption Function The list subcommand outputs data on modules in a library file Explanation Multiple options may be specified Uppercase characters and lowercase characters are not distinguished for the options 0 A device type file name can be specified as the output file name If output file name is omitted an error occurs If the file type is o
179. ectronics products are classified into the following three quality grades Standard Special and Specific The Specific quality grade applies only to NEC Electronics products developed based on a customer designated quality assurance program for a specific application The recommended applications of an NEC Electronics product depend on its quality grade as indicated below Customers must check the quality grade of each NEC Electronics product before using it in a particular application Standard Computers office equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots Special Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems life support systems and medical equipment for life support etc The quality grade of NEC Electronics products is Standard unless otherwise expressly specified in NEC Electronics data sheets or data books etc If customers wish to use NEC Electronics products in applications not intended by NEC Electronics they must contact an NEC Electronics sales representative in advance to determine NEC Electronics willingness
180. ed Function The c option specifies the device type of the target device Application Use the c option sparingly The assembler performs assembly for the target device and generates an object code for that device Explanation For the target devices that can be specified by the c option refer to the user s manual of the device used or Device Files Operating Precautions Notice The c option cannot be omitted However if a control instruction SPROCESSOR with the same function is described at the beginning of the source module command line specification can be omitted ASAPROCESSORA Adevice typeMA ASAPCA Adevice type Abbreviated form For information on control instructions refer to RA78KOR Assembler Package Language User s Manual Example of use To specify the uPD78F1166 AO as the target device describe as C ra78kO0r cf1166a0 main asm User s Manual U17836EJ1VOUM 65 CHAPTER 4 ASSEMBLER Object module file output specification 1 o no Syntax o output file name no Default assumption oinput file name rel Function The o option specifies the output of an object module file It also specifies the location to which it is output and the file name The no option makes the o j g and ga option unavailable Application Use the o option to specify the location to which an object module file is output or to change
181. ed linked and converted into objects in accordance with the execution procedures explained In this section how to run the assembler package on command line is explained 3 1 Before Executing RA78KOR 3 1 1 Sample programs Among the files stored on the system disk are kOrmain asm and kOrsub asm These files are a sample program for use in verifying the operation of the assembler package In later assembler operation these files will be input to the assembler as source program files kOrmain asm Main module kOrsub asm Sub module These programs consist of hexadecimal data converted to ASCII code The program consists of two modules a main routine and a subroutine The name of the main routine module is SAMPM and it is stored in kOrmain asm The name of the subroutine module is SAMPS and it is stored in KOrsub asm Figure 3 1 Structure of Sample Program lt kOrmain asm Main routine kOrsub asm Subroutine gt 40 User s Manual U17836EJ1VOUM CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR kOrmain asm Main routine NAME SAMPM ck ck ck ck ck Ck ck kk ck Ck Ck ck Ck ck ck ck ck ck ck ck Ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ock kk ck ko ck ko Sk Sk A kx ko ko 2 LUN HEX ASCII Conversion Program x 7 pO main routine P 2 ck ck ck ck ck Ck Ck kk ck ck ck ck Ck ck ck ck ck ck ck ck Ck ck ck ck ck
182. ed order ii If two or more i options are specified the include file is searched with the option specified later taking precedence iii X After the path specified by the i option is searched the include file is searched in the same order as the default assumption An abort error occurs if anything other than a path name is specified after i or if the path name is omitted An abort error occurs if i is used to specify 65 or more path names Example of use To read an include file from folder C sample describe as C ra78kO0r cf1166a0 kOrmain asm iC sample 70 User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER Assemble list file output specification 1 p np Syntax p output file name np Default assumption pinput file name prn Function The p option specifies output of an assemble list file It also specifies the destination and file name of the output file The np option makes the p ka ks kx lw ll Ih It and If option unavailable Application Specify the p option to change the output destination or output file name of an assemble list file Specify the np option when performing assembly only to output an object module file This will shorten assembly time Explanation A file name can be specified as a disk type file name or as a device type file name However only CON PRN NUL and AUX can be specified as device type file names
183. edence The characters following or in a parameter file are all assumed to be comments up to the line feed code LF or EOF If the f option is specified two or more times an abort error occurs Example of use 90 Perform assembly using a parameter file Set the contents of the parameter file KOrmain pra as follows parameter file kOrmain asm osample rel g cf1166a0 psample prn User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER Enter the following on the command line C gt ra78kOr fkOrmain pra User s Manual U17836EJ1VOUM 91 CHAPTER 4 ASSEMBLER Specification of path for temporary file creation 1 t Syntax tpath name Default assumption Path specified by environmental variable TMP Current path if no path is specified Function The t option specifies a path in which a temporary file is created Application Use the t option to specify the location for creation of a temporary file Explanation Only apath can be specified as a path name The path name cannot be omitted Even if a previously created temporary file exists if the file is not protected it will be overwritten As long as the required memory size is available the temporary file will be expanded in memory If not enough memory is available the contents of the temporary file will be written to a disk Such temporary files may be accessed later through the saved disk file
184. efined Item Details 1 Linker version no 2 Date of link list file creation 3 Page no 4 or 5 digits 4 Command line image 4 or 5 digits 5 Contents of parameter file 6 Output load module file name 7 Link list file name 8 Directive file name 9 Directive file contents 10 Number of segments output to load module file 11 Size of data output to load module file 12 Number of symbols output to load module file Users Manual U17836EJ1VOUM 279 9 2 2 Maplist CHAPTER 9 PROGRAM OUTPUT LIST The map list outputs data on the location of segments Output format Memory map 1 SPACE REGULAR MEMORY 2 ROM BASE ADDRESS 3 00000H SIZE 4 ED800H 6 OUTPUT 7 INPUT 8 INPUT 9 BASE 10 SIZE SEGMENT SEGMENT ODULE ADDRESS CODE 00000H 00002H 11 CSEG AT CODE SAMPM 00000H 00002H 5 gap 00002H 000BEH CSEGOBO 000COH 00004H 11 CSEG OPT_BYTE CSEG 000C4H 00059H 11 CSEG CSEG SAMPM 000C4H 00017H CSEG SAMPS 000DBH 00042H 5 gap 0011DH ED6E3H MEMORY RAM1 BASE ADDRESS 3 FCFOOH SIZE 4 01100H 6 OUTPUT 7 INPUT 8 INPUT 9 BASE 10 SIZE SEGMENT SEGMENT ODULE ADDRESS 5 gap FCFOOH 01100H MEM
185. egal syntax of local symbol Cause Specification of operand in a LOCAL directive is incorrect E2616 Message Too many local symbols Cause Number of local symbols that can be described in 1 macro body 64 is exceeded E2617 Message Missing ENDM Cause ENDM statement required by macro definition directive is missing E2618 Message Illegal syntax of ENDM Cause ENDM statement is incorrect E2619 Message Illegal defined macro Cause Referenced macro is incorrectly defined E2620 Message Illegal syntax of actual parameter Cause Specification of actual parameter of macro is incorrect E2621 Message Nesting over of macro reference Cause The limit on nesting in a macro reference 8 levels is exceeded E2622 Message Illegal syntax of EXITM Cause EXITM statement is incorrect E2623 Message Illegal operand of REPT Cause An unpermitted expression is specified in the operand of a REPT directive User s Manual U17836EJ1VOUM 307 CHAPTER 11 ERROR MESSAGES 308 VALUE Error Message E2624 Message More than RAFFFF Cause More than 65535 local symbols are replaced during macro development E2625 Message Unexpected ENDM Cause An unexpected ENDM is found E2626 Message Can t describe LOCAL outside macro definition Cause LOCAL directive is specified in a normal source statement other than a macro body E2627 Message More than two segments in this include ma
186. embler and linker create 1 file for every module they output This means that if a large number of modules are created the number of files also grows The RA78KOR therefore includes a function for collecting a number of object modules in a single file This function is called module library formation and a file which is organized as a library is called a library file A library file can be input to the linker By creating a library file consisting of modules common to many programs users can make file management and operation efficient and easy when performing modular programming Editing of library files The librarian incorporates the following editing functions for library files a Addition of modules to library files b Deletion of modules from library files c d Replacement of modules in library files Retrieval of modules from library files For detailed explanations of these functions refer to 7 5 Subcommands Output of library file data The librarian incorporates functions for the editing and output of the following items of data stored in library files a Module names b Created programs Date of registration d Date of update PUBLIC symbol data Caution The librarian performs functions 2 and 3 explained above using subcommands The librarian determines each subcommand in order while performing processing For an explanation of the operation of subcommands refer to 7 5 Subcommands User s
187. embler source Define the segment with 4 bytes in total Any segment name CSE DB DB DB DB OPT_BYTE 11H 22H 33H 44H If specification of the assembler source and specification of this option are made in duplicate this option takes precedence Example of use Embed OFFH at address C3H as a control value Reserve the area starting from the start address address 12345H up to 256 bytes as the program area C gt lk78k0r kOrmain rel goOFFH 12345H 256 User s Manual U17836EJ1VOUM 155 CHAPTER 5 LINKER Security ID specification 1 gi Syntax gisecurity ID Default assumption A security ID is not set Function Specifies a security ID Application Specify the gi option to set a security ID Explanation Specify a hexadecimal value that ends with H If any other value is specified an abort error occurs Specify a security ID within 10 bytes If the specified security ID falls short of 10 bytes the higher bits are filled with 0 The security ID is set at addresses C4H to CDH If a security ID is set no segment can be located at addresses C4H to CDH An abort error occurs if this option is specified for a device that does not have a security ID function A security ID can also be specified by defining the following relocation attribute segment in the assembler source However be sure to specify SECUR_ID as the relocation attribute of the segme
188. en specified by individual option Output File Name Specify the path and file name of the object module file by using the Browse button or directly inputting a path and file name Local Symbol Data g Select this option to add debug data local symbol data to the object module file Assembler Source Debugging Data ga Select this option to add source debug data to the object module file 102 Users Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER Create Error List File e Select this option to output an error list file When specified by common option Output Path Name Specify the path of the error list file by using the Browse button or directly inputting a path name When specified by individual option Output File Name Specify the path and file name of the error list file by using the Browse button or directly inputting a path and file name Common Object Module File common Select this option to output an object module file common to the 78KOR Series 78KO Series Compatible Macro compati Select this option to enable assembly of assembler source files generated by the 78KO Series assembler Command Line Options This edit box is read only The currently set option character string is displayed User s Manual U17836EJ1VOUM 103 CHAPTER 4 ASSEMBLER 2 Output2 tab Figure 4 4 Assembler Options Dialog Box When Output2 Tab Is Selected Assembler Options Output Dutput2 Others
189. er Tol Error Message F6001 Message Missing input file Cause An input file has not been specified Action by User Specify an input file F6002 Message Too many input files Cause Two or more input files have been specified Action by User Specify only one input file F6004 Message Illegal file name file name Cause Either there are illegal characters in the file name or the number of characters exceeds the limit Action by User Input a file name that has legal characters and is within the character number limit F6005 Message Illegal file specification file name Cause An illegal file has been specified Action by User Specify a legal file F6006 Message File not found file name Cause The specified file does not exist Action by User Specify an existent file F6008 Message File specification conflicted file name Cause An I O file name has been specified in duplicate Action by User Specify different I O file names F6009 Message Unable to make file file name Cause The specified file is write protected Action by User Release the write protection on the specified file F6010 Message Directory not found file name Cause A non existent drive and or folder has been included in the output file name Action by User Specify an existent drive and or folder F6011 Message Illegal path option Cause Other than a path name has been specified in the option that specifies the path for the parameter Action by User Specify a
190. er s Manual U17836EJ1VOUM CHAPTER 5 LINKER Example of use To reserve the stack area in memory area RAM describe as C gt lk78k0r kOrmain rel kOrsub rel s However the linker will assume that a segment of size 310H in RAM and a segment of size D8H located in the saddr area are input FFEFFH FFEF8H sias FFEF7H Segment size D8H FFE20H FFE1FH This portion FD210H to FFE1FH is Memory area EPOR 2C10H free the largest free area The following stack symbols are RAM FD20FH generated _ STBEG FE20H Segment size _ STBEG FFE20H 310H FCFOOH Users Manual U17836EJ1VOUM 131 CHAPTER 5 LINKER Directive file specification 1 d Syntax dfile name Default assumption None Function The d option specifies that a specified file is to be input as a directive file Application When you wish to define a new memory area redefine the default memory area or locate a segment to a specific address or memory area you will need to create a directive file Specify the d option to input this directive file to the linker Explanation Only disk type file names can be specified as a file name If a device type file name is specified an abort error occurs f file name is omitted an abort error occurs Nesting of directive files is not permitted The number of characters that can be specified in a directive file is unlimited An abort error occurs if the d option i
191. erter List Output by Librarian Lists Output by List Converter 270 Users Manual U17836EJ1VOUM CHAPTER 9 PROGRAM OUTPUT LIST 9 1 Lists Output by Assembler The assembler outputs the following lists Table 9 1 Lists Output by Assembler Output List File Name Output List Name Assemble list file Assemble list file headers Assemble list Symbol list Cross reference list Error list file Error list 9 1 1 Assemble list file headers The header is always output at the beginning of an assemble list file Output format 78KOR Series Assembler 1 Vx xx 2 SAMPLE_TITLE Date 3 xx xxx xxxx Page 4 1 5 SAMPLE SUBTITLE Command 6 kOrmain asm cf1166a0 Para file 73 ks kx In fine 8 kOrmain asm Obj file 9 kOrmain rel Prn file 10 kOrmain prn Item Details 1 Assembler version no 2 Title character string Character string specified by the Ih option or TITLE control instruction 3 Date of assemble list creation 4 Page no 5 Subtitle character string Character string specified by SUBTITLE control instruction 6 Command line image 7 Contents of parameter file 8 Input source module file name 9 Output object module file name 10 Assemble list file name Users Manual U17836EJ1VOUM 271 9 1 2 Assemble list CHAPTER 9 PROGRAM OUTPUT LIST The assemble list outputs the results
192. ethods to start object converter 192 6 3 2 Execution start and end messages 194 6 4 Object Converter Options 196 6 4 1 Types of object converter options 196 6 5 Option Settings in PM 210 6 5 1 Option setting method 210 6 5 2 Explanation of dialog box 211 CHAPTER 7 LIBRARIAN 216 7 1 I O Files of Librarian 217 7 2 Functions of Librarian 218 7 3 Librarian Startup 220 7 3 1 Methods to start librarian 220 7 3 2 Execution start and end messages 224 7 4 Librarian Options 225 7 4 1 Types of librarian options 225 7 5 Subcommands 231 7 5 1 Types of subcommands 231 7 5 2 Explanation of subcommands 231 7 6 Option Settings in PM 242 7 6 1 Option setting method 242 7 6 2 Explanation of dialog box 243 7 7 Method for Manipulating Library Files from PM 246 7 7 1 Method for manipulating 246 7 7 2 Explanation of dialog boxes 247 CHAPTER 8 LIST CONVERTER 250 8 1 I O Files of List Converter 251 8 2 Functions of List Converter 252 8 3 List Converter Startup 255 8 3 1 Methods to start list converter 255 8 3 2 Execution start and end messages 257 8 4 List Converter Options 258 8 4 1 Types of list converter options 258 8 5 Option Settings in PM 266 8 5 1 Option setting method 266 8 5 2 Explanation of dialog box 267 CHAPTER 9 PROGRAM OUTPUT LIST 270 9 1 Lists Output by Assembler 271 9 1 1 Assemble list fil
193. existent load module file name is specified C 0c78k0r sample Imf 78K 0R Series Object Converter Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx RA78KOR error F4006 File not found sample lmf Program aborted In the above example a non existent load module file is specified An error occurs and the object converter aborts the object conversion 194 Users Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER A non existent object converter option is specified C 0c78ko0r kOr Imf a 78KOR Series Object Converter Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx RA78KOR error F4018 Option is not recognized a Please enter OC78KOR if you want help messages Program aborted In the above example a nonexistent object converter option is specified An error occurs and the object converter aborts the object conversion When an error message is displayed and object conversion is aborted look for the cause in CHAPTER 11 ERROR MESSAGES and take action accordingly User s Manual U17836EJ1VOUM 195 CHAPTER 6 OBJECT CONVERTER 6 4 Object Converter Options 6 4 1 Types of object converter options The object converter options are detailed instructions for the operation of the object converter The types and explanations for object converter options are shown below Table 6 14 Object Converter Options
194. f rkOrsub rel kOrsub prn if errorlevel 1 set LEVEL 1 if SLEVELS 1 echo List conversion error if SLEVEL 1 goto END cls echo No error goto END ERR_BAT echo Usage ra bat chiptype echo on 44 Users Manual U17836EJ1V0UM 1 CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR Execute the batch file Specify the target device specification name and execute the verification batch program for checking the RA78KOR operation C gt ra bat f1166a0 The following message is output to the display 78KOR Series Assembler Vx xx xx xxx xxxx Copyright C NEC Electronics Corporation xxxx Passl Start Pass2 Start Target chip uPD78f1166a0 Device file Vx xx Assembly complete 0 error s and 0 warning s found 78KOR Series Assembler Vx xx xx xxx xxxx Copyright C NEC Electronics Corporation xxxx Passl Start Pass2 Start Target chip uPD78f1166a0 Device file Vx xx Assembly complete 0 error s and 0 warning s found Clear the screen 78KOR Series Linker Vx xx xx xxx xxxx Copyright C NEC Electronics Corporation xxxx Target chip uPD78f1166a0 Device file Vx xx Link complete 0 error s and 0 warning s found Clear the screen 78KOR Series Object Converter Vx xx xx xxx xxxx Copyright C NEC Electronics Corporation xxxx Target chip uPD78f1166a0 Device file Vx xx Object Conversion Complete
195. f actual parameters in IRP quasi directive 16 parameters Number of local symbols in macro body 64 symbols Total number of local symbols in expanded macro 65 535 symbols Nesting levels in macro macro reference REPT quasi directive IRP quasi directive 8 levels Number of characters specifiable by TITLE control instruction the Ih option 60 characters ote 5 Number of characters specifiable by SUBTITLE control instruction 72 characters Include file nesting levels in 1 file 8 levels Conditional assembly nesting levels 8 levels User s Manual U17836EJ1VOUM CHAPTER 1 GENERAL Item Quantitative Limits Number of include file paths specifiable by the i option 64 paths Number of symbols definable by the d option 30 symbols Note 1 Excluding the number of module names and section names Memory is used If there is no memory a file is used Note2 Information to be passed to the linker if the symbol value cannot be resolved by the assembler For example if an externally referenced symbol is to be referenced by the MOV instruction two pieces of relocation information are generated in a rel file Note3 Including CR and LF codes If more than 2048 characters are written on one line a warning message is output and the 2049th character and those that follow are ignored Note4 The switch name is set as true false by the SET RESET quasi directive and is used by IF et
196. f double quotation marks Example To output an error list file KOrmain era describe as C gt ra78kOr cf1166a0 kOrmain asm e np Users Manual U17836EJ1VOUM 57 CHAPTER 4 ASSEMBLER 2 Startup from a parameter file Use the parameter file when the data required to start up the assembler will not fit on the command line or when repeating the same assembler option for two or more assembly operations To start up the assembler from a parameter file specify the parameter file option f on the command line Start up the assembler from a parameter file as follows X ra78k0r Asource module file A fparameter file name a b a Parameter file specification option b A file which includes the data required to start up the assembler Remark Create the parameter file using an editor The rules for writing the contents of a parameter file are as follows A loption Aoption A A If the source module file name is omitted from the command line only 1 source module file name can be specified in the parameter file The source module file name can also be written after the option Write in the parameter file all assembler options and output file names specified in the command line For a detailed explanation of parameter files refer to 3 4 Using Parameter File Example 1 Create a parameter file kOrmain pra using an editor parameter file kOrmain asm osa
197. file name ns Default assumption sinput file name sym Function The s option specifies the output of a symbol table file The s option also specifies the output destination and output file name The ns option specifies that no symbol table file is output Application Specify the s option to change the output destination and output file name of the symbol table file Specify the ns option when performing an object conversion only to output a HEX format object module file This will shorten object conversion time Explanation Specify a disk type file name for output file name If a device type file name is specified an abort error occurs dfoutput file name is omitted when the s option is specified the symbol table file input file name sym will be output to the current folder f only the path name is specified in output file name input file name sym will be output to the specified path If both options s and ns are specified at the same time the option specified last takes precedence Example of use To output a symbol table file sample sym describe as C gt oc78k0r kOr Imf ssample sym 198 User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER Specification of sort by object address order 1 r nr Syntax r EPIS Default assumption r Function The r option outputs sorting of HEX format objects in order of address
198. g other than a numerical value is specified Ifthe number of lines is omitted O will be specified If the number of lines specified is 0 no page breaks will be made If the np option is specified the Il option is unavailable Notice Acontrol instruction LENGTH with the same function as the Il option can also be written at the beginning of a source module ASALENGTH For information on control instructions refer to RA78KOR Assembler Package Language User s Manual Users Manual U17836EJ1VOUM 79 CHAPTER 4 ASSEMBLER Example of use To specify 20 as the number of lines per page in an assemble list file kOrmain prn describe as C ra78kO0r cf1166a0 kOrmain asm IIl20 Contents of kOrmain prn 78KOR Series Assembler Vx xx Date XX XXX XXXX Page 1 Command cfll166a0 kOrmain asm 1120 Para file In file kOrmain asm Obj file kOrmain rel Prn file kOrmain prn Assemble list 78KOR Series Assembler Vx xx Date XX XXX XXXX Page 2 ALNO STNO ADRS OBJECT M I SOURCE STATEMENT 1 1 2 2 NAME SAMPM 3 3 Dk ck ck ck ck ck ck Ck ck Ck ck ck ck ck ck Ck ck ck ck kk ck Ck ck Sk kx kv M kx ko ko kockok 4 4 e d 5 5 HEX ASCII Conversion Program 6 6 PEE 7 j UE main routine X 8 8 78KOR Series Assembler Vx xx Date xx xxx XXxx Page 3 ALNO STNO ADRS OBJECT M I SOURCE STATEMENT 9
199. gal item is specified in the file name F5006 Message File not found file name Cause Specified input file does not exist F5007 Message Input file specification overlapped file name Cause Input file name specification is overlapped F5008 Message File specification conflicted file name Cause Input or output file name specifications overlap F5009 Message Unable to make file file name Cause Specified output file cannot be created F5010 Message Directory not found file name Cause A drive or folder which does not exist is included in the output file name F5011 Message Illegal path file name Cause An item other than a path name is specified in an option specifying the path name for a parameter F5012 Message Missing parameter option Cause Required parameter is not specified F5013 Message Parameter not needed option Cause An unnecessary parameter is specified F5014 Message Out of range option Cause Specified value is out of range F5015 Message Parameter is too long option Cause Number of characters specified in parameter exceeds limit User s Manual U17836EJ1VOUM 325 CHAPTER 11 ERROR MESSAGES E Error Message F5016 Message Illegal parameter option Cause A mistake exists in the syntax of the parameter F5017 Message Too many parameters option Cause Total number of parameters exceeds limit F501
200. gle modules Module Utilization of resources 2 CHAPTER 1 GENERAL Figure 1 6 Reassembly for Debugging m Entire program assembled again Program consisting of two or more modules Module Module ust be Only this module must be assembled again XXX Module Module Highly reliable highly versatile modules which have been previously created can be utilized for creation of another program If you accumulate such high versatility modules as software resources you can save time and labor in developing a new program Figure 1 7 Program Development Using Existing Module Module A Module B Module C Module D New module Module A New module Module D New program Users Manual U17836EJ1VOUM 21 CHAPTER 1 GENERAL 1 2 Overview of Features of RA78KOR The procedure for developing general programs appears in the following table Program development essentially flows from the assembler to the linker to the object converter The assembler linker object converter and other programs are generically referred to as the RA78KOR the assembler program is referred to as the assembler Figure 1 8 Procedure for Program Development Using RA78KOR C source module file C compiler Include file C Object module file Startup module file for the C compiler a Assembler wW module file
201. granted hereby under any patents copyrights or other intellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information When exporting the products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations Renesas Electronics has used reasonable care in preparing the information included in this document
202. h it is specified If the no option is specified the ga option is unavailable Notice A control instruction DEBUGA NODEBUGA with the same function as the ga and nga options can be written at the beginning of a source module ASADEBUGA ASANODEBUGA For information on control instructions refer to RA78KOR Assembler Package Language User s Manual Example of use To add assembler source debug data to an object module file kOrmain rel describe as C ra78kO0r cf1166a0 kOrmain asm ga User s Manual U17836EJ1VOUM 69 CHAPTER 4 ASSEMBLER Include file read path specification 1 i Syntax ipath name path name two or more path names can be specified Default assumption The include file is searched in the following sequence i Path where the source file exists ii Path specified by environmental variable INC78KOR Function The i option specifies input of an include file specified by include in a source module from a specified path Application Use the i option to retrieve an include file from a certain path Explanation Two or more path names can be specified at once by separating them with A space cannot be entered before or after the The include file specified by include is searched in the following sequence i If two or more path names are specified following the i option the include file is searched in the specifi
203. haracters is exceeded E2306 Message Illegal number Cause Incorrect numerical value is specified E2307 Message Division by zero Cause A value is divided by zero E2308 Message Too large integer Cause The value of a constant exceeds 16 bits E2309 Message Illegal bit value Cause Incorrect bit value is specified E2310 Message Bit value out of range Cause Bit value exceeds the range 0 to 7 E2311 Message Operand out of range n Cause Specified value exceeds the range n 0 to 7 E2312 Message Operand out of range byte Cause Operand is outside the specifiable range 00H to OFFH for byte Action by User Specify the operand in a specifiable range E2313 Message Operand out of range addr5 Cause Operand is outside the specifiable range 80H to BFH for addr5 User s Manual U17836EJ1VOUM 301 CHAPTER 11 ERROR MESSAGES TM UE Error Message E2315 Message Operand out of range saddr Cause Operand is outside the specifiable range OFFE20H to OFFF1FH for saddr E2316 Message Operand out of range addr20 Cause The specified operand is out of the specifiable range for addr16 00000H to OFFFFFH or out of the range 32768 to 432 767 as a result of calculation of its relative displacement from the address next to the branch directive E2317 Message Even expression expected Cause Odd number address is specified for word access E2318
204. hich specifies location data such as where in memory the machine language data and each machine language should be stored The assembly data is output as an assemble list file Figure 1 10 Function of Assembler Source module file Device fileN te Input Input Assembly language is converted into machine language Assembly YES errors Assembler Object module file Object module file is created Output List file is created Output Assemble list file Note Obtain the device file by downloading it from the following Website ODS http www necel com micro ods eng index html 24 Users Manual U17836EJ1V0UM CHAPTER 1 GENERAL 1 2 3 Linker The linker inputs the multiple object module files output by the compiler and the assembler and links them to output a single load module file linking must be performed even if only one object module file is input The linker determines the location addresses for the relocatable segments in the input modules This determines the values for the relocatable symbols and external reference symbols so that the correct values can be embedded in the load module file Figure 1 11 Function of Linker Device fijgNote Object module file Library file Directive file Input Input Input Input Load module file Link map file Note Obtain the device file by downloading it from the following Website ODS http www necel com micro ods eng index html Users
205. ia etc of the disk used to attempt to create temporary file F3906 Message Can t write map file file name Cause Data cannot be written to the link list file Action by User Check condition open capacity condition of media etc of the disk used to attempt to create link list file F3907 Message Can t write output file file name Cause Data cannot be written to the load module file Action by User Check condition open capacity condition of media etc of the disk used to attempt to create output file F3908 Message Can t access temporary file file name Cause Temporary file cannot be written Action by User Check condition open capacity condition of media etc of the disk used to attempt to create temporary file F3909 Message Can t read DEVICE FILE file device file name Cause Device file corresponding to device specified by each tool CC78KOR RA78KOR used until the link stage cannot be read Caution The address shown in address xxxxH in the messages in E3301 to E3306 are absolute addresses after segment allocation 320 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES 11 4 Object Converter Error Messages Table 11 3 Object Converter Error Messages Tol Error Message F4001 Message Missing input file Cause An input file has not been specified Action by User Specify an input file F4002 Message Too many input files Ca
206. ical constant for each item in a directive write the constant in decimal or hexadecimal form The method is the same as for source programs add H at the end for hexadecimals If A F appear at the beginning place O first Example 23H OFC80H Users Manual U17836EJ1VOUM 113 CHAPTER 5 LINKER 4 Comments When a or is written in a directive file all characters entered from that point to carriage return LF are handled as a comment If the directive file ends before a carriage return everything before the end of the file is handled as a comment Example The underlined portion is a comment DIRECTIVE FILE FOR 78F1166 AQ MEMORY MEM 40000H 10000H SECOND MEMORY AREA 114 User s Manual U17836EJ1 VOUM CHAPTER 5 LINKER 5 4 2 Memory directives A memory directive is a directive which defines a memory area name of an address in the installed memory The name of a defined memory area the memory area name is used to reference a segment location directive Up to 100 memory areas can be defined including the default memory area Syntax MEMORYAmemory area nameA A A Astart address value A sizeM Amemory space name 1 Memory area names Specify a name for the defined memory area Conditions for specification of memory area names are as follows The characters which can be used to describe a memory area name are A Z a z 0 9 _ and However a memory area name can
207. ically located to the last byte of each 64 KB boundary area If an object module file output from the compiler is input to the linker the linker automatically assumes that the nccza option is specified so no segment is located to the last byte of each 64 KB boundary area Ifthe za option is specified in the compiler relocation of a segment to the last byte of each 64 KB boundary area is enabled so specify the ccza option For details on segment relocation to the last byte of each 64 KB boundary area refer to CC78KOR C Compiler Language User s Manual Users Manual U17836EJ1VOUM 161 CHAPTER 5 LINKER Help specification 1 Syntax Default assumption No display Function The option displays a help message on the display Application The help message is a list of explanations of the linker options Refer to these when executing the linker Explanation When the option is specified all other options are unavailable Caution This option cannot be specified on PM To reference PM help click the Help button in the Linker Options dialog box 162 Users Manual U17836EJ1VOUM Example of use CHAPTER 5 LINKER To output a help message on the display describe as C Ik78ko0r 78KOR Series Linker VX XX xx xxx xx Copyright C NE usage 1k78k0r op The option is as fo ffile dfile bfile idirectory direct o file no p file np
208. ified path Application Specify a path where a device file exists Explanation If anything other than a path name is specified after the y option an abort error occurs f path name is omitted after the y option an abort error occurs The path from which the device file is read in the order determined as follows i Path specified by the y option ii Path registered in the device file installer ii Path by which OC78KOR was started up iv Current folder v The environmental variable PATH Example of use To specify the path for the device file as folder C 78kOr dev describe as C gt oc78k0r kOr Imf yC 78kOr dev Users Manual U17836EJ1VOUM 207 CHAPTER 6 OBJECT CONVERTER File separate output specification for flash memory model 1 zf Syntax Z Default assumption Not separately output Function The zf option outputs the boot area and other areas to separate HEX format files Explanation Adds an option that outputs the boot area and other areas to separate HEX format files when linking the boot area ROM program of a flash memory model is specified If the zf option is specified the output file type at the boot area ROM program side is hxb and the output file type at the side of the other programs is hxf Caution Do not specify this option for a device that does not have a flash memory area self programming function Example of use To outp
209. ify the If option to add a form feed code Explanation Ifthe np option is specified the lf option is unavailable If both options lf and nlf are specified at the same time the option specified last takes precedence Example of use To add a form feed code at the end of a link list file KOr map describe as C IK78kO0r kOrmain rel kOrsub rel pkOr map lf 144 User s Manual U17836EJ1VOUM CHAPTER 5 LINKER Error list file output specification 1 e ne Syntax e file name ne Default assumption ne Function Specify the e option to specify the output destination and file name of an error list file The ne option makes the e option unavailable Application Specify the e option to change the output destination and output file name of the error list file Explanation The file name of the error list file can be specified as a disk type file name or as a device type file name When the e option is specified and the output file name is omitted the error list file name will be input file name elk When the e option is specified and the drive name is omitted the error list file will be output to the current drive If both options e and ne are specified at the same time the option specified last takes precedence Example of use To create an error list file KOr elk describe as C IK78kO0r kOrmain rel kOrsub rel dkOr dr ekOr elk
210. ile Error list files Files containing error data generated during eoc converting objects 174 User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER 6 2 Functions of Object Converter 6 2 1 Flash memory self rewriting mode support The object converter can create separate HEX object module files in the boot area and flash area for the code located in the flash memory when the self rewriting mode of the flash memory is used To output separate HEX files specify the object converter option zf The file type is as follows Table 6 2 File Type When zf Option Is Specified File File Type Output file at boot area ROM program side hxb Output file at program side other than boot area ROM hxf 6 2 2 HEX format object module files The HEX format object module file output by the object converter can be input to a HEX loader such as a PROM programmer or a debugger The following is a HEX format object module file of a sample program 0200000080007E 1000800011201A1620F ry 1000900095FAFI E61713 0D00A000A40072AF4D8 00000001FF E9A93001421Fl E63958462B3 1809AA40073617131809A82 D020D070D30AFA8 Users Manual U17836EJ1VOUM 175 CHAPTER 6 OBJECT CONVERTER Intel standard HEX format object module file format Figure 6 2 Intel Standard Format Data record E 1 Note Data record S End record Note The data re
211. ile and specifies the output destination and output file name of the error list file The option ne makes the the e option unavailable Application Specify the e option to save an error message into a file Specify the e option to change the output destination and output file name of the error list file Explanation The error list file can be saved as a disk type file or as a device type file When the e option is specified and the output file name is omitted the error list file name will be input file name era When the e option is specified and the drive name is omitted the error list file will be output to the current folder If both the e and ne options are specified at the same time the option specified last takes precedence Example of use To create an error list file KOrmain era describe as C ra78kO0r cf1166a0 kOrmain asm ekOrmain era 78KOR Series Assembler Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx PASS1 Start kOrmain asm 31 RA78KO0R error E2202 lllegal operand PASS2 Start kOrmain asm 26 RA78KOR error E2312 Operand out of range byte kOrmain asm 31 RA78KOR error E2202 lllegal operand Target chip uPD78F1166 A0 Device file Vx xx Assembly complete 2 error s and 0 warning s found 88 User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER Contents of kOrmain era PASS1 Sta
212. ime the option specified i perau value os last takes precedence Makes the e option unavailable Library file bfile Inputs a specific file Independent None name specification as a library file User s Manual U17836EJ1VOUM 355 APPENDIX C LIST OF OPTIONS Table C 2 List of Linker Options Interpretation Classification Format Function Relation to Other Options When Omitted Library file ipath Reads a library file If a library file without a path Path specified read path name path from a specified path name is specified by the b by specification na option the i option is environmental more path unavailable variable names can LIB78KOR be specified Parameter ffile Inputs linker options Independent Options and file pame and the input file input file names specification name from a can only be specified file input from the command line Specification tpath Creates a temporary Independent Path specified of path for name file in a specified by the temporary path environmental file creation variable TMP Device file ypath Reads a device file Independent Note search path Sene from the specified specification path Warning w level Specifies whether or Independent w1 message not a warning output message is output to specification the console Link zb Specifies the first None No limitation for specification address of the flash the location of
213. ing self programming Example of use n order not to output errors for the description of CALL xxxxxH during self programming describe as C ra78k0r kOrsub asm cf1166a0 self Users Manual U17836EJ1VOUM 97 CHAPTER 4 ASSEMBLER 78K0 Series compatible macro 1 compati ncompati Syntax compati ncompati Default assumption ncompati Function The compati option enables assembly of assembler source files generated by the 78K0 Series assembler Option ncompati makes the compati option unavailable Application A fatal error E2337 will result if an attempt is made to assemble an assembler source that includes instructions for the 78KO Series which normally cannot be used for the 78KOR Series Specify the compati option to assemble assembler sources without changing the following 78KO instructions that cannot be used for the 78KOR Series 78KO instructions that cannot be used for 78KOR Series DIVUW ROR4 ROL4 ADJBA ADJBS CALLF DBNZ Explanation When the compati option is specified the RA78KOR includes file inc78kOr compati inc for the path through which ra78kOr exe is activated and performs macro conversion for 78KO instructions that cannot be used for 78KOR Series Example of use To perform macro conversion for 78KO instructions that are removed from the 78KOR series describe as C ra78kO0r kOrsub asm cf1166a0 compati 98 User s Manual U17836EJ1
214. inker The I O files of the linker are as follows Table 5 1 I O Files of Linker Type File Name Explanation Default File Type Input files Object module Binary files containing relocation data and rel files symbol data regarding machine language data and machine language location addresses Files output by the assembler Library files Files in which two or more object module files lib are included Files output by the librarian Directive files Files which contain link directives used during dr linking user created files Parameter files Files containing the parameters for the plk executed programs user created files Output files Load module Binary image files which contain all data Imf files created as a result of linking These files are input to the object converter Link list files List files which display the result of linking map Error list files Files containing error data generated during elk linking 0 files Temporary files Files created automatically by the linker for LKxxxxx n linking purposes n 1 to 3 Temporary files are deleted when linking ends User s Manual U17836EJ1VOUM CHAPTER 5 LINKER 5 2 Functions of Linker 1 110 Joining of input segments The linker determines and controls the location address of each segment The linker identifies identical segments and joins them into a single segment even if they are in separa
215. ion The o option specifies the output of an absolute assemble list file The o option also specifies the output destination and output file name Application Use the o option to change the output destination and output file name of the absolute assemble list file Explanation A file name can be specified as a disk type file name or as a device type file name However only CON PRN NUL and AUX can be specified as device type file names If the same device is specified for the file name as for the error file an abort error occurs If the output file name is omitted when the o option is specified the absolute assemble list file name will become assemble list file name p If only the primary name of the output file name is specified the list converter will assign the file type p and output the file If the drive name is omitted when the o option is specified the absolute assemble list file will be output to the current drive Example of use To create an absolute assemble list file sample p describe as C gt Ic78k0r kOrmain prn osample p IKkOr Imf Users Manual U17836EJ1VOUM 261 CHAPTER 8 LIST CONVERTER Error list file output specification 1 e ne Syntax e output file name ne Default assumption ne Function Specify the e option to specify the output of an error list file This option also specifies the output destination and output file na
216. ions Cancel 5 Help 242 User s Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN 7 6 2 Explanation of dialog box The various tabs in the Librarian Options dialog box are described below 1 Output tab Figure 7 3 Librarian Options Dialog Box When Output Tab Is Selected Librarian Options Dutput Others Library File Name B Browse m r r Command Line Options Cancel Help Library File Name Specify the name of the library file by using the Browse button or by directly inputting the file name Output list Select this option to output a list file Output File Name Specify the name and path of the list file by using the Browse button or by directly inputting the file name Output public symbol information public Select this option to add public symbol information to the list file to be output Add Eorm Feed at End of Print File If Select this option to add a page feed code FF to the end of a library file Colums per Line lw Specify the number of characters on one line of a library file Between 76 and 260 characters can be specified Users Manual U17836EJ1VOUM 243 CHAPTER 7 LIBRARIAN Lines per Page ll Specify the number of lines on one page of a library file 0 and between 20 and 32 767 lines can be specified Command Line Options This edit box is read only The currently set option character string is di
217. is given Each address in a program belongs to at least 1 section A scalar does not belong to any section The format for the symbol block is shown below Table 6 8 Symbol Block Format for Extended Tech No of ASCII i Field Characters Explanation Header 6 Standard header field Block type 3 Section 2 to 17 Section name 2 to 17 Name of the section which includes name the symbols defined in the block Number of characters is variable Section 5 to 35 Each symbol block must have 1 of this type of field This definition field may be placed before or after any number of symbol definition fields This format is shown in Table 6 9 Symbol 5 to 35 each This is a symbol definition field greater than 0 as shown in definition Table 6 10 184 Users Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER The symbols contained in a program are transferred as a symbol block Each symbol block includes a section name and a list of the symbols that belong to that section If necessary a scalar can also be included in any section A symbol in the same section can be placed in one or more blocks The formats for the section definition field and the symbol definition field in the symbol block are shown below Table 6 9 Symbol Block Section Definition Fields for Extended No of ASCII Field Characters Explanation 0 1 0 specifies that the field is a section
218. is not exist ignored Cause Segment specified in the directive does not exist E3212 Message Default segment can t allocate to memory ignored Cause The default segment cannot be allocated to the memory area Action by User Check if data of gb gi or go can be allocated to ROM area ranges E3301 Message Relocatable object code address out of range file file name segment symbol name address xxxxxH type adaressing type Cause Correction data of relocatable object code included in the input object module file is output to an address where no object code exists relocation entry address is out of range of origin data Action by User Check that symbol reference is correct E3302 Message Illegal symbol index in line number file file name segment symbol name Cause Line number data for debugging included in the input object module file is incorrect and does not correctly reference the symbol data Line number index and symbol index do not correspond E3303 Message Can t find symbol index in relocatable object code file file name segment symbol name address xxxxxH type addressing type Cause Correction data of relocatable code included in the input object module file is incorrect and does not correctly reference the symbol data Relocation entry and symbol index do not correspond Action by User Check that reference method of symbols and variables is correct E3304 Message Operand out of range file file
219. is uses the RA78KOR assembly language Source module editing editor is used to create a source module ile Assembly ss ttt An object module file is created YE N Debugging 77000 The operation of the software is checked using a hardware debugger such as an in circuit emulator S O NO YES System evaluation User s Manual U17836EJ1VOUM CHAPTER 1 GENERAL The RA78KOR is then applied to the assembly process Figure 1 5 RA78KOR Assembly Process Assembly process From editing of the source module YES Assembly errors Conversion of object to debugging User s Manual U17836EJ1VOUM 19 CHAPTER 1 GENERAL 1 1 3 Relocatable assembler The machine language translated from a source language by the assembler is stored in the memory of the microcontroller before use To do this the location in memory where each machine language instruction is to be stored must already be determined Therefore information is added to the machine language assembled by the assembler stating where in memory each machine language instruction is to be located Assemblers are broadly classified into absolute assemblers and relocatable assemblers depending on the method for determining to which addresses machine language instructions are relocated The RA78KOR employs a relocatable assembler Absolute assembler An absolute assembler locates machine language instructions asse
220. ist file Library data output list 9 4 1 Library data output list The library data output list outputs data on the modules in a library file Output format 78KOR Series librarian 1 Vx xx DATE 2 xx xxx xx PAGE 3 1 LIB FILE NAME 4 kO0r lib 5 xx xxx xx 6 0001 7 kOrmain rel 8 xx xxx xx 9 MAIN 9 START NUMBER OF PUBLIC SYMBOLS 10 2 6 0002 7 kOrsub rel 8 xx xxx xx 9 CONVAH NUMBER OF PUBLIC SYMBOLS 10 1 Item Details 1 Librarian version no 2 Date of list creation 3 Number of pages 4 Library file name 5 Date of library file creation 6 Module serial no beginning from 0001 7 Module name 8 Date of module creation 9 Public symbol name 10 Number of public symbols defined in module 286 User s Manual U17836EJ1VOUM CHAPTER 9 PROGRAM OUTPUT LIST 9 5 Lists Output by List Converter The list converter outputs the following lists Table 9 5 Lists Output by List Converter Output List File Name Output List Name Absolute assemble list file Absolute assemble list Error list file Error list 9 5 1 Absolute assemble list The absolute assemble list embeds absolute values in the assemble list and outputs the list Output format Same as for the assemble list output by the assembler 9 5 2 Error list Error messages output when th
221. ith a blank space a tab or a line feed code LF Options and input file names written in a parameter file will be expanded at the position specified for the parameter file on the command line The expanded options specified last will take precedence The characters following or in a parameter file are all assumed to be comments up to the line feed code LF or EOF If the f option is specified two or more times an abort error occurs Example of use 148 Perform link using a parameter file kOr plk Contents of the parameter file kOr plk gt parameter file kOrmain rel kOrsub rel ok0r lmf pkOr map e tC Ntmp g User s Manual U17836EJ1VOUM CHAPTER 5 LINKER Enter the following on the command line C Ik78k0r fkOr plk Users Manual U17836EJ1VOUM 149 CHAPTER 5 LINKER Specification of path for temporary file creation 1 t Syntax tpath name Default assumption Path specified by environmental variable TMP Current path if no path is specified Function The t option specifies a path in which a temporary file is created Application Use the t option to specify the location for creation of a temporary file Explanation Only apath can be specified as a path name path name cannot be omitted Even if a previously created temporary file exists if the file is not protected it will be overwritten As long as the required memory size is av
222. its file name Specify the no option when performing assembly only to output an assemble list file This will shorten assembly time Explanation The disk type file name device type file names NUL and AUX and the path name can be specified in output file name An abort error occurs when the device type file names CON and PRN are specified Even if the o option is specified if a fatal error occurs the object module file cannot be output If the drive name is omitted when the o option is specified the object module file will be output to the current drive If the output file name is omitted when the o option is specified the output file name will be input file name rel If both the o and no options are specified at the same time the option specified last takes precedence Example of use To output an object module file sample rel describe as C gt ra78kOr cf1166a0 kOrmain asm osample rel 66 User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER Forced object module file output specification 1 j nj Syntax nj Default assumption nj Function The j option specifies that the object module file can be output even if a fatal error occurs The nj option makes the j option unavailable Application Normally when a fatal error occurs the object module file cannot be output When you wish to execute the program with a notice that a fatal error has occurre
223. l U17836EJ1VOUM 43 CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR 3 2 Execution Procedure of RA78KOR The batch files ra bat in the system disk are used for the RA78KOR operation The assembler linker object converter and list converter are executed in this order using kOrmain asm and kOrsub asm which are written in assembly language in ra bat as source files If an error occurs a message is output and the batch file terminates Specification of the type of device to be used as the target is input to this batch file Obtain the device file by downloading it from the ODS The following explanation uses the uPD78F1166 AO as the target device ra bat batch program for verifying RA78KOR operation echo off cls set LEVEL 0 if 1 goto ERR BAT ra78k0r C 1 kOrmain asm if errorlevel 1 set LEVEL 1 ra78k0r C 1 kOrsub asm if errorlevel 1 set LEVEL 1 if SLEVELS 1 echo Assemble error if SLEVEL 1 goto END cls lk78k0r kOrmain rel kOrsub rel s orasample lmf prasample map if errorlevel 1 echo Link error if errorlevel 1 goto END cis oc78k0r rasample if errorlevel 1 echo Object conversion error if errorlevel 1 goto END cls set LEVEL 0 lc78k0r lrasample lmf rkOrmain rel kOrmain prn if errorlevel 1 set LEVEL 1 lc78k0r lrasample lm
224. le kOr poc using an editor parameter file kOr lmf osample hex ssample sym r 2 Use parameter file kOr poc to start up the object converter C 0c78ko0r fkOr poc User s Manual U17836EJ1VOUM 193 CHAPTER 6 OBJECT CONVERTER 6 3 2 Execution start and end messages 1 Execution start message When the object converter is started up an execution startup message appears on the display 78KO0R Series Object Converter Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx 2 Execution end message If it detects no object conversion errors resulting from the object conversion the object converter outputs the following message to the display and returns control to the operating system Target chip uPD78xxx Device file Vx xx Object Conversion Complete 0 error s and 0 warning s found If it detects an object conversion errors resulting from the object conversion the object converter outputs the error number to the display and returns control to the operating system Target chip uPD78xxx Device file Vx xx Object Conversion Complete 3 error s and 0 warning s found If the object converter detects a fatal error during object conversion which makes it unable to continue link processing the object converter outputs a message to the display cancels object conversion and returns control to the operating system Example lt A non
225. le PATH Cause The LB78KOR EXE execution format is not in the specified folder Action by User Re install the RA78KOR assembler package Button Ok Closes the message box Message Cannot find folder Will you create Cause The specified folder does not exist Action by User Create a folder or select another folder Button Ok Creates a folder and closes the message box Cancel Closes the message box Message Not make folder Cause The specified folder could not be created Action by User Specify another folder Button OK Closes the message box Users Manual U17836EJ1VOUM 341 CHAPTER 11 ERROR MESSAGES Table 11 10 Error Messages Displayed by Execution Format DLL Ib78kO0rp exe for Starting Librarian in Standalone Mode Sd Error Message Message Do not be specified library file name Cause No file name has been specified in the edit box for library file name specification Action by User Specify the correct file name Button OK Closes the message box Message Cannot find folder Will you create Cause The specified output path does not exist Action by User Create a folder or select another folder Button OK Closes the message box Message Not make folder Cause An error has occurred during folder creation in the case that creation of folders i
226. ll Specify the number of lines on one page of an output file 0 and between 20 and 32 767 lines can be specified Output public symbol information public Select this option to add public symbol information to the output file to be output Users Manual U17836EJ1VOUM 249 CHAPTER8 LIST CONVERTER The list converter inputs assemble list files and object module files output by the assembler and load module files output by the linker The list converter embeds actual addresses in the relocatable addresses and symbols in the input file and outputs an absolute assembly list This eliminates the troublesome task of looking at an assemble list while referring to a link map Figure 8 1 I O Files of List Converter Assemble list files Object module files Load module files Parameter files Fo ag Pee List converter Absolute assemble list files Error list files 250 User s Manual U17836EJ1VOUM 8 1 CHAPTER 8 LIST CONVERTER 1 0 Files of List Converter The I O files of the list converter are as shown below Table 8 1 I O Files of List Converter User s Manual U17836EJ1VOUM Type File Name Explanation Default File Type Input files Object module Binary files containing relocation data and rel files symbol data regarding machine language data and machine language location addresses Assemble list Files containing assembly data such as prn files assemble lists and cross reference lists Loa
227. ll be read from the path determined in the following order 360 1 2 3 4 Current folder Path registered in the device file installer Path by which LB78KOR was started up The environmental variable PATH User s Manual U17836EJ1VOUM APPENDIX C LIST OF OPTIONS C 5 List of List Converter Options Table C 5 List of List Converter Options PX i Interpretation lassif F Classification ormat Function Relation to Other Options When Omitted Object r input Specifies the input of Independent rassemble list module file file name an object module file file name rel input specification Load module l input Inputs a load module Independent lassemble list file input file name file file name Imf specification Absolute o output Outputs an absolute Independent oassemble assemble list ile name assemble list file list file name p file output specification Error list file e output Outputs an error list If both options e and ne ne output file name file are specified at the same specification time the option specified ne Makes the e option last takes precedence unavailable Parameter ffile Inputs options and Independent Options or input file name input file name from a file names can specification specified file only be input from the command line Help cu Displays a help All other options are No display specification mes
228. located in the mirror area when MAA O f mi1 is specified the segment is located in the mirror area when MAA 1 For details on the mirror area refer to the user s manual of the device Public symbol OMAA will be generated This is a NUMBER attribute symbol that holds 0 when mi0 is specified and holds 1 when mi1 is specified Example of use To locate the segment in the mirror area when MAA 1 describe as C gt lk78k0r kOrmain rel mi1 With a device in which a mirror area is secured at F1000H or higher address segments with CSEG MIRRORP are located at address 11000H and higher Example of use with startup routine provided by the compiler MOVW PMC _ MAA In this case 1 is stored in PMC 160 User s Manual U17836EJ1VOUM CHAPTER 5 LINKER 64 KB boundary location specification 1 ccza Syntax ccza Doeozz a Default assumption ccza when input files are assembler output files only nccza when compiler output file is included in input files Function The ccza option specifies whether to locate a segment to the last byte xFFFFHNote of each 64 KB boundary area Note x OH to EH Application Use the ccza option to specify whether to locate a segment to the last byte of each 64 KB boundary area Explanation If development is performed only with the assembler specification of this option is not necessary because a segment is automat
229. ls menu of PM or if the RA button on the toolbar is clicked Assembler options can be set by inputting the required options in this dialog box Figure 4 2 Assembler Options Dialog Box Assembler Options Dutputi Output2 Others Object Module File o Dutput Path Name Y Browse Output Debugging Information to Object File M Local Symbol Data 3 MV Assembler Source Debugging Data ga mT Create Error List File e Output Pat Common Object Module File common 78K0 Series Compatible Macro compati Command Line Options Users Manual U17836EJ1VOUM 101 CHAPTER 4 ASSEMBLER 4 5 2 Explanation of dialog box The various tabs in the Assembler Options dialog box are described below 1 Output1 tab Figure 4 3 Assembler Options Dialog Box When Output1 Tab Is Selected Assembler Options Output Output Others Object Module File 2 Output Path Name Y Browse Output Debugging Information to Object File M Local Symbol Data g IV Assembler Source Debugging Data ga Create Error List File e al Common Object Module File common 78K0 Series Compatible Macro compati Command Line Options Cancel Apply Help Object Module File o When specified by common option Output Path Name Specify the path of the object module file by using the Browse button or directly inputting a path name Wh
230. mand Aoption Alibrary file name Aoption transaction Aoption a b a The library file name specified immediately before can be replaced with b Transaction object module file nameMlibrary file name A module name A Remark Uppercase characters and lowercase characters are not distinguished for the subcommands and options User s Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN create Syntax createAlibrary file name Atransaction Default assumption C Function The create subcommand creates a new library file Explanation The size of the created library file becomes O When a transaction is specified a module is registered at the same time as the library file is created dibrary file name lf a file with the same name already exists it will be overwritten transaction An object module file carrying the same public symbol as the public symbol in the library file cannot be registered A module with the same name as a module in the library file cannot be registered If an error occurs processing is interrupted and the library file cannot be created Example of use To register modules m1 and m2 at the same time as a library file kOr lib is created describe as create kOr lib m1 rel m2 rel Before file creation m1 m2 After file creation kOr lib m1 m2
231. mat IE intel extend format T tex format M s format ME s 32bit format ydirectory Set device file search path zf Create boot hex module file HXB and flash hex module file HXF E Show this message DEFAULT ASSIGNMENT o s r uOffh User s Manual U17836EJ1VOUM 209 CHAPTER 6 OBJECT CONVERTER 6 5 Option Settings in PM This section describes the method for setting object converter options from PM 6 5 1 Option setting method The Object Converter Options dialog box is opened if Object Converter Options is selected from the Tools menu of PM or if the OC button on the toolbar is clicked Object converter options can be set by inputting the required options in this dialog box Figure 6 7 Object Converter Options Dialog Box Object Converter Options Output Qutput2 Others HEX Madule o Dutput File Name FO Browse jw Object Complement u Select HEX Format Valus C Intel Format ki Intel Extend Format kie C Tex Format kt Start Address Size C Motorola S type Format standard km C Motorola S type Format 32bit kme Divide HEX File for the Product with Flash ROM zf Command Line Options 210 Users Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER 6 5 2 Explanation of dialog box The various tabs in the Object Converter Options dialog box are described below 1 Output1 tab Figure 6 8 Object Converter Options Dialog Box When Output1 Tab I
232. may be accessed later through the saved disk file Temporary files are deleted when library formation is finished They are also deleted when library formation is aborted by pressing CTRL C The path in which the temporary file is to be created is determined according to the following order i The path specified by the t option ii The path specified by environmental variable TMP when the t option is omitted iii The current path when TMP is not set When i or ii is specified if the temporary file cannot be created in the specified path an abort error OCCUIS Example of use To output a temporary file to folder C tmp describe as C gt lb78k0r tC tmp Users Manual U17836EJ1VOUM 229 CHAPTER 7 LIBRARIAN Help specification 1 Syntax Default assumption No display Function The option displays a help message on the display Application The help message is a list of explanations of the subcommands Refer to these when executing the librarian Explanation When the option is specified all other options are unavailable Caution This option cannot be specified from PM To reference PM help click the Help button in the Library File Name dialog box Example of use To output a help message on the display describe as C gt lb78k0r 78KOR Series Librarian Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx Subcomma
233. mbled from the assembly language to absolute addresses Relocatable assembler In a relocatable assembler the addresses determined for the machine language instructions assembled from the assembly language are tentative Absolute addresses are determined subsequently by the linker In the past when a program was created with an absolute assembler programmers had to as a rule complete programming at the same time However if all the components of a large program are created as a single entity the program becomes complicated making analysis and maintenance of the program difficult To avoid this such large programs are developed by dividing them into several subprograms called modules for each functional unit This programming technique is called modular programming A relocatable assembler is an assembler suitable for modular programming which has the following advantages 1 Increase in development efficiency It is difficult to write a large program all at the same time In such cases dividing the program into modules for each function enables two or more programmers to develop subprograms in parallel to increase development efficiency Furthermore if any bugs are found in the program it is not necessary to assemble the entire program just to correct one part of the program and only a module which must be corrected can be reassembled This shortens debugging time 20 User s Manual U17836EJ1VOUM Program consisting of a sin
234. mbler code in the C source satisfies the following conditions Conditions If a local symbol is used use a symbol that starts with string L such as L 201 or 7L sym However keep this symbol to within 8 characters Do not define this symbol externally PUBLIC declaration F4107 Message Can t specify U option for ROMIess device Cause The object complement specification option u is specified for a model without internal ROM E4200 Message Undefined symbol symbol name Cause A symbol whose address is undetermined has been found Action by User Define the symbol s value This symbol is referenced as an external reference symbol If it is not externally defined specify an external definition outside the module in which the value of the symbol is defined E4201 Message Out of address range Cause The address of an object in a load module file is out of range W4300 Message XxxxxH yyyyyH overlapped Cause Objects overlapped in the address from xxxxxH to yyyyyH are output W4301 Message Can t initialize RAM area adaress address Cause Initial value data is output to the RAM area Action by User If DB DW is described in DSEG of the assembly source change it to DS or describe the DB DW instruction in CSEG F4900 Message Can t open file file name Cause File cannot be opened F4901 Message Can t close file file name Cause File cannot be closed User s Manual U17836EJ1VOUM 323 CHAPTER 11 ERROR MESSAGES
235. me The ne option makes the e option unavailable Application Specify the e option to save error messages in a file Explanation The file name of the error list file can be specified as a disk type file name or as a device type file name If the device specified in the file name is the same as that specified in the absolute assemble list file an abort error occurs If the e option is specified and the output file name is omitted the error list file name will be assemble list file name elv If only the primary name of the output file name is specified the list converter will assign the file type elv and output the file If the drive name is omitted when the e option is specified the error list file will be output to the current drive If both options e and ne are specified at the same time the option specified last takes precedence Example of use 262 To create an error list file sample elv describe as C gt Ic78k0r kOrmain prn esample elv Contents of sample elv gt RA78KOR warning W6701 Load module file is older than object module file kOrmain lmf kOrmain rel Passl start RA78KOR warning W6702 Load module file is older than assemble module fil kOrmain lmf kOrmain prn Pass2 start User s Manual U17836EJ1VOUM CHAPTER 8 LIST CONVERTER Parameter file specification 1 f Syntax ffile name Default assumption Options and i
236. memory space name is omitted after is written an error occurs Function Define a specified memory space for a memory area specified with a memory area name 1 memory area can be defined with 1 memory directive A memory directive can be specified more than once However multiple definitions in the specified order will result in an error The default memory area is effective as long as the same memory area is not redefined in a memory directive If the specification of a memory directive is omitted only the default memory area carried by the linker for each device will be specified f you wish to use a different memory area without using the default memory space specify the size of the default area name as O Example of Use Define the addresses OH to 1FFH in the memory space as ROMA MEMORY ROMA OH 200H 116 Users Manual U17836EJ1VOUM CHAPTER 5 LINKER 5 4 3 Segment location directives A segment location directive is a directive which locates a specified segment in a specified area of memory or a specific address Syntax MERGEAsegment nameA A ATA Astart addressA A Amemory area name A Amemory space name MERGEAsegment nameA A merge attribute A Amemory area name A Amemory space name Segment name The segment name is the name of a segment included in an object module file input to the linker Onlyan input segment can be specified with
237. mitted the librarian assumes that input file name Ist is entered public nopublic It can also be specified as p np public specifies output of public symbol data nopublic makes public unavailable If public and nopublic are specified at the same time the last specified option takes precedence Example of use To output a module information in a library file kOr lib to a list file kOr Ist describe as list p okOr Ist kOr lib At this time specify the p option so as to output public symbol information 238 User s Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN Contents of kOr Ist 78KOR Series librarian Vx xx DATE XX XXX XX PAGE 1 LIB FILE NAME kOr lib XX XXX XX 0001 kOrmain rel XX XXX XX AIN START UMBER OF PUBLIC SYMBOLS 2 0002 kOrsub rel XX XXX XX CONVAH NUMBER OF PUBLIC SYMBOLS 1 User s Manual U17836EJ1VOUM 239 CHAPTER 7 LIBRARIAN help Syntax help Default assumption h Function The help command displays a help message on the display Explanation The help message is a list of the subcommands and explanations for each Specify the help command or the option to refer to this message during librarian execution Example of use To specify the help command to output the help message describe as help Subcommands create add delete replace pick list help exit Usage subcomma
238. module file common to the 78KOR Series Application This option generates an object code that can be used commonly in the 78KOR Series regardless of the device type specification option c The output object module file can be linked with an object file for which a different device in the 78KOR Series is specified Explanation Specify this option to generate an object code that can be used commonly in the 78KOR Series Notice Even when the common option is specified the device type specification option c or control instruction of the same function must not be omitted An abort error occurs if the series common object specification option common is specified for all the input object module files to be linked Example of use To generate an object code that can be used commonly in the 78KOR Series describe as C ra78kO0r kOrsub c cf1166a0 common 96 User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER Self programming specification 1 self Syntax self Default assumption None Function The self option stops an error occurring when CALL xxxxxH is described even if address xxxxxH is outside the access range i e there is no internal ROM For address xxxxxH refer to the user s manual of the device used Application Specify the self option when using self programming Explanation Specify this option if an error occurs when CALL xxxxxH is described dur
239. mple rel psample prn 2 Use the parameter file kOrmain pra to start up the assembler C ra78ko0r fkOrmain pra 58 User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER 4 3 2 Execution start and end messages 1 Execution start message When the assembler is started up an execution startup message appears on the display 78KOR Series Assembler Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx 2 Execution end message If it detects no assembly errors resulting from the assembly the assembler outputs the following message to the display and returns control to the operating system PASS1 Start PASS2 Start Target chip uPD78xxx Device file Vx xx Assembly complete 0 error s and 0 warning s found If it detects an assembly error resulting from the assembly the assembler outputs the error number to the display and returns control to the operating system PASSI Start kOrmain asm 12 RA78KOR error E2201 Syntax error PASS2 Start kOrmain asm 12 RA78KOR error E2201 Syntax error kOrmain asm 29 RA78KOR error E2407 Undefined symbol referenc VAH kOrmain asm 29 RA78KOR error E2303 Illegal expression Target chip uPD78xxx Device file Vx xx Assembly complete 3 error s and 0 warning s found CON If the assembler detects a fatal error during assembly which makes it unable to continue assembly
240. n Specify the kp option to output a public symbol list into a link list file Explanation If nkm nkp and nkl options are all specified the link list file cannot be output If ng options is specified the public symbol list cannot be output If both options kp and nkp are specified at the same time the option specified last takes precedence Ifthe np option is specified the kp option is unavailable 138 User s Manual U17836EJ1VOUM CHAPTER 5 LINKER Example of use To output a public symbol list into a link list file KOr map describe as C IK78kO0r kOrmain rel kOrsub rel s g pkOr map kp Reference kOr map Contents of kOr map 78KOR Series Linker Vx xx Date XX XXX XXXX Page Command kOrmain rel kOrsub rel s g pkO0r map kp Para file Out file kOrmain lmf Map file kO0r map Direc file Directive Link information 6 output segment s 9DH byte s real data 40 symbol s defined Memory map SPACE REGULAR MEMORY ROM BASE ADDRESS 00000H SIZE 40000H I 1 78KOR Series Linker Vx xx Date XX XXX XXX Page ee PUD IAC symbod Trst MODULE ATTR VALUE NAME SAMPM ADDR 00000H MAI Public symbol list ADDR 000D2H START SAMPS ADDR 000E9H CONVAH NUM FFE20H _ STBEG NUM FCFO0H GS irs iw Target chip uPD78xxx Device file Vx xx 2 User s Manual
241. n before a segment was created or before a subsequent segment was created after the previous segment had ended E2506 Message Can t describe DB DW DS ORG label in BSEG Cause DB DW DS ORG directives are defined in a bit segment E2507 Message Can t describe opcodes outside CSEG Cause Machine language instruction or BR directive is defined in something other than a code segment E2508 Message Can t describe DBIT outside BSEG Cause DBIT directive is defined in something other than a bit segment E2509 Message Illegal address specified Cause An address allocated to an absolute segment is outside the range for that segment E2510 Message Location counter overflow Cause Location counter is outside the range for a corresponding segment E2511 Message Segment name expected Cause Segment name is not specified for segment definition directive for reallocation attribute is AT E2512 Message Segment size is odd numbers symbol name Cause Size of reallocation attribute calltO segment is described in an odd number E2515 Message Security ID is not supported for this device Cause A security ID cannot be used with the specified device E2516 Message Option Bytes is not supported for this device Cause Option byte cannot be used with the specified device E2601 Message Nesting over of include Cause Nesting of include file exceeds limit 2 levels E2602 Message Must be specified switches Cause Switch name not specified E2603 Message Too many switches descri
242. name segment symbol name symbol symbol name address xxxxxH type adaressing type Cause Operand value used in decision of relocatable object code is out of range for operand values corresponding to the instruction Action by User Describe the value for the operand in the source program that fits within the range determined for each addressing type E3305 Message Even value expected file file name segment symbol name symbol symbol name address xxxxxH type adaressing type Cause The operand value used to determine the callt or saddrp addressing relocatable object code is an odd number callt and saddrp addressing operands must be even numbers 316 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES Error Number Error Message E3306 Message A multiple of 4 value expected segment symbol name address xxxxxH type addressing type Cause The value of the operand used for resolving the relocatable object code for saddr addressing is not a multiple of 4 F3401 Message file name Bad symbol table Cause Symbol data of input object module file is illegal Symbol entry of input file does not begin with file F3402 Message File file name has no string table for symbol Cause Symbol data of input object module file is illegal Action by User Perform assemble or compile again This may be avoidable by making the recogni
243. nd option masterLBF option transaction option transaction OMFname LBFname modulename create gt create masterLBF transaction add gt add masterLBF transaction lt delete gt delete masterLBF modulename replace replace masterLBF transaction pick pick masterLBF modulename list gt list option masterLBF modulename option p output public symbol np no output public symbol o filename specify output file name help gt help lt exit gt exit 240 Users Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN exit Syntax exit Default assumption e Function The exit subcommand exits the librarian Explanation Use this subcommand to exit the librarian Example of use To exit the librarian describe as exit User s Manual U17836EJ1VOUM 241 CHAPTER 7 LIBRARIAN 7 6 Option Settings in PM This section describes the method for specifying library flies from PM 7 6 1 Option setting method Select Librarian Options from the Tools menu of PM or the LB button on the toolbar is clicked to display the Librarian Options dialog box Librarian options can be set by inputting the required options in this dialog box Figure 7 2 Librarian Options Dialog Box Librarian Options Output Others Library File Name FO Browse r LIST Ammann antone Command Line Opt
244. nds create add delete replace pick list help exit Usage subcommand option masterLBF option transaction option transaction OMFname LBFname modulename lt create gt create masterLBF transaction lt add gt add masterLBF transaction lt delete gt delete masterLBF modulename lt replace gt replace masterLBF transaction lt pick gt pick masterLBF modulename lt list gt list option masterLBF modulename option p output public symbol np no output public symbol o filename specify output file name lt help gt help lt exit gt exit 230 User s Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN 7 5 Subcommands 7 5 1 Types of subcommands The subcommands provide detailed directions for the operation of the librarian The explanations for subcommands are shown below Table 7 3 Subcommands Subcommand Name Abbrev Explanation create C Creates a new library file delete d Deletes a module from a library file replace r Replaces module in a library file with other modules pick p Retrieves a module from a library file list Outputs data on modules in a library file help h Displays a help message on the display 7 5 2 Explanation of subcommands The following is a detailed explanation of the function and operation of each subcommand General format of command files Subcom
245. ned to run on the following OSs Command prompt of Windows 2000 XP 2 7 2 Environmental variables Set the following environmental variables Table 2 3 Environmental Variables Environmenta Explaination Variables PATH Specifies the folder to which the executable format of the assembler is stored TMP Specifies a folder where a temporary file is to be created INC78KOR Specifies a folder where the include file is searched LIB78KOR Specifies the folder where a library is searched if the library is used LANG78K Specifies the kanji code 2 byte code described in the comment Example PATH PATH C Program Files NEC Electronics Tools RA78KOR Vx xx bin set TMP C tmp set INC78KOR C Program Files NEC Electronics Tools RA78KOR Vx xx inc78k0r set LIB78KOR C Program Files NEC Electronics Tools XXXXXX Vx xx lib78k0r set LANG78K SJIS 2 7 3 Kanji code in source file Kanji 2 byte character can be used in specific places comments etc in the source file Specify the kanji code type using an environmental variable LANG78K kanji code control instruction KANJICODE or kanji code specification option zs ze zn Users Manual U17836EJ1VOUM CHAPTER3 EXECUTION PROCEDURE OF RA78KOR This chapter explains the procedures for using the assembler package RA78KOR from assembling to object conversion Sample programs kOrmain asm and kOrsub asm are assembl
246. neration of stack decision symbols specification 1 s ns Syntax s area name ns Default assumption ns Function The s option generates the stack decision public symbols STBEG and QSTEND The ns option makes the s option unavailable Application Specify the s option to reserve a stack area Explanation 130 area name is a name in which an area memory name defined by the user or an area memory name defined by default is specified Area names distinguish between uppercase and lowercase characters The linker searches the memory area specified by the s option for the largest address in which no segment is located The linker then generates public symbol _ STEND which holds the lead address of the largest address area as its value and public symbol OSTBEG which holds the last address 1 as its value These symbols are handled as publicly declared NUMBER attribute symbols and are registered at the end of the linker s symbol table When these symbols are output to a link list file the module name column is left blank If the largest open area is 10 bytes or smaller a warning message is output If no free area exists a warning message is output and both OSTEND and _ STBEG hold the last address 1 as their values If an area name is omitted RAM is specified If both options s and ns are specified at the same time the option specified last takes precedence Us
247. ng is displayed Users Manual U17836EJ1VOUM 215 CHAPTER7 LIBRARIAN The librarian edits RA78KOR object module files and library files in units of 1 module The librarian also outputs a list file If a librarian error occurs an error message is output to the display indicating the cause of the error Figure 7 1 I O Files of Librarian Object module files output by the compiler or assembler Subcommand d Librarian Temporary files Library files List files 216 Users Manual U17836EJ1VOUM 7 1 CHAPTER 7 LIBRARIAN 1 O Files of Librarian The I O files of the librarian are as follows Table 7 1 I O Files of Librarian Temporary files are deleted when execution of the librarian ends User s Manual U17836EJ1VOUM Type File Name Explanation Default File Type Input files Subcommand Files containing the parameters for the None files executed programs user created files Output files List files Files containing the result of library file data Ist output l O files Object module Object module files output by the compiler or rel files assembler Library files Files used to input the library files output by lib the librarian and update the contents Temporary files Files created automatically by the librarian Lbxxxxxx y when forming a library y 1 6 217 CHAPTER 7 LIBRARIAN 7 2 Functions of Librarian 1 218 Formation of a library of modules The ass
248. ng the r address source of object and u complement value specification options These options are specified by default An abort error occurs if a ROM code is ordered work known as across processing or tape out when the addresses of the objects are not sorted Therefore be sure to specify r do not cancel the specification Memory initialization quasi directives If memory initialization quasi directives DB DW and DG are described in a data segment DSEG object codes are output but the object converter outputs the warning message W4301 This is because a code exists at an address other than one in the ROM area code area An abort error occurs if a ROM code is ordered work known as across processing or tape out in this status Manipulation specification of object converter If starting address is specified by the object converter the u option complement is started from the start address or the address where the code is located whichever is lower complement is not performed for the internal RAM area ED800H to FFFFFH Description format ucomplement value start adaress size Remark may be omitted Memory directives The default memory area name of each device cannot be erased Set the size of the default memory area name not used to 0 Some segments however are allocated to the default area Bear this in mind when changing the area name For the default memory area name refer to the User s Manual
249. nnot be output F6109 Message Overlay file can not open path name Cause Assembler overlay file cannot be opened F6110 Message Illegal assembler list file file name Cause Input assemble list is a file type other than an assemble list file W6701 Message Load module file is older than object module file load module file name object module file name Cause A load module file is specified which is older than the object module file W6702 Message Load module file is older than assemble module file load module file name assemble list file name Cause A load module file is specified which is older than the assemble list file W6703 Message Assemble list has error statement file name Cause An error exists in the assemble list W6704 Message Segment name is not found in assemble list file symbo name Cause Segment name of object module file is not found in assemble list W6705 Message Segment data length is different symbo name Cause Length of segment data in assemble list file is different from length of segment data in object module file Program Surplus segment data is ignored and processing continues Processing F6901 Message File open error has occurred file name Cause File cannot be opened F6902 Message File read error has occurred file name Cause File cannot be correctly read F6903 Message File write error has occurred file name Cause Data cannot be correctly written to file User s Manual U17836EJ1VOUM 331
250. not begin with 0 9 Uppercase and lowercase characters are interpreted as separate characters Uppercase and lowercase characters can be mixed together Maximum length of a memory area name is 256 characters If 257 or more characters are described an error occurs Each memory area name must exist in only 1 location in the entire memory space The same memory area name cannot be used for a different memory area even if they are in different memory spaces Memory area MEM 1 Memory area MEM 1 REGULAR space 2 Start addresses Specify the start address of the memory area to be defined Describe a numerical value from OH to FFFFFH Users Manual U17836EJ1VOUM 115 CHAPTER 5 LINKER 3 Size Specify the size of the memory area to be defined Specification conditions are as follows Describe a numerical value of 1 or higher If the size specification is changed to the default memory area size defined by the linker limitations on the definable range apply For the default memory area size defined for each device and the redefinable range for each device see the Notes on Use for each device file 4 Memory space names The memory space name is displayed in the 64 KB space REGULAR The following conditions on specification of memory space names apply Memory space names must be specified entirely in uppercase characters When a memory space name is omitted REGULAR is assumed to be specified If the
251. nput file names can only be input from the command line Function The f option specifies input of options and the input file name from a specified file Application Specify the f option when the data required to start up the list converter will not fit on the command line When you wish to repeatedly specify the same options each time list conversion is performed describe those options in a parameter file and specify the f option Explanation Only a disk type file name can be specified as file name If a device type file name is specified an abort error occurs Ifthe file name is omitted an abort error occurs If only the primary name of the file name is specified the list converter will assign the file type plv and open the file Nesting of parameter files is not permitted If the f option is specified within a parameter file an abort error occurs The number of characters that can be written within a parameter file is unlimited Separate options or input file names with a blank space a tab or a line feed code LF Options and input file names written in a parameter file will be expanded at the position specified for the parameter file on the command line The expanded options specified last will take precedence If the f option is specified two or more times an abort error occurs All characters entered after or and before a line feed code LF or EOF will be interpreted as
252. nt Any segment name CSEG SECUR ID DB 11H DB 22H DB 33H DB 44H DB 55H DB 66H DB 77H DB 88H DB 99H DB OAAH If specification of the assembler source and specification of this option are made in duplicate this option takes precedence Caution If this option is not specified for a device that has a security ID function any code may be allocated 156 User s Manual U17836EJ1VOUM CHAPTER 5 LINKER Example of use To specify the same 112233445566778899AA as the specification of the above assembler source describe as C IK78kO0r kOrmain rel gi112233445566778899aah Users Manual U17836EJ1VOUM 157 CHAPTER 5 LINKER User option byte specification 1 gb Syntax gbuser option byte value Default assumption Initial value set in the device file Function The gb option specifies the value set for the user option byte Application Use the gb option to specify the user option byte value Explanation The range of values that can be specified for the user option byte is shown below 0 lt user option byte value lt OFFFFFFH An abort error occurs if a value that cannot be specified as the user option byte value is specified Specify a hexadecimal value that ends with H If any other value is specified an abort error occurs The user option byte is specified at addresses COH to C2H If the gb option is not specified no u
253. ocuments listed above are subject to change without notice Be sure to use the latest version of each document for designing User s Manual U17836EJ1VOUM 7 MEMO 8 User s Manual U17836EJ1V0UM CONTENTS CHAPTER 1 GENERAL 15 1 1 Assembler Overview 15 1 1 1 Assembler 16 1 1 2 Development of microcontroller related products and the role of RA78KOR 1 1 3 Relocatable assembler 20 1 2 Overview of Features of RA78KOR 22 1 2 1 Creating a source module file using an editor 23 1 2 2 Assembler 24 1 2 8 Linker 25 1 2 4 Object converter 26 1 2 5 Librarian 27 1 2 6 List converter 28 1 2 7 Debugger 29 1 8 Reminders Before Program Development 30 1 3 1 Quantitative limits for RA78KOR 30 1 4 Features of RA78KOR 32 CHAPTER 2 PRODUCT OUTLINE AND INSTALLATION 33 2 1 Host Machine and Supply Medium 33 2 2 Installation 34 2 3 Installation of Device Files 35 2 4 Folder Configuration 36 2 5 File Organization 37 2 6 Uninstallation 38 2 7 Environment Settings 39 2 7 1 Host machine 39 2 7 2 Environmental variables 39 2 7 3 Kanji code in source file 39 CHAPTER 3 EXECUTION PROCEDURE OF RA78KOR 40 3 1 Before Executing RA78KOR 40 3 1 1 Sample programs 40 3 1 2 Configuration of sample program 43 3 2 Execution Procedure of RA78KOR 44 3 3 Execution Procedure from Command Line 49 3 4 Using Parameter File 53 CHAPTER 4 AS
254. of 72 to 2046 Lines per Page ll Specify the number of lines on one page of the assemble list file O or in a range of 20 to 32 767 Expand TAB Character It Specify the length of the tab character in a range of 0 to 8 List Header String Ih Specify the character string to be printed in the title column of the header of the assemble list file The number of characters that can be input is up to 60 Command Line Options This edit box is read only The currently set option character string is displayed User s Manual U17836EJ1VOUM 105 CHAPTER 4 ASSEMBLER 3 Others tab Figure 4 5 Assembler Options Dialog Box When Others Tab Is Selected Assembler Options Output Qutput2 Others Include Search Path i Y Edit Temporary Directory t Y Browse Use Self Programmina self Use Command File Edit Parameterfile f d Browse Other Options x Reset Option data read Option data save Command Line Options Change Source Regulation z SJIS zs EUC ze No Multibyte zn Symbol Definition d Cancel Apply Help Include Search Path i Specify the path via which the include file is to be read by using the Edit button opens the Edit Option dialog box or directly inputting a path name Up to 64 items can be specified by using commas as delimiters Temporary Directory t Specify the path where a temporar
255. of the assemble with error messages if errors occur Output format 272 Assemble list 1 ALNO 2 STNO 6 ADRS 8 OBJECT 3 M 4 I 5 SOURCE STATEMENT 1 1 2 2 NAME SAMPM 3T 31 0000A RFD0000 CALL CONVAH convert ASCII HEX 32 32 output BC register ASCII code 33 33 0000D 00000000 MOV DE LOWW STASC set DE store ASCII code table 00011 00 7 ERROR E2202 STNO 33 33 Illegal operand 34 34 00012 63 MOV A B 35 35 00013 99 MOV DE A Segment informations 9 ADRS 10 LEN 11 NAME FFE20 00003H DATA 00000 00002H CODE 00000 00019H CSEG Target chip 12 uPD78xxx Device file 13 Vx xx Assembly complete 14 1 error s and 15 0 warning s found 16 33 Details Line no of source module image Line no including expansion of INCLUDE files and macros Macro display M This is a macro definition line n This is a macro expansion line n is the nest level Blank This is not a macro definition or expansion line 4 INCLUDE display In Within an INCLUDE file n is the nest level Blank INCLUDE file is not used Source program statement Location counter value 4 or 5 digits Error occurrence line Relocation data R Object code or symbol value is changed by the linker Blank Object code or symbol value is not changed by the linker Segment address 5 digits User s Manual U1
256. of the device to be used Debug option If debug information is output by the C compiler and the compiler is executed do not output the debug information when the output assemble source is assembled specify this by using the nga option If the debug information is output debugging may not be executed at the C compiler source level Users Manual U17836EJ1VOUM 347 APPENDIX B NOTES ON USE 7 CC78KOR Several points must be noted when C source level debugging is executed by assembling the assembler source output by the CC78KOR For details refer to the document supplied with the C compiler package Notes on Use ID78KOR QB SM for 78KOR When debugging is executed with the ID78KOR QB SM for 78KOR keep the number of symbols and the number of source lines to within the limit of the ID78KOR QB SM for 78KOR For details refer to the document supplied with the debugger simulator Notes on Use Segment name When describing a segment name do not describe the same name as the primary name of the source file name Otherwise the abort error F2106 will occur as a result of assembly 10 EQU definition of SFR name An SFR name may be specified as an operand of the EQU quasi directive If the name of an SFR outside the saddr area is specified as PUBLIC an assembly error occurs 11 When using a network If a folder where a temporary file is to be created is on a file system that is shared on a network a file conflict m
257. on changes the number of characters that can be printed in 1 line in a list file Application Specify the lw option to change the number of characters that can be printed in 1 line in any type of list file Explanation The range of number of characters that can be specified with the lw option is shown below 80 characters in the case of display output 72 lt number of characters printed on 1 line lt 2046 An abort error occurs if a numerical value outside this range or something other than a numerical value is specified Ifthe number of characters is omitted 132 will be specified However when an assemble list file is output to display 80 will be specified The specified number of characters does not include the terminator CR LF If the np option is specified the Iw option is unavailable Notice Acontrol instruction WIDTH with the same function as the Iw option can also be written at the beginning of a source module ASAWIDTH For information on control instructions refer to RA78KOR Assembler Package Language User s Manual Users Manual U17836EJ1VOUM 77 CHAPTER 4 ASSEMBLER Example of use 78 To specify 80 as the number of characters per line in an assemble list file KOrmain prn describe as C ra78kO0r cf1166a0 kOrmain asm Iw80 Contents of kOrmain prn Assemble list ALNO STNO ADRS OBJECT M I 1 1 2 2 3 3 4 4 5 5 6 6 7 7
258. onics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics RENESAS User s Manual RA78KOR Ver 1 00 Assembler Package Operation Target Devices 78KOR Microcontrollers Document No U17836EJ1VOUMOO 1st edition Date Published July 2006 CP K NEC Electronics Corporation 2006 Printed in Japan MEMO 2 User s Manual U17836EJ1VOUM Windows and WindowsXP are either registered trademarks or trademarks of Microsoft Corporation in the United States and or other countries PC AT is a trademark of International Business Machines Corporation The information in this document is current as of July 2006 The information is subject to change without notice For actual design in refer to the latest publications of NEC Electronics data sheets or data books etc for the most up to date specifications of NEC Electronics products Not all products and or types are available in every country Please check with an NEC Electronics sales representative for availability and additional information e No part of this document may be copied or reproduced in any form or by any means without the prior written consent of NEC Electronics NEC Electronics assumes no responsibility
259. ons oa Imf pa map Cancel Apply Help Directive File d Specify the file to be input as a directive file by using the Browse button or directly inputting a path and file name Temporary Directory t Specify the file where a temporary file is to be created by using the Browse button or directly inputting a path and file name Create Stack Symbol s Select this option to allocate the maximum vacant area of the memory area as a stack area Area Name Specify a memory area name defined by the user or the memory area name defined by default The number of characters that can be input is up to 256 170 Users Manual U17836EJ1VOUM CHAPTER 5 LINKER Warning Level w Specify the warning message output level 0 Don t output warning message 1 Output normal warning message 2 Output detailed warning message Elash Start Address for the Product with Flash ROM zb Specify the boot area start address for products with flash memory The specifiable value range is as follows OH lt zb lt OFFFFH Caution Do not specify this option for a device that does not have a flash memory area self programming function Use Command File Select this option to create a command file Parameterfile f Specify the file to be input as a user defined parameter file by using the Browse button or directly inputting a file name Other options To specify an option other than those that can be se
260. option Specification formats for start address and size in the u option and their interpretation are as follows a ucomplement value If the target device for assembly contains internal ROM the internal ROM range b ucomplement value size From address 0 to the size 1 address c ucomplement value start adaress size From start address to start address size 1 address Example of use Complement an address area to which a HEX format object has not been output with code In the following example it is supposed that a HEX format object module file exists In this case code cannot be written to the address area 003EH to OFFFH 00000200FC 02002B41000BFC80FE2B40000944F7083A20EC gt 1 12001A6720FE2822006521FED350D25014FE1A X1 2200B900059F2835002431B900059F28350005 z 1 3200242156AF0A8302A807A830560C 0003B5D0d0026A3 2 100024A5F622B667 0 C oompmbDmnpPo OrRADWGCAOAAON HoOoo0ooOo0o00oc C S SS c Xo 00000001FF 1000H OFFFH Code is complemented to this area 003EH 003DH 0002H 0001H 0000H Users Manual U17836EJ1VOUM 201 CHAPTER 6 OBJECT CONVERTER To complemente OOH to the address area 003EH to OFFFH describe as C gt oc78k0r kOr Imf u00h 003eh Ofc2h 202 Users Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER Error list file output specification 1 e ne Syntax e output file name ne Default
261. option specification of the individual option becomes illegal Check the specification of the individual option and retry Button OK Closes the message box Users Manual U17836EJ1VOUM 335 CHAPTER 11 ERROR MESSAGES 11 7 2 Linker LK78KOR Table 11 7 Error Messages Displayed by Linker LK78KOR DLL Error Type Error Message x Message Cannot find LK78KOR EXE shown in environmental variable PATH Cause The LK78KOR EXE execution format is not in the specified folder Action by User Re install the RA78KOR assembler package Button Ok Closes the message box Message Invalid value The range of warning level is from 0 to 2 Cause A value outside the limit input range is specified as the warning level Action by User Specify a value within the limit range Button Ok Closes the message box Message Invalid value The range of flash start address is from Oh to OFFFFFh Cause A value outside the input limit range is specified as the flash start address Action by User Specify a value within the limit range Button Message Cause Action by User OK Closes the message box Cannot find path or file Make sure path or filename The specified path or file cannot be found Specify a correct path or file name Button OK Closes the message box Message Cannot find folder Will you create Cause The specified folder
262. or Option Bytes Cause An illegal value was located to the segment that specifies the user option byte and on chip debug option byte Action by User Locate a correct value For the locatable values refer to the user s manual for the device E2343 Message Illegal Option Bytes segment Cause Two or more segments were specified as the segment that specifies the user option byte and on chip debug option byte Action by User Specify only one segment to specify the user option byte and on chip debug option byte 304 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES PUR Error Message E2401 Message Illegal symbol for PUBLIC symbol name Cause This symbol cannot be declared PUBLIC E2402 Message Illegal symbol for EXTRN EXBIT symbol name Cause This symbol cannot be declared EXTRN EXTBIT E2403 Message Can t define PUBLIC symbol symbol name Cause This symbol already has a PUBLIC declaration and cannot be defined with a PUBLIC declaration Action by User A symbol defined with bit items other than saddr bit cannot have a PUBLIC declaration Cancel PUBLIC declaration or change EQU definition E2404 Message Public symbol is undefined symbol name Cause A symbol with a PUBLIC declaration is undefined E2405 Message Illegal bit symbol Cause An illegal symbol is used as a forward reference symbol or bit symbol for the bit symbol of an operand in a m
263. program can be interrupted by entering CTRL C from the keyboard If break on is specified during execution of a batch file control is returned to the operating system regardless of the timing of the key input When break off is specified control is only returned to the operating system during screen display In this case all open temporary files and output files are deleted Users Manual U17836EJ1VOUM 291 CHAPTER 10 EFFICIENT USE OF RA78KOR 10 4 Making Assemble List Easy to Read Display a title in the header of an assemble list using the Ih option or the TITLE control instruction By displaying a title that briefly indicates the contents of the assemble list the contents of the assemble list can be made easy to see at a glance When the SUBTITLE control instruction is used a subtitle can also be displayed For information on control instructions refer to RA78KOR Assembler Package Language User s Manual Example of use To print a title in the header of an assemble list file kOrmain prn C ra78kO0r cf1166a0 kOrmain asm IhRA78KOR MAINROUTINE Contents of kOrmain prn gt 78KOR Series Assembler Ex xx RA78KO0R MAINROUTINE Date XX xxx xxxx Page 1 Title Command cf1166a0 kOrmain asm 1hRA78K0R MAINROUTINE Para file In file kOrmain asm Obj file kOrmain rel Prn file kOrmain prn Assemble list ALNO STNO ADRS OBJECT MI SOURCE STATEMENT 1 1 2 2 AME SAMPM 3 3 i K
264. put file Action by User Do not specify the gb go or gi option when a load module file is specified for the input file to be relinked F3435 Message ext table address in file s First specified in file s Cause The value of pragma ext table specified in the C source is illegal Action by User Specify the same value for ITBLTOP in the startup routine and pragma ext table in the C source file F3502 Message Too many segment up to 65535 0FFFFH Cause Total number of input segments exceeds 65 535 F3901 Message Can t open overlay file file name Cause Overlay file cannot be opened Action by User Make sure the overlay file is in the correct folder a folder containing an execution program F3902 Message File file name not found Cause The specified library file cannot be opened F3903 Message Can t read input file file name Cause Object module file specified as an input file cannot be read F3904 Message Can t open output file file name Cause Output file cannot be opened Action by User Check condition open capacity condition of media etc of the disk used to create output file User s Manual U17836EJ1VOUM 319 CHAPTER 11 ERROR MESSAGES Error M rmibef Error Message F3905 Message Can t create temporary file file name Cause Temporary file for symbol entry cannot be created Action by User Check condition open capacity condition of med
265. r Input the user option byte value Button Ok Closes the message box Message Invalid User Option Byte Option Bytes is specified in hexadecimal numbers Cause The specification format of the User Option Byte is illegal Action by User Button Specify the value in the correct format OK Closes the message box 338 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES Error Type Error Message Message Too many files for Library File Up to 64 can be specified for Library File Cause A number of library files outside the input limit range is specified Action by User Specify a number of library files within the limit range Button Message Cause Action by User OK Closes the message box library file Too long file name for Library File The file name specified as a library file has a number of characters outside the limit range Retry with a number of characters within the limit range Button OK Closes the message box Message library file Multiple Library File definition Cause Library files are described in duplicate Action by User Delete the duplicate library file s and retry Button OK Closes the message box Message Too many path for Library File Search Path Up to 64 can be specified Cause A number of paths for reading a library file is described outside the limit input range
266. recedence nkm Makes the km option If the nkm nkp and nkl unavailable options are all specified the link list file cannot be output even if the p option is specified kd Outputs a link If the nkm option is kd directive file into a specified the kd option link list file becomes unavailable If both options kd and nkd Makes the kd option nkd both kp and unavailable nkp or both kl and kp Outputs a public DK are SPecileg atine nkp symbol list into a link Sans timo ine option list file specified last takes precedence nkp Makes the kp option If the ng option is specified unavailable the public symbol list and local symbol list cannot be k1 Output a local symbol output even if the kp or kl nkl list into a link list file option is specified nkl Makes the kl option unavailable Link list Specifies number of If the np option is specified IlO format ll number lines that can be the II option is unavailable specification puedes printed in 1 page in a link list file 1f Inserts a form feed If both options If and nif FF code at the end nlf are specified at the of a link list file same time the option x specified last takes nlf Makes the If option precedence unavailable If the np option is specified the option specified last takes precedence Error list file e file Outputs error list file If both options e and ne ne output name are specified at the same specification t
267. rehend The basic programming language system that uses this symbolic coding is called an assembly language Since machine language is the only programming language in which a microcontroller can handle programs however another program is required that translates programs created in assembly language into machine language This program is called an assembler Figure 1 2 Flow of Assembler Program written in Program written in machine assembly language language collections of binary numbers Source module file Assembler Object module file 16 User s Manual U17836EJ1VOUM CHAPTER 1 GENERAL 1 1 2 Development of microcontroller related products and the role of RA78KOR The following figure illustrates the position of assemble in the product development process Figure 1 3 Development Process of Microcontroller Applied Products Product planning System design Software development Logic design Software design Manufacturing Program coding in assembly language NO NO Hardware development YES Debugging NO YES System evaluation Product marketing Users Manual U17836EJ1VOUM 17 18 CHAPTER 1 GENERAL A more detailed explanation of the software development process appears in the following figure Figure 1 4 Software Development Process Software development Creation of program specifications Creation of flowchart Th
268. rformed and to save those options to a parameter file Explanation Only a disk type file name can be specified as file name If a device type file name is specified an abort error occurs If file name is omitted an abort error occurs Nesting of parameter files is not permitted If the f option is specified within a parameter file an abort error occurs The number of characters that can be written within a parameter file is unlimited Separate options or input file names with a blank space a tab or a line feed code LF Options and input file names written in a parameter file will be expanded at the position specified for the parameter file on the command line The expanded options specified last will take precedence All characters entered after or and before a line feed code LF or EOF will be interpreted as comments If the f option is specified two or more times an abort error occurs Example of use 204 Perform object conversion using a parameter file 78kOr poc Contents of 78k0r poc gt parameter file kOr lmf osample hex ssample sym r User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER Enter the following on the command line C 0c78ko0r kOr Imf f78kOr poc User s Manual U17836EJ1VOUM 205 CHAPTER 6 OBJECT CONVERTER HEX format specification 1 ki kie kt km kme Syntax ki kie kt km kme Default assumption kie
269. ribute symbol BIT attribute symbol addr bit BIT attribute symbol saddr bit BIT attribute symbol sfr bit BIT attribute symbol A bit X bit PSW bit Names defined as SFRs by EQU directive Names defined as SFRPs by EQU directive External reference symbol declared by EXTRN or EXTBIT Undefined symbol Symbol value 8 digits Local symbol name Users Manual U17836EJ1VOUM 283 CHAPTER 9 PROGRAM OUTPUT LIST 9 2 5 Error list An error list stores the error messages output when the linker is started up Output format RA78KOR 1 error 2 E3405 3 Undefined symbol CONVAH in file kOrmain rel Item Details 1 Type of error 2 Error no 3 Error message 284 Users Manual U17836EJ1VOUM CHAPTER 9 PROGRAM OUTPUT LIST 9 3 List Output by Object Converter The object converter outputs the following list Table 9 3 Explanation of Object Converter Output Items Output List File Name Output List Name Error list file Error list 9 3 1 Error list Error messages output when the object converter is started up are stored in an error list Output format Same as error list output by the linker User s Manual U17836EJ1VOUM 285 CHAPTER 9 PROGRAM OUTPUT LIST 9 4 List Output by Librarian The librarian outputs the following list Table 9 4 List Output by Librarian Output List File Name Output List Name L
270. ror file name Cause The parameter file cannot be read Action by User Specify a correct parameter file F6021 Message Memory allocation failed Cause There is insufficient memory Action by User Secure the necessary memory F6101 Message File is not 78KOR file name Cause Input file name is not a 78KOR file name F6102 Message Load module file is not executable file name Cause Attempted to input a file other than a load module file or attempted to convert a load module file created on an incompatible host machine F6103 Message Load module file has relocation data file name Cause Address of load module file is not determined 330 User s Manual U17836EJ1V0UM CHAPTER 11 ERROR MESSAGES E Error Message F6104 Message Object module file is executable file name Cause Object module file is in an executable format F6105 Message Segment name is not found in module file symbol name Cause Segment name of object module file is not found in load module file F6106 Message Segment name is not found in object module file symbo name Cause Segment name of assemble list file is not found in object module file F6107 Message Not enough memory Cause Memory is not sufficient for program operation F6108 Message Load module file has no symbol data load module name Cause The ng option is specified in linker so symbol data in load module file ca
271. rt kOrmain asm 31 RA78KOR error E2202 lllegal operand PASS2 Start kOrmain asm 26 RA78KOR error E2312 Operand out of range byte kOrmain asm 31 RA78KOR error E2202 lllegal operand User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER Parameter file specification 1 f Syntax ffile name Default assumption Options and input file names can only be input from the command line Function The f option inputs assembler options and the input file name from a specified file Application Specify the f option when the data required to start up the assembler will not fit on the command line Specify the f option to repeatedly specify the same options each time assembly is performed and to save those options to a parameter file Explanation Only a disk type file name can be specified as file name If a device type file name is specified an abort error occurs If the file name is omitted an abort error occurs Nesting of parameter files is not permitted If the f option is specified within a parameter file an abort error OCCUIS The number of characters that can be written within a parameter file is unlimited Separate options or file names with a blank space a tab or the line feed code LF Parameters and input file names within a parameter file will be expanded at the position specified for the parameter file on the command line The expanded options specified last will take prec
272. s selected Action by User Check if there are problems in the system folder structure Button OK Closes the message box Message LB execute error Display log Cause An error has occurred during LB execution Action by User Select either of the following actions by clicking the OK button displays LB execution log or Cancel button does not display the LB execution log Button OK Displays the LB execution log Cancel Closes the message box Message No file selected in left list box Cause No file is selected in the left hand list box for execution of the add or replace subcommand Action by User Select at least one file Button OK Closes the message box Message No file selected in right list box Cause No file is selected in the right hand list box for execution of the pick or delete subcommand Action by User Select at least one file Button OK Closes the message box Message Would you like to delete the selected modules Cause This is the message for confirming deletion of the selected module in the library Action by User Select either of the following actions by clicking the OK button delete or Cancel button do not delete Button OK Deletes the module selected in the library Cancel Closes the message box 342 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES Error Type Error Message Message Invalid output file
273. s Selected Object Converter Options Dutputl Output Others HEX Madule o Dutput File Name v Browse jw Object Complement u Select HEX Format Intel Format ki Intel Extend Format kie icy C Tex Format kt C C Value Start Address Size Motorola S type Format standard km Motorola S type Format 32bit kme Divide HEX File for the Product with Flash ROM zf Command Line Options Cancel Help Output File Name Specify the path and file name of the object module file by using the Browse button or directly inputting a path and file name Object Complement u Specify this object to write a code in advance to addresses to which a HEX format object is not output to prevent unwanted codes from being written to those addresses and the program from hanging up Value Specifies the value for complement to be performed The range of values that can be specified for complement value is as follows OH lt complement value lt OFFH Users Manual U17836EJ1VOUM 211 212 CHAPTER 6 OBJECT CONVERTER Start Address Specifies the start address area for complement to be performed The range of values that can be specified for start is as follows OH start address lt OFFEFFH Size Specifies the size of the address area for complement to be performed The range of values that can be specified for size is as follows 1H size OFFFOOH Select HEX Format Sele
274. s for Check Sum Evaluation Character Value Decimal 0 to 9 0 to 9 AtoZ 10 to 35 36 37 period 38 _ underscore 39 a z 40 to 65 Users Manual U17836EJ1VOUM 181 CHAPTER 6 OBJECT CONVERTER 1 Data block The format for the data block is shown below Table 6 5 Data Block Format for Extended Tech No of ASCII Field Characters Explanation Header 6 Standard header field Block type 6 Load address 2 to 17 Address from which the object code is loaded Number of characters is variable Object code 2n Number of bytes n displayed as a 2 digit hexadecimal Caution In extended Tech the number of characters in a specific field is variable within 2 to 17 1 to 16 characters of actual data The first character in this variable field is a hexadecimal which indicates the length of the field The numerical zero indicates that a character line consists of 16 characters The length of the character string is therefore 1 to 16 characters and the length of the variable length field including the character string length indicator is 2 to 17 loe I in In Is Q Jo Il iO 020202020202 i ii iii iv v vi vii i Header character ii Block length 15H 21 iii Block type 6 iv Check sum 1CH v Number of digits in load address vi Load address 100H vii Object code 6 bytes 182 Users Manual U17836EJ1VOUM 2 Termination block
275. s is output when TOOL information is not found in input object module file Normally this is always output when link is performed with an old DF incompatible object module file W3420 Message File file name has already had error s warning s by tool name Cause An error message or warning message for each tool CC78KOR RA78KOR used until the link stage is output E3424 Message ZF REL and no ZF REL are mixed in file file name Cause When linking load module of the boot area ROM program of a flash memory model with object module of the flash area program some object module do not specify the zf option during compilation E3425 Message There are different function ID in same name function name file file name Cause A function of the same name declared as EXT FUNC by the compiler has a different ID value F3426 Message Multiple input BOOT file file name 1 First input file file name 2 Cause Two or more load modules in the boot area ROM program were input when a load module in the boot area ROM program of a flash memory model was to be linked with an object module in the flash area program Action by User Specify only one load module file for the boot area ROM program E3427 Message BOOT REL and ZF REL are mixed in file file name Cause Object module specified by the zf option is input during compilation for linking with the zf option specified E3428 Message FLASH start address larger than ROM max address Cause The fir
276. s of the RA78KOR 1 1 Assembler Overview The RA78KOR Assembler Package hereafter referred to as the RA78KOR is a generic term for a series of programs designed to translate source programs coded in the assembly language for 78KOR Series microcontrollers into machine language coding The RA78KOR contains 5 programs Assembler Linker Object Converter Librarian and List Converter In addition a PM that helps you perform a series of operations including editing compiling assembling linking and debugging your program on Windows is also supplied with the RA78KOR Figure 1 1 RA78KOR Assembler Package ASSEMBLER LINKER OBJECT CONVERTER RA78KOR Assembler Package LIBRARIAN LIST CONVERTER PM Users Manual U17836EJ1VOUM 15 CHAPTER 1 GENERAL 1 1 1 Assembler An assembly language is the most fundamental programming language for a microcontroller Programs and data are required for the microprocessor in a microcontroller to do its job These programs and data must be written by users to the memory of the microcontroller The programs and data handled by the microcontroller are collections of binary numbers called machine language For users however machine language code is difficult to remember causing errors to occur frequently Fortunately methods exist whereby English abbreviations or mnemonics are used to represent the meanings of the original machine language codes in a way that is easy for users to comp
277. s specified more than once or if more than one file name is specified Fora detailed explanation of directive files refer to 5 4 Link Directives Example of use Redefine the default memory area ROM RAM lt Contents of the directive file kOr dr gt memory ROM OH 40000H memory RAM OFCFOOH 3000H To link the directive file kOr dr describe as C gt lk78k0r kOrmain rel kOrsub rel dkOr dr 132 Users Manual U17836EJ1VOUM CHAPTER 5 LINKER Link list file output specification 1 p np Syntax p output file name np Default assumption pinput file name map Function The p option specifies output of a link list file It also specifies the destination and file name of the output file The np option makes the p km kd kp kl ll and If option unavailable Application Specify the p option to change the output destination or output file name of a link list file Specify the np option when performing link only to output a load module file This will shorten link time Explanation A file name can be specified as a disk type file name or as a device type file name However only CON PRN NUL and AUX can be specified as device type file names f output file name is omitted when the p option is specified the link list file name in the current folder becomes input file name map If only output file name is specified inp
278. sage on the unavailable display console User s Manual U17836EJ1VOUM 361 APPENDIXD LIST OF SUBCOMMANDS This appendix is a summary of the subcommands in list form It will be helpful to refer to this list when developing software programs This list of subcommands can also serve as an index Table D 1 List of Subcommands IET Abbrev Classification Format Function Format create createAlibrary file Creates a new library file C name Atransaction add addAlibrary file nameAtransaction Adds a module to a library a file delete deleteAlibrary file nameA Amodule Deletes a module from a d name A A library file replace replaceAlibrary file nameAtransaction Replaces one module with r another in a library file pick pickAlibrary file nameA Amodule Retrieves a specified p name A A module from an existing library file list list Aoption Alibrary file Outputs data on modules l name A Amodule name A 4 in a library file help help Displays a help message h on the display exit exit Exits the librarian e 362 User s Manual U17836EJ1V0UM Symbols LB78KOR LC78KOR LK78KOR OC78KOR RA78KOR 230 265 162 209 99 f LK78KOR 148 Absolute assemble list 252 287 A Abort error 296 add 233 a lmf 165 a map 167 asm 55 Assemble list 272 292 Assembler 15 24 AT 113 B b LK78
279. se Memory area space name specified in merge directive is not defined E3205 Message Name name in directive has bad attribute Cause An item that cannot be described in a segment name memory area name or memory space name is described in the directive for example a memory space name is described where a memory area name is required E3206 Message Segment symbol name can t allocate to memory ignored Cause Segment cannot be allocated to memory not enough memory area exists to allocate segment E3207 Message Segment symbol name has illegal segment type Cause This segment type data is illegal User s Manual U17836EJ1VOUM 315 CHAPTER 11 ERROR MESSAGES Error Number Error Message E3208 Message Segment symbol name may not change attribute Cause Attempted to change the link type in the directive for a segment created with the reallocation attribute AT xxxxxH specified during assemble or created using the ORG directive E3209 Message Segment symbol name may not change arrangement Cause Attempted to change the allocation address in the directive for a segment created with the reallocation attribute AT xxxxxH specified during assemble or created using the ORG directive Action by User Do not specify the allocation address in the assembler for a segment whose link type is to be specified during link E3210 Message Segment symbol name
280. ser codes can be located at addresses CO to C2H because these addresses are reserved Specify the option byte value within 3 bytes If the specified option byte value falls short of 3 bytes the higher bits are filled with O The control value to be located at addresses COH to C2H can also be specified by defining the segment with relocation attributes shown below in the assembler source Define the segment with 4 bytes in total including the user option byte starting from address C3H Any segment name CSEG OPT BYTE DB 11H DB 22H DB 33H DB 44H If specification of the assembler source and specification of this option are made in duplicate this option takes precedence 158 User s Manual U17836EJ1VOUM CHAPTER 5 LINKER Example of use To specify A1H at address COH B2H at address C1H and C3H at address C2H as the user option byte value describe as C gt Ik78k0r kOrmain rel gb0A1B2C3H User s Manual U17836EJ1VOUM 159 CHAPTER 5 LINKER Mirror area specification 1 mi Syntax miO or mil Default assumption miO Function The mi option specifies the location destinations of segments in the mirrored area Application Use the mi option to specify the location destinations of segments in the mirrored area Explanation The location destinations of segments with relocation attribute CSEG MIRRORP are specified by the linker f mi0 is specified the segment is
281. so outputs list files such as assemble list files and error list files If assembly errors occur an error message is output to the assemble list file and error list file to clarify the cause of the error Figure 4 1 I O Files of Assembler Include files Assembler source module files Parameter files Temporary files Assembler Assemble list files Object module files Error list files 54 User s Manual U17836EJ1V0UM 4 1 CHAPTER 4 ASSEMBLER 1 O Files of Assembler The I O files of the assembler are as shown below Table 4 1 I O Files of Assembler Type File Name Explanation Default File Type Input files Assembler source module files Source module files written in assembly language for 78KOR Series microcontrollers user created files asm Include files Files referenced from assembler module files Source module files written in assembly language for 78KOR Series microcontrollers user created files source Parameter files Files containing the parameters for the executed programs user created files pra Output files Object module files Binary files containing relocation data and symbol data regarding machine language data and machine language location addresses rel Assemble list files Files containing assembly data such as assemble lists and cross reference lists prn Error list files Files containing error data generated
282. splayed 244 User s Manual U17836EJ1VOUM CHAPTER 7 LIBRARIAN 2 Others tab Figure 7 4 Librarian Options Dialog Box When Others Tab Is Selected Librarian Options Dutput Dthers zal Command Line Options DK Cancel 5 Help Temporary Directory t Specify the path where a temporary file is to be created by using the Browse button or directly inputting a path name Other Options To specify an option other than those that can be set in the dialog box enter it in the input box Caution The help specification option cannot be specified on PM Reset Resets the input contents Option data read Opens the Read Option Data dialog box and after the option file has been specified reads this file Option data save Opens the Save Option Data dialog box and saves the option file under the specified name Command Line Options This edit box is read only The currently set option character string is displayed Users Manual U17836EJ1VOUM 245 CHAPTER 7 LIBRARIAN 7 7 Method for Manipulating Library Files from PM This section describes the method for manipulating library files from PM The Edit Option dialog box is described below 7 7 1 Method for manipulating Register the execution format for starting LB in standalone mode by selecting Register Ex tool from the Tools menu of PM Selecting the registered icon then opens the Library File Name dialog
283. ssage Sub command Buffer full Cause Limit for continuous line length in a subcommand 128 x 15 characters is exceeded Limit for length of 1 line in a subcommand 128 characters is exceeded E5117 Message Can not use device file Cause A device type file is specified in the input file CLOCK is specified in the list command of an input or output file Hie CON or CLOCK is specified in an output object module file or output library E5118 Message Illegal path file file name Cause Path name in the specified file is incorrect W5201 Message Module not found module file name Cause The module for which replace is specified is not in the library file Users Manual U17836EJ1VOUM 327 CHAPTER 11 ERROR MESSAGES POUR Error Message F5901 Message File open error file file name Cause File cannot be opened F5902 Message File read error file file name Cause File cannot be correctly read F5903 Message File write error file file name Cause Data cannot be correctly written to file F5904 Message File seek error file file name Cause File seek error has occurred F5905 Message File close error file file name Cause File cannot be closed 328 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES 11 6 List Converter Error Messages Table 11 5 List Converter Error Messages Action by Us
284. ssary parameter has been specified Action by User Delete the unnecessary parameter F3014 Message Out of range option Cause The specified numerical value is outside the range Action by User Specify a correct numerical value F3015 Message Parameter is too long option Cause The number of characters in the parameter exceeds the limit Action by User Specify a parameter whose character number is within the limit F3016 Message Illegal parameter option Cause The syntax of the parameter is incorrect Action by User Specify a correct parameter F3017 Message Too many parameters option Cause The total number of parameters exceeds the limit Action by User Specify parameters within the number limit F3018 Message Option is not recognized option Cause The option name is incorrect Action by User Specify a correct option name F3019 Message Parameter file nested Cause The f option has been specified inside a parameter file Action by User Do not specify the f option inside a parameter file F3020 Message Parameter file read error file name Cause The parameter file cannot be read Action by User Specify a correct parameter file F3021 Message Memory allocation failed Cause There is insufficient memory Action by User Secure the necessary memory F3031 Message Security ID is not supported for this device Cause A Security ID cannot be used with the specified device Action by User Do not specify a Security ID
285. ssion 1 ERROR AS 2232 RA78KOR 3 error 4 E2202 5 Illegal operand 1 ERROR ASM 2 37 RA78KOR 3 error 4 E2407 5 Undefined symbol reference F 1 ERROR AS 2237 RA78KOR 3 error 4 E2303 5 Illegal expression Item Details 1 Name of source module file in which error occurred 2 Line on which error occurred 3 Type of error 4 Error no 5 Error message Caution The file name and the line where the error occurred may not be displayed Users Manual U17836EJ1VOUM 277 CHAPTER 9 PROGRAM OUTPUT LIST 9 2 Lists Output by Linker The linker outputs the following lists 278 Table 9 2 Lists Output by Linker Output List File Name Output List Name Link list file Link list file headers Map list Public symbol list Local symbol list Error list file Error list User s Manual U17836EJ1VOUM CHAPTER 9 PROGRAM OUTPUT LIST 9 2 1 Linklist file headers The header is always output at the beginning of a link list file Output format 78KOR Series Linker 1 Vx xx Date 2 xx xxx xxxx Page 3 1 Command 4 kOrmain rel kOrsub rel s okO0r map dkOr dr Para file 5 Out file 6 kOrmain lmf Map File 7 kOr map Direc File 8 kOr dr Directive 9 MEMORY ROM OH OED800H 9 MEMORY RAM1 OFCFOOH 1100H 8 EMORY RAM OFEOOOH 1FOOH Link information 10 6 output segment s 11 9DH byte s real data 12 40 symbol s d
286. st address of the flash memory area is greater than the ROM end address of the target device 318 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES Error Nu mbet Error Message E3429 Message BOOT segment symbol name are found in FLASH file file name Cause When load module of the boot area ROM program of a flash memory model is linked with object module of the flash area ROM program a segment with a location address less than the first address of the flash memory area exists in the object module F3430 Cause Different FLASH address in file file name 1 First specified in file file name 2 Action by User Several values are specified as the start address of the flash memory area in the input file Cause Specify the same value for all of the zb option description E3431 Message There are different function name in same ID function name file file name Cause Two or more functions declared as EXT FUNC by the compiler have the same ID value E3432 Message Illegal allocation of an EXT FUNC function function name file file name Cause The entity of the function declared as EXT FUNC by the compiler exists when linking is performed with the zb option specified W3434 Message Can t specify User Option Bytes On Chip Debug Option Bytes Security ID with LMF Cause The gb go or gi option cannot be specified if a load module file is specified for the in
287. struction by paying attention to the branch destination range for each branching By describing the BR CALL directive the assembler generates the appropriate branch instruction according to the branch destination range This is called the optimization function of branch instructions 3 Conditional assembly function With this function a part of a source program can be specified for assembly or non assembly according to a predetermined condition If a debug statement is described in a source program whether or not the debug statement should be translated into machine language can be selected by setting a switch for conditional assembly When the debug statement is no longer required the source program can be assembled without major modifications to the program 32 User s Manual U17836EJ1V0UM CHAPTER2 PRODUCT OUTLINE AND INSTALLATION This chapter explains the procedure used to install the files stored in the supply media of the RA78KOR in the user development environment host machine and the procedure to uninstall these files from the user development environment 2 1 Host Machine and Supply Medium The assembler package supports the development environments shown below Table 2 1 Supply Medium of Assembler Package Host Machine OS Supply Medium IBM PC AT compatible Windows 2000 XP Nete CD ROM Note To use the assembler in Windows PM is necessary If PM is not used each tool included in the RA78K
288. t 22 22 CSEG 23 23 00000 START 24 24 25 29 chip initialize 26 26 00000 RCBF80000 MOVW SP _ STBEG Dl aed 28 28 00004 CD201A MOV HDTSA 1AH 29 29 00007 3620FE MOVW HL LOWW HDTSA Set hex 2 code data in HL registor 30 30 31 ST 0000A RFD0O000 CALL CONVAH Convert ASCII HEX 32 32 output BC register ASCII code 33 33 0000D 3421FE MOVW DE LOWW STASC set DE store ASCII code table 34 34 00010 63 MOV A B 35 35 00011 99 MOV DE A 36 36 00012 A5 INCW DE 37 37 00013 62 MOV A C 38 38 00014 99 MOV DE A 39 39 40 40 00015 EFFE BR 41 41 42 42 END Absolute assemble list 22 22 CSEG 23 23 000D2 START 24 24 25 25 chip initialize 26 26 000D2 RCBF820FE MOVW SP _ STBEG 2M X24 28 28 000D6 CD201A MOV HDTSA 1AH 29 29 000D9 3620FE MOVW HL LOWW HDTSA Set hex 2 code data in HL registor 30 30 31 31 000DC RFDE900 CALL CONVAH convert ASCII lt HEX 32 32 output BC register ASCII code 33 33 000DF 3421FE MOVW DE LOWW STASC set DE store ASCII code table 34 34 000E2 63 MOV A B 35 35 O00E3 99 MOV DE A 36 36 000E4 A5 INCW DE 37 37 000E5 62 MOV A C 38 38 000E6 99 MOV DE A 39 39 40 40 000E7 EFFE BR 41 41 42 42 END 254 User s Manual U17836EJ1VOUM CHAPTER 8 LIST CONVERTER 8 3 List Converter Start
289. t Self self Specifies when using Independent None programming self programming specification 78K0 Series compati Enables assembly of Independent ncompati compatible assembler source macro files generated by the 78KO Series assembler Help Displays a help When the option is No display specification message on the specified all other options display are unavailable User s Manual U17836EJ1VOUM APPENDIX C LIST OF OPTIONS Note Device files will be read from the path determined in the following order 1 Path registered in the device file installer 1 2 Path by which RA78KOR was started up 3 Current folder 4 The environmental variable PATH User s Manual U17836EJ1VOUM 353 APPENDIX C LIST OF OPTIONS C 2 List of Linker Options Table C 2 List of Linker Options Interpretation Classification Format Function Relation to Other Options When Omitted Load module o output Outputs a load If both options o and no oinput file file output file name module file are specified at the same name Imf specification time the option specified no Does not output a last takes precedence load module file Forced load j Forces output of a If both options j and nj are nj module file load module file specified at the same time output MER the option specified last specification PJ Makes the j option takes precedence unavailable Debug d
290. t Converter Options Dialog Box When Output Tab Is Selected 267 List Converter Options Dialog Box When Others Tab Is Selected 268 User s Manual U17836EJ1VOUM LIST OF TABLES Table No Title Page 2 1 2 2 2 3 4 1 4 2 4 3 5 1 5 2 5 3 5 4 6 1 6 2 6 3 6 4 6 5 6 6 6 7 6 8 6 9 6 10 6 11 6 12 6 13 6 14 7 1 7 2 7 3 7 4 8 1 8 2 9 1 9 2 9 3 9 4 9 5 10 1 10 2 11 1 11 2 11 3 11 4 11 5 11 6 11 7 11 8 11 9 11 10 11 11 C 1 Co C 4 C 5 Supply Medium of Assembler Package 33 File Organization 37 Environmental Variables 39 I O Files of Assembler 55 Assembler Options 61 Order of Precedence of Assembler Options 63 I O Files of Linker 109 Segment Allocation Groups External ROM etc 111 Linker Options 124 Order of Precedence of Linker Options 126 I O Files of Object Converter 174 File Type When zf Option Is Specified 175 Extended Tech Header Field 181 Character Values for Check Sum Evaluation 181 Data Block Format for Extended Tech 182 Termination Block Format for Extended Tech 183 Symbol Block Format for Extended Tech 184 Symbol Block Format for Extended Tech 184 Symbol Block Section Definition Fields for Extended 185 Symbol Block Symbol Definition Fields for Extended Tech 185 Motorola HEX File Record Types 186 General Format for Each Record 186 Meanings of Fields 187 Object
291. t in this dialog box enter the option in the input box Caution The help specification option cannot be specified on PM Reset Resets the input contents Option data read Opens Read Option Data dialog box opens and the option data file is specified that file is read Option data save After the Save Option Data dialog box opens save the option data file to the option data file with a name Command Line Options This edit box is read only The currently set option character string is displayed Users Manual U17836EJ1VOUM 171 CHAPTER 5 LINKER 5 7 3 Edit Option dialog box 172 Items are edited in list format in the Edit Option dialog box The Edit Option dialog box is described below Figure 5 6 Edit Option Dialog Box Edit Opiton LIST T Add button Adds a list item If the item to be added is a file or folder the corresponding Browse for Folder dialog box opens In all other cases the Add Option dialog box opens Specify details of the item to be added in this box Figure 5 7 Add Option Dialog Box Add Option Cancel Delete button Deletes the selected list item Up button Moves the selected list item up Down button Moves the selected list item down Add Sub Directory button A subfolder can be added to the selected list item when the item is specified as Library File Search Path i on the Library tab User s Manual U17836EJ1VOU
292. t open temporary file file name Cause Temporary file cannot be opened Action by User Use a disk with an open area in its folder F2913 Message Can t read source file file name Cause A file input output error has occurred in the source file F2914 Message Can t read parameter file file name Cause A file input output error has occurred in the parameter file F2915 Message Can t read include file file name Cause A file input output error has occurred in the include file F2916 Message Can t read overlay file file name Cause A file input output error has occurred in the overlay file F2917 Message Can t write object file file name Cause A file input output error has occurred in the object file Action by User Output object file to another folder or create an open area in the specified disk F2918 Message Can t write print file file name Cause A file input output error has occurred in the assemble list file Action by User Output assemble list file to another folder or create an open area in the specified disk 310 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES E Error Message F2919 Message Can t write error list file file name Cause A file input output error has occurred in the error list file Action by User Output error list file to another folder or create an open area in the specified disk F2920 Message Can t read write temporary file fil
293. te object module files Determination of input modules When a library file is specified for input the module to which an input object module file refers is retrieved from the library and handled as an input module Determination of location addresses for input segments The linker determines location addresses for each segment of an input module If location attributes for a segment are specified in the source module file the segment is located according to those attributes The linker can also specify location attributes in the link directive file of the linker Correction of object codes When location addresses are buried in object codes the linker corrects the object code according to the location address determined in 3 above User s Manual U17836EJ1VOUM CHAPTER 5 LINKER 5 3 Memory Spaces and Memory Areas A memory space is a space provided for defining memory areas A memory area is an area defined in memory for the allocation of segments Memory area Each memory space is divided into several memory areas The memory area declares the memory addresses for the installed memory Caution Only one memory space can be defined No name other than REGULAR can be specified as the mem ory space Table 5 2 Segment Allocation Groups External ROM etc Memory Area Name Default Address Segments Allocated by Default ROM Internal ROM CSEG up to the start address of the RAM area in the case of ROMless products
294. tents of sample prn gt Assemble list ALNO STNO ADRS OBJECT M I SOURCE STATEMENT J 1 2 2 NAME SAMPM 3 3 1 ck ck ck ck Ck ck kk ck Ck ck ck Ck ck ck Ck ck Ck ck ck oko ck kk ck Kk ko kv kv ko ko ko k ck ok 4 4 H 5 5 A HEX gt ASCII Conversion Program 6 6 p 7 7 y main routine 8 8 9 ck ck ck ck kk ck Ck ck kk ck ck kk Sk kk ok KKK ko ko ko kockockockockckc kck 10 10 11 Id PUBLIC MAIN START 12 12 EXTRN CONVAH 13 13 EXTRN _ STBEG 14 14 15 Lo Sse DATA DSEG AT OFFE20H 16 16 FFE20 HDTSA DS 1 17 17 FFE21 STASC DS 18 18 19 F9 nasede CODE CSEG A OH 20 20 00000 R0000 MAIN DW START To specify 1 blank entered by the HT code describe as C gt ra78kOr cf1166a0 sample asm it1 User s Manual U17836EJ1VOUM 86 Contents of sample prn gt CHAPTER 4 ASSEMBLER Assemble list ALNO STNO ADRS OBJECT 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 TL 12 12 13 T3 14 14 15 qi uc 16 16 FFE20 17 17 FFE21 18 18 19 19 2222 20 20 00000 R0000 MI SOURCE STATEMENT NAME SAMPM Ck Ck ck ck ck ck kk ck kk ck kk Ck kk kk ck kk ck kk kk KKK KK KKK R HEX gt ASCII Conversion Program main routine ck ck ck Ck ck Ck ck Ck ck ck Ck ck ck Ck ck kk ck ok ock ck Sk ck ko Sk kv Mk Sk ko ko ko ko PUBLIC MAIN START EXTRN CONVAH EXTRN _ STBEG DATA DSEG AT OFFE20H HDTSA DS 1 STASC DS 2
295. ter the program options are listed Please refer to these when developing programs This list of options can also be used as an index User s Manual U17836EJ1VOUM 349 C 1 APPENDIX C LIST OF OPTIONS Assembler Options Table C 1 Assembler Options Interpretation Classification Format Function Relation to Other Options When Omitted Device type cdevice Specifies the device Independent Cannot be specification type type of the target omitted device Object o output Specifies the output If both options o and no oinput file module file file name of an object module are specified at the same name rel output file time the option specified specification last takes precedence P no Specifies that no j object module file is output Forced Specifies that the If both options j and nj are nj object object module file specified at the same time module file can be output even if the option specified last output a fatal error occurs takes precedence specification mum nj Makes the j option unavailable Debug data g Specifies that local If both options g and ng g output symbol data is to be are specified at the same specification added to an object time the option specified module file last takes precedence ng Makes the g option unavailable ga Specifies that source If both options ga and nga ga debugging data is to are specified at the same be added to an o
296. tes CSEG MAC MOD SET NUM BIT RBIT SFR SFRP Blank dee DSEG BSEG ADDR Code segment name Data segment name Bit segment name Macro name Module name Symbol defined by SET directive NUMBER attribute symbol ADDRESS attribute symbol BIT attribute symbol addr bit SABIT BIT attribute symbol saddr bit SFBIT BIT attribute symbol sfr bit BIT attribute symbol A bit X bit PSW bit Names defined as SFRs by EQU directive Names defined as SFRPs by EQU directive External reference symbol declared by EXTRN or EXTBIT Undefined symbol 3 Symbol value 8 digits 4 Public symbol name User s Manual U17836EJ1VOUM CHAPTER 9 PROGRAM OUTPUT LIST 9 2 4 Local symbol list A local symbol list outputs data on local symbols defined in an input module Output format Local symbol list 1 MODULE 2 ATTR 3 VALUE 4 NAME SAMPM MOD SAMPM DSEG DATA ADDR FFE20H HDTSA ADDR FFE21H STASC CSEG CODE CSEG CSEG SAMPS MOD SAMPS CSEG CSEG ADDR 00114H SASC ADDR 0011AH SASC1 Item Details Name of module in which local symbols are defined CSEG DSEG BSEG MAC MOD SET NUM ADDR BIT SABIT SFBIT RBIT SFR SFRP Blank dee Symbol attributes Code segment name Data segment name Bit segment name Macro name Module name Symbol defined by SET directive NUMBER attribute symbol ADDRESS att
297. tly set option character string is displayed Users Manual U17836EJ1VOUM 267 CHAPTER 8 LIST CONVERTER 2 Others tab Figure 8 4 List Converter Options Dialog Box When Others Tab Is Selected List Converter Options Output Others r eer Command Line Options OK Cancel Help Use Command File Select this option to create a command file Parameterfile f Specify the file to be input as a user defined parameter file by using the Browse button or directly inputting a file name Other Options To specify an option other than those that can be set in this dialog box enter the option in the input box Caution The help specification option cannot be specified on PM Reset Resets the input contents Option data read Opens the Read Option Data dialog box and after the option data file has been specified reads this file Option data save Opens the Save Option Data dialog box and save the option data to the option data file with a name 268 User s Manual U17836EJ1VOUM CHAPTER 8 LIST CONVERTER Command Line Options This edit box is read only The currently set option character string is displayed User s Manual U17836EJ1VOUM 269 CHAPTER9 PROGRAM OUTPUT LIST The following is an explanation of the formats and other information for the lists output by each program Lists Output by Assembler Lists Output by Linker List Output by Object Conv
298. truction DEBUG NODEBUG or DG NODG with the same function as the g ng options can be written at the beginning of a source module ASADEBUG ASADG abbreviated form ASANODEBUG ASANODG abbreviated form For information on control instructions refer to RA78KOR Assembler Package Language User s Manual Example of use To add debug data local symbol data to an object module file kOrmain rel describe as C gt ra78kOr cf1166a0 kOrmain asm g 68 User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER 2 ga nga Syntax ga nga Default assumption ga Function The ga option specifies that source debugging data is to be added to an object module file by the structured assembler The nga option makes the ga option unavailable Application Use the ga option when performing debugging at the source level of the assembler or structured assembler To perform debugging at the source level you will need the separately available integrated debugger Use the nga option in the following 2 cases i Debugging without an assembler source ii When only the object is required evaluation using PROM etc ii Debugging at the source level of the C compiler Explanation If both the ga and nga options are specified at the same time the option specified last takes precedence The ga option takes precedence over other options regardless of the position in whic
299. up 8 3 1 Methods to start list converter The following two methods can be used to start up the list converter 1 Startup from the command line X gt 1c78k0r Aoption input file name Aoption A a b c d c a Current drive name b Command file name of the list converter c Enter detailed instructions for the operation of the list converter When specifying two or more list converter options separate the list converter options with a blank space Uppercase characters and lowercase characters are not distinguished for the list converter options For a detailed explanation of list converter options refer to 8 4 List Converter Options Enclose a path that includes a space in a pair of double quotation marks d Primary name of assemble list Specify the file name of a path that includes a space by enclosing it in a pair of double quotation marks Use the extension prn If only the primary name of the assemble list is specified in the command line the primary names of the object module file and load module file must be identical to the primary name of the assemble list file The file types must also be as shown below File Name Type Object module type rel Load module file Imf Example If the primary name is different between an assemble list file kKOrmain prn and a load module file sample Imf describe as follows so as to specify the input of a lo
300. use Two or more input files have been specified Action by User Specify only one input file F4004 Message Illegal file name file name Cause Either there are illegal characters in the file name or the number of characters exceeds the limit Action by User Input a file name that has legal characters and is within the character number limit F4005 Message Illegal file specification file name Cause An illegal file has been specified Action by User Specify a legal file F4006 Message File not found file name Cause The specified input file does not exist Action by User The file is output as startup routine name Imf if the startup routine of the C compiler is linked In this case specify an output file name with a linker option like o Imf F4008 Message File specification conflicted file name Cause An I O file name has been specified in duplicate Action by User Specify different I O file names F4009 Message Unable to make file file name Cause The specified file is write protected Action by User Release the write protection on the specified file F4010 Message Directory not found file name Cause A non existent drive and or folder has been included in the output file name Action by User Specify an existent drive and or folder F4011 Message Illegal path option Cause Other than a path name has been specified in the option that specifies the path for the parameter Action by User Specify a
301. ut file name map is output to the specified path If both options p and np are specified at the same time the option specified last takes precedence Example of use To create a link list file KOr map describe as C Ik78kO0r kOrmain rel kOrsub rel pkOr map User s Manual U17836EJ1VOUM 133 CHAPTER 5 LINKER Link list file data specification 1 km nkm Syntax km nkm Default assumption km Function The km option outputs a map list into a link list file The nkm option makes the km option unavailable Application Specify the km option to output a map list to a link list file Explanation Ifthe nkm nkp and nkl options are all specified the link list file cannot be output If the nkm option is specified the link directive file cannot be output to a link list file df both the km and nkm options are specified at the same time the option specified last takes precedence Ifthe np option is specified the km option is unavailable 134 Users Manual U17836EJ1VOUM Example of use CHAPTER 5 LINKER To output a map list into a link list file KOr map describe as C IK78kO0r kOrmain rel kOrsub rel s pkOr map km Contents of kOr map Command Para file Out file Map file Direc file Directive kOr map Memory map kOrmain lmf Link information 4 output segment s 5FH byte s
302. uts the boot area and other areas to separate HEX format files kOr hxb kOr hxf describe as C gt oc78k0r kOrlmf zf 208 User s Manual U17836EJ1VOUM CHAPTER 6 OBJECT CONVERTER Help specification 1 Syntax z Default assumption No display Function The option displays a help message on the display Application The help message is a list of explanations of the object converter options Refer to these when executing the object converter Explanation When the option is specified all other options are unavailable Caution This option cannot be specified from PM To reference PM help click the Help button in the Object Converter Options dialog box Example of use To output a help message on the display describe as C gt o0c78k0r 78KOR Series Object Converter Vx xx xx xxx xx Copyright C NEC Electronics Corporation xxxx usage oc78k0r option input file option The option is as follows means omissible ffile Input option or input file name from specified file o file no Create HEX module file with specified name Not s file ns Create symbol table file with specified name Not file ne Create th rror list file with the specified name Not r nr Sort HEX object by address Not uvalue start size nu Fill up HEX object with specified value Not kkind Select hex format I intel for
303. value The range of complement value is from Oh to OFFh Cause A value outside the input limit range is specified as the complement value Action by User Button Message Cause Specify a value within the limit range OK Closes the message box Out of range The range of start address is from Oh to OFFEFFH A value outside the input limit range is specified as the start address Action by User Specify a value within the limit range Button OK Closes the message box Message Out of range The range of size is from 1h to OFFFOOH Cause A value outside the limit input range is specified as the size Action by User Button Message Cause Specify a value within the limit range OK Closes the message box Cannot find folder Will you create The specified folder does not exist Action by User Create a folder or select another folder Button OK Creates a folder and closes the message box Cancel Closes the message box Message Not make folder Cause The specified folder could not be created Action by User Specify another folder Button OK Closes the message box 340 User s Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES 11 7 4 Librarian LB78KOR Table 11 9 Error Messages Displayed by Librarian LB78KOR DLL Error Type Error Message x Message Cannot find LB78KOR EXE shown in environmental variab
304. was started up iv Current folder v The environmental variable PATH Example of use To specify the path for the device file as folder C 78kOr dev describe as C ra78k0r kOrmain asm cf1166a0 yCA78k0ndev 94 Users Manual U17836EJ1V0UM CHAPTER 4 ASSEMBLER Symbol definition specification 1 d Syntax dsymbol name value symbol name value Default assumption None Function The d option defines symbols Application Specify the d option when defining symbols Explanation The value given to a symbol is binary octal decimal or hexadecimal When value specification is omitted 1 will be specified Upto 30 symbols can be specified by using a comma as a delimiter Upto 31 characters can be described for a symbol name When duplicate names are specified the latest one specified is valid Symbol names are case sensitive Symbols defined with d are used instead of EQU SET RESET An abort error occurs if a symbol name specified for d was also defined in the source Example of use To specify 2 as the symbol definition describe as C gt ra78k0r kOrmain asm cf1166a0 dSYM 2 User s Manual U17836EJ1VOUM 95 CHAPTER 4 ASSEMBLER Series common object specification 1 common Syntax common Default assumption The object file supporting the specified device is output Function The common option specifies output of an object
305. y file is to be created by using the Browse button or directly inputting a path name Change Source Regulation Z This option selects the type of kanji code 2 byte code SJIS zs EUC ze or No Multibyte zn to be used in the comment of the source Use Self Programming self Select this option to use the self programming function Use Command File Select this option to create a command file 106 User s Manual U17836EJ1VOUM CHAPTER 4 ASSEMBLER Symbol Definition d Input a numeric value to be defined as a symbol by using the Edit button opens the Edit Option dialog box or directly inputting a value Up to 30 items can be specified by using commas as delimiters Up to 31 characters can be used for specifying a symbol Parameterfile f Specify the file to be input as a user defined parameter file by using the Browse button or directly inputting a file name Other Options To specify an option other than the options that can be set in this dialog box enter the option in the input box Caution The help specification option cannot be specified on PM Reset Resets the input contents Option data read Opens the Read Option Data dialog box and after the option data file has been specified reads this file Option data save Opens the Save Option Data dialog box and save the option data to the option data file with a name Command Line Options This edit box is
306. ype rel and input the file Example of use f the primary name is different between an assemble list file kOrmain prn and an object module file sample rel describe as follows so as to specify the input of an object module file sample rel C gt Ic78k0r kOrmain prn Isample rel User s Manual U17836EJ1VOUM 259 CHAPTER 8 LIST CONVERTER Load module file input specification 1 I Syntax l input file name Default assumption lassemble list file name mf Function The option specifies the input of a load module file Application When the primary name of a load module file is different from the primary name in the assemble list file or if its file type is not Imf specify the l option Explanation Ifa fatal error occurs the absolute assemble list file cannot be output If only the primary name of the input file name is specified the list converter will assign the file type Imf and input the file Example of use f the primary name is different between an assemble list file kKOrmain prn and a load module file sample Imf describe as follows so as to specify the input of a load module file sample Imf C gt Ic78k0r kOrmain prn Isample Imf 260 User s Manual U17836EJ1VOUM CHAPTER 8 LIST CONVERTER Absolute assemble list file output specification 1 o Syntax o output file name Default assumption oassemble list file name p Funct
307. ype Explanation Fn0xx Command line analysis error Fn9xx File or system error Fnixx Other abort error Cnxxx Internal error En2xx Statement specification error En3xx Expression error En4xx Symbol error En5xx Segment error En6xx Control instruction or macro error Wnxxx Any type of warning Remark n 2to6 2 Assembler 3 Linker 4 Object Converter 5 Librarian 6 List Converter Users Manual U17836EJ1VOUM CHAPTER 11 ERROR MESSAGES 297 CHAPTER 11 ERROR MESSAGES 11 2 Assembler Error Messages Table 11 1 Assembler Error Messages d Error Message F2001 Message Missing input file Cause An input file has not been specified Action by User Specify an input file F2002 Message Too many input files Cause Two or more input files have been specified Action by User Specify only one input file F2004 Message Illegal file name file name Cause Either there are illegal characters in the file name or the number of characters exceeds the limit Action by User Input a file name that has legal characters and is within the character number limit F2005 Message Illegal file specification file name Cause An illegal file has been specified Action by User Specify a legal file F2006 Message File not found file name Cause The specified file does not exist Action by User Specify an existent file F2008 Message File specification conflicted file name
308. zable number of characters 8 for the assembler and 7 for the compiler E3403 Message Symbol symbol name unmatched type in file file namet First defined in file file name2 Cause Externally defined referenced symbol type with same name is different in file 1 and file 2 E3404 Message Multiple Symbol definition symbol name in file file name1 First defined in file file name2 Cause Public symbol defined in object module file 1 is already declared PUBLIC in object module file 2 E3405 Message Undefined symbol symbol name in file file name Cause Symbol declared EXTRN in the file is not declared PUBLIC in another file W3406 Message Stack area less than 10 bytes Cause Size of protected stack area is 10 bytes or less size of stack area protected in memory area specified with the s option is 10 bytes or less W3407 Message Can t allocate stack area Cause No free area is available in memory area in which stack area is protected stack area cannot be protected in memory area specified with the s option E3408 Message Can t find A symbol Cause The symbols written subsequent to the program entry address specification a of the linker option do not exist in the public symbols E3409 Message A symbol symbol name is unmatched type Cause The type of the symbol searched by a in program entry address specification of a linker option is incorrect Action by User Use the permitted type of the symbol that is to be searched by program entry

Download Pdf Manuals

image

Related Search

Related Contents

presse site DB 005.jpg  Riverview Access Transit User's Guide  imprimir  Foremost COBA3021 Instructions / Assembly  普通便座  Il existe plusieurs moyens pour aider vos patients à cesser de fumer.  

Copyright © All rights reserved.
Failed to retrieve file