Home
CA830, CA850 C COMPILER PACKAGES OPERATION
Contents
1. GP SYMBOL SECTION SECTIO SECTION GP NAME NAME SIZE REAL SIZE ASSUMED NUMBER Op DATA sdata 0x000af10 0x00002000 4 OK 0x00003450 8 OK 0x00004430 12 OK 0x000050a8 16 OK 0x00007b40 20 OK 0x0000a010 24 0x0000af10 32 sbss 0x00012050 0x00000050 4 OK 0x00002050 16 OK 0x00007050 512 OK 0x00010050 1024 a b c d e 227 Example of output information on relocatable object fle z kk LINK EDITOR GP INFORMATION x x GP SYMBOL SECTION SECTIO SECTION GP NAM E AME SIZE REAL SIZE ASSUMED NUMBER NOT AVAILABLE a The a b c d sdata 0x000af10 0x00002000 4 OK 0x00003450 8 OK 0x00004430 12 OK 0x000050a8 16 OK 0x00007b40 20 OK 0x0000a010 24 0x0000af10 32 sbss 0x00002050 0x00000050 4 OK 0x00002050 16 OK GpCommon 0x00010000 0x00005000 512 OK 0x00010000 1024 b c d e meaning of each item of the output information is as follows Name of global pointer symbol The name of the global pointer symbol refer to 3 6 on page 290 used for link If the created object file is relocatable NOTAVA ILABLE is displayed Section name The name of the sdata sbss attribute section to which data are allocated Because a relocatable object file cannot determine allocation of an undefined external symbol to a section the Id inter
2. To set up scrolling Drag the scroll button used for the scroll size and interval to the desired setting Or from the keyboard use arrow keys to change the setting incrementally The unit of measurement is the number of lines Click the OK button to change the scrollable number of lines and the scroll interval before closing the dialog box Click the Cancel button to close the dialog box without making any changes These scroll settings are ignored when copying or moving an internal command or when executing an external command In such cases scrolling is always one line at a time al Operation Prompt To change the prompt Opens the dialog box for changing the VSH window s prompt bus Cancel Help Enter a character string from the keyboard to the dialog box s command line Click the OK button to change the prompt and close the dialog box The new prompt will be shown starting from the next input line Click the dialog box without changing the prompt Cancel button to close the In addition to ordinary characters such as alphanumeric characters the character string can include special character strings that automatically convert to other meanings Special character strings are listed below The default character string is N G B D G H L N P Q T
3. ceeeeeeeee 66 Setting other options C compiler eeeeeeeee 58 Setting other options link editor 0 0 eee 74 Setting other options ROM storing processor 79 Setting output 1 opilonsg 50 Setting output 2 option 53 Setting pre processor Options ssssssssessereseeresrenesene 44 Setting ROM storing processor options ss 76 sSIDSS SECTION ccseececeeeeeeeeeeeeees 266 279 314 321 Sidata section 266 279 314 321 Software register bank 53 157 Special fUNCtION target eeeeeeeeeeeeeeeeeeteeeeeeteneees 143 Standard directory of device file 160 204 223 232 344 373 385 Standard directory of include file eee 154 Standard directory of library s easn 223 233 242 String RTE 365 420 Structure of Object le 412 Suppression of warning message eseeseeeeeeee 158 Symbol directive 2 eee eeeeeeeeeeeeeseeeeeeeeeaeeeeeenaeees 255 ele TEE 294 alignment condition 0 eee eeeeeeeeeneeeetteeeeeneeeeeees 294 base symbol name sssssssssssssssrrsssrrrnnrssrrennsessrnne 294 Segment NAME sietini aereis akenei iaai 295 Symbol name sannin n A R R 294 Symbol e 294 SyMbol table ccceccceeeeceeessseeeeseeeessneeeesees 365 419 Symbol table entre 419 T RE te 140 Temporary AU 29 text attriDUte SECTION eeseeeeeeeeeeeeeeees 257 294 E ag le UE 221 254 Text pointer symbol seere 221 254 290 314 E de E 321 Des section 266 279
4. Option Compiler Options Select the lt lt Output 2 gt gt option button Check the Create Object for ROM box L Create Object for ROM Xr When specifying an option for romp go to the PM s Option menu and select ROM Processor Options After the above options have been set and a build is started from the PM romp is automatically started after ca as and Id and an object file that contains the ROM storing information is created During the build operation linking of libr a and rompcrt o is automatically specified The lId s output file is deleted as a temporary file Caution When romp is started from the PM the output object file name is the first file name in source list out which is the same naming convention for the Id The file name is not romp out which is the default name when romp is started from the VSH 389 Command startup from VSH Example in which Id is started from ca gt gt Is ldir sample c gt ca830 cpu 5100 W1 D ldir Xr sample c gt Is a out ldir sample c gt romp830 a out gt Is a out ldir romp out sample c If the c option of the ca is specified directly link libr a and rompcrt o with the Id In this case be sure to specify the Xr option of the ca to call the copy routine _rcopy in a C source program Example in which Id is started by itself gt gt Is ldir sample c
5. Since the ROM storing processor needs to be activated only once per project there are no file specific settings The name of executable object file that can be output by the ROM storing processor is the first filename minus the extension shown in the lt lt Source List gt gt dialog to which the extension OUT is added and is the same object file name output by the link editor The ROM storing processor is started up by the Project Manager only when lt lt Create Object for ROM gt gt has been specified as a C compiler option At that time the object file output by the link editor is a temporary file which is deleted when the ROM storing processor is terminated The output object file name cannot be specified there is no specification method that corresponds to the o specification to activate from the VSH command line Two option buttons are displayed at the upper part of the ROM storing processor option setting dialog By selecting an option button the display of dialog is changed 1 Option buttons for displaying option setting dialogs 1 Option Opens the dialog box that is used to set the ordinary options of the ROM storing processor refer to page 77 0 Other Opens the dialog box that is used to set the other parameters refer to page 79 76 Setting options A Figure 2 22 Option Settings Dialog ROM Storing Processor ROM Processor Options EN CO Others Packing Section p Entry Labe
6. This option outputs Id s version number to standard output and then terminates processing This option can be specified only when starting from VSH e symbol This is the entry point address value for the object file from which a symbol value symbol is created If this option is omitted the symbol start value or the lowest address value from the created object file is used as the entry point address value This option uses a two byte num value a four digit hexadecimal number as a filling value for any holes that occur in created object files If this option is omitted 0x0000 is assumed This option outputs a description of options to standard output This option can be specified only when starting from VSH This option outputs a link map showing the location of sections to standard output This option specifies ofile as the name of the object file to be created If this option is omitted a out is assumed This option can be specified only when starting from VSH This option creates a relocatable object file If this option is omitted an executable object file is created This option can be specified only when starting from VSH regnum This option specifies the register model of the library to be referenced The following numbers can be specified as num 22 22 register mode 26 26 register mode If this option is omitted the 32 register mode library is referenced This option cr
7. a gt file rompcrt s text align 4 globl S rome D romp Bi When the ca is started with the Create Object for ROM Xr option specified a code is generated in the manner that a label called __S_romp indicates the first address exceeding the end of the text section within the object as an absolute address By linking this code lastly an area for the rompsec section is allocated immediately after the text section When romp is started from the Project Manager libr a and rompcrt o are linked automatically with Id by using the Create Object for ROM option of the ca Even when starting from VSH if Id is started from ca the ca specifies to link libr a and rompcrt o with Id by using the Xr option In either case rompcrt o is linked lastly 6 If this code is customized create a relocatable object rompcrt o by using the assembler as and place the object in the directory at the lipxxx r32 libxxx r26 libxxx r22 position from the directory to which the C compiler driver ca has been installed 7 Section name defined in the second line of the above mentioned code 8 Aligned under a 4 byte alignment condition 386 3 2 rompsec Section and Link Directive When storing a program to ROM a link directive is necessary that takes addition of the rompsec section to the text section into consideration Specify addresses suitable for RAM and ROM locations of the target system so that the address
8. than once in same or other directive Mistake example gt sec SPROGBITS AX AW 52 Ignore section attribute G and section attributes A W and X must match segment attributes R W and X 282 4 Address Specify the address from which allocating of the specified output section is started Usually an address is specified for each segment but a specific section can be allocated to a specific address The address specification format conforms to the address specification format of the segment directive refer to page 270 Automatic location of interrupt handler The Id adds a link directive to allocate an interrupt handler to the specified directive file in accordance with the interrupt request name defined in the device file Refer to page 270 for details 5 Hole size Specify the size of the hole to be created The specified hole is created at the end of the specified section Specification format of the hole size conforms to specification format of the hole size of the segment directive refer to page 271 6 Alignment condition Specify the alignment condition that must be satisfied when the specified section is allocated The alignment condition can be omitted If omitted the default values are as follows tidata byte tibss byte section 0x1 bytes V850 text section 0x4 bytes V830 text section 0x2 bytes V850 Others 0x4 bytes The specification form
9. 18 Range of 0x0 to Oxffffff 19 Range of 0x0 to Oxffffffff 20 Range of 0x0 to Oxffffffff 350 5 S8 record Indicates an entry point address S8 LL AAAAAA SS NL a b a Record type is S8 b Entry point address 24 bits 21 Range of 0x0 to Oxffffff 351 3 3 Expanded Tek Hex Format The file in the expanded Tek hex format consists of three types of blocks data block symbol block and termination block Figure 3 3 shows the file configuration in the expanded Tek hex format Figure 3 3 File Configuration in Expanded Tek Hex Format Data block Data block Symbol block Termination block Each block consists of fields as follows LL TI SS field field NL a b c d e a Header character b Block length number of characters in blocks other than and NL c Type of block d SS and NL by 256 and expressed as 2 digit hexadecimal number e New line n 22 6 data block 3 symbol block 8 termination block 23 The value for each character is determined as follows 0 to 9 0 to9 AtoZ 10 to 35 36 65 352 Symbol block Og Beet Check sum value of remainder resulting from dividing total value of characters in blocks other than 38 39 a to z 40 to 1 Data block Indicates the value of a code LL I SS LA A D D NL a b c O Block type is 6 Number of digits
10. 8 Alignment condition Specify the alignment condition of the specified segments in allocating the segments to a memory space The alignment condition can be omitted If omitted 0x84 is used as the default value refer to Table 3 3 on page 265 Specify the alignment condition in the following format e Specify an alignment condition as an even number If an odd number is specified the Id outputs the following message assumes that the specified alignment condition plus 1 is specified and continues linking warning line num aligned odd value number1 to be even value number2 e Ifan address is specified the specified address takes precedence and the specified alignment condition is ignored e Start specifying an alignment condition with A e A must not be followed by a blank space s A may be uppercase or lowercase e Do not use an expression to specify an alignment condition 9 Mapping directive Specify allocation of the input section to a segment For the details of the mapping directive refer to 3 5 on page 278 e Ifthe mapping directive is not specified for the segment directive the Id ignores the segment directive 47 8 byte boundary double word boundary 48 It is assumed that the segment directive is not specified 273 3 4 4 Using segment directive 1 Allocating segment to specified address When allocating a segment to a memory space by specifying an address specify the a
11. This command removes the directory specified by path However the directory to be removed must be empty The directory where the system file or hidden attribute file exists cannot be removed The current directory cannot be removed either This command contains the same function as the RD command does Examples A gt RMDIR TMP lt Removes empty TMP directory in drive A A gt RMDIR B TMP lt Removes empty TMP directory in drive B 134 TIME Display time TIME TIME Summary Display time Synopsis TIME Description This command displays the current time Examples A gt TIME Current time is 17 05 09 00 lt Displays the current time 135 TYPE Display contents of text file TYPE TYPE Summary Display contents of text file Synopsis TYPE A drive path filename Description This command displays the contents of the specified text file Examples A gt TYPE A gt TYPE 136 FILE C B WORK FILE lt Outputs the contents of FILE C lt Outputs the contents of FILE C in the WORK directory of the drive B 3 6 Activation of CA Commands This section describes how to activate the commands included in this compiler package i e CA commands from the VSH shell 3 6 1 Activation from command line CA commands can
12. 11 f Sets filling value Format f A num e f must be followed by a blank space Feature Uses a 2 byte value specified by 4 digit hexadecimal number num as the filling value of the hole created in the object file to be created The specification by this option takes precedence over the filling value specified by a link directive e If numis of less than 4 digits it is assumed that as many Os as the deficient digits are specified at the beginning If the size of the hole is less than 2 bytes only the necessary number of digits is taken out from the lower part of the specified filling value for initialization Default assumption 0x0000 is assumed Example e 1d850 f Oxffff file1 o file2 0 Object files lei o and file2 o are linked with a filling value of Oxffff 31 Includes both the hole created to satisfy the alignment condition of a segment and section and the hole explicitly specified to be created by a link directive 239 12 fe Checks mixing of calling specifications Format fc Feature Checks all the input object files whether the old calling specifications and new calling specifications exists in mix Default assumption Only checks the object file created from the C source file Example e 1d850 fc file1 o file2 0 Checks mixing of calling specifications when object files lei o and file2 0 are linked regardless of whether they have been created from a C source file or assembler sou
13. 328 line num section name is expected at the beginning of section directive Start a section directive with a section name line num segment segment already defined Segment segment has been already defined line num string specified in EP symbol directive ignored string must not be specified in ep symbol directive and is ignored V850 line num string specified to section section more than once in same or other directive string has been specified more than once in the same section directive or another section directive for section section line num string specified to segment segment more than once in same or other directive string has been specified more than once in the same segment directive or another segment directive for segment segment line num string specified to symbol symbol more than once in same or other directive string has been specified more than once in the same symbol directive or another symbol directive for symbol symbol line num symbol symbol already defined at line number Symbol symbol has been already defined on the numberth line line num symbol directive of symbol symbol needs string string is necessary for the symbol directive of symbol symbol line num symbol kind string specified more than once in same or other directive Symbol type string has been defined more than once in the same or another directive line num too many F
14. Section Data File Specifies a section file name to allocate data toa section by using an option instead of pragma refer to page 397 By checking lt lt Use File gt gt a file name can be set in the text box Be sure to specify a file name when lt lt Use File gt gt is checked Since a section file is divided into several files delimit each file names with from others when specifying two or more file names This option cannot be set independently for each source file and is always used for all files This area is in the form of a drop down list and a file once specified is registered to the list up to 10 files This option can be selected by clicking or arrow key 2 Refer to the section of the V800 Series C Compiler Package User s Manual C Language that describes character strings and comments in the language specifications 42 2 Buttons OK Delete Source Option Cancel Help Enables the specified items and closes the dialog This button appears dimmed and cannot be selected when options for the overall project have been specified It can be selected when options are specified by selecting source files via the Project Manager s lt lt Source List gt gt dialog When itis selected this button deletes any options specified for a particular source file and applies only overall options Ignores the specified items and closes the dialog Opens the Hel
15. Summary Rename directory Synopsis RENDIR A drive path1 A path2 Description This command changes the specified path1 to path2 Examples A gt RENDIR DIR DIR2 lt Renames the directory name DIR as DIR2 A gt RENDIR C DIR DIR2 lt Renames the directory name DIR in drive C as DIR2 The drive is not changed 132 RM Remove file RM RM Summary Delete file Synopsis 1 RM A option A drive path filename 2 RMA t A option A drive path Options f Forcibly removes read only files No error message is output if the specified file does not exist i Opens a dialog box to prompt for confirmation of removal r Recursively removes subdirectory contents Description When using 1 in Synopsis this command removes the file specified by filename When using 2 in Synopsis this command removes the entire contents of the directory specified by path To do this the r option must be specified Examples A gt RM f TMP FILE C lt Forcibly removes FILE C from the TMP directory A gt RM r B TMP lt Removes the entire contents of the TMP directory in the drive B including any subdirectories 133 RMDIR Remove directory RMDIR RMDIR Summary Remove directory Synopsis RMDIR A drive path Description
16. This chapter explains the operations of the ar 2 1 Command Input Format from VSH Command Line ar A key option A member name A archive file name A member name or file name Can be omitted Pattern in immediately before can be repeated A One or more blank spaces 2 2 Types and Features of Keys Options Only one key can be specified on starting the archiver Options may be omitted 2 2 1 Key list The following table lists keys of the ar Specification Format Feature This option outputs the ar version number to standard output and then terminates processing This option deletes the specified member from the specified archive file This option moves the specified member to the end of the specified archive file ma A member This option moves the specified member to the position immediately after the member member in the specified archive file If the member is omitted processing is stopped mb A member This option moves the specified member to the position immediately before the member member in the specified archive file If the member is omitted processing is stopped This option adds the specified file to the end of the specified archive file If the specified archive file does not exist a new archive file is created and contains the specified file This option exchanges the specified file with the member having the same name in the specified archive lei ra A member This option exch
17. gp symbol offset to an address of first address of lowest data attribute section 32 Kbytes in subjected segment data attribute section exists Specifies base symbol name gp symbol value an address of first address of lowest data attribute section 32 Kbytes in subjected segment gp symbol value offset to an address of first address of lowest bss attribute section 32 Kbytes in subjected segment bss attribute section exists Specifies base symbol name gp symbol value l an address of first address l of lowest bss attribute section T 32 Kbytes in subjected gp symbol value 0x0 segment 293 3 6 3 Explanation of each item that can be specified for symbol directives 1 2 3 4 5 Symbol name Specify the name of the created tp symbol gp symbol or ep symbol V850 e An identifier consisting of appropriate characters shown on page 255 and with any length can be used for a symbol name s This symbol name is in the symbol table of the output object file Symbol type Specify whether the tp symbol gp symbol or ep symbol V850 is to be created e The type of symbol that can be specified is only TP_SYMBOL that is the symbol type of the tp symbol GP_SYMBOL that is the symbol type of the gp symbol or EP_SYMBOL that is the symbol type of the ep symbol e Specification of the symbol type must not be omitted Base sym
18. gt ca830 cpu 5100 c Xr sample c gt Ils ldir sample c sample o gt 1d830 D ldir nectools 1lib830 r32 crtN o sample o lr lc nectools 1lib830 r32 rompcrt o gt Is a out ldir sample c sample o gt romp830 a out gt Is a out ldir romp out sample c sample o Caution When romp is started from the VSH the default name for the output object file is romp out 390 CHAPTER 4 COPY ROUTINE This chapter explains the copy routine _rcopy necessary for the program to be stored to ROM Outline _rcopy Copies initial value data RAM text Format int _rcopy amp label number unsigned long label long number Explanation rcopy amp label number copies the initial value data and text to be located in the internal RAM in the rompsec section indicated by number to an area prior to ROM storing based on the information in the rompsec section existing at addresses following the address indicated by label Copying is not executed if a magic number that indicates an object created by the romp does not exist in a 4 byte area following the address indicated by label Specify the number of the section to be copied as number To copy all the sections in the rompsec section specify 1 If any other number is specified copying is not executed Copying is not executed also if overwrite occurs as a result of copying Return value _rcopy returns 0 if
19. must not be redefined Macro name must not be re defined because it is reserved for the system E2126 E2129 E2130 E2131 E2133 E2134 E2135 E2136 E2137 E2151 E2152 E2155 E2156 E2157 E2159 System reserved macro name must not be undefined Macro name definition reserved for the system cannot be canceled illegal macro parameter name The parameter name of the macro is incorrect macro name mismatch number of parameters The number of parameters of macro name does not agree macro name missing yY is missing from the macro name definition that has a parameter illegal operand for operator Something other than a parameter is specified for the operator in macro definition compiler limit too long stringizing result num The character string is too long The maximum value of this processing system is 4045 illegal operand for operator The description of connection of tokens in macro definition is incorrect illegal pasting result The result of connection tokens is incorrect compiler limit too long pasting result num The result of connection tokens is too long The maximum value of this processing system is 4045 illegal preprocessing directive The description of the preprocessing directive is wrong illegal number name in conditional inclusion name that is not an integer must not be specified in an expre
20. regname for unary amp The address of internal peripheral function register regname cannot be obtained unexpected EOF missing pragma endasm Specification of the final assembler insertion cannot be found illegal argument for set UU unsigned int The argument of the function that sets an interrupt level is wrong Specify only one integer type as an argument V830 First argument for set_il is out of range The value of an interrupt level exceeds the range that can be specified An integer of 0 to 16 can be set as an interrupt level V830 First argument for set_il is out of range The value of an interrupt level exceeds the range that can be specified An integer of 1 to 8 can be specified as an interrupt level V850 E2682 E2685 E2692 E2693 E2694 E2695 E2696 E2697 E2698 E2701 E2702 E2712 E2713 E2714 Second argument for __set_il must be string literal Specify a character string indicating an interrupt request name as the second argument of the function that sets an interrupt level V850 illegal argument for set_il int char The argument of the function that sets an interrupt level is wrong Specify an integer type as the first argument and an interrupt request name as the second argument V850 Both interrupt attribute and rtos_task are specified An RTOS task and an
21. 18 Subscript 18 An entry with symbol table index 0 is reserved and each constituent has the value of 0 419 B 5 2 String table This section explains the string table which is a type of a section The string table is a section having section type STRTAB and consists of a character string that ends with a null character 0 This character string is referenced by using an index that is an offset from the beginning of the string table refer to Figure B 2 The object file in the ELF format uses this character string to hold the names of symbols and sections For example constituent name of the section header table entry has an index to string table shstrtab that holds a section name Figure B 2 Relationships between Index and Character String in String Table Index 0 1 2 3 4 5 6 7 8 9 0 10 20 Character string no name name Variable able able null string 20 It is stipulated that the first 1 byte expressed by index 0 is a null character 420 B 5 3 Reserved section In the ELF object file format several sections are reserved as reserved sections Table B 7 lists the names section types and section attributes of the reserved sections Table B 7 Reserved Sections Contents Section Type Section Attribute bes bes section NOBITS cdata1 cdata1 section PROGBITS cdata2 cdata2 section PROGBITS cdata3 cdata3 section PROGBITS const const sec
22. MEMO lt APPENDIX gt 407 APPENDIX A SECTION FILES Section files are text files that are input during compilation and that revise sections used for allocating variables An allocation specification using a section file takes priority over a pragma section directive in a C language source program In the CA850 section files that are output by the sf can be used The sf merges information from several input files and outputs a single section file as specified by the ca s options Example of section file output by st SES Created by sf850 at Sat Mar 2 17 26 25 1996 tidata file func variable section size frequency a c sil data 4 10 a c si2 data 4 8 a c fl sfil 4 8 i 4 3 j Cie After the section file in the above example has been specified and recompiled variables eil and si2 which had been allocated to the data section and variables sfi1 i and j which had not been allocated to a specific section are allocated to the tidata section Section file is specified and recompiled sfi1 j tidata si2 data sil In the CA830 there is no sf but like the CA850 the CA830 can use section files to revise sections The format of section files accepted by the ca830 and ca850 are described below along with some caution points 9 For the comment output levels and the meanings refer to the description of the sf s cl option 408
23. Section Data File XI Use File Xsec_file File Name secfile E Example of activation from VSH gt ca850 Xsec_file secfil et EI Dat 6 6 A o o E 400 Refer to lt lt Frequency Information File gt gt on page 50 Refer to _Xcre_sec_data option on page 156 Refer to lt lt Section Data File gt gt on page 42 Refer to Xsec_file option on page 153 Cautions e The variables that can be specified to be located are external variables static variables in file and static variables in function Character string constants are not located e When compiling each of two or more C source files and linking them to create an object file compile each file by specifying its frequency information output and creating two or more sec files When creating a section file however sec files must be input to sf all at once and integrated Otherwise the variable information for the external variables will not be integrated and the valid section file cannot be created e The variable specified by the section file is equivalent to specifying pragma section Therefore temporary definition of an external variable is treated as definition If the external variable is temporarily defined by two or more files an error occurs during linking In this case extern must be always declared in a file that references external variables e sf outputs a section file directing that all variables be allocated to
24. This button appears dimmed and cannot be selected when options for the overall project have been specified It can be selected when options are specified by selecting source files via the Project Manager s lt lt Source List gt gt dialog When itis selected this button deletes any options specified for a particular source file and applies only overall options Ignores the specified items and closes the dialog Opens the Help window 45 o Setting language options Figure 2 9 Language Option Settings Dialog Compiler Options x 1 Input 2 Preprocessor 3 C 4 Optimization CD Output 6 Output 7 Message C0 Others Sign of Bit field int Default signed Signed xbitfield signed Unsigned xbitfield unsigned T Strict ANSI C Rule ansi I Strict Integer Extension Xe In the case of CA850 Sign of char Default signed Signed Xchar signed Unsigned xchar unsigned Delete Source Option Cancel Help 1 Options Sign of Bit field int Xbitfield This area is used to specify the signed or unsigned status of an integer type bit field for which the signed unsigned status has not been specified The default setting is signed Sign of char Xchar This area is used to specify the signed or unsigned status of simple char type for which the signed unsigned status has not been specified The default setting is s
25. __gp_DATA GP_SYMBOL amp __tp_TEXT DATA1 DATA2 DATA3 oe __ep_DATA H EP_SYMBOL D I 297 Figure 3 25 Example of Creating One Each of tp gp ep Symbols sidata SIDATA tidata segment DATA3 segment DATA2 segment DATA1 segment libfunc o TEXT3 segment TEXT2 segment TEXT1 segment __tp_ TEXT gt Lower address 298 2 Creating a symbol with each segment specified To create the tp and gp symbols for each of two or more segments specify each of the segment names by the symbol directive For example when object files crtN o main o and func o and object file libfunc o in archive file a usrlib libusr a are linked with the directive shown in Figure 3 26 tgo symbols mp symbol1 mp symbol2 and___tp_symbol3 are created for the three segments TEXT1 TEXT2 and TEXT3 and gp symbols gp _symbol1 gp_symbol2 and __gp_symbol3 are created for another three segments DATA1 DATA2 and DATA refer to Figure 3 27 Note that the example in Figure 3 27 is for the CA850 and that the SIDATA segment is subjected to the ep symbol To create two or more symbols normally the tp and gp values must be explicitly changed by the application program When the RTOS is used as the target environment the RTOS changes the gp value 69 Refer to V800 Series Real Time Operating System User s Manual 299 Figure 3 26 Example of Commands for Creating Two
26. cccsecsseesseesseeeseeeeseeeneee eee eeeaeesenessneesneesaneeseesesenseenseeanensaees 84 SL What is VSH aeaa eena AEE AEEA Eeen AE EEA AE AAE EES AAEE EEA 84 3 2 Activation of VSH aserre ueenssrenrenden e anane un aeann EES r AE N ERE Eeen a een EENS 84 23 Funcion Of VSH areare NEEE EA EEE EE O E EE OOE eee 85 3 3 1 Command line editing FUNCTION s ssssssussunsunsensnnnnnnnennnnnnnnnnunnunnnnnunnnnnnnnnnnnnnnnennnannnnn nannan 86 3 3 2 Scroll FUNCOMS eis ccisceciccsiveesctente cee csescecinescnentevenue ecnte ccbewcctredceveuecentte cue cescensnnenuevacerstuesues 87 3 3 3 History FUNCTION cc ceeeeeeeseeeeeeeeeeneeeeeenseeeeeseeeeeseeeeeneneeeasenesaseeeeeaseessasenenaseeesenseeeenseeneesenens 88 3 3 4 Allas Ile EE 89 cc MOMUS S E AA T A 90 3 4 Activation of Commands from VSH sssssssssssssssnnnennnunnnnnnunnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nannan nna 99 3 4 1 Operations related to internal commandS Only cceeeseeeeeeeeeeeeneeeeeeeeeeeeeeeeeneeeneeees 99 3 4 2 Operations related to external commandS Only ss ssssssnssnssunsnnnnunnnnnnunnnnnnnnnnnnnnnnnnnnna 100 3 4 3 Operations related to all COMMANAS ss ssssssnssnssunrnnnnnnnunnnnnnnnnnnnnunnnnnnnnnnnnnnnnnnnnnn nanana 100 3 5 VSH Internal Commands ee ee EES GE ER Ene Kaake tee er Eesen 102 3 6 Activation of CA CommandsS ssssssssssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnm nnmnnn nnmnnn nnmnnn 137 3 6 1 Activation from command line s sssssssens
27. dis messages are basically output in the following format dis message 3 2 Messages file bad magic file The specified file is not an object file of the V800 Series can not open file file File file cannot be opened file is not ELF nor archive file File file is neither an object file in the ELF format nor an archive file memory allocation error The memory capacity has run short nested command file file Command file file is nested It must not be nested 376 VOLUME 10 HANDLING ROM STORING PROCESSOR 377 CHAPTER 1 OVERVIEW This volume explains the outline procedure of storing to ROM operation rompsec section copy routine and output messages of the ROM storing processor romp included in this compiler package 1 1 Flow of Operation The romp inputs an executable object file whose relocation has been resolved and creates initialization data to be stored to ROM and an object file having information necessary for the copy routine that is used to store a program to ROM refer to Figure 1 1 Figure 1 1 Flow of Operation of romp ROWM storing area allocation code ROMWM storing library Compile with ROM storing specification option Executable object file Source program a es ROM storing object file 378 In the case of an embedded system an application program that has been debugged is usually written to the ROM area on the target system In this case the initialization information on
28. or bss attribute section called data bss attribute section generates a machine language instruction that is assumed to be allocated to a memory range that can be referenced by using the global pointer gp and 32 bit displacement consisting of two or more instructions Figure 2 1 Image of Memory Location of gp Offset Reference Section Higher address bss attribute section Bi Data without initial value sbss attribute section gp gt r sdata attribute section D gp indicates the position of the first of the sdata attribute data attribute section section 32 Kbytes Data with initial value Lower address Therefore the more the data are allocated to the sdata sbss attribute section that can be referenced with a single instruction the higher is the execution efficiency of the generated machine language instruction and the object efficiency However because a memory range that can be referenced by using 16 bit displacement is limited totalling 64 Kbytes if the sdata sbss attribute section is allocated exceeding that range the assumption of ca and as is not satisfied 6 C source file or assembler source file used to create a specified object file 17 Section having section type PROGBITS and section attribute AWG 18 Section having section type NOBITS and section attribute AWG 9 Section having section type PROGBITS and section attribute AW 20 Section having section type NOBITS and secti
29. 0x00000048 A 2 0UE Offset 0x00000000 0x00000004 0x00000006 0x0000000A 0x0000000C 0x00000010 0x00000012 0x00000014 0x00000016 Ox0000001A O0x0000001C 0x00000020 0x00000022 0x00000024 0x00000028 0x0000002C 0x0000002E 0x00000032 0x00000034 0x00000038 0x0000003A 0x0000003C 0x0000003E 0x00000040 0x00000044 0x00000048 lt Displays addresses offsets codes in accordance with the instruction format and titles with assembly language instructions and displays in another name of the register Opecode A0200018 0861 DFE30014 8A48 DO0040060 03A0 4FAA 9C2A 1440000 OCA 164FE64 OEB 11D ACOO0008C A1840060 DOC A1A40000 OOED ACO000C8 47A1 4FAA 8DDA 40CA AC000018 CFA30010 CFE30014 A 0 A 0 0 _main movea sub st b mov cmp bge movea mov movea mov mov jal movea mov movea mov jal add cmp blt mov jal ld w ld w 0x18 zero r1 ri sp lp 0x14 s p main 0x52 0x60 gp r29 r29 zero zero Oxa main 0x3e 0x0 gp ELO r10 r6 0x19c Ely 7 r29 CR gp rll _sprintt 0x60 gp FL2 EP 0x0 gp SZ x27 r12 rls _strcat Oxl r29 Oxa r29 main 0x16 Oxa r6 SE 0x10 sp r29 0x14 sp lp 375 CHAPTER 3 MESSAGES This chapter explains the output messages of the dis The italic characters in the output messages and explanatory statements are determined during command processing 3 1 Message Format
30. 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 main SDGs LA MOV 5 file Wer ei align 4 BF frame main F2 globl main jbr LA mov CDU r10 ld w 4 F2 sp lp add F2 sp jmp lp SE sub EZ sp Ox4 r1 Cl ap st w lp 4 F2 sp jbr LS FUNC_ARG The following information is indicated in the assemble list 1 Section attribute The section attribute of the section to which the codes created for the source program on a given line are stored refer to Table 3 1 Table 3 1 Section Attributes and Their Meanings Section Attribute Meaning Section occupying memory Section that can be written Executable section Section allocated to memory range that can be referenced by using global pointer gp and 16 bit displacement 2 Value of location counter The value of the location counter for the beginning of the code created for the source program on a given line 3 Code The code created for the source program on a given line with each byte expressed as a 2 digit hexadecimal number 4 Line number The line number of a given line in decimal number 5 Source program The source program on a given line If instruction expansion is executed to the instruction on that line the result of disassembling the instruction string of the machine language instructions created as a result of the instruction expansion is indicated following 13 Mach
31. 5 are given by a segment directive and mapping directive 3 is given by a segment directive and 6 is given by a symbol directive e To specify a segment name section name file name and symbol name for a link directive use the following characters Numerals 0 to 9 Uppercase characters A to Z Lowercase characters a to z Underscore _ Dot Back slash yen mark Colon e in the link directive indicates the beginning of a comment A comment starts with and ends at the end of the line 255 3 3 Section and Segment Here let s discuss the types and attributes of the sections and segments handled by the Id For the internal configuration of a section refer to APPENDIX B For the details of section allocation by program refer to V800 Series C Compiler Package User s Manual C Language Assembly Language Section Basic unit configuring a program Sections input sections included in two or more object files and having the same type and attribute are linked and sections output sections constituting a segment are created Asection name attribute and address to which a program is loaded can be freely specified by a link directive Segment A cluster of sections having the same attribute and type and is a basic unit in which a program is loaded to memory Asegment name attribute and address to which a program is loaded can be freely specified by a link
32. Ae E E teenie es 339 AS eg Deet deen AA ates 210 Ca ewan see Ri ee eet 176 EE 376 QUIM STE 369 AE ER 356 e EE 323 FOMP iin sais Ae RO eS ee ee 394 EE 405 MKDIR E 122 MOV Exts is8 ee ees e ee 123 Move le 123 125 MV wooden vuln eins Rade edlicie anid 125 N NOBITO EE 281 Non debug Mode ccceseceeceseceeeeeceeeeeeeeeeseeenesanenees 39 NUL getest Ge Satelite aie ete ei gege 101 O Operating environment ceeeeeeeeeteeeteeeteeteeeeneeeee 25 Optimization eye 156 162 Ee le 97 Option list Al ieee aa A a a E S 338 AS reat EE ep recedes dee J acess Aide Eeer tee 201 Ca weigh SA a A et 153 e EE 373 Ell EE 361 EE 344 ld cies ie Ae dee ao eer ee teas 222 ll E 384 E decree atthe E 402 Option not shown in dialogs 39 153 201 222 Option Priority Acc ened on eed eee 160 403 Option PSECUCO INSTFUCTION 00 eee eeeeeeeteeeeeereeeeeeees 204 Output of bdld instruction eee eeeeeeeeeeeeteeetees 166 lit elle ET 100 Output section 220 254 256 278 279 319 P POP Daaa a God Aa ere de 126 Pop directory Stack in ir incr mannii 126 PDre optimtzer 148 159 172 175 BROSSEL elt 281 Program header table sssssssseeessseneeesrernesene 364 414 Project Manager essesssieriieriissrireerirerrresrrrssres 23 33 Prom o E 95 PUSHD onneen ee ee et 127 PWD eege Ath ege uge Adtran dik hen ee 128 R PR attpbute PEET 268 teil 391 RD isch eet eres EE 129 Rebuild EE 82 RE ee 101 Reference of
33. By opening the project file with the Project Manager these settings are automatically repeated enabling restart of development with the same settings as when Project Manager was ended previously The following describes a newly created sample project entitled test4 For details of project related operations refer to Project Manager User s Manual 1 Click New Ctrl N in the Project menu to open the lt lt Project Setup gt gt dialog Project Setup x Ctrl N Project File Name en Cancel Project Title _ Cancel Source Files Browse ege o Make a Make File Ctril M Memo Series Name Device Name 2 Set the project file name title project directory series name and device name for the project to be created then click the OK button Project Setup x Project File Name test4 prj Title Cancel test4 Browse Project Directory Help cAwork1 Series Name Device Name 850 Family gt uPD703000 35 3 Click Source Files in the Project menu to open the lt lt Source Files Setup gt gt dialog Since this is a new project nothing is shown in the source file list Click Add to open the lt lt Source Files gt gt dialog for setting the source file to be used for the project Click the source file to be used on the list of the lt lt Source Files gt gt
34. Hard Disk 10 MB of empty capacity Operating Memory 32 MB Cautions e Microsoft Windows 95 creates swap file in windows folder when various tools are operated Always keep enough empty capacity in the drive where the windows folder is installed e The operation of CA is not guaranteed in Microsoft Windows for OS 2 For the processing of the CA command a device file refer to cpu option on page 159 dependent on the target device is necessary 1 The device file is separately available 25 2 2 Installation This package consists of six FDs The read out method of the files of the C compiler package including Project Manager is explained below 1 Insert Setup Disk 1 1 6 of the C compiler package into the FD drive of the host machine 2 Execute the SETUP EXE command which is in the root directory of the FD with Explorer in Windows Install the C compiler following the instructions 3 Set the command search path Set the bin directory under install directory to the environmental variable PATH in batch file autoexec bat In the PATH of autoexec bat add the bin directory under the install directory or the following description after environmental variable PATH Note that the environmental variable PATH recognizes up to 128 characters PATH A PATH A NECTOOLS BIN 4 Restart Windows By restarting Windows new autoexec bat is executed necessary device drivers are set and Project Manager an
35. If this option is omitted the search goes directly to the standard directories If the Id is started from the ca the ca s devpath is specified When the command is started from the option dialog the device file s installation directory is automatically set for this option so this option can be specified only when starting from VSH If the I option is specified with this option or after this option in the case of VSH the archive file also called library file specified by the I option is searched for in the directory dir first and then in the standard directories If this option is omitted only the standard directories are searched cpu devicename This option specifies that the device file for the target device specified by devicename will be read When using the Project Manager this is equivalent to specifying the device during a project setup If this option is omitted the device file for the target device specified when the o file was created will be read Istring When resolving an unresolved external symbol reference this option references archive file lib string a If several archive files are specified by this option the files are searched in the order of their specification ol V850 This option references the library containing old function call specifications If this option is omitted it references the library containing new function call specifications This option ca
36. S System file Examples A gt ATTRIB C KEY TBL lt Indicates KEY TBL attribute of C drive A C KEY TBL A gt ATTRIB R C KEY TBL lt Adds R attribute to KEY TBL of C drive 104 CAT Concatenate files CAT CAT Summary Concatenate files Synopsis CAT A option A drive path filename Options b Assigns line numbers to all lines except blank lines e Assigns to the end of each line as an addition to the v option n Assigns line numbers to all lines S Outputs several continuous blank lines as a single blank line t Outputs I for each tab character as an addition to the v option V Outputs all non printing characters except tab characters and line feed characters as identifiable characters Description This command concatenates links files for output Examples A gt CAT n A C B C gt C C lt Links A C and B C assigns line numbers and outputs both as C C 105 CD Change display current directory CD CD Summary Change display current directory Syntax 1 CD A drive path 2 CD Description When using 1 in Synopsis this command changes the current directory to the directory in the specified path When using 2 in Synopsis this command displays the absolute path in the current directory The Synopsis 1 and 2 are the same as those in the CHDI
37. SymIdx TmpReg ParReg 0x1 0x5 0x5 Symbol table index Number of work registers Number of registers for register variables 5 Array of relocation entries 365 3 11 Global Pointer Table GPTAB INFORMATION Displays contents of global pointer table Gnum Gsize 0x4 0xC Size of num data of Gnum Size when aligned by 0 word 3 12 Line Number Information LINE NUMBER INFORMATION Displays contents of line number information Bfunc Maddr Daddr Pad Function Name 0x0 OxA2 OxE28 0x0 _main Beginning of Address of function Address of debug Padding Function name subsection information Num Snum Offset Flags 0x5 0x0 0x0 0x1 Line number Position of statement Offset Flag 3 13 Debug Information DEBUG INFORMATION Displays contents of debug information Tag Attr Aux 0x0016 size 0x00000026 0x000C 0x00000E1C Tag Attribute Auxiliary information 3 14 PROGBITS Data PROGBITS DATA in HEX 0x00000000 40 OE 00 00 21 2E 00 00 Displays in hexadecimal number the contents of raw data of section having section type PROGBITS 6 If the D option is specified the result of disassembling the contents of the section is displayed after the title TEXT DATA for a section having section attribute X 366 3 15 Element Values and Meanings When the v option has been specified the following information indicates that character strings are used instead of numerical values to indi
38. Table A 1 Format of Section File Section type file name function name variable name lt specification of static variable in function file name variable name lt specification of static variable in file variable name lt specification of external variable comment The following character strings can be specified as the section type Table A 2 Section Types Specifiable by CA830 Allocated Section s Character String Specifying Type If an initial value has been set allocated to the data section If it has not been set allocated to the bss section If an initial value has been set allocated to the sdata section If it has not been set allocated to the sbss section sedata If an initial value has been set allocated to the sedata section If it has not been set allocated to the sebss section sidata If an initial value has been set allocated to the sidata section If it has not been set allocated to the sibss section const Allocated to the const section cdatal Allocated to the cdata1 section cdata2 Allocated to the cdata2 section cdata3 Allocated to the cdata3 section udatal Allocated to the udata1 section udata2 Allocated to the udata2 section udata3 Allocated to the udata3 section 10 The specifiable section types are the same as the specifiable section types for the pragma s
39. Too many are specified for line num unknown symbol kind string string that must not be specified as a symbol type is specified linking of symbol symbol in sdata or sbss attribute section in lei and in other attribute section in file2 is attempted Symbol symbol allocated to the sdata or sbss attribute section in file and symbol symbol allocated to a section other than the sdata and sbss attribute section in file2 are linked memory size number7 of segment segment overflowed specified or default maximum memory size number2 Memory size number of segment segment exceeds the explicitly specified maximum memory size or default maximum memory size multiple inclusion of same file attempted ignored The same file is specified more than once as an input file 329 nesting of command file file in command file is not supported Command file file is specified in a command file Nesting of command files is not supported no archive symbol table ignored this archive file An archive symbol table does not exist in the specified archive file Specification of this archive file is ignored no GP symbol for relocation by relocation entry section section offset offset type relocation type GP symbol s symbol value 0x0 is assumed The gp symbol that serves as a basis by a calculating the relocation value in relocation by a relocation entry section section offset offset and reloca
40. VSH when these option specification is required 1 Input options These specifications set options related to ca input Specification Format Feature Xk code This option specifies the character code to be used for Japanese comments or character strings in input files gt An error message is output if a code other than the specified code exists The following can be specified as code e euc EUC n none Code is not guaranteed s sjis Shift JIS The indicates that either left or right of it must be specified If this option is omitted shift JIS is assumed Xsec_file file This option specifies the name of the section file refer to page 408 that is used to specify section V850 allocation of data when the C compiler is started Be sure to specify this file name This option can be specified several times and several section files can be input 5 Refer to the section of the V800 Series C Compiler Package User s Manual C Language that describes character strings and comments in the language specifications 153 2 Preprocessing options These specifications set options related to preprocessing during compilation Specification Format Feature Dname def When this option is specified it is assumed that define name def is entered before the C source program If the def specification is omitted defis assumed to be 1 This option specifies searching first in the directory dir a
41. blank spaces cannot be inserted before or after tidata Only one variable can be used per line Two or more variables must not be described on one line Neither should one variable specification be indicated on two or more lines Do not insert blank spaces before or after Do not specify the path when specifying file names If a function or variable definition is included in a header file the file name in the section file is not the header file name but the C source file name that includes the header file Comments in the form of or can be inserted However a section name or variable name must not be delimited by a comment A blank space is necessary immediately after a variable name ASCII code and EUC Japanese code can be used in comments If a variable for which data has been specified as the section type in a section file is referenced by another assembler source file use the option pseudo instruction to specify data so that the assembler will be notified of the data bss attribute Also if a variable for which sdata has been specified is referenced by another assembler source file use the option pseudo instruction to specify sdata so that the assembler will be notified of the sdata sbss attribute 11 Refer to User s Manual Assembly Language of each family 410 Description examples Section file data a c datl b c dat2 sdata a c sdatl b c sdat
42. c d a Number of bytes 4 b Location address c Record type is 00 d Code each byte of code expressed as 2 digit hexadecimal number Example gt 04 0100 00 3C58E01iB 6C NL a b c d e a Number of bytes of 3C58E01B expressed as 2 digit hexadecimal number is 04 b Location address is 0100 c Record type is 00 d Code e Check sum is 6C which is the lower 1 byte of 2 s complement E6 of 04 01 00 00 3C 58 E0 1B 194 expressed as a 2 digit hexadecimal number 4 End record Indicates the end of a code 00 0000 o FF NL a b c d a Number of bytes is fixed to 00 b Fixed to 0000 c Record type is 01 d Check sum is fixed to FF 14 Limited to the range of 0x1 to Oxff the minimum value of the number of bytes of the code indicated by one data record is 1 and the maximum value is 255 348 3 2 Motorola S Type Hex Format A file in the Motorola S type hex format consists of five records SO record as a header record S2 S3 records as data records and S8 S7 records as end records Figure 3 2 shows the file configuration in Motorola S type hex format Figure 3 2 File Configuration in Motorola S Type Hex Format SO record S2 S3 record S2 S3 record S8 S7 record Each record consists of fields as follows ST LL field field SS NL a b d c wa a Re
43. c d e f a Record mark b Number of bytes number of bytes that are expressed as 2 digit hexadecimal numbers of field c Location address d Record type e Checksum value expressed as 2 digit hexadecimal number in records other than SS and NL sequentially subtracted from initial value 0 and that lower 1 byte expressed as a 2 digit hexadecimal number Il New line n 1 Start address record Indicates an entry point address 04 0000 03 PPPP OOOO SS NL a b c d e a Number of bytes is fixed to 04 b Fixed to 0000 c Record type is 03 d Paragraph value of entry point address e Offset value of entry point address 2 Expanded address record Indicates the paragraph value of a load address 02 0000 02 PPPP SS NL a b c d a Number of bytes is fixed to 02 b Fixed to 000 c Record type is 02 d Paragraph value of segment 11 03 start address record 02 expanded address record 00 data record 01 end record 12 The address is calculated by paragraph value lt lt 4 offset value 13 The paragraph value is output if the segment is renewed at the beginning of a segment when the data record is output or when the offset value of the load address of the data record exceeds the maximum value of Oxffff 347 3 Data record Indicates the value of a code CC AAAA 00 ODD DD SS NL a b
44. data for which the sdata or sbss section is specified by the pragma section directive or section file refer to page 408 is allocated to the sdata or sbss section regardless of its size Kanji Code of Target Japanese character strings are converted into specified codes and output This conversion is convenient when converting Kanji codes that were used in application development in the target Codes are not converted when lt lt None gt gt or lt lt Default gt gt is specified The comment output by the specification of Output Source Comment is not converted in spite of this option CAUTIONS If code other than the default shift JIS are used in the input file whose code is to be converted by the specification of Kanji Code of Target specify the code being used with Kanji Code of the Input option Input file Output file Input Output 1 Kanji Code Kanji Code of Target EUC Shift JIS Unless specified the code is not converted because the input default is recognized as shift JIS Output Assemble List a The assembly list is output to a file whose extension c is changed to v refer to page 208 P Refer to the data section allocation in the V800 Series C Compiler Package User s Manual C Language 7 Refer to the section of the V800 Series C Compiler Package User s Manual C Language that describes character strings and comments in the language specifications 51 52 Output
45. lt hole_size gt lt input_section_name gt lt region_begin gt lt files gt lt region_end gt Not described lt symbol_name gt lt symdir_specifier gt lt symbol_type gt lt symbol_parameters gt lt directive_end gt Not described lt symbol_parameters gt lt region_begin gt lt names gt lt region_end gt CV v lt value gt A a lt value gt H h lt value gt F f lt value gt a ba es lt seg_attribute gt lt value lt scn_attribute gt lt target_own_attr gt Ef LOAD load lt section_type gt lt symbol_type gt lt output_section_name gt lt input_section_name gt lt seg_attribute gt lt scn_attribute gt lt target_own_attr gt lt target_own_type gt lt files gt lt names gt lt segment_name gt lt section_name gt lt file_name gt lt symbol_name gt lt value gt lt segdir_specifier gt lt scndir_specifier gt lt symdir_specifier gt lt region_begin gt lt region_end gt lt directive_end gt S PROGBITS progbits NOBITS nobits S lt target_own_type gt lt section_name gt lt section_name gt Not described NSA CW w AX ORA lt seg_attribute gt Not described SAN pa CW gt w X x lt scn_attribute gt Not described LPGA g TP_SYMBOL tp_symbol GP_SYMBOL gp_symbol1 ep_symbol EP_SYMBOL Not described
46. section header table section and segment which are constituents of the object file in the ELF format are explained 412 Figure B 1 Structure of Object File Relocatable object file ELF header Section 1 Section n Section header table First Executable object file ELF header Program header table Segment 1 Segment n Other information Section header table B 2 ELF Header This section explains the ELF header that constitutes an object file in the ELF format The ELF header is at the beginning of the object file and has the information necessary for interpreting the object file or for accessing the other constituents included in the object file refer to Table B 1 Table B 1 Constituents of ELF Header and Their Meanings Constituent Meaning ident CLASS Class of this object file ident DATA Byte order of data in this object file 2MSB in big endian 2LSB in little endian type Type of this object file machine Processor to which this object file is subjected version Version number of this object file entry Entry point address phoff Offset in file of program header table shoff Offset in file of section header table flags Flag peculiar to processor in which this object file runs ehsize Byte size of this ELF header phentsize Size of entry of program header table phnum Number of entries
47. specified in the mapping directive it is searched for unresolved external reference at that specified point and only the necessary object files are linked 5 2 Reserved Symbols In processing linking the Id creates reserved symbols having the first address of each output section the first address aligned under a 4 byte alignment condition exceeding the termination of each output section and first address aligned under a 4 byte alignment condition exceeding the termination of a created and executable object file as values If the user defines a symbol having the same name as any of these reserved symbols the Id uses the defined symbol and does not create its own symbol As the reserved symbol that has the first address of a section as a value a symbol having the name constituted by prefixing __s to the name of the output section is used If this section name begins with is taken out and then __s is prefixed as a symbol name As the reserved symbol that has the first address aligned under a 4 byte alignment condition exceeding the termination of a section as a value a symbol name with e prefixed to the name of that output section is used If the section name begins with however is taken out and then __e is prefixed as a symbol name As the reserved symbol having the first address aligned under a 4 byte alignment condition exceeding the termination of a created executable object
48. time File for which the archive file attribute is set File for which the archive file attribute is not set Subdirectory ies File s File for which the hidden file attribute is set File for which the hidden file attribute is not set File for which the read only file attribute is set File for which the read only file attribute is not set File for which the system file attribute is set File for which the system file attribute is not set Displays only filename s or directory name s Displays using lowercase letters Specifies the sequence in which the filenames and directory names are classified when displayed The specifiable classification sequences are listed below Several classification sequences can be specified at the same time Sequence of date and time with earliest first Sequence of date and time with latest first Alphabetic order by extension Reverse alphabetic order by extension Group directories before files Group files before directories Alphabetic order by filename or directory name Reverse alphabetic order by filename or directory name Size with smallest first Size with largest first Displays directory and all files in subdirectory Displays several filenames or directory names in one line 113 DIR Description Display file list DIR When using 1 in Synopsis this command displays a list of the directories specified by path If the path specification is
49. 4 1 Message Format The message of dump is basically output in the following format dump message 4 2 Messages archive string table not exist The archive string table is missing archive symbol table not exist The archive symbol table is missing can not open file file File file cannot be opened close error The file cannot be closed convert error Conversion cannot be executed empty in archive file The archive file has no content illegal option string string must not be specified as an option file is not ELF nor archive file File file is neither an object file nor an archive file memory allocation fault The memory capacity has run short nested command file file Command file file is nested It must not be nested not enough argument The argument is insufficient 369 not enough argument for string The argument for the option string is insufficient read error Data cannot be read from the file seek error The file cannot be sought usage dump options file options abcefghiklmprsvxATV d number d number n name t index t index z name number Z number Input the command line like this 370 VOLUME 9 HANDLING DISASSEMBLER CHAPTER 1 OVERVIEW This volume explains the outline operation an output example and output messages of the disassembler dis included in this compiler package dis starts from the VSH command line 1 1 Flow of Operation The dis inputs
50. A gt RD TMP lt Removes the empty TMP directory in the drive A A gt RD B TMP lt Removes the empty TMP directory in the drive B 129 REN Rename file REN REN Summary Rename file Synopsis REN A drive path filename1 A filename2 Description This command changes the specified filename1 to filename2 This command contains the same function as the RENAME command and Synopsis 5 of the MOVE command Examples A gt REN OLD C NI EN CL A gt REN B WORK OLD C NI 130 lt Renames the filename OLD C as the filename NEW C EW C lt Renames the filename OLD C in the WORK directory of the drive B as the filename NEW C in the same location RENAME Rename file RENAME RENAME Summary Rename file Synopsis RENAME A drive path filename1 A filename2 Description This command changes the specified filename1 to filename2 This command is the same as the REN command and the Synopsis 5 of the MOVE command Examples A gt RENAME OLD C NEW C A gt RENAME B WORK OLD C NI lt Renames the filename OLD C as the filename NEW C EW C lt Renames the filename OLD C in the WORK directory of the drive B as the filename NEW C in the same location 131 RENDIR Rename directory RENDIR RENDIR
51. Directive Even if an object file or archive file to be allocated to a section is specified in the directive file they may not be allocated to the expected sections depending on how the file name is described In this case specify the directive file with the file name displayed on the link map and with the identical name including the path name for re linking while referring to the link map m 5 4 Link between V850 Family Object File and V850E Object File The V850E is upward compatible with the other V850 Family microprocessors The source program used in the V850 Family can be used in the V850E In this case create the V850 Family object file as an object file common to the family with the as option refer to page 205 The object file created as common within V850E cannot link with the object file other than the V850E refer to Cautions on page 205 322 CHAPTER 6 MESSAGES This chapter explains the messages output by the Id The italic characters in the output messages and explanatory statements are determined during command processing 6 1 Message Format The Id outputs the following two types of messages With file name displayed Id file name level message Without file name Id level message levelin the above formats indicates the type of the error that has occurred The correspondence between the type of eve and the remedial action performed by the Id is shown below warning Warning The Id cont
52. GmbH Scandinavia Office Taeby Sweden Tel 08 63 80 820 Fax 08 63 80 388 NEC Electronics Hong Kong Ltd Hong Kong Tel 2886 9318 Fax 2886 9022 9044 NEC Electronics Hong Kong Ltd Seoul Branch Seoul Korea Tel 02 528 0303 Fax 02 528 4411 NEC Electronics Singapore Pte Lid United Square Singapore 1130 Tel 253 8311 Fax 250 3583 NEC Electronics Taiwan Ltd Taipei Taiwan Tel 02 719 2377 Fax 02 719 5951 NEC do Brasil S A Cumbica Guarulhos SP Brasil Tel 011 6465 6810 Fax 011 6465 6829 J97 8 Revision History Date of Issue Description reason November 1997 First edition INTRODUCTION Target Device The V800 Series C Compiler Package creates the object codes for the NEC s V800 Series RISC microprocessors which are compatible with each family The V830 Family inherits the basic instruction set of the V810 Family Therefore the software resource of the V810 Family can be used without modification Target Users This manual is intended for users who develop application systems using the V800 Series C Compiler Package under Windows Objective This manual explains how to operate the commands which are included in C compiler and assembler in each package under Windows A Project Manager is included in these C compiler packages For operation methods for integrated development refer to the User s Manual of Project Manager For operation of Windows refer to t
53. Keys Function Displays the history contents If the character cursor is at the start of the command line the immediately previous command input contents are shown If the character cursor is not at the start of the command line the same command input contents in which the character cursor is at the start of the command line are selected from among the previous command input contents listed in the history information This shows the next command input contents in the history information This operation can be used when the user has gone back beyond the desired command input contents in the history information If the character cursor is at the start of the command line the next command input contents are displayed If the character cursor is not at the start of the command line the same command input contents in which the character cursor is at the start of the command line are selected from among the next command input contents listed in the history information 88 When searching the history information for command input contents in which the character cursor is not at the start of the command line when the target history information is found it is displayed with the character cursor at the end of the command line In subsequent searches if the character cursor position is not moved the character string range used in the subsequent search operation will be the same range as was used in
54. References the library of the old function calling specifications Default assumption References the library of the new function calling specifications Example e 1d850 ol file1 o file2 o lc References the standard library of the old function calling specifications and links object files file1 o and file2 o 36 Refer to V800 Series C Compiler Package User s Manual C Language 246 19 r Specifies retention of relocation information Format r e This option can be specified only at the start from VSH Feature Creates a relocatable object file e If this option is specified the Id does not output a message and normally terminates linking even if an unresolved external reference remains after linking Default assumption Tries to create an executable object file e lf an unresolved external reference remains after linking the Id outputs the following message and stops linking If this happens the object file is not created fatal error undefined symbol symbol referenced in file Caution e To specify an object file created by the Id for re linking by the Id specify this option to create the object file to be re linked e Ifthe r option is specified only the type attribute of the mapping directive part of the link directive is valid and the others are ignored e If the r option is specified the Id does not create reserved symbols Example e 1d850 r file1 o file2 0 Links object files file1
55. a segment type with ay must not be followed by a blank space e The uppercase and lowercase characters are not distinguished in specifying a segment type Therefore LOAD can be uppercase or lowercase characters 267 3 Segment attribute Specify the segment attribute of a segment to be created s Table 3 4 shows the segment attributes that can be specified and their meanings Table 3 4 Segment Attributes and Their Meanings Segment Attribute Meaning Segment that can be read Segment that can be written Executable segment e Specification of a segment attribute must not be omitted If omitted the Id outputs the following message and stops linking fatal error segment directive of segment segment needs SEGMENT ATTRIBUTE e Start specifying a segment attribute with e 2 must not be followed by a blank space Example gt SEG LOAD RX s R W or X can be specified in any sequence e R W or X can be specified more than once when specifying a segment attribute once In terms of meaning however it is the same as specifying R W or X only once Example gt SEG LOAD RXRX e lIfasegment attribute is specified more than once in one segment directive the Id outputs the following message and stops linking syntax error line num SEGMENT ATTRIBUTE specified to segment segment more than once in
56. alignment condition of the specified type This warning message is error message E2301 when the ansi option is specified The bit field object name is put into the next unit Bit field name is located in the next area because it exceeds the boundary 47 Refer to V800 Series C Compiler Package User s Manual C Language 193 W2520 W2521 W2525 W2527 W2554 W2555 W2600 W2601 W2606 W2607 W2621 W2634 W2635 194 Immediate for shift operator is out of range The immediate value specified for the shift instruction exceeds the value of the range that can be specified It is assumed that only the lower valid digits have been specified division by zero Division by zero is executed during the operation of a constant expression that is executed upon compiling It is assumed that 0 is specified for the constant expression illegal type combination for operator type type2 The combination of types type7 type2 for operator operator is not correct Type conversion is executed and processing continues This warning message is error message E2524 when the ansi option is specified Operands of operator operator must have same type type type2 The types to the left and the right of operator operator must be the same type7 type2 cannot convert non L value array to pointer An array that is not at the left side cannot be converted into a pointer This warning message is
57. an object file or archive file converts the data of text attribute into assembly language codes and outputs them to the standard output refer to Figure 1 1 The dis is used to reference the corresponding assembly language source program from a created object file or archive file Figure 1 1 Flow of Operation of dis Object file or archive file L Outputs assembly language to standard output 372 CHAPTER 2 OPERATION This chapter explains the operations of the dis command 2 1 Command Input Format from VSH Command Line dis A option A file name A file name Can be omitted Pattern in immediately before can be repeated A One or more blank spaces 2 2 Types and Features of Options If no option is specified the o option is assumed 2 2 1 Option list The following table lists the option of the dis Specification Format A Feature Specifying this option is equivalent to specifying the option aoptr F A devpath This option searches for the device file first in the directory devpath then in the standard directories If this option is omitted only the standard directories are searched V This option outputs the dis version number to standard output and then terminates processing This option displays addresses Cc This option displays Code e address This option specifies an end address address is specified as a decimal num
58. attributes are specified for both the segments the sections are allocated to the segment specified first and not to the segment specified last At this time the Id outputs no message For example if the following directive is specified sections are allocated to segment TEXT1 but not to segment TEXT2 9 Example gt TEXT1 LOAD RX textl SPROGBITS AX filel o file2 o TEXT2 LOAD RX text2 SPROGBITS AX filel o file2 o Pa lt Because section types section attributes and input file names are the same as TEXT1 TEXT2 is not created DATA LOAD RW data PROGBITS AW sdata PROGBITS AWG sbss SNOBITS AWG bas S NOBITS AW __tp_symbol H TP_SYMBOL __gp_symbol GP_SYMBOL amp __tp_symbol ep DATA H d EP_SYMBOL 59 Segment TEXT2 is not created 288 2 Linking object files To link two or more object files in section units use the mapping directive to specify the file names of the object files to be linked and the section names to be linked To link all the sections having the same type and same attribute in two or more object files in the sequence in which they are included in the files the section names need not be specified refer to Figure 3 3 on page 259 The linking sequence is in accordance with the sequence specified by the mapping directive and from the lower address toward the higher address If the sequence of the f
59. avoid register and flag hazards Optimization by assembler is not compatible with the debugger When the debug mode g option is specified in the Project Manager Option Debug specification the debug mode is ignored if there is a debug information section in the source file Optimization is ignored and the debug mode is valid if there is no debug information section This displays execution status of assembler Warning messages are not output when r1 has been specified as the source register or destination register when r20 or r21 has been specified as a destination register when the mask register function has been used when rO has been specified as the destination register or when r30 has been specified as the destination register for the mul mulu div divu instructions in V830 Family Creates an object file having information that the mask register function is used When lt lt Use New Style Function Call gt gt is specified this option can be specified It is valid when an assembler source file created with the old version of the C compiler is used This option cannot be selected for each source file and is always selected for all source files CAUTIONS In an application where both the C source file and assembler source file are used or in an ke application where only the assembler source file is used to specify checking during linking Use Mask Register must be specified by both the C compiler option and a
60. change in a range in which volatile or nooptimize is specified Warning base register is ep r30 only A register other than ep is specified as the base register of the sld sst instruction Warning illegal operand range error in displacement The value of the displacement exceeds the range of the value that can be specified It is assumed that only the lower valid digits have been specified and assembly continues Warning illegal operand range error in immediate The value of the immediate exceeds the range of the value that can be specified It is assumed that only the lower valid digits have been specified and assembly continues Warning illegal operand range error in immediate for setf shl The value of the immediate specified for the setf or shift instruction exceeds the range of the value that can be specified It is assumed that only the lower valid digits have been specified and assembly continues Warning illegal regID for Idsr A reserved register number or a register number inhibited from being accessed is specified as the second operand of the der instruction 215 Warning illegal regID for ster A reserved register number is specified as the first operand of the stsr instruction Warning mask register r20 or r21 used as destination register A mask register r20 or r21 is used as a destination register when the mask register function is used Warning register r0 used as destination register The zero register
61. directive essences eeseeeeenseeeeeneeeeeneeeeeaseeeeesseeeeneeeesaseeesenseenenenees 290 3 6 2 Configuration Of symbol directive eceeceseeeeeeseeeeeeeeseeeeeeeenseeeseeeeseeeneeeseeeseeeeeeeenae 292 3 6 3 Explanation of each item that can be specified for symbol directives 294 3 6 4 Using symbol directive cceeeeeseeeesseeeeeeeeeeeseeeeenseeeeaseeesaseeeeeaseeeseseneeeneeesaseeeeensneneneees 296 3 6 5 tp symbol offset in label reference ssssunsssunsennnennnnenunnonunnnnunnnnnnnnnnnenunnnnnnnnnnnnnnnnn nanna 302 3 7 Default Link Directive cccccesseseeeeeeseeeeeeeeeseeeeeeensneeeeeeenseeeeeesnsaeeneeeenseeeeeeeeeeeeeeenees 305 3 8 Using Default Link Directive sssssnsessnunnnnnunnnnnnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnmnnn 315 3 9 Syntax of Link Directive ccccsceeeeseseeeeseeeeeeeeeeseeeeeeeeeeescaeeenseeeesesaeseseeeeenseeseseeeeeneee 316 CHAPTER 4 LINK MAP eege Seed ee EEN Ara EEE EEEa AP ENEE Dee denne cee EEan EEEE AEE Ree 318 CHAPTER BS SUPPLEMENT see n cesesucdesesencencsevennnceseveseccccesevesuecesvressucesensdnbecesvedebeeessvvesneecseis 320 Sel USING Archive Eileen EEE A A EEE E 320 5 2 Reserved Symbols sitrun nanena aeaaeae aa ira neeaaeia aae asane Ae Enaoui sat 320 5 3 File Name in Link Directive sssssuunnnennunnnnnnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnna 322 5 4 Link between V850 Family Object File and V
62. e If all of the external memory data to be transferred is in the cache specifying this option will slow down the transfer speed e If the data size is not a multiple of 16 bytes the Id st instruction will be output to transfer the fractional parts Since the Id instruction performs caching to access cacheable external memory the cache contents will change e Assignments that use pointers are not subject to bdld instruction output 167 Description example in which use of pointer excludes bdld instruction output struct data int i 4 hi struct test struct data image pragma section sidata begin struct data a pragma section sidata end struct test b lt Pointer variable void func a b gt image lt Assigned by pointer 168 Output assembly language sbss com eee L6 r L6 sidata align 16 globl a 16 Sar space 16 text Enner movea a zero rio ld w Sub SL ld w eA We eZ st w r12 Erro ld w AEETI Jy is St W EUS 2 PLEO d w 8 r11 r14 st w r14 8 r10 ld w LA Pelle LVS st w r15 12 4r10 169 e When structures are nested and the members have not been aligned into multiples of 16 bytes those members are not subject to bdld instruction output Description example in which nesting of structures excludes bdld instruction output struct data int i 4 i struct test char header struct data image lt Member image is
63. file end is used 75 The archive file has a symbol table of the symbols belonging to the object files of the archiver and the archive file is repeatedly searched until the unresolved external reference is no longer resolved 76 Object file defining a referenced symbol 320 The default link directive of the Id uses the following reserved sections as output sections text data sdata sbss bes sconst const sedata sebss sidata sibss both families itext cdata1 cdata2 cdata3 udata1 udata2 udata3 CA830 only tidata tibss tidata byte tibss byte tidata word tibss word CA850 only Therefore the Id usually creates the following reserved symbols Table 5 1 Special Symbols in Normal Object File end __ebss __sbss _ ecdata1 __scdata1 V830 __ecdata2 __scdata2 V830 __ecdata3 __scdata3 V830 __econst __sconst __edata __sdata eitext __sitext V830 __esbss __ssbss __esconst __ssconst __esdata __ssdata __esebss __ssebss __esedata __ssedata __esibss __ssibss __esidata __ssidata _ etext __stext __etibss __stibss V850 __etibss byte __stibss byte V850 __etibss word __stibss word V850 _ etidata _ stidata V850 __etidata byte __stidata byte V850 ___etidata word stidata word V850 _ eudatai _ sudatai V830 _ eudata2 _ sudata2 V830 eudata3 _ sudata3 V830 321 5 3 File Name in Link
64. file is allocated to the corresponding segment a value different from memsz is set refer to page 287 414 BA Section Header Table This section explains the section header table that constitutes an object file in the ELF format The section header table is an array of section header table entries having information on all the sections included in the object file refer to Table B 3 An index to this array is called a section header table index and the section header table entries are referenced by using this section header table index Table B 3 Constituents of Section Header Table Entry and Their Meanings Constituent Meaning Name of corresponding section index to string table shstrtab holding section name Section type of corresponding section Refer to B 4 1 Section attribute of corresponding section A for section occupying memory W for section that can be written X for executable section G for section that is allocated to memory range that can be referenced by using global pointer gp and 16 bit displacement addr First address of corresponding section offset Offset in file of corresponding section size Size of corresponding section link Section header table index link of corresponding section Refer to B 4 2 info Information dependent on section type of corresponding section Refer to B 4 2 addralign Alignment condition of corresponding section entsize Size of entry of corresp
65. func 43 Refer to V800 Series C Compiler Package User s Manual C Language 44 Refer to User s Manual Assembly Language of each family 270 5 Maximum memory size Set the maximum value of the memory size of the segment to be created If the memory size specified for the segment to be created exceeds the maximum memory size the link editor outputs the following message and stops linking fatal error memory size number1 of segment segment overflowed specified or default maximum memory size number2 e Specifying the maximum memory size can be omitted If omitted 0x100000 is used as the default value refer to Table 3 3 on page 265 e Start specifying the maximum memory size with L e L must not be followed by a blank space e L may be uppercase or lowercase e Do not use an expression to specify the maximum memory size The maximum memory size must not exceed the intended size If the actual size is less than the specified maximum memory size the address of the segment located relatively rearward immediately follows the address to which the preceding segment is actually allocated 6 Hole size Specify the size of the hole to be created The specified hole is created at the end of the specified Segment Specify the hole size in the following format e Specifying the hole size can be omitted If omitted 0x0 is used as the default value refer to Table 3 3 on page 265 e Start specifyin
66. gt ERASE Y WORK FILE C lt Deletes FILE C in the WORK directory of the drive A A dialog box does not open to prompt for confirmation before deleting 118 EXIT Exit VSH EXIT EXIT Summary Exit VSH Synopsis EXIT Description This command exits the VSH shell to close the VSH window It closes the VSH window Examples A gt EXIT lt Exits VSH 119 L Display file list LS LS Summary Display file list Synopsis 1 LS A option A drive path 2 LS A option A drive path filename Options A Also displays file for which the hidden file attribute is set F Adds a after each directory name and a after each executable filename in the output list R Recursively displays the contents of the subdirectory a Also displays the contents of hidden files and directory names that include or Displays the name attribute s size and last revised date and time for one file or directory per line r Displays filenames in reverse alphabetic order If the t option is also specified t has priority t Displays filenames with most recently revised files first Description When using 1 in Synopsis this command displays a list of directories specified by path If path is omitted it displays a list of all files and directories un
67. if it is not specified 24 Install directory libxxx and install directory libxxx r32 69 Library Search Path L Link Directive File D Startup File Specifies the directory where the archive file library file to be accessed is stored When specifying several libraries separate each name with a semicolon This area uses the drop down list type of display to list all directories that have been specified once up to 10 directories To select a directory either click the desired directory or use the arrow keys to select it If a directory is specified by this option the library is searched from the specified directory before the standard directory of the library If two or more libraries are specified the library is searched in the sequence in which they have been specified in the text box This specifies the link directive file to be accessed refer to page 254 This area uses the drop down list type of display to list all directive files that have been specified once up to 10 files Either click the desired directive file or use the arrow keys to select it This specifies the start up modules ei When creating a final object file via the build rebuild function in other words in cases other than when creating a file whose target specification in building is o file if this start up file specification is omitted the supplied start up module is linked This area uses the dr
68. illegal operand label label An expression in the format of label label is specified for a branch instruction illegal operand label not allowed A label is specified for an instruction for which a label must not be specified as an operand illegal operand label not allowed for setf shl A label is specified for the setf or shift instruction illegal operand label reference for jmp must be label Absolute address reference label is not specified for the jmp instruction illegal operand must be evaluated positive or zero The result of evaluating an expression is negative illegal operand must be even displacement An odd displacement is specified illegal operand must be immediate label or symbol for hi lo hi1 Immediate label or symbol is not specified for hi lo and hi1 212 illegal operand must be register A register is not specified illegal operand needs base register A base register must be specified illegal operand range error in displacement The value specified as displacement exceeds the range of the value that can be specified illegal operand range error in immediate The value specified as immediate exceeds the range of the value that can be specified illegal origin value va ue The value specified value for the org pseudo instruction is wrong illegal section An instruction that must not be described in the current section is described illegal section kind The specifi
69. interrupt cannot be specified for a function at the same time Function function is already defined rtos_task must be specified before function definition A function must not be specified as an RTOS task after the function definition Function function is already defined without __rtos_interrupt Although function function is specified as an interrupt handler function has been already defined without interrupt specification for RTOS cannot call rtos_task function A function that is specified as an RTOS task cannot be called Rtos system call function is already defined cannot specify pragma kind A function having the same name as function function has already been defined or declared The RTOS system call cannot be validated by the pragma specification of the RTOS function Rtos system call name is called in the function for which rtos interrupt attribute is not specified RTOS system call name is called by a function for which an RTOS interrupt is not specified name is regarded as a normal function call cannot call rtos_interrupt function A function that is specified as an RTOS interrupt handler cannot be called Duplicated GP symbol for RTOS interrupt function function Another gp symbol has already been allocated to function function specified as an RTOS interrupt handler Specifying interrupt name name is not allowed for rtos_interrupt name must not be specified as an interrupt req
70. invalid e If V h and help are specified at the same time the one specified first is valid and the others are invalid e If O and an option related to sorting are specified at the same time O is valid and the option related to sorting is invalid Contents of comments of sf sf outputs comments in the section file as default assumption The detail level of the comment can be specified by the cl option The meanings of three data of comments output by sf are as follows section Section to which allocation of a variable is explicitly indicated is displayed for a variable not explicitly indicated size Size of variable in bytes 0 is displayed if the size is unknown frequency Reference frequency of variable Indicated by the number of times the load store instructions have appeared for the variable Example of section file output by sf a N Created by sf850 at Sat Mar 2 17 26 25 1996 tidata file func variable section size frequency ascris i data 4 10 a c si2 data 4 8 ance tiers ELE fr Sa 38 i he 4 3 a gl es l Ko D 403 2 3 Examples of Use Here are some examples of using the sf e To optimize allocation of data to sections so that the tidata section does not overflow sf850 O a sec b sec c sec o secfile Frequency information files output by the C compiler a sec b sec and c sec are input and the section file whose data allocation is optimized so that the memory rang
71. is created At this time the execution status is output in the format of x a o 338 CHAPTER 3 MESSAGES This chapter explains the output messages of the ar in alphabetical order The italic characters in the output messages and explanatory statements are determined during command processing 3 1 Message Format The ar outputs the messages in the following format ar message 3 2 Messages bad key character use dm a b qr a b u txV character must not be specified as a key bad option character use cv character must not be specified as an option can not close file file File file cannot be closed can not create file file File file cannot be created can not find file file File file cannot be read can not find member member Member member does not exist in the archive file can not nest command file file Command file file is nested It must not be nested can not open file file File file cannot be opened can not read archive header file The header of archive file file cannot be read can not read file file Data cannot be read from file file can not seek file file File file cannot be sought 339 can not write file file File file cannot be written creating file Archive file file is being created file name name is too long The length of file name name exceeds the limit file has no member No member exists in archive file file file is not archive file file is not an archive file
72. is not found section section overflowed highest address of target machine section exceeds the upper limit of the memory as a result of creating the rompsec section symbol start_label must be word alignment Make sure that start_labe label is at an address of a 4 byte boundary file symbol symbol not found Specified symbol is not found in object file file unknown option argument An argument that must not be specified for the option is specified 395 MEMO 396 VOLUME 11 HANDLING SECTION FILE GENERATOR 397 CHAPTER 1 OVERVIEW This volume explains the outline of the section file generator sf included in this compiler package sequence to use the section file sf operation and output messages sf is supplied only to the CA850 at present Activate sf on the VSH command line 1 1 Flow of Operation sf reads the frequency information file sec file output by the ca through option specification and outputs a section file that is used to allocate variable data that are frequently referenced to the tidata section that can be referenced at high speed refer to Figure 1 1 Figure 1 1 Flow of Operation of sf Specifies output of frequency information file SE section file and re a C source file Gate information file sec file CT LC B Section file Object file changing allocation to tidata section 1 The section file can be output to a specified file by using the o option 3
73. judgment may not be correct for example in the following cases If a section that creates a hole is specified by a link directive etc H an address is directly specified for a global pointer symbol If data is allocated to the sdata sbss section by the pragma section directive Example e 1d850 A file1 o file2 0 file1 o and file2 0 are linked and information that can be used as a criterion upon setting num of the Gnum option that can be specified for the ca or as upon compiling or assembling is output to the standard output 24 Because this compiler package usually assumes that the sections to which data are allocated are allocated from the lower address in the order of data sdata sbss bss attribute sections and that the global pointer gp is set by the start up module so that it indicates it can be considered first address of the sbss attribute section 32 Kbytes if this judgment results in OK that the sdata sbss attribute section is allocated to a memory range that can be referenced by using 16 bit displacement 25 Refer to V800 Series C Compiler Package User s Manual C Language 229 2 D Specifies link directive Format D A dfile e D must be followed by a blank space Feature Links object files in accordance with the link directive in directive file dfile e For the feature and configuration of the link directive refer to Chapter 3 on page 254 Default assumption Links object files in acc
74. limit The name of the module responsible for the error is appended to the error message output by the ca If the name of a file or the number of the line where the error occurred can be identified the file name and line number are appended also along with a message number The message number indicates the level of the error that has occurred and the module in which the error occurred The meaning of the initial character of a message number indicating the error level is as follows F Fatal error Compiling is always stopped Example gt Memory capacity runs short E Error due to violation of syntax or compiler limit If errors of this type occur exceeding the specified number compiling is stopped Example gt Undefined variable W Warning Compiling continues Example gt A variable is referenced before a value is set to it The number following the above mentioned characters indicates the module where the error occurred ca driver module ca front end cafe global optimization module opt code generation module cgen pre optimizer popt NO ODM A 175 3 2 Messages This section lists the error messages in the alphabetical order of the error number level from the lowest error number toward the highest Note that some messages are not output depending on the family used The italic characters in the output messages and explanatory statements are determined during command processing E1
75. lt Rebuild gt gt is activated to the Id and the build specifying o file by lt lt Build Target gt gt makes each object refer to Volume 2 and Project Manager User s Manual Attention should not be paid as much as when starting from VSH Batch processing Modular processing D 0 lt gt gt gt p ca e e REH 0 E gt ca gt as gt gt Ga as D a out lt The feature of the Id is to link specified object files in accordance with an explicitly specified link directive or the default link directive and a device file resolve addresses and create an executable object file To resolve an unresolved external reference a specified archive file library file is searched and only the necessary object files are linked to create an executable object file a out refer to Figures 1 1 and 1 2 a es 1 Symbol having the binding class of GLOBAL and the section header table index of UNDEF 2 When starting from VSH a relocatable object file can be also created by using the r option 3 When starting from VSH the name of the default if a out however creating executable object file name can be specified by using o option When starting from Project Manager the creating executable file name is file name with OUT at the top of lt lt source list gt gt 218 Figure 1 1 Flow of Operation by Id Object file Object file Object file WV Archive file Directive file Device fil
76. malformed archive file file The contents of archive file file may be destroyed memory allocation fault The memory capacity has run short string table error file The contents of the archive string table in archive file file may be destroyed symbol table error file Creating an archive symbol table in archive file file has failed symbol table limit error file number7 limit is number The number of symbols number in archive file file exceeds the limit The limit value is number2 usage ar dm a b qr a b u txV cv key memberJarchive file file Input the command line like this version error file The version of the format of specified file file is not the version that can be handled by this archiver 340 VOLUME 7 HANDLING HEX CONVERTER CHAPTER 1 OVERVIEW This volume explains the outline operations output file format and output messages of the hex converter hx included in this compiler package hx starts from the VSH command line 1 1 Flow of Operation The hx inputs an executable object file output by the link editor Id included in this compiler package converts the format of that file into a hex format and outputs the hex format file to the standard output refer to Figure 1 1 When loading an application to the target machine the file format that can be input to an in circuit emulator monitor or ROM writer used for loading may be the hex format only In this case convert the object file into a h
77. merged 3 When created from the Project Manager the object file becomes the name which is omitted the suffix of the first file of the source list and is added OUT When created from VSH command start it becomes a out at the default The o option can be used if the name of an object file is desired to be specified when started from VSH refer to page 160 148 The global optimization module and the machine dependent optimization module are called only when the optimization option is specified refer to Figure 1 1 It is assumed that the modules of 1 front end cafe through 5 machine dependent optimization module impr are started from the ca If any of these modules is started alone therefore the operation is not guaranteed Figure 1 1 Operation Flow of ca Code generation module Other than Os Ot lt lt U Assembler Other than Os Ot NO processing of input file YES lt es Link editor e out 149 1 2 Handling File The ca can specify the following files as input files file c C source file called c file file ic OPTIC file called ic file file s assembler source file called s file Den object file called o file file a archive file called a file e If only one of the c ic or s files is specified on starting the ca the ca links the relocatable object file that has been internally generated
78. must be placed before the function s definition pragma text function is ignored The text section must be specified before the function definition The text section specification for a function function is ignored Function specified as direct can not be allocated in text pragma text function is ignored The text section cannot be specified for a function specified as interrupt in direct location direct The text section specification for a function function is ignored Function allocated in text can not be specified as direct Previously specified pragma text function is ignored Function specified as text section cannot be specified as interrupt in direct location direct The text section specification for a function function already specified is invalid W2743 W2744 W2748 Ww5009 W6101 W6102 W7101 W7102 W7103 W7104 W7105 W7106 Function allocated in text can not be inlined pragma inline function is ignored inline cannot be specified for a function specified as text section The inline specification for a function function is ignored Function allocated in text can not be inlined Previously specified pragma inline function is ignored text section is specified to a function specified as inline The inline specification for a function function already specified is invalid Section name is not specified The section name is not specified be
79. must not be specified file is not ELF file File file is not an object file in the ELF format memory allocation fault The memory capacity has run short nested command file file Command file file is nested It must not be nested section No such section Specified section section cannot be found read error Data cannot be read from the file seek error The file cannot be sought too many input files Two or more input files must not be specified too many output files Two or more output files must not be specified usage hx f ITSs F dir name U num zxRSV b num d num o file input file Input the command line like this Warning S expect fT The S option is valid only when the expanded Tek hex format is specified when fT is specified Warning U option overrides f option The f option is invalid because the U option is specified 357 Warning x expect S and fT The x option is valid only when specified with the S and fT options Warning address is too long The address exceeds the maximum value of the address that can be expressed in the specified hex format Warning block length is set Length gt length The maximum value of the block length is changed from the default value to ength and processing is continued Warning expect command file after ignored Specify command file after option is ignored Warning symbol block length exceed default value Th
80. number for the object being created This means that the object can only be used as a common object belonging to the V850E refer to page 205 If this option is omitted the object becomes fixed as a device type so a magic number defined for a specific model will be embedded This option creates an object file that includes the information this is a function call for a new format This is valid when using an assembler source file that was created for the V850 Family by an old version of the C compiler or when using an assembler source file that was created for the V850 Family by an old version of the C compiler under the V810 Family This option outputs information for the debugger This option is ignored if the O option has also been specified and if the source file contains debugging information sections If it does not contain debugging information sections this option is valid but the O option is ignored This is equivalent to specifying Debug from the Option menu when the Project Manager is used Specify a decimal number for num Section having section type PROGBITS and section attribute AWG Section having section type NOBITS and section attribute AWG If activated from the C compiler ca the Gnum option that was specified during C compiler startup is passed Refer to User s Manual Assembly Language Refer to V800 Series C Compiler Package User s Manual C Language The sections are define
81. o and file2 0 to create a relocatable object file 247 20 reg Specifies register mode for referencing libraries Format regnum e 22 or 26 can be specified as num e reg must not be followed by a blank space Feature Searches specified register mode directory to reference the supplied library Default assumption Searches the 32 register mode directory Example e 1d850 reg22 file1 o file2 0 lc References standard library for 22 register mode and links object files file1 o and file2 o 37 Refer to V800 Series C Compiler Package User s Manual C Language 248 21 s Specifies deletion of debug information line number information and global pointer table Format S Feature Creates an object file from which the debug information line number information and global pointer table are deleted Default assumption Creates an object file in which the debug information line number information and global pointer table remain Example e 1d850 s file1 o file2 0 Links object files file1 o and file2 0 to create an object file from which the debug information line number information and global pointer table are deleted 249 22 t Does not specify checking of size and alignment condition in linking undefined external symbols Format t Feature Does not check the symbol size and alignment condition in linking undefined external symbols 8 Default assumption Checks the symbol size and alig
82. of load address and the load address O O a Code 1 byte of code expressed as 2 digit hexadecimal number Example gt 15 6 1C 3100 020202020202 NL a b c d e S Block length is 15 Block type is 6 Check sum is 1C which is remainder expressed as 2 digit hexadecimal number resulting from dividing 1 5 6 3 1 0 0 0 2 0 2 0 2 0 2 0 2 0 2 28 by 256 Number of digits of load address is 3 and load address is 100 e Code O O e a g 2 Symbol block Indicates the value of a symbol LL T SS LN N section definition field 4 cont d to next line a b A symbol definition field symbol definition field NL B a Block type is 3 b Number of characters of the section name and the section name A Section definition field Indicates that this field is a section definition field SS Number of digits of the base address of a section and the base address of the section O Number of digits of the length of a section and the length of the section 24 One section definition field must exist in each section A section definition field can be followed by or follow any of symbol definition fields 353 B Symbol definition field Type of symbol Number of characters of symbol and the symbol Number of digits of symbol value and value of symbol anann CO CO o e FS wa Example 1 gt 37 3 60 8SVCSTUFFO 02402C6 22CR1D14OPEN25014READ25815WRITE26
83. only constants with the constants of the result upon compiling In addition to the above invokes the machine dependent optimization module Optimization such as deleting unreferenced labels redundant instruction elimination and peephole optimizations replacing instruction sequence with more efficient ones is executed to an assembly language source program output by the code generation module lt Example gt To delete meaningless branch instructions In addition executes interfunctional optimization and optimization by the as Optimization such as copy propagation in a function common subexpression elimination redundant assignment elimination loop invariant motion operation strength reduction induction variable substitution and code hoisting is performed by using the information that can be grasped in a function In addition sophisticated register allocation that gives consideration to the frequency of referencing variables is performed by using coloring technique Moreover optimization by the as is also executed refer to page 201 lt Example gt To move a substitution statement whose value in a loop is not changed to outside the loop 34 Maximum instruction arrangement that is always executed from the first instruction and from which execution does not branch from any instruction other than the last instruction 162 s Executes object size priority optimization This is the most valid optimization in the normal a
84. pragma directive 183 E2653 E2654 E2655 E2660 E2661 E2662 E2663 E2664 E2665 E2666 E2670 E2680 E2681 E2681 184 Directive pragma section is nested Section allocation specification by the pragma directive is nested inconsistent section for symbol The section contradicts symbol symbol misplaced pragma section section end The position of pragma section section end is inappropriate cannot write read only I O register regname Data cannot be written to internal peripheral function register regname that has only a read attribute cannot read write only I O register regname Data cannot be read from internal peripheral function register regname that has only a write attribute cannot access for I O register bit number regname A position that cannot be accessed is specified in the description of the bit access to internal peripheral function register regname UO register bit number must be integral type Describe the specification of the bit position for an internal peripheral function register with an integer value Specifying bit number for I O register regname is not allowed Bit access cannot be specified for a bit of internal peripheral function register regname unknown cpu type cannot use I O register The internal peripheral function register cannot be used because the target device is unknown illegal operand I O register
85. size of external symbols when they are linked If a difference in size is detected the following message is output and linking continues normally At this time the symbol size of the file to which a symbol is actually defined is valid warning symbol symbol has different size in file file Example e 1d850 T file1 o file2 0 Does not check the multiple defined external symbol in linking object files file1 o and file2 o 235 8 V Outputs version number Format V e This option can be specified only at the start from VSH Feature Outputs the version number of the Id to the standard output Default assumption Does not output Example e 1d850 V Outputs the version number of the Id850 to the standard output 236 9 cpu Specifies target device Format cpu A devicename cpu must be followed by a blank space Feature Reads the contents of the device file of the target device specified by devicename and uses them for processing such as memory allocation e Linking is stopped if a target device is specified different from that specified by the cpu option of the ca or as the pragma cpu directive in the C source file or option pseudo instruction in the assembler source file e When using the option dialog in the project manager this is equivalent to the device specification performed in project setting e For the device type that can be specified as devicename refer to the User s Manual of e
86. the CPU used refer to the documents supplied with the CPU 66 2 Buttons OK Delete Source Option Cancel Help Enables the specified items and closes the dialog This button appears dimmed and cannot be selected when options for the overall project have been specified It can be selected when options are specified by selecting source files via the Project Manager s lt lt Source List gt gt dialog When itis selected this button deletes any options specified for a particular source file and applies only overall options Ignores the specified items and closes the dialog Opens the Help window 67 2 5 3 Setting link editor options The link editor option setting dialog box can be displayed by performing the following operation after a project has been set with the Project Manager e Click the Option menu Click Linker Options Since the link editor needs to be activated only once per project there are no file specific settings The names of executable object files that can be output by the link editor is the first filename minus the extension shown in the lt lt Source List gt gt dialog to which the extension OUT is added The output filename cannot be specified there is no specification method that corresponds to the o specification to activate from the VSH command line Three option buttons are displayed at the up
87. the data that is rewritten by the application processing as well as the instruction to be located on the high speed internal RAM of the sections that are stored to ROM must be copied to a RAM area on the target gt ROM Constant data p ROM Combined to be Data with initial value Text located on RAM P stored to ROM Copied upon RAM for execution xecution Data without initial value gt RAM The romp packs the sections to be located on the RAM of the target system as a rompsec section to store them in ROM and creates initialization information as well as an object file having module copying processing Consequently you do not have to be aware of storing to ROM while developing the application The first address of the rompsec section of the object file created by the romp is the address indicated by a specified label or by S_romp 379 1 2 Types of Sections to Be Packed Data to be packed as a rompsec section are the data allocated to the section having an attribute that can be written As the types of the sections the sdata attribute section and data attribute section are used refer to page 257 With the V830 Family the section of the module to be located in the internal instruction RAM is packed in addition to the above Specify the sdata attribute or data attribute in the following reserved section and assembly language program by using the section pseudo instruction The section created
88. the default link directive If only the symbol directive of the link directives specified upon starting the Id is specified linking is executed by using the segment directive section of the default directive and the specified symbol directive If the symbol directive is not specified by the link directive specified upon starting the Id the default text pointer symbol mp TEXT global pointer symbol __gp_DATA and element pointer symbol __ep_ DATA are not Created The directive for an interrupt handler is automatically created and added to the default link directive based on the information read from the device file If an interrupt handler is specified by the pragma directive in the C source program or an interrupt handler is specified by the section pseudo instruction in the assembly language source program the interrupt handler is allocated in accordance with the added directive The default link directive specifies the following output section names corresponding to the following segment Sections having other names are not allocated to each segment sconst section SCONST segment const section CONST segment sedata sebss section SEDATA segment sidata section sibss section tidata section tibss section l tidata byte section tibss byte section tidata word section SIDATA segment tibss word section cdata1 section CDATA1 segment cdata2 section CDATA2 segment cdata
89. the output section e Table 3 6 shows the section attributes that can be specified and their meanings Table 3 6 Section Attributes and Their Meanings Section Attribute Meaning Section occupying memory Section that can be written Executable section Section allocated to memory range that can be referenced by using global pointer gp and 16 bit displacement e The section attribute must not be omitted If omitted the Id outputs the following message and stops linking syntax error ATTRIBUTE line num section directive of section section needs SECTION e If this mapping directive is specified in a segment directive the specified section attribute must match the section attribute specified in that segment directive e Start specifying the section attribute with e 2 must not be followed by a blank space Example gt sec SPROGBITS AX e A W X and G can be specified in any sequence e A W X or G can be specified more than once in specifying an section attribute once In terms of meaning however it is the same as when specifying A W X or G only once Example gt sec SPROGBITS AXAX e Ifa section attribute is specified more than once in one mapping directive the Id outputs the following message and stops linking syntax error line num SE GM ENT ATTRIBUTE specified to section section more
90. used or the User s Manual of the device file For example when creating the ITEXT segment with the V830 as the target device specify address Oxfe000100 The input output section names for SEDATA CONST SCONST SIDATA CDATA1 CDATA2 CDATA3 UDATA1 UDATA2 UDATA3 and ITEXT are fixed to the same name as the default names and must not be omitted With CA850 The valid address range is fixed for the segment placed in the internal memory or the segment that is placed at an address determined by the Id850 such as SEDATA When creating and specifying a directive file specify an address suitable for the memory location of the microprocessor as the address for the segment to be created by referring to the User s Manual of the microprocessor used or device file For example if the V851 with internal ROM is used as the target device and if the SIDATA segment is to be created specify Oxffe000 as the address The input output section names of SEDATA CONST SCONST and SIDATA are fixed to the same name as the default names and must not be omitted Caution If the SIDATA segment is not created and for example a data segment such as the DATA segment for the default directive is allocated to the internal RAM a warning message indicating that the DATA segment does not fit in the internal RAM area is output almost every time if the start up module or library supplied with this compiler package are used In this ca
91. various command descriptions in Volume 3 and subsequent volumes 3 4 1 Operations related to internal commands only 1 2 3 Delimiters for options and directories In internal commands options are preceded by or Option specifications that begin with are not case sensitive but those except ATTRIB that begin with nn nm or are case sensitive When specifying a command that does not have any option specifications that begin with can be used as the delimiter for directories Option specification sequence The sequence in which options for internal commands are specified is not significant unless otherwise stated in a caution note If a function activated by an option specification conflicts with another function only the most recently specified option is valid Wild cards Wild cards can be used when specifying file names in cases where the internal command can be specified for several files This wild card function is the same as that implemented in MS DOS Indicates any character string Indicates any single character 99 3 4 2 Operations related to external commands only 1 Command input method Executable files that operate under Windows and PIF files with pif extension that operate under MS DOS can be specified as external commands Specifications are not case sensitive Also can be used as the delimiter f
92. with an arbitrary name given is packed Table 1 1 Reserved Sections Packed by romp data section data section sdata section sdata section sedata section sedata section sidata section sidata section cdata1 section tidata section cdata2 section tidata byte section cdata3 section tidata word section udata1 section udata2 section udata3 section itext section With the CA830 the sections of the interrupt handler located in the internal instruction RAM addresses Oxfe000000 through OxfeOOOOff are packed in addition to the above By referencing the object file created through romp with dump it can be confirmed that the rompsec section has been created instead of the data sdata or itext section 1 The bss attribute section and sbss attribute section that can be written but do not have an initial value are not packed 2 romp830 allows the first address of each section to align in word size when packing the section located in the internal instruction RAM such as itext section or interrupt handler As a result a padding area may be generated and the object size may become larger accordingly 380 1 3 Procedure of Storing to ROM The procedure of storing a program to ROM by using the romp is shown below 1 Start copy routine _rcopy holding the necessary arguments within the program to be stored to ROM when that program is started refer to Figure 1 2 and CHAPTER 4 Figure 1 2 Example of Using Copy
93. 0 NL a b c d e f a Block length is 37 b Block type is 3 c Check sum is 60 d Number of characters of a section is 8 and the section name is SVCSTUFF e Section definition field number of digits of the base address of the section is 2 the base address of the section is 20 the number of digits of the length of the section is 2 and the length of the section is C6 f Symbol definition field 22CR1D 140PEN250 14READ258 15WRITE260 Example 2 gt 37 3 C8 8SVCSTUFFO 15CLOSE26814EXIT27029BUFLENGTH28013BUF278 NL a b c d e a Block length b Block type is 3 Cl Check sum d Number of characters of section name is 8 and section name is SVCSTUFF e Symbol definition field 15CLOSE268 14EXIT270 29BUFLENGTH280 13BUF278 25 1 global address symbol having binding class GLOBAL and type other than ABS 2 global scalar symbol having binding class GLOBAL and type ABS 5 local address symbol having binding class LOCAL and type other than ABS 6 local scalar symbol having binding class LOCAL and type ABS 354 3 Termination block Indicates an entry point address LL I SS LA A NL a b a Block type is 8 b Number of digits of entry point address and the entry point address Example gt 08 8 1A 280 NL a b c d a Block length is 8 b Block type is 8 c Check sum is 1A d Number o
94. 00 S int c To select history information Double click a history information to highlight or select it to click the OK button The dialog box is closed and the selected history item is displayed on the command line Click Cancel to close the dialog box without selecting the history item 3 Alias Opens a dialog box to display a list of aliases Add Edit Opens the dialog box for setting up aliases After clicking the item to be changed from among the items listed click the Edit button to open the dialog box for changing the name Edit Alias 91 92 al Operation CAUTIONS Delete Close Help Click this button to delete the highlighted alias Click this button to confirm the displayed alias and close the alias dialog Opens the Help window When setting up an alias In the dialog box opened via the Add button which is in the dialog box that had been opened via the Alias menu enter an alias in the text box under lt lt Name gt gt and enter the corresponding command including arguments in the text box under lt lt Definition gt gt Click the OK button to set the alias and close the dialog box In the dialog box opened via the Edit button enter corr
95. 150 1 3 Execution Object Creating Pattern ccccscecssseeeeseeeessseeeeeeeeessseseseeeeeeseeseseeeeeeeas 151 CHAPTER 2 OPERATION irana a aAA acts REENEN 153 2 1 Command Input Format from VSH Command Line ccceseeeseeeeeeseeeeesseeeneeeees 153 2 2 Types and Features Of Options cccsseecceeeeeeseeeeeeeeeeseaesensneeeseeseeseeeeeeesseneeeeeeenees 153 PAP A Option LSU EE 153 1 Input options siirre aeaaaee ae oaa aaae aee aAa Eaa eanan pe Aaa Ena aana EEA EEEn aaaea in paaa 153 2 Preprocessing Options sssssssussennnsnnnnnnnnnnnnnnnnnnnnnnnnnannnnnnnnnannnnnnnnnnnnnnnnnnnnnnnnnn nananman 154 3 Language Options seeEkSNEEERRRREEESREEEEEREEEEERREEEERKREEEERKEEEERREEEERRREEEERKEEEEEREEEEREREEEERKEEEERRNek 155 4 Optimization option 0 cceecceseeeeeeeseeeeeeeeeeeeeseeeeeneeseeeeseeeseesaseeenseeseeesaseaeseesseeeseneeesenes 156 5 OUTPUt OPtiON E OTT 156 6 Message options 2 0 ceeesesseeeeenseeeenseeeeesseeeeaseeesaseeeeeseneeeaseeesaseneeeaseeesasenesaneoneenseeees 158 7 Other option se eerste uge egeEEeeEedeg ek Seege ee deeg See 159 10 2 2 2 Efficient use Of OPTIMIZATION 5 SeeeeSREEEERKNEEEERKREEERREEEEERREEEERKEEEERREEEEERREEEEREEEEERREEEERRKEEEENEn 162 2 2 3 Effects of debugging ON optimization s s sssessssusssnnnsnnunsnnnnnnnnnnnnnnunnnnnnnnnnnnnnnnnnnnnnnn nnne 165 2 2 4 Output of bdid instruction V830 aea eaaa rarena Aa Ara EAr KESTE Eana aranana ais 166 2 2 5 Arg
96. 16 mc Checks mixing of mask register function Format mc e This option can be specified only at the start from VSH Feature Checks whether a file using the mask register function and a file not using the mask register function exist in mix in the object file created from the C source file Default assumption Does not check Example e 1d850 mc file1 o file2 o Checks whether a file using the mask register function and a file not using the mask register function exist in mix when object files file1 o and file2 o are linked 35 Refer to V800 Series C Compiler Package User s Manual C Language 244 17 o Specifies name of object file to be created Format o A Ofile e ofile must be permitted by the Windows as a file name e o must be followed by a blank space e This option can be specified only at the start from VSH Feature Uses ofile as the name of the object file to be created The option dialog does not have this option The name always becomes the name which is omitted the suffix of the first file in source list and is added OUT Default assumption Assumes that a out is specified Example e 1d850 o ofile file1 o file2 o Links object files file1 o and file2 0 and uses ofile as the name of the object file to be created 245 18 ol Library reference of old function calling specifications V850 Format ol e This option can be specified only at the start from VSH Feature
97. 2 Assembler source file option data _datl text mov _datl r11 option data _dat2 text mov S _dat2 r12 ve mov S _sdatl r13 TEXT mov _sdat2 r14 T T T T option sdata _sdatl option sdata _sdat2 With initial value allocation is to data section Without initial value allocation is to bes section With initial value allocation is to sdata section Without initial value allocation is to sbss section Instruction is expanded assuming that allocation is to data section Instruction is expanded assuming that allocation is to bss section Instruction is not expanded assuming that allocation is to sdata section Instruction is not expanded assuming that allocation is to sbss section 411 This Appendix explains the format of the object file used with this compiler package APPENDIX B FORMAT OF OBJECT FILE B 1 Structure of Object File The format of the object file used with this compiler package conforms to the ELF format which is one of the standard object file formats The structure of an object file in this format slightly differs between a relocatable object file and an executable object file refer to Figure B 1 The relocatable object file has the information necessary for creating an executable object file and the executable object file has the information necessary for executing the object file In the sections that follow the ELF header program header table
98. 2 When using 2 in Synopsis this command moves all of the files in the directory specified by path1 to the directory specified by path2 When using 3 in Synopsis this command moves the file specified by filename to the directory specified by path When using 4 in Synopsis this command changes the directory name specified by path1 to path2 When using 5 in Synopsis this command changes the file specified by filename1 to filename2 K FILE C TMP Examples A gt MV FILE1 C TMP FILE2 C L A gt MV B WORK TMP A gt MV f B WOR A gt MV WORK TMP A gt MV i B FILE1 C FILI HZ oC a lt Moves FILE1 C to FILE2 C in the TMP directory lt Moves all files in the WORK directory of the drive B to the TMP directory in the drive A lt Forcibly moves FILE C in the WORK directory of the drive B to the TMP directory in the drive A lt Changes the WORK directory in the drive A to TMP directory in the same drive lt Changes FILE1 C in the root directory of the drive B to FILE2 C in the same drive and the same directory If FILE2 C already exists it opens a dialog box to prompt for confirmation before replacing existing file s 125 POPD Pop directory stack POPD POPD Summary Pop directory stack Synopsis POPD A option Options n Pops removes the contents of the nth
99. 3 4 on page 264 Output object file a out a out lt text section text section TEXT segment 2 D 5 Bi sbss section sbss section O L sdata section DATA segment O X ox100000 4 The minimum unit for loading a program to memory it is reflected in the program header of the created object file 220 4 Resolves unresolved external reference in the output section 5 Creates the following three types of symbols for the subject segment in accordance with an explicitly specified or default link directive refer to 3 6 on page 290 e Text pointer symbol having an address value to be set to the text pointer tp e Global pointer symbol having an address value to be set to the global pointer gp or an offset value from the text pointer tp of the address value to be set e Element pointer symbol having an element pointer ep V850 as the address value to be set 6 Creates reserved symbols having the values of the first address of each output section the first address aligned under a 4 byte alignment condition that exceeds the end of each output section and the first address aligned under a 4 byte alignment condition that exceeds the end of the created and executable object file refer to 5 2 on page 320 5 These symbols are used to set appropriate values to the text pointer tp global pointer gp and element pointer ep before executing the codes created by t
100. 3 section CDATA3 segment udata1 section UDATA1 segment udata2 section UDATA2 segment udata3 section UDATA3 segment NEW E EE E itext section ITEXT segment The output sections other than the above are allocated to the TEXT segment or DATA segment by the section type and section attribute In the above segments the input section names are fixed to the same names of the output sections 72 In the example of the start up module crtN s included in this compiler package the text pointer symbol __tp_TEXT global pointer symbol __gp_DATA and element pointer symbol __ep_DATA created by the default link directive are used 73 Refer to V800 Series C Compiler Package User s Manual C Language 74 Refer to User s Manual Assembly Language of each family 314 3 8 Using Default Link Directive In describing a link directive some items must be described in the same manner as the default link directive refer to page 305 The items of each family are explained below 1 2 With CA830 The valid address range is fixed for the segment corresponding to the internal memory or chip select signal The address range of the default directive conforms to the memory location of the V830 When creating and specifying a directive file specify an address suitable for the memory location of the microprocessor as the address of the segment to be created by referring to the User s Manual of the microprocessor
101. 305 E1307 E2103 E2104 E2111 E2113 E2114 E2116 E2117 E2118 E2123 E2124 E2125 176 cannot remove temporary directory dir The work directory dir prepared for creating a temporary file cannot be deleted cannot unlink temporary file file Temporary file file cannot be deleted illegal header name The character string of the header name specified by include is incorrect cannot find include file file The file file specified by the include directive cannot be found illegal token token An illegal token token is recognized unexpected EOF The file ends at a position not permitted by syntax non terminated comment P that closes the comment is missing illegal expression syntax The description of the expression in preprocessing control is incorrect compiler limit too long identifier name num The name of the identifier is too long The maximum value of this processing system is 1023 in the case of the internal identifier and 1022 in the case of the external identifier compiler limit too many characters in string literal num The character string literal is too long The maximum value of this processing system is 4045 compiler limit too many macro parameters num Too many macro parameters are used The maximum value of this processing system is 31 illegal macro name name The macro name name is incorrect System reserved macro name
102. 314 321 tibss byte sechion 266 279 314 321 426 Des word section 266 279 314 321 tidata section cccecccceeeeeeeeeeeeeee 266 279 314 321 tidata byte section 266 279 314 321 tidata word eechon 266 279 314 321 TIME x cee ceeds EE 135 ue BE ul e EE 292 us Rule ele EE 302 BR GE Cd e 294 Da dl Seen cee eee Rte Se echt oes ees i tt tate 136 Type OF SOCOM siha eoira apii tanai aii 257 U Udatal section 266 279 314 321 Udata2 section cccceceeeeeeeeeeee 266 279 314 321 Udatad SECTION cccceceeeeeeeeeeee 266 279 314 321 Undefined external Symbol sesser 250 419 Use temporary command file 59 66 74 79 V V810 inheriting Option sesser 202 Vertical Scroll garene aid ai asin aes 87 MORE besse dd Ee itt staat kt he eet ct 139 Ve EE 23 84 activation Beak ce tee Aiea Ae 84 EE 90 output file SPECIFICATION 0 eee eeeeeeeteeeeeee 138 VW W ODU ON dasna n decent ieee deg 172 174 VW attriDUte ia a l 268 282 Warning messages for each parameter ne 158 Window STA eee eeeeeeeeceeceecceteceeeeeseeeceeeecetsnsanansseeees 93 Windows based device files AA 101 Work CIrOCtOry ess a a eaat eaa En aaa EAE EiS 29 X X attributen a aae 268 282 Z Zero register r0 sssssssscssssssrnrrsrnrrrrnrennernnnnn 212 216 NEC Message Although NEC has taken all possible steps to ensure that the documentation supplied to our customers
103. 6 422 Segment attribute A 414 Segment directive ccccccceesseeeeeseeeeesteeeeees 255 264 fale le EAEE EEA AAE E 269 305 alignment condition ccceceeeeeeeeeeees 273 275 filing Malget ani Adi dene 272 277 hole EE 271 MAPPING directive 0 eee eeseeeeeeeeeeeeneteeeneeteaes 273 MGM OLY EE ET 271 segment attribute ee eeeeeeeneeeeeneeeeeeeeeeees 268 SEQGMENENAMG sde ental aan en 266 Segment type ege deeg ein 267 Segment overflow CA850 e ee eeeeeeeeeeeeeeeeeeeees 315 Segment specification of symbol s ssssssssreesrssseeen 296 Segment tyPe oe eeeeeeeeeceeeeeneeteeeeeeeteaeeeeeteaeeeeeeeeatens 414 e 93 Setting assembler Options ccecceeseeseeeeeeeeeeteeeees 60 Setting compiler options eceeeeeeeeeeeeeeeeeteeeeneeeees 39 425 Setting files inienn inai is 69 Setting input options ecccesceeeseteeeseteeessteeeesneeees 42 Setting language Options cee eeeeeeeeeeeeeeeeeeeeeees 46 Setting link editor Options sssssseeseeseeeeeeeeeeeeereereeen 68 Setting message OPTIONS cceeeeeeseseeeetteeeeeeeees 56 Setting optimization Options ccceeeeeeeseeeeeeeees 48 Setting option 1 assembler s sssssssssesseresrressnneene 61 Setting option 2 assembler s sssssssssssseresrrsssnseee 63 Setting options link editor eee ee eeeeeeteeeteeeeeeeeees 71 Setting options ROM storing processor 77 Setting other options assembler
104. 850E Object File sccse 322 CHAPTER 6 MESSAGES guest ss REENEN EES EE EENS ENEE 323 61 Message F rmate eege 323 6 2 Messages nhors aE eed esteeeceeccescanet ESTAVAN EE Aa fis a 324 VOLUME 6 HANDLING ARCHIVER ccccccsceeeseeseseeseesseesseesseeseeeseeesseeseeseseessesssnsneness 335 CHAPTER T OVERVIEW eege See E rinan 336 14 Flow ot Operation s siriene eeose aeaeo aneta EES EEN 336 1 2 Handling H d LEE 336 CHAPTER 2 OPERATION i icccsciecceccccccccisscsteceschesscces vevcecensevessnccts SEENEN Ee SEENEN ENEE 337 2 1 Command Input Format from VSH Command Line ecceseceesseeeeeeeeeeeseeeeneeeees 337 2 2 Types and Features of KeyS Options ccccssseeceseeeseseeeeseeeesssaeseseeeeeeseesesseeeenenees 337 KENNT E 337 222 2 OP tim IST E 338 2 3 Examples Of USC cccccssseeeceeesseeeeeeensseeeseeenseceeseeensneeseeensseeeeeeessceeeeensaeeseeenseeeeeeeenss 338 CHAPTER 3 MESSAGES ivi sien ine ee a ce rt eas 339 3 1 Message FOrimat ccceeeccecceeeeeeeeeeeneeeeeeenneeeseeeesnneeseeenseeeeseensneeeeeeeeseeeeeeeenseeeeeensneeeeeeens 339 B22 E EE 339 12 VOLUME 7 HANDLING HEX CONVERTER ekkseEESRREERRREEEREEEEERKEEEEEEEEERRREEEEEEEEERRKEEEESEEEE 341 CHAPTER 1 OVERVIEW siciiseccccl tc isctececccecctocecte Seeds A avec cack Feudeenccaetestvdeet ddeeesaue squaansauees E EE EE 342 TA How Of Operation ccccccsseeeeeseeeesneeeeeseeseseeeeeeseeseseeeeeneneeescaeeseseeeesesaesesse
105. 98 This compiler package supports the following three methods to specify allocation of data sections for the C source program e Specify the size of data to be allocated to the sdata or sbss section by using an option G of the C compiler e Allocate each variable to any section by using the pragma directive e Change the section allocating the specified variable by using the section file when the C compiler is started If a section file satisfies the file format requirements it can be coded and used freely but for tidata section it is useful to use section files output by sf For details of the format of output section files refer to page 408 Allocation to section Allocation to section by C source program by section file pragma section tidata Addition of description Specify section file by option A V V Object file Object file sf creates a section file according to the frequency at which variables are referenced The section file is a text file and allocation to the section can be freely changed according to the file format If specification of allocation by the pragma directive to a different section exists for the same variable in the C source program specification by the section file takes precedence 2 Refer to lt lt sdata sbss Allocation gt gt on page 51 and G option on page 156 3 Refer to V800 Series C Compiler Package User s Manual C Language 399 1 2 Sequence to Use Secti
106. A segment is not created refer to Figure 3 35 on page 313 The DATA segment is allocated to the first address of the internal RAM The CONST segment is allocated to an address suitable for the type of the device in accordance with the de vice file For example in the V851 that has an internal ROM the CONST segment is allocated to the first address of the external memory The Ss EDATA segment is allocated to an address lower than the first address of the internal RAM The CA850 includes v850def2 dir file for a sample which is the default directive when the target device is the V851 The segments other than mentioned above are allocated to addresses in the sequence in which the segments are described 309 Figure 3 32 Default Link Directive with SIDATA CA850 V851 SCONST DATA CONST We EDATA SIDATA _ ep DA __tp_TEXT TP_SYMBOL 9Jp_DAI LOAD R sconst SPROGBITS A sconst LOAD RX text PROGBITS AX LOAD RW VOx100000 data SPROGBITS AW sdata PROGBITS AWG sbss SNOBITS AWG SNOBITS AW Das LOAD R const S PROGBITS A const LOAD RW VOxff6000 sedata SPROGBITS AW sebss SNOBITS AW LOAD RW VOxffe000 tidata byte SPROGBITS tibss byte SNOBITS tidata word PROGBITS tibss word SNOBITS tidata SPROGBITS tibss NOBITS sidata PROGBITS sib
107. C in the WORK directory of the drive B A dialog box does not open to prompt for confirmation before deleting 111 DELTREE Delete file directory DELTREE DELTREE Summary Delete file directory Synopsis 1 DELTREE A option A drive path 2 DELTREE A option A drive path filename Options IY Deletes without Y Opens a dialog Description opening a dialog box to prompt for confirmation box to prompt for confirmation before deleting default When using 1 in Synopsis this command deletes the directory specified by path All files in the specified directory and its subdirectori When using 2 in Synopsis Examples A gt DELTREE WORK LA A gt DELTREE WORK FILI es will be deleted this command deletes the specified file lt Deletes all files under the WORK directory 112 E C lt Deletes FILE C file in the WORK directory DIR Display file list DIR DIR Summary Display file list Synopsis 1 DIR A option A drive path 2 DIR A option A drive path filename Options A attribute B L O Classification sequence IS W Displays only the filename s or directory name s with the specified attribute The specifiable attributes are listed below Several can be specified at the same
108. EW OF OPERATIONS cccssecceeeeeeseeeeensneeeeeeenseaeeeensneaeeeeseseaaeeesensseeeensnsnsenenees 32 CHAPTER 2 OPERATIONS USING THE PROJECT MANAGER ccccessssceeeeseeseeeeenseseeeeenseeeeeens 33 2 1 What is the Project Manager ccseecssseeeseeeesseeeeeseeeseeaeseseeeesesaeseneeeeesseeseseeeenes 33 2 2 Activation Of Project Manager cccceeececeseeeeseeeeeneeseeeeeeeeseeeeeeneseeeeeneeseeeeseeeseeeeenes 34 2 3 PROJECUSCIINGS lege erst ccc cetc nas Ed eaa ane Kea ea maaa Eein aaaea r aSo ae saioan abadie 35 2 4 Project Manager amd CA ae e Eeer 37 2 5 Dialogs for Setting CA Command Options sss ssssssesunsunnnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn annaa 39 2 5 1 Setting compiler Options cecssesseeeeeeesseeeseeenseeseneenseeenseesseesaseeseeesnseeseeeesseesneeesseeeeeees 39 Setting IMPUt Options osisssa aneri ca eeteedencendanteccudsatyerucyeedes sscescbeceucevetersearsandl sucevsuneds 42 Setting pre processor Options cceecsseeesseeeeeeenseeeeeeeseeeeneeeeseeeneeeseeeesseesneeeeeeeeseeesseeeeeeeas 44 Setting language Options sccsseceeeeeseeeeeeeeeeeeeeeeeeeeeeeeeesaeeseeeasaeenseeseeeeaseesseeeaeneeneeeeeeaens 46 Setting optimization Options 0 0 eeccseeeeeeeeeeeeeeeeeeeeeeneeeeeeeeeeeeeeeeeeeeseneeaseesseeenseeeneeeneeeeas 48 Setting output 1 OPTIONS 00 0 eecceeeeseeeneneenseeeseeeeseeeneeeeeeeenseeseeesaseesaeeeseeeenseeeseeneeeseneeneees 50 Setting OUTPUT 2 OPTI
109. File name Delimit each of these items from the others by a blank space Specifying of a section type and a section attribute must not be omitted If the same item is specified more than once for the same output segment the Id stops linking e Be sure to end the mapping directive with PE 278 3 5 3 Explanation of each item that can be specified for mapping directives 1 Section name Specify the name of a section output section to be included in the created object file on the left of On the right of specify the name of an input section to be allocated to the specified output section section included in the specified object files and the object files in the specified archive file Note however that an input section name starting with V v H h A a must not be specified e If the section name input section name on the right of is omitted all the sections having the specified section type and section attribute are allocated to the section output section on the left of on e The section name on the left of output section name must not be omitted If omitted the Id outputs the following message and stops linking syntax error line num section name is expected at the beginning of section directive e The same output section name must not be specified for two or more mapping directives If specified the Id outputs the following message and stops linking syntax
110. Header Table Offset Memsz 0x0 0x0 Offset in file Memory size Vaddr Flags 0x0 0x0 Virtual address Segment attribute SECTION HEAD ER Displays contents of section header table No Type Flags Addr Offset Link Info Adralgn Entsize ds 0x1 0x6 0x0 OxB4 0x0 0x0 0x4 0x0 Index Section type Section First address Offset in file attribute Section header Information Alignment Size of entry table index link condition 364 Version Ehsize Shstrndx T 0x34 5 Version number Size of ELF header Section header table index of string table holding section name Paddr Align 0x0 0x0 Physical address Alignment condition Size Name 0x7556 text Size Section name 3 7 String Table STRING TABLE INFORMATION Displays contents of string table Index String 0x1 etext Index Character string 3 8 Symbol Table SYMBOL TABLE INFORMATION Displays contents of symbol table No Value Size Bind Type Other Shndx Name Wa 0x0 0x0 0 3 0 0x1 text Index Value Size Binding Type Other Section header Section name class table index 3 9 Relocation Information RELOCATION INFORMATION Displays contents of relocation information Offset Sym Type Addend 0x20 6 0x23 0x0 Offset Symbol table index Relocation type Addend constant 3 10 Register Mode Information REGISTER MODE INFORMATION Displays contents of register mode information
111. IY Replaces existing file s without prompting for confirmation I Y Opens a dialog box to prompt for confirmation before replacing existing file s default setting Description When using 1 in Synopsis this command copies filename1 to filename2 When using 2 in Synopsis this command copies all files in the directory specified by path1 to the directory specified by path2 When using 3 in Synopsis this command copies the specified file s to the directory specified by path Examples A gt COPY FILE C B WORK lt Copies FILE C in the current directory to the WORK directory in the drive B 108 CP Copy file CP CP Summary Copy file Synopsis 1 CP A option A drive path filename1 A drive path filename2 2 CPI A option A drive path1 A drive path2 3 CPI A option A drive path filename A drive path Options R Same as the r option i Opens a dialog box to prompt for confirmation before replacing existing file s p Suppresses updating the last revised time for the copied file r Recursively copies the contents of the source subdirectory Valid only for the Synopsis 2 Description When using 1 in Synopsis this command copies filename1 to filename2 When using 2 in Synopsis this command copies all files in the directory specified by path1 to the directory specified by path2 If the r
112. NEC User s Manual CA830 CA850 C COMPILER PACKAGES OPERATION Windows BASED Target Device V800 Series Compatible Compilers CA830 Ver 1 10 or later CA850 Ver 2 00 or later Document No U12827EJ1VOUMO0 1st edition Date Published November 1997 N NEC Corporation 1997 Printed in Japan MEMO Trademarks e V800 Series V810 Family V830 Family V850 Family V810 V830 V851 and V850E are trademarks of NEC Corporation e Windows Windows NT Win32s Win32 and MS DOS are either registered trademarks or trademarks of Microsoft Corporation in the United States and or other countries e The other company names and product names appearing in this document are the trademarks of their respective companies The information in this document is subject to change without notice No part of this document may be copied or reproduced in any form or by any means without the prior written consent of NEC Corporation NEC Corporation assumes no responsibility for any errors which may appear in this document NEC Corporation does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from use of a device described herein or any other liability arising from use of such device No license either express implied or otherwise is granted under any patents copyrights or other intellectual property rights of NEC Corporation or of others Regiona
113. NS e Command line editing s scope is limited to the client area Therefore it is not possible to edit beyond the client area e If the window is resized during an editing operation the editing operation will be cancelled Table 3 1 Edit Key Lists Keys Function Moves character cursor one character forward Moves character cursor one character backward Deletes the character before the character cursor position Deletes the character at the character cursor position Deletes all characters from the character cursor position to the end of the current line Toggles between insert and overwrite modes When in insert mode the character cursor is the same size as the characters and when in overwrite mode the character cursor is an underscore mark When the VSH is activated insert mode is set Moves the character cursor to the start of the current line Moves the character cursor to the end of the current line 86 3 3 2 Scroll functions 1 Vertical scroll When the display of the entered command line or command output cannot fit in the client area a vertical scroll bar appears in the VSH window so that the display can be scrolled back to view previous output When scrolling back the character cursor is temporarily deleted Pressing a character key or edit key returns the display t
114. ONS wie ics cance secccces sect ccceessceeescezdieeecdecsnaeepnds Saduesbeyedecesaeeendscceestecesserds 53 Setting MESSAGE OPTIONS ceeccsseeseeesseeesseesseesneeeeseesseeeseeseeeaseesaseeesaeeaseesseeenseeseeeeeeeeeas 56 Setting Other Options sssrin see eege ee ENEE dEr 58 2 5 2 Setting assembler Options ccssccseecsseeceeeseseeeseeeeeeeeeeeesseeeseeessaeesseesseeeaseesseeeeseesnenensees 60 SOUti iG Opti Onn E BE 61 Setting Opti On use eenegen 63 Setting other Options s ivisccvcccccsiccssstecescccvesceeseccvcncrecsescctiasnevteceeseecceesuceevsnenneesanerssteeuce es 66 2 5 3 Setting link editor OPtiOMS ccceeseeeeseeeeeeeeeeeeeeeeeeneeeeensnesneeeeseeeneeeseeeeaseesseeeaeeeseeeeneees 68 Setting files sisccciscccseebisecciececterstecdsreccseestieecedectecteuevinewecdawedvasscbeuceveleeseavecdenveevteeenecrestedeuetey 69 ele RoT el E 71 Setting other Options ege EENS 74 2 5 4 Setting ROM storing processor Options cceecesesseeeseeeseeeenseeeeeeenseeseneeeeeeeneeeseeeeeeees 76 SOtting Kee e EE 77 Setting Other Option ee 79 2 6 Creating and Building Make Files cccseccssseeeseeeseseeseseeeeeeceeseseeeeeeeeeeesseeeenseneess 80 2 6 1 Using menu to create make files c cesses essen eeseeeeneeeeeaseeesaseeeeenseeeenseneeaseeeenseenenss 80 2 6 2 Auto generation of make file Via build FUNCTION sssusssensseunnnunnnunnnnnnnnnunnnnnnnnnnnnnnnnnna 81 CHAPTER 3 USE OF COMMAND SHELL
115. R command The Synopsis 2 is the same as the one in the PWD command Examples A gt CD B lt Changes the current directory to the root directory in the drive B A gt CD B WORK lt Changes the current directory to the WORK directory in the drive B B gt CD lt Displays the current directory B WORK 106 CHDIR Change display current directory CHDIR CHDIR Summary Change display current directory Synopsis 1 CHDIR A drive path 2 CHDIR Description When using 1 in Synopsis this command changes the current directory to the directory in the specified path When using 2 in Synopsis this command displays the absolute path in the current directory The Synopsis 1 and 2 are the same as those in the CD command The Synopsis 2 is the same as the one in the PWD command Examples A gt CHDIR B lt Changes the current directory to the root directory in the drive B A gt CHDIR B WORK lt Changes the current directory to the WORK directory in the drive B B gt CHDIR lt Displays the current directory B WORK 107 COPY Copy file COPY COPY Summary Copy file Synopsis 1 COPY A option A drive path filename1 A drive path filename2 2 COPY A option A drive path1 A drive path2 3 COPY A option A drive path filename A drive path Options
116. REEEEERREEEEREREEERREEEEREREEERREEEEEEREEERREEEEEEREEEEREEEEEER NEEN 256 3 3 1 Type Of seton ennenen essen eeseeeeeneeeeeaseeeeaseneeeaseeeeasenesaseeeeeaseeeeeseeesaseneesaseeeeeseneeanenees 257 3 3 2 Examples of Mapping image cccssseeesseeeesseeeeeseeeeeseeeenseeeeaseeeeeseeneeseeeeeaseneeeseneeenseenes 259 34 Segment DIS CUi Ve Eeer 264 3 4 1 Feature of Segment directive ccseeessenesseeeeeseeeeesseeeeneeeesaseeeseseeeesnseeeeaneneeesecenenseeees 264 3 4 2 Configuration Of segment directive 0 10 eeccseesseeeeeeeseeeeeeneeeeeeeeseeeeneeeeseeeseeeeseeeseeenees 264 3 4 3 Explanation of each item that can be specified for segment directive 266 3 4 4 Using segment directive cesses nese eeeeeeeeseeeneaseeeeeneeeeeneeeeaseeesensneeeneeeeeaseeesenseeneneeees 274 3 5 Mapping Directive ccccceceeeeeeeesseeeeeeenseceeeeeenseceeeeensseeeeeeenseceeeeseeseeeeeeensseenenseeteeeneenes 278 3 5 1 Feature Of mapping directive cesses essen eesseeeenseeeeeseeeeeeeeeeeaseeesaseenseseeeensseeeeseeeey 278 3 5 2 Configuration Of MAPPING directive cccseeesseeeeeeeeseeeeeeneeeeeeeeseeeeneeeseeeseeeeeseeeseeetees 278 3 5 3 Explanation of each item that can be specified for mapping directives 279 3 5 4 USING MAPPING directive cccseseeseeeeeesseeneeeeeeenseeeeeseeeeenseesuseeesesseeeenseeeeaneeeeeseneneneeenes 286 30 SyMDOl DU reet ee edd eege 290 3 6 1 Feature of symbol
117. ROGBITS AW sdata PROGBITS AWG sbss SNOBITS 2 AWG bas SNOBITS AW __tp_TEXT TP_SYMBOL Op DATA GP_SYMBOL amp __tp_TEXT 50 A hole can be also created between sections refer to page 283 51 The default filling value is 0x0000 277 3 5 Mapping Directive This section explains the feature configuration and usage of the mapping directive 3 5 1 Feature of mapping directive The mapping directive is used to instruct the following item of information e Configuration and attribute of an output section constituting the object file created by linking input sections sections included in specified object files or in object files within a specified archive file 3 5 2 Configuration of mapping directive The configuration of the mapping directive is shown below Figure 3 17 Configuration of Mapping Directive section name section type A section attribute A section name A V address A H hole size A A alignment condition file name A file name e The items that can be specified by the mapping directive and their formats are shown in Table 3 5 Table 3 5 Items That Can Be Specified and Their Specification Formats Item Specification Format Section name Section name Section type PROGBITS or NOBITS Section attribute A W X G Address V address Hole size H hole size Alignment condition A alignment condition File name
118. RX SPROGBITS AX secl filel o file2 o file3 o RW AOx10 SPROGBITS AW sec2 filel o file3 o RW A0x10 SPROGBITS AW sec3 file2 o SNOBITS AW sec4 file2 o STP_SYMBOL SEG1 3GP_SYMBOL amp __tp_TEXT SEG2 SEG3 276 Figure 3 14 Example of Allocation with Alignment Condition Specified Dei o SEG3 segment p zer Segment E S Segment file2 o Address Lower address 3 Creating hole Creating a certain area called a hole between segments and filling that area with a certain value called a filling value is called creating a hole To create a hole between segments specify the hole size and as necessary a filling value by using the segment directive that defines the segment with the address lower than that of the created hole Figure 3 15 shows the general format of allocation with creating a hole specified Figure 3 15 General Format of Allocation with Creating Hole Specified segment name LOAD A segment attribute A H hole size mapping directive D For example when object files are linked with the directive shown in Figure 3 16 specified a hole of 0x50 bytes is created after segment TEXT and segment DATA is allocated after the hole Figure 3 16 Example of Allocation with Creating Hole Specified TEXT LOAD RX VOx0 HOx50 text SPROGBITS AX DATA LOAD RW AOx8 data SP
119. Routine _rcopy define ALL COPY 1 extern unsigned long _S_romp main int ret ret _rcopy amp _S_romp ALL_COPY 2 Create an object file by specifying the ROM storing option of the ca e When using the Project Manager also specify the lt lt Output 2 gt gt of the C compiler Create Object for ROM e When using the VSH also specify the Xr option of the C compiler At this time link the codes that are used to allocate an area for the rompsec section by specifying reference of the ROM storing library Also reference the link directive that takes the area for the rompsec section into consideration refer to CHAPTER 3 3 By using the romp create an object file having a section with the data or sdata attribute having an initial value and placed in a RAM and the rompsec section instead of the section such as interrupt handler section and itext section placed in the internal instruction RAM with the V830 Family 4 Create hex data by starting the hx from the VSH command line 5 Load created hex data to the ROM of the target system refer to Figures 1 3 and 1 4 3 Refer to page 380 381 382 Figure 1 3 Image of ROM Storing example of V830 Family Executable object output by ca Executable object output by romp Interrupt external memory Interrupt external memory sconst section sconst section const section const section Jet section 4 In
120. S EE 378 LL FIOW Of Operation see 378 1 2 Types of Sections to Be Packed ccccsseccceseeeesseeeeeseeeeseeeseneeeeeseeeseeseeeeseeeseneeaeeeens 380 1 3 Procedure of Storing to ROM ss ssssssssunenuunnnnnnnnnnununnnnunnnunnnnunnnnnnnnnnnnnnnnnnnn nenne nnmnnn 381 CHAPTER 2 OPERATION e a aa e e ae aa aaar aa p EE EE ECNEEAEEE Ee EEESEEEEEeEeEER 384 2 1 Command Input FOorimat cccccccccececesceeseeeeeeeeeeesneeeeneeeeeseeeseseeeesesaeseseeeeeeseeseseeeeeneaees 384 2 2 Types and Features Of Options 0 ccccsseecceseeeeeseeeeeeeeeeseaeseneeeeeseaeseeseeeeeeeeesenneeeenenees 384 2 220 Option VST NEE 384 1 Output options asco sence ceccseectacadedenntcese er raam asana paa maS kaS Sapna aaae nane snes puuesendestecssntesdeecs 384 2 Other Opo NSm eege Eed 385 2 3 Examples ot Hee enee ana a aE aani Eia a aaa 385 CHAPTER 3 ALLOCATING AREA OF rompsec SECTION AND LINK PROCEDURE ccee 386 3 1 Allocation Area of rompsec Section s ssssssssnnsenusnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnna 386 3 2 rompsec Section and Link Directive cssseccesseeseseeeeeeeeeseseseseeeeeeseeseeseeeeeeeees 387 CHAPTER 4 COPY ROU INE eegene Seege AER 391 CHAPTER 5 MESSAGES a a a a a aar pa a a ste Aaaa aa a arr aa a r aaar es e a EES 394 5 1 Message Forimat s sscccccssseeceeesseeeeeeenseeeeeeensseeeeesenseeeeeeensseeeseeenseeeeeesenseeeeenensaeeeenseess 394 5 2 ET E 394 VOLUME 11 HANDLING SECTION FILE GENERA
121. Source Comment Xc Use Performance Checker Xpc Output Information for Analyzer Xaz 2 Buttons OK Delete Source Option Cancel Help Outputs a C language source program to the assembler source file to be output as comments This option can be specified only when Output Assemble List is specified The comments that are output however are only for reference and may not strictly correspond to the codes For example the output position of the global variables local variables and function declaration may be shifted In addition the codes may be deleted and only comments may remain because of optimization This box cannot be selected at present This box cannot be selected at present Enables the specified items and closes the dialog This button appears dimmed and cannot be selected when options for the overall project have been specified It can be selected when options are specified by selecting source files via the Project Manager s lt lt Source List gt gt dialog When itis selected this button deletes any options specified for a particular source file and applies only overall options Ignores the specified items and closes the dialog Opens the Help window o Setting output 2 options 0 Figure 2 12 Output 2 Option Settings Dialog Compiler Options x 1 Input 2 Preprocessor 3 Language C 4 Optimization CD Output ef X C7 Message CO Othe
122. TEST LOAD RX VOxfffc0000 text PROGBITS AX IR __tp_TEXT TP_SYMBOL gp_DATA GP SYMBOL A mp TEXT DATA1 DATA2 Input sequence mp TEST 1 OxFFFCO000 2 EE __tp_ TEXT 4 op DATA 3 0x100000 262 5 To create a symbol for each segment to set values to tp and gp If it is necessary to change the tp and gp during application execution specify a segment by the symbol directive to create two or more tp and gp symbols The tp and gp are changed by program by using the created symbol Figure 3 7 Example of Mapping Image 5 DATA1 ILOAD RW VO0x100000 data PROGBITS AW sdata PROGBITS AWG DATA2 LOAD RW V0x200000 sbss NOBITS AWG bes NOBITS AW TEXT LOAD RX VOxfffc0000 text PROGBITS AX D __tp_TEXT TP_SYMBOL gp_DATA1 GP_SYMBOL DATA1 gp_DATA2 GP_SYMBOL DATA2 Input sequence __tp_TEXT 1 d DNFFFCOOOO _ op DATA 2 0x200000 __gp_DATA1 3 0x100000 0x0 263 3 4 Segment Directive This section explains the feature configuration and usage of the segment directive 3 4 1 Feature of segment directive The segment directive can be used to specify the following items e Configuration and attribute of a segment created by linking sections e Address and alignment condition for allocating a segment to a memory space e Size of the hole created as necessary for allocating a segment to a memory space e Filling value of the h
123. TEXT TP_SYMBOL SEG1 op DATA GP_SYMBOL amp __tp_TEXT SEG2 SEG3 49 For allocation of a section to a segment refer to 3 5 4 on page 286 274 Figure 3 11 Example of Allocation with Address Specified Dei o SCONST sconst segment Address Oxffff8000 SEG3 segment SEG2 segment file3 o0 SEG1 segment sconst Lower address 2 Allocating segment with specified alignment condition satisfied To allocate a created segment to a memory space with the alignment condition of n byte boundary n is a multiple of 2 specify n as an alignment condition by using the segment directive that defines the segment Figure 3 12 shows the general format of allocation with an alignment condition specified Figure 3 12 General Format of Allocation with Alignment Condition Specified segment name LOAD A segment attribute A A alignment condition mapping directive D For example when object files lei o file2 0 and lei o including the sections in the sequence shown in Figure 3 14 are linked with the directive shown in Figure 3 13 specified segments SEG2 and SEG3 are allocated with the alignment condition of 0x10 satisfied refer to Figure 3 14 275 Figure 3 13 Example of Allocation Display with Alignment Condition Specified SEG1 LOAD secl j SEG2 LOAD sec2 SEG3 LOAD sec3 sec4 __tp_TEXT op DATA
124. TOR c ccccecccessseeeeeeeeeeseeeeeeseees 397 CHAPTER 1 OVERY E W e T e e ra a a aa e rE area araa rada apa rosaa asru aasa 398 LL Flo Of Operation geesde 398 1 2 Sequence to Use Section File cccccsccssseeeeeseessneeeeeeeeesseeeeeeseeesseaeseneeeeesseeseneeeneneas 400 CHAPTER 2 OPERATION a ei e dE Eege 402 2 1 Command Input ForMat sssssssssesenseunnreunnnuunnununnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nennen nnna 402 2 2 Types and Features Of Options 0 ccccsseccceseeessseeeeeseeesseeeseeseeeeseesseseeeeeeeeeseseeeeeneeees 402 KEN ele H E E 402 2 3 Examples Of USec aiana nia naaa raana i aa aianei i 404 14 CHAPTER 3 MESSAGES vic cessiccscccsssecsceceaneesaseeebseensdensdedusceuecteuscseeeedhasdquesunetenusvestretdeesecessdeessuceseeeseedesie 405 3 1 Message Format ssssccccssseeeceeesseeeeeeenseeeeeeensseeeeesensnceeeeensnneeeeeenseeeeeesessneeeeeenssneneeeenss 405 BET oerien ec en tee vectee te ddeceadtedecscadt tues sequetuecdvenactindeyeccdtaueveetuetnecdesseetedevente 405 APPEND I Xe eege ees Casares ele ee ERENNERT NN 407 APPENDIX A SECTION FILES e ssa cevecd ce SEENEN EEN EES ENEE EEN 408 APPENDIX B FORMAT OF OBJECT FILE cccceceeeeceeeeseeeceeeesceeeeeenseceseeeessneeseeesseaeeseeeeseaeseeeneaaes 412 B 41 c Structure Of Object blei eege EEN eege 412 BZ ELE Headers ee ee ENEE EE E 413 B 3 Program Header Table ccecccceseeeeeeeeeeeeeseeeeeeeeeseeneeeeeeeeseseeee
125. The gp symbol cannot be specified for a function already defined The gp symbol specification is ignored GP symbol is not specified for RTOS interrupt function function A gp symbol is not specified for a function function specified as an RTOS interrupt handler Function function is undefined previously specified rtos_task is ignored Function function specified as an RTOS task is not defined in the file The rtos_task specification is invalid Section section is already specified for symbol section is ignored section has been already specified in a section file for symbol symbol section2 that has been specified later is ignored Different section is specified for symbor in source file section and section file section2 Source file specification is ignored Section specification section1 for the source file and section specification section2 for the section file for symbol symbol differ The section specification section1 for the source file is ignored Block interrupt function cannot be installed inline is ignored inline must not be specified for a function declared to disable interrupts inline specification is ignored Block interrupt attribute is specified for function function previously specified inline is ignored Function function specified as inline is specified to disable interrupts inline specification is ignored pragma text function name
126. V830 Function allocated in itext can not be inlined Previously specified pragma inline function is ignored itext is specified to a function specified as inline The inline specification is ignored V830 Second argument name for __set_il is not interrupt request name name specified as the second argument of a function that sets an interrupt level is not an interrupt request name The interrupt level is not set cannot set interrupt level for name An interrupt level cannot be set for interrupt request name name The interrupt level is not set Rtos_task is specified for function function previously specified inline is ignored A function for which inline is specified is specified as a task for the RTOS The inline specification is ignored 195 W2691 W2699 W2700 W2703 W2704 W2710 W2711 W2730 W2731 W2740 W2741 W2742 196 Startup routine for RTOS task cannot be inlined inline is ignored Inline expansion must not be specified for a function specified as a task for the RTOS The inline specification is ignored Function function is undefined previously specified GP symbol for rtos_interrupt is ignored The function specified as an interrupt handler with a op symbol specified is not defined in the file The interrupt handler specification is invalid cannot specify gp symbol function function is already defined
127. ach device file Default assumption Reads the device file of the target device specified upon creating the o file Example e 1Id850 cpu 3000 file1 o file2 o0 Links object files iert o and file2 0 At this time the contents of the device file corresponding to device name 3000 V851 are read 237 10 e Sets entry point address Format e A symbol e e must be followed by a blank space Feature Uses the value of symbol symbol as the entry point address value of the object file to be created e Ifthe specified symbol symbolis not found the Id outputs the following message and stops linking fatal error can not find entry point symbol symbol specified with e option Default assumption The entry point address value of the object file to be created is determined by the following convention e The value of symbol start if the symbol exists e First address of a text attribute section allocated to the lowest address of the object file to be created if start does not exist e O if a text attribute section does not exist Example e 1d850 e mv start file1 o file2 o Uses the value of symbol mv start as the entry point address value of the object file to be created after linking object files file1 o and file2 o 29 This value is used as an entry address value by the hex converter hx included in this compiler package 30 Section having section type PROGBITS and section attribute AX 238
128. ae alee la in ei 260 3 5 Example of Mapping Image EE 261 3 6 Example of Mapping lu Le CC EE 262 3 7 Example of Mapping Image tease daeliedis soca EES ENER REENEN Eeer 263 3 8 Configuration of Segment Directive ee ceeeeeceseneeeeeeeeeeeceeeeeaeeseeeeeaeeeeeesaeeeneeeeseeseaeeeaeeseaeeseeeenaees 264 3 9 General Format of Allocation with Address Specified AA 274 3 10 Example of Allocation Display with Address Gpechfled A 274 3 11 Example of Allocation with Address Specified AA 275 3 12 General Format of Allocation with Alignment Condition Specified 0 eceeeeeeeeeeeeeeeeeeeeeeneeeneees 275 3 13 Example of Allocation Display with Alignment Condition Specified AA 276 3 14 Example of Allocation with Alignment Condition Specified A 276 3 15 General Format of Allocation with Creating Hole Specified A 277 3 16 Example of Allocation with Creating Hole Specified AA 277 3 17 Configuration of Mapping Directive eececeeeceeeeeeeeeeeeeeeeeeeeeaeesaeeeeaeeseeesaeeseeeeeaeeseaeeeeeseaeeeeeeenaees 278 3 18 General Format to Link Object Files AAA 289 3 19 Example of Commands for Linking Object Files A 289 3 20 Example of Linking Object Files ss win teste teehee teens testi dierent aed co 289 3 21 Configuration of Symbol Directive eee ceeeeeececeeeeeeeeeeeeeeeeeneesseeseaeeeeeseaeeseeeeaeeseeeeeaeeteaeeneeeenaees 292 3 22 Rules to Determine gp Symbol Value 0 0 eeeeeeceeeeeeeeeeeeeeeeeeceeeeaeeseeeeaeeseeeeaeeseeeseaeeseeeenae
129. ains the symbol table that is a type of a section The symbol table is a section having section type SYMTAB and is an array of symbol table entries having information on all the symbols included in the object file refer to Table B 6 An index to this array is called a symbol table index and the symbol table entries are referenced by using this symbol table index Table B 6 Constituents of Symbol Table Entry and Their Meanings Constituent Meaning name Name of corresponding symbol index to string table strtab value Value of corresponding symbol size Size of corresponding symbol BIND info Binding class of corresponding symbol GLOBAL for symbol used to resolve external reference LOCAL for symbol not used to resolve external reference TYPE info Type of corresponding symbol FILE in case of normal file name FUNC in case of function name NOTYPE in case of undefined symbol OBJECT in case of symbol indicating normal label SECTION in case of section name DEVFILE in case of device file name Section header table index of section corresponding to corresponding symbol which takes following value ABS in case of symbol indicating constant COMMON in case of undefined external symbol that is referenced by using global pointer gp and 32 bit displacement GPCOMMON in case of undefined external symbol that is referenced by using global pointer gp and 16 bit displacement UNDEF in case of undefined symbol
130. alue Higher address Sets tp symbol value to tp mov _ mp TEST tp ip a Lower address e Creating a global pointer symbol gp symbol having the address value to be set to the global pointer gp or the offset value from the address to be set to the text pointer tp of the address to be set Sets gp symbol value address to gp or tp symbol value gp symbol value offset mov __gp_DATA gp or mov __gp_DATA gp add tp gp Higher address Lower address 290 e Creating an element pointer symbol ep symbol having the address value to be set to the element pointer ep V850 Higher address Sets ep symbol value to ep mov __ep_DATA ep tp BS Internal RAM Lower address The tp symbol gp symbol and ep symbol are used to set appropriate values to the text pointer global pointer and element pointer by using the start up routine that is started before execution of the program This compiler package assumes that a reference not dependent on the position of the text position independent is executed by using the text pointer Data are also referenced independently of position by using the offset value from the global pointer In referencing data the data can be referenced at high speeds or the codes can be reduced by using gp relative access that places data in the sdata attripute section and sbss attribute section in the range that can be referenced by using the
131. an that of a pointer variable that is not automatic variable is not position independent Asm declaration used out of function is not supported completely Use of assembler description asm described outside the function and the assembler description between pragma asm and pragma endasm is limited If you want to use asm statement use __asm _asm must not be used for description of an assembler instruction when the ansi option strictly conforming to the language specifications is used Use __asm illegal use of static Storage area class specifier st atic is not correctly used Function requires return value No return value is specified for a function having a return value It is assumed that 0 is specified as the return value return type mismatch type type2 Type type2 of the return value indicated by the return statement does not agree with the return type type of the function argument type mismatch type7 type2 Type type2 of an actual argument does not agree with type7 of the dummy argument upon declaration of a function Type specifier of argument name is missing The type specifier of dummy argument name declared in the function definition is omitted int type is assumed This warning message is error message E2292 when the ansi option is specified illegal bit field type A type that cannot be specified with the ANSI specifications is specified for a bit field Padding is executed under the
132. and is used to check the information on a section or segment such as the address attribute and symbol name by displaying the contents of the section header table or symbol table in a created object file or archive file Figure 1 1 Flow of Operation of dump Object file or archive file dump 1 Outputs contents of input file to standard output 1 Ifa member that is not an object file exists in a specified archive file except when the e option is specified the dump command outputs a warning message and proceeds to the processing of the next member 360 CHAPTER 2 OPERATION This chapter explains the operations of the dump command 2 1 Command Input Format from VSH Command Line dump A option A file name A file name Can be omitted Pattern in immediately before can be repeated A One or more blank spaces 2 2 Types and Features of Options If no option is specified it is assumed that the A option is specified 2 2 1 Option list The following table lists the option of the dump Specification Format Feature This option displays the entire contents of the specified object file or archive file This option does not display the member update date among the displayed archive header contents This option outputs the dump version number to standard output and then terminates processing This option displays the archive header contents of all members existing in the specif
133. anges the specified file with the member having the same name in the specified archive file and then moves the specified file to the position immediately after the member member If the member is omitted processing is stopped rb A member This option exchanges the specified file with the member having the same name in the specified archive file and then moves the specified file to the position immediately before the member member If the member is omitted processing is stopped If the specified file has been updated more recently than the member having the same name in the specified archive file this option replaces member with the specified file A file is called a member when it is linked in an archive file A member has the same name as that before the file is linked 2 Whether or not a member with the same name as the specified file exists is not checked If the member with the same name as the specified file does not exist in the specified archive file the specified file is added to the end of the specified archive file If the specified archive file does not exist a new archive file is created and contains the specified file If the member with the same name as the specified file does not exist in the specified archive file the specified file is added to the end of the specified archive file 337 Specification Format Feature If a member name has been specified this option outputs only the member name of member e
134. ared as an interrupt The inline specification is ignored Interrupt attribute is specified for function function previously specified inline is ignored Function function for which inline was specified is specified as an interrupt handler The inline specification is ignored Function function is already defined directive pragma inline is ignored The inline specification must be described before the function definition The inline specification is ignored pragma itext function name must be placed before the function s definition pragma itext function is ignored The itext specification must be described before the function definition The itext specification is ignored V830 Function specified as direct can not be allocated in itext pragma itext function is ignored Function specified as an interrupt handler in direct location cannot be allocated to itext section The itext specification is ignored V830 Function allocated in itext can not be specified as direct Previously specified pragma itext function is ignored Function specified as itext is specified as an interrupt handler in direct location The itext specification is ignored V830 Function allocated in itext can not be inlined pragma inline function is ignored inline cannot be specified for a function specified as itext The inline specification is ignored
135. argets 143 4 4 4 Command lines The activation commands that are used to generate targets are described via the following syntax Be sure to begin each command line with a tab character Lob character A command A option Ignores command termination status Command is not displayed unless the n option in VMAKE has been specified Example Target description ca850 cpu 3000 main c 0s Wl D ldir 4 4 5 Macros Macros can be defined and referenced in make files 1 Macro definitions Macro definitions are described via the following synopsis macro name A A macro_character_string The following can be specified as macroname all are half size characters e English alphabet e Numerals e Periods e Underscore The blank spaces before and after the equal sign between macro_name and macro_character_string are removed during make execution Example cs ca850 cpu 3000 g D v c Note the following caution points e Do not enter a tab character at the start of the above line e It is not possible to recursively describe a target and a dependent file 144 2 Macro references Macro references can be described using any of the following synopsis a macro_name b macro_name c macro_name Example stem main c The operation is the same for all synopsis However the synopsis a can only be spec
136. as default assumption Command Line Options Displays ROM storing processor options setin each dialog with the command line options This area is for reference and writing is disabled 2 Buttons OK Enables the specified items and closes the dialog Cancel Ignores the specified items and closes the dialog Help Opens the Help window 79 2 6 Creating and Building Make Files The Project Manager can be used to create make files that incorporate the options specified in each dialog of the C compiler assembler link editor or ROM storing processor by a menu When build of the application load module is specified the building starts after creating the make file automatically For details of the menu items or the build function refer to Project Manager User s Manual 2 6 1 Using menu to create make files The following operation will create a make file from a menu of the Project Manager e Click the Project menu Click Make a Make File Ctrl M If the information required for creating a make file has not been set the menu item Make a Make File Ctrl M appears dimmed and cannot be selected When Make a Make File Ctrl M has been selected a make file is generated based on the option information set via the CA command s option dialog While the make file is being generated the message Generating make file is displayed in the status bar and onc
137. as850 cpu 3000 a I afile a s Assembler source file a s is assembled and object file a o is created At this time an assemble list is created and included in a file named afile The V851 is used as the target device e To specify created object file name as850 cpu 3000 o aobj a s Assembler source file a s is assembled and object file aobj is created 207 CHAPTER 3 ASSEMBLE LIST This chapter explains the assemble list output by the as The as outputs an assemble list by specifying a option When specifying with option dialog the assemble list is output to the file which has the file name with its extension replaced with v When starting from VSH if I option is specified the assemble list is output to the file specified by I option If I option is not specified the assemble list is output to standard output Figure 3 1 shows an example of the assemble list that is output by compiling C source program main int a and then assembling the output assembly language source program AX A X REXA A X A X A X A X A K A X A X A X A X A X A X Aa X A X A X A X ASKS 208 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 00 00 00 00 00 00 00 02 02 04 08 OA OC OC OC 10 14 16 Figure 3 1 Example of Output Assemble List OC8A 4001 E3CF0000 6444 1F18 2440 6108 E3DF0000 E8B 4 16
138. at of the alignment condition conforms to the specification format of the alignment condition of the segment directive refer to page 273 However odd numbered values can be specified in alignment conditions for the tidata byte tibss byte section only These odd values are not compensated to become even values 7 File name Specify an object file that includes an input section to be allocated to the output section If a file name is specified only the input section that is included in the specified file and has the corresponding section type and section attribute is allocated to the output section e In specifying a file name enclose the object file name to be specified in and e To specify two or more file names delimit each from the others by a blank space Example gt sec SPROGBITS AX filel o file2 o file3 o 53 A hole area is appended to the specified section 54 If the specified alignment condition value differs from a previously set alignment condition for the specified section the least common multiple of the both values is taken as the alignment condition 283 284 e To specify an object file in an archive file a file enclose the archive file name including a path in The path must be the same as the one specified by the path specification L option of the library if no path is specified the path of the standard directory is assumed Example gt sec SPROGBITS AX
139. ation Ot Size priority optimization Os 1 Break points cannot be set for statements where deletions have occurred 2 The transfer splitting and merging of statements may have rearranged the sequence of executable instructions in which cases the lines between lines which have been rearranged may be handled as a single line for which break points step execution etc can no longer be set 3 If the sequence of executable instructions for if else statements has been rearranged or if loop unrolling has caused a sequence of executable instructions to be rearranged step execution may no longer be possible as in 2 above 4 The entire function is regarded as the valid range scope for all automatic variables However if automatic variables have been allocated to registers even when they are within the scope they can be deleted or otherwise rendered invisible by optimization This can be due to the variables being used as local variables within the scope or being assigned as local variables as a result of optimization Example int f int a lt Valid within function Address 1 lt ais used only in the range from address 1 to address 2 Address 2 38 The range in the program within which the variables can be referenced 39 Position in a register or in memory 40 The address of an executable instruction within a line of source code may be smaller than the address of an executable instruction in a prev
140. attribute section regardless of its size Magic Number Specifies magic number of the object By selecting lt lt Common to V850 Family gt gt objects that are common in the V850 Family are created Similarly by selecting lt lt Common to V830 Family gt gt objects that are common in the V830 Family are created If lt lt Common to V850E Family gt gt is selected common items are limited to the V850E in the V850 Family V850 The default is fixed for the device If fixed for the device linking to other objects fixed to the device is impossible 17 If as is activated from ca at the VSH command line the Gnum option specified for ca will be passed even if this option is not specified for as but only the settings made via this dialog are valid for assembly source files This does not affect the lt lt sdata sbss Allocation gt gt setting made via the compiler option settings dialog 18 Refer to User s Manual Assembly Language 63 19 Refer to page 202 Output Assemble List a l Do Optimization O Verbose Mode v Suppress Warning w Use Mask Register m Outputs the assemble list Unlike the a I specification for as in the VSH command line base processing of the a in the ca command is executed refer to page 157 In other words the assemble list is output to a file whose extension is changed to v Executes optimization which rearranges instructions to
141. be activated using the command line in the VSH window Gavsh Figure 3 3 Example of CA Command Activation from VSH Edit History Alias Set Option Help popt850 is done e nectools lib opt850 01 C WINDOWS TEMP CAGO0000 3 i WINDOWS TEMP CAO00000 5 ic opt850 is done c nectools lib opt850 01 C WINDOWS TEMP CAGO0000 4 i WINDOWS TEMP CAOO0O0000 6 ic opt850 is done Code generating c nectools lib cgeng50 cgen850 is done e nectools lib cgen850 cgen850 is done erase erase erase erase erase erase erase c gt c gt Cc C C C C C C c gt ca850 AL WINDOWS TEMP CAGOOOOO G WINDOWS TEMP CAGOOOOO S WINDOWS TEMP CAGOOOO0 4 WINDOWS TEMP CAGOOOO0 3 WINDOWS TEMP CAGOOOO0 2 WINDOWS TEMP CAGOOOO0 1 WINDOWS TEMP CAGOOOO0 O cpu 3000 S int d C WINDOWUS TEMP CAOO0000 5 ic C NNINDONSNTENDNCODOODOONE LC ic c ic c ic cmd ic H H main e eub e For details of CA command options etc refer to the command specific descriptions in Volume 3 and later volumes 137 3 6 2 Output file specification in VSH When a command output to the VSH is redirected refer to page 101 to a file a command message is also output to the standard output The commands that the result is output to the standard output by default contain the result and message together Therefore when executing file output to
142. ber or as a hexadecimal number starting with 0x If this option is omitted it is assumed that Oxffffffff has been specified l A size This option specifies the display size size is specified as a decimal number or as a hexadecimal number starting with Ox If this option is omitted it is assumed that Oxffffffff has been specified This option displays the assembler source format If this option is omitted it is displayed with a symbol offset etc This option displays the offset from symbols If this option is omitted symbols are displayed unless the a option or the m option has been specified This option displays code that has been arranged according to the processor s instruction format However the c option takes priority if it has been specified 1 dis handles the directory at the dev position from the des installation directory as the standard directory of the device file 2 Machine language instruction or data 3 Machine language instruction or data 373 Specification Format Feature This option displays registers r0 r2 r3 r4 r5 and r31 as zero hp sp gp tp and Ip In the V850 Family r30 is also displayed as ep V850 If this option is omitted all registers are displayed in rnum format in which num is a value from 0 to 31 s address This option specifies a start address address is specified as a decimal number or as a hexadecimal number starting with 0x If thi
143. bol but differs in size from the symbol having the same name defined in file symbol symbol has incompatible type in file file Link occurs in symbol symbol but differs in type from the symbol having the same name defined in file symbol symbol has unknown binding class number Symbol symbol has illegal binding class number symbol symbol multiply defined Symbol symbol is multiple defined string symbol multiply defined first defined symbol symbol used string symbol is multiple defined string symbol symbol that is defined first is used string symbol multiply defined to segment segment first defined symbol symbol used string symbol is multiple defined for segment segment Symbol symbol that is defined first is used as string symbol for segment segment symbol table overflow The symbol table area has run short TP symbol symbol specified as GP symbol symbol2 s base symbol is not found tp symbol symbol1 specified as the base symbol of op symbol symbol2 is not found 332 undefined symbol symbol referenced in file Symbol symbol referenced in file file is not defined unknown cpu type Specify a target device This message is output if an attempt is made to create an executable object file by linking only the file specifying the cn option of the as when a relocatable object file is created unknown format type file file Specified file file has an ille
144. bol name Specify the tp symbol that is used to determine the gp symbol value in creating the gp symbol e If the base symbol name is omitted the gp symbol value is the address determined by the rules on page 292 e Ifa base symbol name is specified in creating the tp symbol the Id outputs no message and ignores the specification Address Specify the tp symbol or gp symbol value Address specification may be omitted If omitted the tp symbol value is the first address of the text attribute section allocated to the lowest address in the subjected segment if a text attribute section exists in the segment If the text attribute section does not exist in the segment the Id outputs a message and stops linking For the gp symbol value when address specification is omitted refer to the explanation on page 292 The address specification format conforms to the address specification format of the segment directive refer to page 270 Alignment condition This is used to specify the alignment condition for setting the value of the tp symbol or gp symbol Specification of the alignment condition may be omitted If omitted 0x4 is assumed as the default alignment condition The alignment condition specification format conforms to the alignment condition specification format of the segment directive refer to page 273 88 Section having section type PROGBITS and section attribute AX The reserved section includes the text section and itext sect
145. can be specified where optimization level is 2 or above and when execution time priority optimization is selected When size priority optimization is selected however this option appears dimmed because this option function is included and therefore this option cannot be specified Enables the specified items and closes the dialog This button appears dimmed and cannot be selected when options for the overall project have been specified It can be selected when options are specified by selecting source files via the Project Manager s lt lt Source List gt gt dialog When itis selected this button deletes any options specified for a particular source file and applies only overall options Ignores the specified items and closes the dialog Opens the Help window 49 o Setting output 1 options 0 Figure 2 11 Output 1 Option Settings Dialog Compiler Options x C1 Input 2 Preprocessor 3 Language 4 Optimization ai Cp Output C 7 Message C0 Others Frequency Information File T Create File Xxcre_sec_data F Specify File xcre_sec_data File Name sdata sbss Allocation M Allocate All Data Size Threshold G Kanji Code of Target Default No Conversion None Xkt none Shift JIS Xkt sjis EUC Xkt euc T Output Assemble List a F Output Source Comment vc F Use Performance Checker Xpc F Output Information for Analyzer Xaz ep Delete Source Option Can
146. cate the meaning of the value for some elements e ELF header e Program header table e Section header table e Symbol table e Relocation information e Debug information The following table lists the values display when v is specified and meaning of those elements which are displayed as character strings when v has been specified 1 Flags in ELF headers Display when v is specified Meaning vline section exists vdebug section exists Object is a PIC Position Independent Code object Register mode is 22 register mode or 26 register mode Different register modes are mixed Object is output by romp Default function call specification call does not use old specification Uses mask register function Segment is loaded into memory Segment including supplemental information 7 The value is displayed using the number base output by dump 367 3 Type in section header table 0x1 Display when v is specified Progbits Meaning Section that corresponds to an entity that contains an actual value in an object file machine language instruction and data with initial value 0x2 Symtab Symbol table 0x3 Strtab String table 0x4 Rela Relocation information 0x8 Nobits Section that corresponds to an entity that does not contain an actual value in an object file data without initial value 0x9 Rel Relocation inf
147. cceeeceeeseeeeeeeeeeeeeeeeeeeseeeeeeeeeaeeeeeseaeeeeeeteaeee 77 2 23 Other Option Settings Dialog ROM Storing Processor cecceeeceeseeeeeeeeeeeeeseeeseeeeeaeetsaeeeeeeeeatens 79 3 1 V EE 84 3 2 History Search Examples ege deederet data di a eas ioe ieee dee 89 3 3 Example of CA Command Activation from VSH ecceeceeseeeeeeeeeeeeeeeeeeeeeeaeeseeeeeaeeseeeeeeeseaeeeeeeeaeees 137 4 1 Position or VMAKEts 2e iat san baie lieth Wee aie ie EE 139 VOLUME 3 HANDLING C COMPILER 1 1 Operation FlOwsOf Caw tichisin aie ed AER ee al EENS 149 16 LIST OF FIGURES Figure No Title Page 2 1 Optimization Levels and Parameters ccccesceeseeeeneeeeeeeeneeeeeeceaeecaeeeeeesaeeeaeeseeeeeeeeeaeeseeeeeeseeeeeaes 162 VOLUME 4 HANDLING ASSEMBLER 1 1 Flow of Operation of as eege e eet es ae ah dale alt einen aang eed 200 2 1 Image of Creating Common Object With as 205 3 1 Example of Output Assemble List E 208 VOLUME 5 HANDLING LINK EDITOR 1 1 Flow of Operation By ld eebe detente d Zeenen deer deen de ee degt 219 1 2 Example of Image of Operation by Wl 219 2 1 Image of Memory Location of gp Offset Reference Section eccceceeeeeeeeeseteeeeeeeeeseneeseeeeneeeas 226 3 1 Section and SEQMeNt EE 256 3 2 Memory Location of Reserved Section ccccecceeeceeeeeeeeeeeeeeseeeeeeeeceeeeeaeeseeeeeaeeeeeeeseesneeeseeseaeeeeeeee 258 3 3 Example of Mapping Bilan Le CAE 259 3 4 Example of Mapping Image 2 03 hc dees
148. ceeding this number of bytes For the guideline of the length refer to Output Function Report The default size is 128 This option can be specified only when execution time priority optimization is specified Stack Threshold Wp G Expand Static Function Wp S Output Function Report Wp l Number of Loop Unrolling Wo Ol Pack Alignment Wi P 2 Buttons OK Delete Source Option Cancel Help Limits the stack length in the intermediate language of a function subject to inline expansion to the specified number of bytes and does not execute inline expansion a function exceeding this number of bytes For the guideline of the length refer to lt lt Output Function Report gt gt The default size is 32 This option can be specified only when execution time priority optimization is executed Performs inline expansion of static functions that are referenced only once Displays information on functions The displayed information serves as a guideline for specifying the upper limits of lt lt Code Threshold gt gt and lt lt Stack Threshold gt gt Output example function name code stack 15 4 Specifies the number of loop unrolling refer to page 173 This option can be selected only when execution time priority optimization is specified Suppresses optimization that aligns labels As a result this enables a smaller code length This option
149. cel Help 1 Options Frequency Information File Clicking lt lt Create File gt gt creates a frequency information file that is necessary for creating a section file that allocates sections by using the section file generator sf refer to page 397 If lt lt Specify File gt gt is not clicked the frequency information file is created under the name with c of the source file changed to sec If lt lt Specify File gt gt is clicked a file name can be specified in the text box In this case be sure to specify a file name This area uses the drop down list type of display to list all files that have been specified at least once up to 10 files Either click the desired file or use the arrow keys to select it V850 CAUTIONS When specifying an information file name for each of two or more source files do not specify a file name with an option that is related to all the projects but specify a file name by using an option that is related to each source file This option also outputs the frequency information on the variables in the C source file It does nothing to the assembler source file 50 sdata sbss Allocation G Use this area to specify the length of data allocated to the sdata sbss section If all data allocations are cancelled input to the text box for specifying the data length is enabled Data of the specified size in bytes or less is allocated to the sdata or sbss section However
150. ch they are specified Default assumption The standard directory is searched Example e 1d850 Llib file1 o file2 0 lIc Object files file1 o and file2 0 and as necessary the object file in archive file libc a are linked At this time the directory lib below the current directory is searched for archive file libc a If the archive file is not found there the standard directory is searched 27 The Id treats the directory at the libxxx position from the directory to which the Id has been installed and the directory at the lipxxx r32 position from the install directory as the standard directory for the library 233 6 M Specifies output of message to all multiple defined external symbols Format M Feature Outputs the following message to all the multiple defined external symbols and stops linking error multiple defined symbol symbol defined file previous defined file symbol file_name file_name Default assumption Outputs the message only to the first multiple defined external symbol and stops linking Example e 1d850 M file1 o file2 o Outputs the message to all the multiple defined external symbols in the linking of object files file1 o and file2 0 and stops linking 28 The object file is not created 234 7 T Does not specify checking the external symbol size Format T Feature Does not check the size of external symbols when they are linked Default assumption Checks the
151. character character Current date according to computer gt character Backspace lt character Current drive Current directory in current drive character Current time according to computer 95 96 al Operation cl Operation History Opens the dialog box for setting the history memory size the maximum number of commands to be shown in the history information in VSH activated and the history save size the number of histories to be saved to activate VSH next time refer to page 90 Number of Memory H z 4 Number of Save A D Cancel Help To set the memory size Drag the scroll button to the desired setting Or from the keyboard use arrow keys to change the setting incrementally The unit of measurement is the number of commands Click the OK button to change to the specified memory size and close the dialog box Click the Cancel button to close the dialog box without making any changes To set the save size Drag the scroll button to the desired setting Or from the keyboard use arrow keys to change the setting incrementally The unit of measurement is the number of commands However more histories than the number of histories specified by memory size cannot be saved Click the OK button to change to the specified save size and close the dialog box Click the Cancel button to close the dialo
152. check symbol size and alignment condition during linkage of external symbols This option checks whether or not old call specifications are mixed with new call specifications in all input object files If this option is omitted only the object files created from the C source files are checked This option checks whether or not the files that use the mask register function are mixed with files that do not use this function when linking the object files created from the C source files Link processing is stopped if they are found to be mixed This option can be specified only when starting from VSH This option does not check symbol size and alignment condition during linkage of undefined external symbols 3 Message options These options are set in relation to messages output during linkage This option outputs Id s execution status This option does not output a warning message 11 Refer to V800 Series C Compiler Package User s Manual C Language 12 Symbols having the binding class of GLOBAL and section header table index of GPCOMMON or COMMON 224 4 Other options These specifications set other options Specification Format Feature This option outputs to standard output information that can be used as a criterion for setting num in the Gnum option that can be specified for ca and as when compiling and assembling source files 3 This option can be specified only when starting from VSH
153. chine dependent data files read by ca 101 3 5 VSH Internal Commands This section describes the functions of VSH internal commands Table 3 4 contains a list of internal commands Table 3 4 List of VSH Internal Commands Command Description ATTRIB Change view file attributes CAT Concatenate files CD Change display current directory Change display current directory Copy file CP Copy file DATE Display date DEL Delete file DELTREE Delete file directory DIR Display file list DIRS Display directory stack DUMP File binary dump ECHO Display character string ERASE Delete file EXIT Exit VSH LS Display file list MD Create directory Create directory Move file Move file Pop directory stack Save push directory stack Display current directory RD Remove directory REN Rename file RENAME Rename file RENDIR Rename directory RM Remove file Remove directory Display time Display contents of text file 102 These commands are described in alphabetical order on the following pages Note that internal command names are not case sensitive Each internal command description uses the following format COMMAND NAME Description of command COMMAND NAME COMMAND NAME Summary A summary description of each commande function is given Synopsis Eac
154. copying has been correctly executed If copying has not been executed 1 is returned 12 Data section with initial value located in RAM and text section for internal RAM 13 This section number is a positive integer starting from 1 If the p option is specified sections are allocated in the sequence in which they have been specified If the p option is not specified sections are allocated in the sequence in which they appear in the input file 391 392 Cautions _rcopy executes copying only in accordance with the information created by the romp Processing such as to add an offset to the copy destination address cannot be performed upon execution of _ copy Specify a global label having an absolute value or an absolute address as the first argument label of _rcopy If any other thing is specified the result is not guaranteed Example of incorrect specification 1 gt A N extern unsigned long _S_romp char cp func int ret cp amp _S_romp lt First argument is gp relative value because ret _rcopy cp 1 copying to variable is executed Ne J Example of incorrect specification 2 gt C 8 N extern unsigned long _S_romp Dante 2 func int ret i 0x100 lt First argument is gp relative value because ret _rcopy i 1 copying to variable is executed Ne E Example of description extern unsigned long _S_romp main int
155. cord type b Record length number of bytes of field field expressed as 2 digit hexadecimal number number of bytes expressed by SS c Check sum Lower 1 byte expressed as 2 digit hexadecimal number of 1 s complement of total of number of bytes in records other than ST SS and NL expressed as 2 digit hexadecimal number d New line n 15 Each record is output in ASCII code 16 The Motorola S type hex formats are divided into two types 24 bit standard address and 32 bit address types The format of the standard address type consists of SO S2 and S8 records and the format of the 32 bit address type consists of SO S3 and S7 records 17 1 349 1 SO record Indicates a file name SO LL FF FF SS NL a b a Record type is SO b File name specified file name indicated in ASCII code 2 S2 record Indicates the value of a code S2 LL AAAAAA DD DD SS NL 1 2 3 Sa n MI lt lt Record type is S2 Load address 24 bits 3 Code 1 byte expressed as 2 digit hexadecimal number 3 S3 record Indicates the value of a code S3 LL AAAAAAAA DD DD SS NL a b c a Record type is S3 b Load address 32 bits 9 c Code 1 byte expressed as 2 digit hexadecimal number 4 S7 record Indicates an entry point address S7 LL AAAAAAAA SS NL a b a Record type is S7 b Entry point address 32 bits
156. cription on page 161 4 Redirect The following specification methods redirect the contents output by a command to VSH so that those contents can be handled as a file gt filename The contents output to VSH are output to the file specified by filename as contents beginning at the start of the file gt gt filename The contents output to VSH are output to the file specified by filename as contents appended to the end of the file Note that input redirect and pipe operations are not supported Example A gt ca830 cpu 5100 Im v file c gt logfile lt ca830 s output contents are output to logfile Note that within VSH there is no distinction in output between standard output and standard error output Therefore when redirecting output contents to a file the command output may become mixed with messages To avoid mixing the command output and messages such as when using hx specify an output destination with command option instead of using the redirect operation refer to page 138 5 Windows based device files NUL is supported as a device let which is when a peripheral device is handled as a file Other device file names are not supported When specifying NUL the command s output contents are not output to any destination 30 In this case device files indicate destinations for input and output under Windows and thus these device files are different from devices files that are ma
157. ctive to allocate that section to a segment different from the one to which the sections having the same type and same attribute are allocated when the assembly language program has description specifying a section name Figure 3 5 Example of Mapping Image 3 TEXT1 ILOAD RX VOxfffcO0000 text PROGBITS AX text i TEXT2 ILOAD RX VOxtffffe00 hdir PROGBITS AX hdlr Ip Input sequence OxFFFFFE0O OxFFFC0000 0x0 261 4 When one symbol is created in an application to set values to tp and gp If the tp and gp need not be changed during application execution one each of the tp and gp symbols is created by specifying two or more segments or omitting specification of a segment by using the symbol directive The created symbol is used to set tp and gp upon starting the program by the start up routine etc If a section of data bss attribute and rO or ep relative reference such as sedata section exits in the application and if a segment name are omitted in creating the gp symbol the segments to which that section is to be allocated are subjected to the gp symbol creation and an unexpected value is set to the gp symbol To prevent this error specify the targeted segment name in directing creation of the gp symbol Figure 3 6 Example of Mapping Image 4 DATA1 ILOAD RW V0x100000 data PROGBITS AW sdata PROGBITS AWG E DATA2 LOAD RW sbss NOBITS AWG bes NOBITS AW E
158. cute compilation This option can be specified only when starting from VSH We arg1 arg2 This option passes arguments arg1 arg2 and so on to module CH The following can be specified as module c p Pre optimizer o Global optimization module i Machine dependent optimization module Assembler 1 Link editor This option outputs the object file as a file whose extension is o instead of c or s without starting the ld The ld is started if this option is omitted When the Project Manager is used this option is automatically specified for all compilation Accordingly Id is not started if an individual o file is specified in lt lt Build Target gt gt specification cpu devicename This option specifies the target device When using the Project Manager this is equivalent to specifying the device during a project setup If this option is omitted and nothing has been specified by the pragma directive compilation is stopped 2 pN These are the libxxx directory and the libxxx r32 directory both of which are under the installation directory However if register mode has been specified the r22 or r26 directory is searched in the same order instead of the r32 directory Refer to the description of the L option for the Id Refer to V800 Series C Compiler Package User s Manual C Language Installation directory libxxx r32 r26 r22 Refer to page 172 for a description of the option t
159. d V850 can not link old_fcall objects with new_fcall objects file is old_fcall object An object file of the new function calling specifications and an object file of the old function calling specifications cannot be linked File file is an object file of the old function calling specifications can not link V850E common objects with V850 objects file is V850E common object A common object file for the V850E Family cannot be linked with an object file whose target device is fixed as the V850 The file file is a common object file for the V850E Family A common object file for the V850E Family can be linked with an object file whose target device is fixed as the V850E or with an object file that is common to both the V850 and V850E Families can not open command file file Command file file cannot be opened can not open directive file file Directive file file cannot be opened can not open input file file Input file file cannot be opened can not open output file file Output file file cannot be opened can not read directive file file Directive file file cannot be read can not seek output file file Output file file cannot be sought can not truncate output file file to have size number The size of output file cannot be changed to number bytes V850 325 can not write output file file Output file file cannot b
160. d CA can be used 2 7 FDs for Japanese version 3 The mark indicates a blank space 26 2 3 Directory Configuration The configuration of the directory of the files read from the supply media as a result of installing this compiler package is shown in Figure 2 14 The default of install directory is NECTOOLS in the drive where the Windows system is located Figure 2 1 Directory Configuration Command group VSH VMAKE and project manager Include file group Modules internally called by C compiler New function calling specification Library for 22 register mode r22 start up module Library for 26 register mode r26 start up module Install directory r32 a a AR mode Old function calling specification V850 Library for 22 register mode ieee start up module Library for 26 register mode 126019 start up module r320ld Library for 32 register mode start up module caxxx Sample of link directive hlp On line manual nt doc Release note txt file Be sure to set the above bin directory to the command search path when installing the compiler package refer to page 26 The old function calling is not supplied in the CA830 The library start up module for the old function calling specification is not included in the supply media of the CA830 Even in the CA850 the old function calling is not supplied when the V850E is used for the target device 4 In this co
161. d and cannot be selected when options for the overall project have been specified It can be selected when options are specified by selecting source files via the Project Manager s lt lt Source List gt gt dialog When it is selected this button deletes any options specified for a particular source file and applies only overall options Ignores the specified items and closes the dialog Opens the Help window 57 Setting other options Figure 2 14 Other Option Settings Dialog C Compiler Compiler Options x C1 Input C2 Preprocessor C3 Language C 4 Optimization CD Output 6 Output 7 Message Any Option M Use Temporary Command File Command Line Options cpu 3000 g Delete Source Option Cancel Help 1 Options Any Option The following options can be specified in the text box Optimization Enhancement To perform the data flow analysis precisely Wi Option 04 can be described CPU Fault Prevention Option To prevent CPU faults options Xnoabcond page 157 or Xnopldsr page 157 in CA830 Xv850patch page 157 in CA850 can be described Options Common to Family Options are passed to the assembler because objects are shared in the family Wa cn can be described In the CA850 the Wa cnv850e option can also be described 12 Refer to pages 162 and 173 13 To check whether the fault that has occurred applies to the CPU u
162. d by the pseudo instructions vline vdebug and vdbstrtab refer to User s Manual Assembly Language Debugging information sections are always created for assembler source that are output by ca by specifying the g option as ignores the g option and regards the O option as valid when the assembler source code has been output by ca or includes intentionally defined debugging information sections In all other cases the O option is ignored and the g option is regarded as valid on oar won 202 Specification Format Feature This option creates an object file that contains information that a mask register function is being used This is valid when using an assembler source file that was created by an old version of the C compiler This option outputs code that avoids CPU faults The type of code that can be output is specified as num refer to page 206 If num is omitted output of all three types of code is set by default The O option is ignored when this option has been specified 3 Message options These options are set for messages output during assembly Specification Format Feature This option outputs the as s version number to standard output and then terminates processing This option can be specified only when starting from VSH This option outputs the as s execution status This option does not output warning message when r1 has been specified as the source register or
163. d line Drive of current directory 29 MEMO 30 VOLUME 2 OPERATION METHODS 31 CHAPTER 1 OVERVIEW OF OPERATIONS Volume 2 describes how to operate these compiler packages from the Project Manager and the VSH shell function When using the CA to generate application load modules i e compile assemble source files link object files and create ROM storing object file there are two methods shown in Figure 1 1 operating from the Project Manager as part of an integrated environment or operating from the VSH s command line interface Figure 1 1 Outline of CA Package Operations fo gt Windows Project Manager VSH GE deg Stand alone activation of ealasliditom calasiidiromp p option specification l Stand alone activation of ar dis dump hx MAKE option specification for Project Manager VMAKE ca as Id romp activation Activation of all commands l W Chapter 2 describes how to operate the compiler package from the Project Manager Chapter 3 describes the functions of VSH and how to operate the compiler package from the command line interface of VSH and Chapter 4 describes the functions and operations of the make utility VMAKE that runs on VSH For details of CA command functions options etc see the command specific descriptions in Volume 3 and later volumes 32 CHAPTER 2 OPERATIONS USING THE PROJECT MANAGER This chapter describes the use of the Project Ma
164. d onto the start of the stack and the current directory is changed In either case this command displays the current directory and stack contents Examples A gt PUSHD 2 lt Changes the current directory to the contents of the second c work a tmp a windows directory stack A gt PUSHD a WORK lt Changes the current directory to the WORK directory in a work c work a tmp a windows the drive A 33 The output is displayed in lowercases 127 PWD Display current directory PWD PWD Summary Display current directory Synopsis PWD Description This command displays the current directory s absolute path This command is the same as Synopsis 2 of the CD and CHDIR commands Examples A gt PWD lt Displays the absolute path in the current directory al a windows 34 Note that the output in the PWD command is displayed in lowercases 128 RD Remove directory RD RD Summary Remove directory Synopsis RD A drive path Description This command removes the directory specified by path However the directory to be removed must be empty The directory where the system file or hidden attribute file exists cannot be removed The current directory cannot be removed either This command contains the same function as the RMDIR command does Examples
165. d the codes expanded num times If O or 1 is specified as num expansion is suppressed If num is not specified 4 is assumed lt Example gt To expand 4 times a loop which is executed 10 times a N i 0 while i lt 10 processing i i 0 processing i 1 processing 1 2 while i lt 10 processing i processing i processing i processing Ls Ne J e Machine dependent optimization module impr Wi D Can reduce the memory capacity required for compiling 04 Executes data flow analysis precisely and enhances optimization However compiling speed drops Specify only when enhanced data flow analysis is required after Ol specification P Suppresses optimization of aligning labels This can reduce the code size 42 Specify num in decimal number 43 A complicated loop such as the one that internally includes another loop may not be expanded 44 This is useful for not executing loop unrolling with optimization level t specified 173 2 3 Cautions on Specifying Options The following specification sequence is applied to the options specified when starting the compiler The options specified with W option are allocated at the end of a command line other than the W option Example gt gt ca850 cpu 3000 file o Wl D dfile ol Arguments are passed as follows upon starting 1d 1d850 nectools 1lib850 r32 crtN o o a out file o lc D dfile ol H
166. ddress by using the segment directive that defines the segment For segments other than those for which addresses are fixed such as the segments to be placed in the internal ROM any address in the memory space can be specified if all the segments are allocated within the memory space without overlapping Figure 3 9 shows the general format of allocation with an address specified Figure 3 9 General Format of Allocation with Address Specified segment name LOAD A segment attribute A V address mapping directive D For example if object files file1 o file2 0 and file3 0 including the sections in the sequence shown in Figure 3 11 are linked with the directive shown in Figure 3 10 specified segment SEG1 to which section sec1 is to be allocated is allocated from address 0 segment SEG2 to which section sec2 is to be allocated is allocated from address 0x10000 and segment SEG3 to which sections sec3 and eech are to be allocated is allocated immediately after the preceding segment SEG2 refer to Figure 3 11 Figure 3 10 Example of Allocation Display with Address Specified SEG1 LOAD RX secl SPROGBITS AX secl filel o file2 o file3 o SEG2 LOAD RW VOx10000 sec2 SPROGBITS AW sec2 filel o file3 o SEG3 LOAD RW sec3 SPROGBITS AWG sec3 file2 o sec4 SNOBITS AW sec4 file2 o SCONST LOAD R VOxffff8000 sconst SPROGBITS A sconst F __tp_
167. declaration Argument name is missing Dummy argument name name declared in the function definition cannot be found illegal first argument requires a named argument cannot be used as the first argument of a function Struct union size must not be zero The size of a structure union must not be zero illegal bit field type A type which must not be specified for a bit field is specified illegal bit field size The value of a constant expression that specifies the width of a bit field must not exceed the number of bits constituting the object of the specified type name has incomplete type The type of name is incomplete Field name declared as a function The type of member name is a function type syntax error The syntax is incorrect Label label not defined Label abel is not defined E2411 Jabel is not in switch The case label or default label is missing from the switch statement E2412 duplicate case num in switch The case label num in the switch statement is duplicated num may be expanded as a numeric value E2413 duplicate default in switch The default label is duplicated in the switch statement E2414 break not in loop nor switch break is outside a repeat statement or a switch statement E2415 continue not in loop continue is outside a repeat statement E2420 argument num expected for function call function The argu
168. der the current directory When using 2 in Synopsis this command displays a list of specified filenames If the filename s specification is omitted it displays a list of all files and directories under the current directory If all options are omitted for the Synopsis 1 and 2 this command displays on one line several filenames or directory names Examples A gt LS lt Displays a list of files in the current directory a bat main c test sdb test3 prj a s main o testl mak test3 sdb A gt LS l r WORK lt Displays a detailed list of files in the WORK directory arranged in reverse alphabetic order rw rw rw 1 root 12009 Apr 13 09 43 work win ini rw rw rw 1 root 1818 Oct 3 13 09 work test4 sdb 120 MD Create directory MD MD Summary Create directory Synopsis MD A drive path Description This command creates a directory in the specified path The MD command contains the same function as the MKDIR command does Examples A gt MD TMP A gt MD B WORK TMP lt Creates the TMP directory in the drive A lt Creates the WORK TMP directory in the drive B 121 MKDIR Create directory MKDIR MKDIR Summary Create directory Synopsis MKDIR A drive path Description This command creates a directory in the specified path The MKDIR command contains the
169. dialog The source file is actually added by clicking Add When the lt lt Source Files Setup gt gt dialog is displayed again by clicking Close the added file will be displayed on the list Source Files Setup Lx Source File List Add Delete All ve Move Up Move Down Add Source Files Lx File Name Directories Add cork Select All ci amp work Close Help Network main c sub c List Files of Type Source File c s Source File List i OK main c sub c Delete Cancel Delete All Help Move Up Move Down Select Add D Close Check that all of the desired source files have been set from the source file list then click the OK button to set project test4 before exiting In the title bar of the Project Manager the project file name test4 prj is displayed 36 2 4 Project Manager and CA The Project Manager can specify the options of the C compiler assembler link editor and ROM storing processor for the source file to be used for the target project It is also possible to automatically create a make file based on the above selection Figure 2 3 Outline of CA Option Specification from Project Manager Auto generation of make file Project CA option Manager L rig D A project name MAK MAKE for Project Manager CA command activation Object cr
170. directive Figure 3 1 Section and Segment Input section Output section Segment file1 o NOBITS AW NOBITS AWG DATA RAM PROGBITS AWG PROGBITS AW PROGBITS AX __gp_DATA NOBITS AW NOBITS AWG PROGBITS AX n ke n n TEXT gt ROM PROGBITS AWG PROGBITS AW Ba PROGBITS AX lt __tp TEXT 256 3 3 1 Type of section Sections come in six types depending on the combination of a section type refer to page 281 and section attribute refer to page 282 Each type of section has a reserved section name Some reserved sections can be used commonly with all the families and the others are peculiar to a specific family Table 3 1 Types of Sections Type of Section Meaning Corresponding Reserved Section Name bss Section having section type NOBITS and section attribute AW bes sebss sibss bss attribute section tibss tibss byte tibss word const Section having section type PROGBITS and section attribute A sconst const const attribute section data Section having section type PROGBITS and section attribute AW data sedata data attribute section sidata cdata1 cdata2 cdata3 udata1 udata2 udata3 tidata tidata byte tidata word sbss Section having section type NOBITS and section attribute AWG sbss sbss attribute section sdata Section having section type PROGBITS and section attribute AWG sdata sdata attribute s
171. e An illegal interrupt request is specified by the pragma directive Interrupt request name name is already specified Interrupt request name name has already been specified illegal directive pragma interrupt function name must be specified A function name is necessary for declaration of an interrupt handler by the pragma directive E2633 E2636 E2638 E2639 E2640 E2641 E2642 E2644 E2646 E2647 E2648 E2649 E2650 E2651 E2652 cannot specify interrupt attribute direct function function is already defined An interrupt handler cannot be directly located and specified after function definition Multiple interrupt request names are specified for function function direct cannot be specified Two or more interrupt requests are specified for function function Direct location direct cannot be specified for a function for which two or more interrupts are specified Interrupt function must be void type The return type of a function declared as an interrupt must be of void type illegal function type for software interrupt function must be void unsigned int A function declared as a software exception interrupt trap interrupt can only have one unsigned int type as the argument illegal function type for interrupt function must be void void A function declared as an interrupt except software exception cannot have an argument cannot call int
172. e Figure 1 2 Example of Image of Operation by Id In the case of gt Id a o b o c o lib a a out Section 1 Section 2 Segment 1 Section 1 of lib a Section 1 of c o Section 1 of b o Section 1 of a o gt Sen Section 2 of lib a Section 1 Section 2 Section 1 D D D Section 3 Section 2 of b o Section 2 of a o lib a Establishes relation between Section 1 sections and segments and ecuon references address Segment 3 Directive file Device file Section 2 Section 3 of c o Higher Lower Higher Lower 219 1 1 1 Link procedure The procedure of link by the Id is as follows 1 Links a section input section included in a specified object file in accordance with an explicitly specified or default link directive and device file and creates an output section organizing an object file to be created refer to 3 5 on page 278 Input object file Output object file file o aout 5 _sdata section ee je SCH GE 5 5 D ss LZ 5 2 ck sl SY sbss section sc I CO o 2 Links the output section created in the above mentioned step in accordance with an explicitly specified or default link directive and creates a segment refer to 3 4 and 3 5 on pages 264 and 278 3 Allocates the segment created in the above mentioned step to the memory space of the target machine in accordance with an explicitly specified or default link directive and device file refer to
173. e 3 29 70 Refer to C Compiler Package User s Manual Assembly Language of each family 302 Figure 3 29 Example of Assembler Codes of ao through c o Section text1 movea _labell tp r10 _labell word 0x10 Section text2 movea Label tp r10 _label2 word 0x20 Section text3 movea _ label3 tp r10 _label3 word 0x30 Because tp symbol __tp_ TEXT is created for the TEXT1 segment to which text through text3 sections are allocated in Figure 3 28 the values of _label1 through _label3 in Figure 3 29 are the offsets from the value of the tp symbol __tp_TEXT to the definition position of each label This makes it possible to access the labels in text1 through text3 sections with one tp symbol __tp_ TEXT On the other hand if the TEXT1 segment is not specified for creating the tp symbol __ mp TEXT in Figure 3 28 the values of labels _label1 through _label3 are the offsets from the first address of each section and access by the tp symbol cannot be executed Caution The processing that uses a label reference without a symbol as the tp symbol offset instead of as an offset in a section is always executed if the label in the text attribute section allocated to the segment that creates the tp symbol is label referenced Therefore if a register other than those to which the tp symbol value is set is used in combination with a label reference in an assembly language source pro
174. e Configuration in Intel Expanded Hex Format cccccecceesceeeseeeeeeeeeeeeeeeeeaeeeeeeseaeeseeeeeeeseeeeeaeene 346 3 2 File Configuration in Motorola S Type Hex Format cccccesceseceseeeeeeeeeeeeeseeeeeeeeeeeeeeeseeeeeeeseaeeeneeees 349 3 3 File Configuration in Expanded Tek Hex Format 352 VOLUME 8 HANDLING DUMP COMMAND 1 1 Flow of Operation gtgdunmp eege aie igen ed aed AL eee aia a N AEN 360 VOLUME 9 HANDLING DISASSEMBLER 1 1 Flow of Operation ot diss rca weit sd es acetal 372 VOLUME 10 HANDLING ROM STORING PROCESSOR 1 1 1 2 1 3 1 4 Elow of Operation of romp a aani a eege SEENEN EENEG 378 Example of Using Copy Routine rop c ceeceeseeeeeeeeeeeeeeeceeeeeeeeeeeesaeeeeaeeseeeeseeseaeesieeseeeseeeeeaeees 381 Image of ROM Storing example of V830 Family eccecceeseesseeeeeeeeeeeeeeeeseeeeeneeseaeeeeeeeeeeseaeeeaeeeea 382 Image of ROM Storing example of V850 Family eceeceeseesseeeeeeeeeeeeeneeseeeeeeeeseaeeeeeeseeeseaeeeaeene 383 VOLUME 11 HANDLING SECTION FILE GENERATOR 1 1 18 Be ee en Be LEE 398 LIST OF FIGURES Figure No Title Page APPENDIX B 1 Structure of Object E 412 B 2 Relationships between Index and Character String in String Table A 420 19 LIST OF TABLES Table No Title Page VOLUME 2 OPERATION METHODS 3 1 Edit Key LISTS arp a deine a aeolian ated eh teen artnet 86 3 2 Keys for Operating Vertical Scroll Bar A 87 3 3 Keys for Operating History Funct
175. e block length of the symbol block exceeds the maximum value of the specified block Warning too large block length Length gt length The maximum value of the specified block length is too big The value is changed to the maximum value ength that can be specified and processing is continued Warning too small block length Length gt length The maximum value of the specified block length is too small The value is changed to the default value ength and processing is continued 26 This message may be output in the Intel expanded hex format or Motorola S type hex format standard address After outputting this message the hx continues processing outputting as an address the lower 20 bits in the case of the Intel expanded hex format and the lower 24 bits in the case of the Motorola S type hex format standard address 27 This message is output if a value that can be specified is specified when the b option is specified 358 VOLUME 8 HANDLING DUMP COMMAND 359 CHAPTER 1 OVERVIEW This volume explains the outline operation display format and output messages of the dump command dump included in this compiler package dump starts from the VSH command line 1 1 Flow of Operation The dump command displays the contents of a specified object file or archive file in a format easy to see refer to Figure 1 1 The displayed contents can be selected by an option that is specified upon starting the dump command This comm
176. e converted to a single blank space 4 4 3 Description of targets The dependency among targets to be generated is described in the following syntax target A target A A dependent_filename A dependent_filename The command line described in page 144 is entered after the above line For dependent_filename specify the filename needed to generate the desired target When specifying several targets it is assumed that all of the described targets will be generated from the same file Example object main o func o usrlib a Command line in page 144 142 Note the following caution points e Do not enter a tab character at the start of the above line e It is not possible to use different rules when making several specifications of the same target e It is not possible to recursively describe a target and a dependent file Special function targets Unlike ordinary targets the following targets can be used to provide special functions e IGNORE The target is generated without regard to the activated commande termination status This is the same as the i option Example gt IGNORE a o gt a C ca850 cpu 3000 0 c a c e SILENT Execution is performed without displaying the command This is the same as the s option Example gt SILENT a o 7 OO ca850 cpu 3000 0 c a c As shown in the above examples command lines cannot be described for the IGNORE and SILENT t
177. e file is written illegal option option The specification of option option is not correct compiler limit too many option options num The number of times option option is specified exceeds the limit The maximum value of this processing system is num compiler limit scope level too deep num The depth of the scope level exceeds the limit The maximum value of this processing system is 50 compiler limit too many parameters num The number of the dummy arguments of the function is too many The maximum value of this processing system is 255 compiler limit too long file name file num The name of the file file is too long The maximum value of this processing system is 1024 Non empty file must end in new line character A file that is not vacant must be terminated with a carriage return unknown character character An illegal character character is used compiler limit too many characters in logical source line num The number of characters in the logical source line exceeds the limit The maximum value of this processing system is 4047 F2115 F2120 F2121 F2122 F2128 F2153 F2154 F2158 F2160 F2230 F2410 F2608 F2620 F2622 non terminated string literal closing a character string is missing compiler limit preprocessor token buffer overflow num The length of the expanded character string in macro definition exceeds the limit the buffer capacit
178. e former is the setting for the C source file for the all target projects and the latter is the individual setting for that C source file When source file specific settings are made overall option settings become invalid for the particular source file If the Delete Source Option button is clicked on the setting dialog of each source the option set for each source file is deleted and the option for the all projects set by the former method becomes valid 1 mark is appended to the file that is set to the individual option setting in lt lt Source List gt gt 39 Figure 2 6 Delete Source Option Button e E when setting options of entire project oc lt Delete Source Option gt Source AES Cancel Help se ee when setting individual options in Source List ox lt Delete Source Option gt Source ESS Cancel Help Eight option buttons are displayed at the upper part of the C compiler option setting dialog By selecting an option button the display of the dialog is changed 40 1 Option buttons for displaying option setting dialogs LA IN Ka A jn ID N jo Input Preprocessor Language Optimization Output 1 Output 2 Message Others Opens the dialog box that is used to set the options related to input to the C compiler refer to page 42 Opens the dialog box that is used to set pre processor related options refer to page 44 Opens the dialo
179. e of the tidata section does not overflow is output The output file name is secfile e To sort variable names by size sf850 ssize a sec b sec c sec Frequency information files output by the C compiler a sec b sec and c sec are input and the names of the variables in the section file to be output are arranged in sequence starting from the variable smallest in size Because no output file name is specified the section file is output to the standard output 404 CHAPTER 3 MESSAGES This chapter explains the output messages of the sf in alphabetical order The italic characters in the output messages and explanatory statements are determined during command processing 3 1 Message Format The sf messages are basically output in the following format sf message 3 2 Messages cl level out of range 0 2 The numeric value specified by the cl option is incorrect cannot calculate name s frequency The frequency of variable name cannot be calculated cannot open input file file Input file file cannot be opened cannot open output file file Output file file cannot be created not enough memory The memory capacity runs short option option needs subargument Option option needs an argument too many input files Too many input files are specified unknown option option Option option must not be specified you use O option sorting option ignored Because the O option is specified the sorting option is ignored 405
180. e optimization functions both reduce size and increase execution speed for some functions the user must decide a trade off between size and execution speed Among the options described above Os and Ot are used to make this specification 35 Refer to V800 Series C Compiler Package User s Manual C Language 163 1 2 Size priority optimization Os Ol Specify both the size priority option Os and the optional optimization option Ol The system will specify the stronger optimization option Among the types of optimization supported by ca all types of optimization that do not increase the code size should be performed so as to keep the code size as small as possible Depending on the application the following functions may be used in addition to the options described above to further strengthen the optimization e Specify Wi O4 refer to page 173 This performs a data flow analysis to further strengthen optimization However this may result in a much longer compilation time Use mask register function If the application includes a lot of mask code for processing of unsigned char and unsigned short types using the mask register function can reduce the code size However using the mask register function means that two fewer registers will be available to be used for register variables Use a section file The code size can be reduced and the execution speed increased by all
181. e the make file has been generated the status bar message changes to Make file generation completed The filename of the generated make file is projectname MAK In addition to the make file another file named projectname SDB is simultaneously generated for managing information related to the source file 80 2 6 2 Auto generation of make file via build function Make files can be automatically generated by executing build from the Project Manager There are three types of build specifications build rebuild and build specified target 1 Build Build can be selected via either of the following operations e Click the Run menu Click Build Ctrl B e Click the button When this build function is selected a make file is generated in the same way as when Make a Make File Ctrl M is selected Depending on the make file generated by the build function C compiler assembler link editor or ROM storing processor is executed and an executable object file is created as the make target A window lt lt PRJTMAKE gt gt displaying the build execution conditions and status is opened and this is where any error messages output by the CA command are displayed The contents shown in this window are output to a file in the project directory called projectname PLG To abort build click the mark button in the execution display window lt
182. e written duplicated cpu type A target device is specified in duplicate Different target devices are specified in the object files to be linked EP symbol is needed for using SIDATA SEDATA segment The ep symbol is not created Create the ep symbol to use the SIDATA or SEDATA segment V850 Error Number number An error of error number number occurs in the object file I O library internally used by the Id The chances are that the contents of the object file are illegal or destroyed This message is also output if a work memory area cannot be allocated in this library failed to get section header Getting a section header has failed failed to get section name string Getting a section name has failed failed to get section name string table section Getting the string table section of the section name has failed fail to get symbol name string Getting a symbol name character string has failed fail to get symbol name string table section Getting a string table section has failed failed to get numberth symbol name string Getting the numberth symbol name character string has failed ignored ol option all object files follow new_fcall convention All the input files are of the new function calling specifications The ol option that specifies linking of libraries of the old specifications is ignored V850 illegal character number in filling value field Illegal character number ASCII code
183. eates an object file removing the debug information line number information and global pointer table in creating the object file 13 If started from the ca the A option that was specified during ca startup is passed 14 The executable object file name to be output cannot be specified from the Project Manager s option dialog Instead the out extension is added to the first file in the source list from which the suffix has been removed 15 Refer to V800 Series C Compiler Package User s Manual C Language 225 2 2 2 Using options This section explains how to use each option 1 A Output of information on Gnum option for compiler and assembler Format A e This option can be specified only at the start from VSH Feature Outputs to the standard output the information that can be used as criteria on the value to be set to num of the Gnum option that can be specified for ca and as when the source file is compiled and assembled e The ca and as included in this compiler package generates machine language instructions as follows For data to be allocated to the sdata attribute section or sbss attribute section called sdata sbss attribute section generates a machine language instruction that is assumed to be allocated to a memory range that can be referenced by using the global pointer gp and 16 bit displacement For data to be allocated to the gp relative section of the data attribute section
184. eation file name OUT If you set a project file via the Project menu the project file name will be shown in the Titles area as shown in Figure 2 4 The option of the C compiler assembler link editor and ROM storing processor are set by displaying the corresponding option setting dialog box from the Option menu after the project has been set 37 Figure 2 4 Window for Setting Project File Project file name of set project ja Project Manager TEST4 PRJ Eile Run Project A menu of CA command is added via project setup The items shown in Figure 2 5 will be displayed when you click the Project Manager s Option menu Use this menu to open the dialogs for setting CA command options Figure 2 5 Project Manager s Option Menu after setting project Option Project Manager Options Compiler Options Assembler Options Linker Options ROM Processor Options Specify Debuqger s Projectile Cansel Debugger s Projectile To open command option setting dialog of CA Tools v Debug v Status Bar Tool Box Source List 38 2 5 Dialogs for Setting CA Command Options This section explains each dialog that sets the command option of the CA for the source file of the target project Cautions e The option names used to activate commands from the VSH command line are displayed in square brackets 1E e For details of the
185. ect is not allowed Both signed and unsigned are specified Both signed and unsigned are specified illegal type specifier combination The combination of type specifiers is incorrect Typedef declaration must not have initializer typedef declaration must not include an initializer too many initializers Too many initializers are used illegal initializer The initializer is incorrect E2240 E2250 E2251 E2252 E2260 E2261 E2262 E2263 E2265 E2266 E2267 E2269 E2270 E2280 E2281 E2282 Local static function is not allowed The static function must not be declared in local scope Array size is not given The size of the array is not given Array size must not be zero The size of the array must not be zero Array type has incomplete element type The type of the array element is incomplete compiler limit complicated type modifiers num Too many derivative modifiers are used The maximum value of this processing system is 16 illegal storage class specifier combination The combination of storage class specifiers is incorrect illegal use of enum Type specifier enum is incorrectly used illegal use of struct Type specifier st ruct is incorrectly used illegal use of union Type specifier union is incorrectly used illegal use of auto Storage area class specifier auto is incorrectly used
186. ecting source files via the Project Manager s lt lt Source List gt gt dialog When itis selected this button deletes any options specified for a particular source file and applies only overall options Ignores the specified items and closes the dialog Opens the Help window Setting option 20 Figure 2 17 Option 2 Settings Dialog Assembler Assembler Options EN 1 Option C0 Others sdata sbss Allocation M Allocate All Data Size Threshold G T Output Assemble List a l T Do Optimization 0 T Verbose Mode v IT Suppress Warning w F Use Mask Register m F Use New Style Function Calllf f Magic Number Unique to Device Common to 850 Family cn Common to V850E Family cnv850e Delete Source Option Cancel Help Unique to Device and Common to V830 Family cn in the case of CA830 1 Options sdata sbss Allocation G Generates a machine language instruction on the assumption that all data of the specified size byte or smaller are allocated to the sdata sbss attribute section in response to external label access If lt lt Allocate All Data gt gt is cancelled input to the text box for specifying the data length is enabled On the other hand for data whose sdata option is specified by the option pseudo instruction a machine language instruction is generated on the assumption that the data is allocated to the sdata attribute section or sbss
187. ection text Section having section type PROGBITS and section attribute AX text attribute section Figure 3 2 shows the memory location of sections having reserved section names For the nature of each section refer to the explanation of data allocation to sections in V800 Series C Compiler Package User s Manual C Language 257 258 Figure 3 2 Memory Location CA830 Interrupt sconst section of Reserved Section CA850 Peripheral I O register sibss section sidata section const section tibss section tidata section text section tibss word section itext section tidata word section Interrupt function tibss byte section tidata byte section bes section sebss section sedata section sbss section sdata section data section const section udata3 section bes section udata2 section udata1 section sbss section sdata section cdata3 section data section cdata2 section cdata1 section sebss section text section sedata section sibss section sconst section sidata section Interrupt 0x0 3 3 2 Examples of mapping image Here examples of mapping image by link directives are shown For the specific description rules refer to 3 3 3 and following sections 1 In an application wh
188. ection For details of each sections characteristics refer to the description of section allocation of data in V800 Series C Compiler Package User s Manual C Language 409 Table A 3 Section Types Specifiable by CA850 Character String Specifying Type Allocated Section s tidata The byte data with the initial value set is allocated to the tidata byte section The data that is more than a half word with the initial value set is allocated to the tidata word section The byte data not setting the initial value is allocated to the tibss byte section The data that is more than a half word not setting the initial value is allocated to the tibss word section If an initial value has been set allocated to the data section If it has not been set allocated to the bss section If an initial value has been set allocated to the sdata section If it has not been set allocated to the sbss section sedata If an initial value has been set allocated to the sedata section If it has not been set allocated to the sebss section sidata If an initial value has been set allocated to the sidata section If it has not been set allocated to the sibss section const Allocated to the const section sconst Allocated to the sconst section Cautions Do not insert blank spaces before or after a section name when specifying the section name in square brackets For example in the case of tidata
189. ed the V810 Family s floating point operation instruction and bit string instruction produce an error This option can be specified only when starting from VSH This option specifies that machine language instructions are created based on the assumption that all data whose size is no larger than num bytes is allocated either to an sdata attribute section or a sbss attribute section when accessing external labels If this option is omitted num is regarded as infinity However in the case of data for which the sdata option has been specified by the option pseudo instruction this option specifies that machine language instructions are created based on the assumption that all data regardless of its size is allocated either to an sdata attribute section or a sbss attribute section This option creates an assemble list However if the O option has also been specified the code scheduling may produce unreliable results in at least part of the output assemble list This option embeds a family s common magic number value as the magic number for the object being created This means that the object can be used as a common object within that family refer to page 205 If this option is omitted the object becomes fixed as a device type so a magic number defined for a specific model will be embedded cnv850e This option embeds a common magic number value for the V850E as the magic
190. ed as signed or unsigned specifications The following can be specified as string s Regarded as signed signed Regarded as signed u Regarded as unsigned unsigned Regarded as unsigned A warning message is output when the specification is regarded as unsigned The specification is regarded as signed if this option is omitted Xchar string This option specifies whether char type specifications that do not indicate the type specifier signed or unsigned are regarded as signed or unsigned specifications The following can be specified as string s Regarded as signed signed Regarded as signed u Regarded as unsigned unsigned Regarded as unsigned The specification is regarded as signed if this option is omitted This option specifies that a runtime library mu mulu or div ____divu will be used instead of the mulh and divh instructions for integers corresponding to data that is 16 bits or less This option slows the processing speed but strictly complies with the multiplication and division processing under the ANSI standard The mulh and divh instructions are used if this option is omitted This option outputs an error message or warning message corresponding to the returned symbol so that ca s processing strictly complies with the ANSI standard All extensions other than the _asm extension are recognized Specifying this option defines the macro name __STDC__ Strict ANSI compliance cannot be guarante
191. ed if this option is omitted 9 The CA850 s runtime library is used as a standard library for this compiler to meet the ANSI standard for instructions that are not included in the V850 Family architecture For details of the runtime library refer to V800 Series C Compiler Package User s Manual C Language 10 For details of how processing of the supplied extension symbol and the defined macro name differs according to whether or not this option has been specified refer to V800 Series C Compiler Package User s Manual C Language To maintain compatibility with previous C language specifications a warning message is output and processing continues 155 4 Optimization option These specifications set options related to the optimization levels and items Specification Format Feature This option specifies the optimization level Numbers and characters that can be specified as c are as follows 0 No optimization 1 Optimizes within basic block 2 Also starts machine dependent optimization module 3 Also starts interfunctional optimization and optimization by as refer to page 201 Optimizes based on object size Optimizes based on execution speed Forcibly optimizes code scheduling and redundant instruction elimination valid at level 2 or above Note that this slows the compilation speed If the c specification is omitted c is assumed to be 3 If this option is omitted O1 is assumed as the specified value 5 Output opti
192. ed type of the section of the section pseudo instruction is wrong illegal size value The specified size is wrong illegal symbol reference symbol is specified for a symbol illegal symbol reference symbol is specified for a symbol include nest over The include statements are nested nine times or more identifier is reserved word Reserved word identifier is used at a location where reserved words must not be used label identifier redefined Label identifier is defined more than once memory allocation fault The memory capacity runs short memory allocation fault icode Allocating an internal data area intermediate code has failed memory allocation fault icode table Allocating an internal data area intermediate code table has failed 213 memory allocation fault section list Allocating an internal data area section list has failed memory allocation fault section name buffer Allocating an internal data area section name buffer has failed memory allocation fault section table Allocating an internal data area section table has failed memory allocation fault source file buffer Allocating an internal data area source file buffer has failed memory allocation fault string table Allocating an internal data area string table has failed memory allocation fault symbol table Allocating an internal data area symbol table has failed nested command file file Command f
193. eeeeeeeeeeeeeeeneeeeeeeeseeeneeneneees 96 ele E EE AEE E E EE 277 Horizontal scroll inn a en 87 l file oUtp ti ai e ein eter 138 lef L TT 150 Input section s s 220 243 254 256 273 278 279 319 Instruction work register sssssssssessriesriieriirrrrsee 216 Internal commande 85 99 102 Delimiter for option and directory seses 99 Option specification Sequence ceeeeeeee 99 AVATA Le ET EE 99 itext sechon cece eeeteeeeeeeeeee 266 279 314 321 424 K Key list e E E A dgev na dest escheat eobeesaeteas ezeshene 337 L label reference 0 ceceecceceeeeeceeeeeeeeneeeeeeeeeeteeeeeeetees 302 Level of warning message 158 Library T eiaeaen errana aea as bee ceagiastapesatearses 28 Line number information cccccceceeeeeeeeee 249 366 bink Gre CUI Cis er cieecd aS e a 254 COMMENT a i e E 255 file AIM EE 322 SYNTAX ste a ee eee 316 Enk TEE 225 243 318 LOAD EE 264 267 USS sees tote oin es eae E EN eh 120 M Machine dependent optimization module 148 159 173 Magic number idratare 202 205 Make file for VSH oe eeeeeeeeeeeeeeeeeeeeeeneeteneeeeeeee 142 Make target binarni ai 140 Mapping directive ecccseseseeeeseeeeeceeseseereneeeens 255 tele TEE 283 alignment condition oe eee eeseeeeeeeeeeneeerenees 283 le E LEE 283 hole EE 283 section attribute aid eirean ni 282 section Dages a e EEN 279 Section typen ivi aea ar ies nahn 281 MI Ze Ee 121 Meute E EEN 337 361 Messages
194. eeeeeeeseeeteneeeeeeneeeeeaes 257 COPY EE 108 COPY UE 108 109 CP isin de Ae a Ss 109 Create directory s raai 121 122 D data Section 2 ajdeencnsicpseses araar neaei deekin EERE REEE EE 321 data attribute section eee 257 287 292 TRL RE 110 Debug information c cceceeeeeseeeeeeeeeetees 249 366 Debug Mode 2 sateen aiei ir 39 Default link directive oe eee eseeeeeeneeesneeeeneeees 305 BIS BEE 111 Delete remove file cceeeeeeeeeeeeeees 111 118 133 Delete file direCtory ee cccececeeeeceeeeeeeeeeeeeeeneeenes 112 Delete source OPTION aeeie 43 62 65 Delimiter of directory path 2 0 ee eeeeeeeseeeeeeneeeeeee 29 DEL TREE nisiende a piden nna e e 112 Devi an E 25 DIRS ates dat ii elie Rat eee eae 113 Directory configuration 0 eee eeeeeeeneeeteneeeteeeeeees 27 DIRS sede eet et ie is Se ee S 115 Display character String escceeeseeeeeneeeeeseeereneeees 117 Display contents of text file 136 Display current directory ues eeeeeeeeneeeeeeeeeeneeees 128 Display datet ipai aoaaa naa a danai 110 Display directory stack 115 Display tile list ctin irni 113 120 Display time mknn ar anan ENEE ited 135 EIN 29 DU MR eae araa anaE a nE saad rE aaa a inane eii 116 E ECHO edentate ae 117 o eA E E E EE EREE E die ATT 90 Edit key iane A n n A E EEN A 86 Effects of debugging 0 0 0 eee eeeseeeeenteeeeeneeeesnneeeenaeees 165 Element pointer ccceseceesescceesere
195. eeeeeseeeeeseeeeseeesenseeeesseeseeseeeeeseeeseseeeesenees 361 22221 OPtlOM E E 361 2 3 Examples Of USC ccccccssseeeeeeeeseeeeeeenseeeeseeenseeeeesensneeeeeensneeeeesessueeeeeensaeeeeeeenseeeeeeenas 362 CHAPTER 3 DISPLAY FORMAT eeneg te eege EENS EENS ENEE 363 3 1 Archive Header cccceececcsseeeeeeeesseeeeeeenseeeeeesenseeeeeeensneeeeeseeseeeeeesesaeeeeeesaseeeeeesenseeeeeees 363 3 2 Arehiv Sym Nol Tall eare eaae ee 363 3 3 Archive String Table ccccescessseeeeeseeeeeeeeeeeeeeeeseeesenseeeesaesenseeeesseseaseeeesesesseseneeenseees 363 34 ELF Header occon sat ceccuessecccaegssseteastesstbccareessececusyssnteas easenccereess 364 3 5 Program Header Table eeessSEEESRREEREEEEEERREEEREEEEEERNEEERERREEEREEEEEERNEEEREEEEEERREEEREEEEEERREEEEen 364 3 6 Section Header Table ccccsscccssceeeseseeeeseeeeeeseeseseaesenseeeesnaesenseeeeseeesseseeaeeseeeseseeeensees 364 Bat COUMING Table Eege EE 365 3 8 Symbol Table naranai aen er aerer En aeaaeae aan lian renna eean aaa aaraa ohianean 365 3 9 Relocation Information sssssssssssunnnenununnnnnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnmnnn nnna 365 3 10 Register Mode Information ccccceceseeceeeeseeeeeeeeeseeeeeeeesneeeeeeenseceeeeensneeeeeeenseneeeeeenas 365 3 11 Global Pointer Table sssssssnnsnennnennneunnnuunnununnununnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nunne nnmnnn 366 3 12 Line Number Information sssssnnss
196. eeeeseesesaeenenes 342 LZ Handing File cece soccecce ec ccenBecek dee E 343 CHAPTER 2 OPERATION seniii nandai saoao reen aaa aaraa Sb teabcbeadctedssclecuevoeetvacecl suert seceedcuce 344 2 1 Command Input Format from VSH Command Line ccceseeesseeeeeeeeeeeeeeeenseeees 344 2 2 Types and Features Of Options ccccsseccceseeessseeeeeseeesseaeeensneeenseeseeseeeeeseeseneaeeesenees 344 222A ele EE E 344 2 3 Examples Of USC cesicc ccccccecceccec cee ccces sede cdc ccebeeeccs deve docedebceccacecedevcnnes detventuclependecencedenchee 345 CHAPTER 3 TYPES OF OUTPUT FILES seess eegene 346 3 1 Intel Expanded Hex Format c sccccccceeeeeeeeeeeeeeeeeeeneeeeeeeeseceeeeeenseeeseeensaeeeeeeenseeeeeeenens 346 3 2 Motorola S Type Hex Format ccccccesccessseeeeeseeeeseeeeeeeeeeesnaesenseeeeseaeeseneaeeeeeeeseseeseeenes 349 3 3 Expanded Tek Hex Forimat cccsssccccceseeeeeeeeseneeeeeeenneeeseeesneeeeeeenseceeeeenseeeeeeensneeeeeeents 352 CHAPTER 4 MESSAGES eege eege veces ccatectesadpcatede duceriennacdestectuaecceezde 356 4 1 Message al LU LE 356 ET TEE 356 VOLUME 8 HANDLING DUMP COMMAND cc eeeccceeeeeeeseeeeeeeeeeenseneeeeeeeeeeeseeeeeeeseeees 359 CHAPTER OVERVIEW eege ee deed Eed e 360 1 1 How Of Oper t O ee EENS EENS 360 CHAPTER 2 OPRERATION a eerste EE 361 2 1 Command Input Format from VSH Command Line ccceseceesseeeeeeeeeeeseeeneeeees 361 2 2 Types and Features Of Options cccccsseeees
197. emporary Command File Command Line Options cpu 3000 Library Options Ic Cancel Help 1 Options Any Option Use Temporary Command File Command Line Options Library Options 74 This is not supported at present In the Windows environment the length of character strings used to specify options for command is restricted to 126 characters If this check box is selected the option character string is temporarily output to a command file refer to page 161 which enables the operation to be completed without observing the restriction on the character string length This option is checked as default assumption Displays link editor options excluding library related options set in each dialog with the command line options This area is for reference and writing is disabled Displays library related options set in the file option dialog with the command line options This area is for reference and writing is disabled 2 Buttons OK Cancel Help Enables the specified items and closes the dialog Ignores the specified items and closes the dialog Opens the Help window 75 2 5 4 Setting ROM storing processor options The ROM storing processor option setting dialog box can be displayed by performing the following operation after a project has been set with the Project Manager e Click the Option menu Click ROM Processor Options
198. ened cannot unlink file file File file cannot be deleted cannot write file file errno num Error of error number num occurs while file file is written out of memory The memory capacity has run short Xold_fcall option is not supported for V850E Xold_fcall option is invalid for the V850E V850 F7000 F7001 F7002 F7003 F7004 F7005 F7006 F7007 F7009 F7010 F7011 F7012 W1111 W1112 W1114 W1116 too many errors Compiling has stopped because errors exceeding the specified limit have occurred unknown option option An illegal option option has been specified invalid argument of option option The argument of the option option is illegal nested command file file The command file file is nested It must not be nested no input file No input file is specified cannot open file file File file cannot be opened archive symbol table and archive member mismatch An abnormality occurred in the archive symbol table unknown file type file The file type of file is not Known out of memory The memory capacity has run short multiple defined symbol symbor Multiple defined symbol symbol exists duplicated cpu type A target device is specified in duplicate by an option or the pragma directive cannot write file file errno num Error of error number num occurs while file file is written sorry no
199. ent directive of segment segment needs string string is necessary for the segment directive of segment segment segment segment number number2 must be in EP relative address able range number3 number4 The area to which segment segment is specified to be allocated number number2 exceeds the range that can be referenced by ep relative number3 number4 V850 segment segment number number2 must be in r0 relative address able range number3 number4 The area to which segment segment is specified to be allocated number number2 exceeds the range that can be referenced by 10 relative number3 number4 segment segment overflowed highest address of target machine The area to which segment segment is specified to be allocated exceeds the range of the internal memory of the target machine segment segment number number2 overflowed highest or lowest address of internal memory number3 number4 The area to which segment segment is specified to be allocated number number2 exceeds the range of the internal memory of the target machine number3 number4 segment segment number number2 overlaps guarded area number3 number4 The area to which segment segment is specified to be allocated number1 number2 overlaps the guard use prohibited area number number4 segment segment overlaps previous segment segment2 The area to w
200. ents of relocation information This option displays the contents of section This option displays the contents of symbol table starting from the numth symbol table entry If num is omitted the display starts from the first symbol table entry This option displays the contents of symbol table up to the numth symbol table entry This option displays a value of section attribute etc with the character string which indicates meaning of the value rather than a number refer to page 367 z A name A num This option displays contents of line number information for the function name starting from the numth line number entry If num is omitted the display starts from the first line number entry z A num This option displays contents of line number information up to the numth line number entry cfile This option handles cfile as a command file refer to page 161 If this option is omitted it is assumed that no command file has been specified 2 3 Examples of Use Here are examples of using the dump e To display contents of object file in meaning dump850 ftv a out The contents of ELF header and symbol table existing in the object file a out are displayed with a character which indicates meaning not a numerical value e To specify a section name dump850 n text a out The contents of the text section in the object file a out are displayed 362 CHAPTER 3 DISPLAY FORMAT This c
201. eparately for each source file setting This option is always set as the overall option This option creates a branch table for the case label in the switch statement in 4 bytes per label Specify this option if compile errors due to long switch statements occur If this option is not specified the branch table is generated in 2 bytes Enables the specified items and closes the dialog This button appears dimmed and cannot be selected when options for the overall project have been specified It can be selected when options are specified by selecting source files via the Project Manager s lt lt Source List gt gt dialog When itis selected this button deletes any options specified for a particular source file and applies only overall options Ignores the specified items and closes the dialog Opens the Help window 55 o Setting message options 0 Figure 2 13 Message Option Settings Dialog 1 Input 2 Preprocessor 3 Language C 4 Optimization C5 Output 6 Output C0 Others Warning Level C No Output w Level 1 C Level 2 w2 Individual Warnings T Bit Field Alignment wbitfield_align T Call of Not Declared Function wcallnodecl T Use of Non PIC wnopic C Unrecognized pragma wpragma T Non White Space before Sharp wsharp C Verbose Model Delete Source Option Cancel Help 1 Options Warning Level Use this area to set the level of warning messages to be out
202. eprocessing only for a C language source program and outputs the results to standard output The results include the line number display and file name display of the source program This option can be specified only when starting from VSH This option searches the library starting in the directory dir then in the standard directories 5 Only the standard directories are searched if this option is omitted This option executes preprocessing only for a C language source program and outputs the results to a file whose name is the C source file name plus i as the extension instead of c The source program s line number display and file name display are not output This option can be specified only when starting from VSH When startup goes as far as Id the startup module to be used is indicated to Id as file If this option is omitted crtN o in the standard directory is used as the startup module This option is equivalent to the file option of the Id when started from the Project Manager This option outputs a created assembly language source program without executing any modules after startup of as The output file name is the C source file name plus s as the extension instead of c Modules after startup of as will be executed if this option is omitted This option can be specified only when starting from VSH This option outputs this compiler package s version number to standard output It does not exe
203. ere sections having the same type and same attribute are mapped as one segment If sections having the same type are combined into one the input section name and file name need not be specified by using the mapping directive except a section whose correspondence between an I O section name and a segment name is fixed section such as sconst and sedata Refer to pages 266 279 Figure 3 3 Example of Mapping Image 1 TEXT LOAD RX VOxfffc0000 text PROGBITS AX D Input sequence 1 OxFFFCO000 0x0 259 2 In an application where sections having the same type and attribute have the same section name in all 260 object files but cannot be combined into one segment Specify a file name by using the mapping directive to allocate a section in a certain object file to another segment when the assembly language program does not have a description specifying a section name even though the method in 1 allocates sections to the same segment Figure 3 4 Example of Mapping Image 2 TEXT1 ILOAD RX VOxfffcO0000 text PROGBITS AX file1 0 file2 0 B TEXT2 ILOAD RX VOxfffffe00 text PROGBITS AX file3 o ag Input sequence 1 OxFFFFFE0O OxFFFCO000 0x0 3 In an application where a section having a different name exists among the sections having the same type and same attribute and the sections cannot be combined into one segment Specify a section name by using the mapping dire
204. error line num section section already defined at line num e The correspondence between the section name on the left of output section name and the section name on the right of input section name is fixed for the following section names For example do not allocate the sedata section to an output section with a different name tidata section gt tidata bss section gt tibss tidata byte section gt tidata byte tibss byte section gt tibss byte tidata word section gt tidata word tibss word section gt tibss word sidata section gt sidata sibss section gt sibss sedata section gt sedata sebss section gt sebss sconst section gt sconst const section gt const cdata1 section gt cdatal cdata2 section gt cdata2 cdata3 section gt cdata3 udata1 section gt udatal udata2 section gt udata2 udata3 section gt udata3 itext section gt itext 279 280 For example if data is specified as the section type such as by section sec sedata section directive and is allocated to the data attribute section for which no input section name is specified To allocate a section to a segment area the same as the sedata section a mapping directive must be added for sec section If there is no mapping directive for sec section sec section appears first in the Example gt SEDATA LOAD RW seda
205. error message E2553 when the ansi option is specified expression expression must have enumeration type expression must be enum type ignored option option Option option is ignored category is not supported now The feature indicated by category is not supported at present Wide character is not supported The wide character is not supported and is ignored Multibyte character is not supported The multi byte character is not supported and is ignored duplicated cpu type command line option is used A target device is specified in duplicate The target device specified by the cpu option is valid Interrupt attribute is specified for function function previously specified block_interrupt is ignored Function function that is disabled from interrupts is specified as an interrupt handler Because the interrupt handler is disabled from interrupt unnecessary interrupt prohibition specification is ignored Interrupt attribute is already specified for function function block_interrupt is ignored Function function has been already declared as an interrupt handler Because the interrupt handler is disabled from interrupt unnecessary interrupt prohibition specification is ignored W2637 W2643 W2671 W2672 W2673 W2674 W2675 W2676 W2683 W2684 W2690 Interrupt function cannot be inlined inline is ignored inline must not be specified for a function decl
206. errupt function A function declared as an interrupt cannot be called Function function is already defined block_interrupt must be specified before function definition Interrupts cannot be disabled after the function definition Function function is already defined without _interrupt Although function function is specified as an interrupt handler function has been already defined without interrupt specification Both interrupt and RTOS interrupt attributes are specified The normal interrupt and RTOS interrupt must not be specified at the same time Specifying interrupt name name is not allowed RESET and RST must not be specified as an interrupt request name unknown cpu type cannot use interrupt request name An interrupt request name cannot be used because no device is specified Interrupt function function with direct is undefined Function function that is specified to be located directly is not defined in the file illegal directive pragma section section name must be specified A section name is not specified in section allocation by the pragma directive illegal directive pragma section unrecognized section name name An illegal section name name is specified in section allocation by the pragma directive illegal directive pragma section begin or end must be specified begin and end are necessary for section allocation by the
207. ers are defined for various device files to establish relationships among the device files The as references the device files and embeds the magic numbers e Object files that operate device specific peripheral function registers etc should not be used as common files within the same family e The V850E is upwardly compatible with the V850 Family Source files that are used with the V850 Family such as the V853 can be used with the V850E CPU such as the V850E MS1 In such cases specify the cn option or the cnv850e option before creating an object The created object can be linked with a device specific object whose target device is a V850E Note that an object that is created with cnv850e cannot be linked with a device specific object whose target device is anything other than a V850E 205 as850 cnv850e as850 cn Common to V850E Common to V850 Family as850 cpu 3101 as850 cpu 3000 V850E device specification V851 device specification p option V850 The CA850 supplies Xv850patch option to the ca850 and p option to the as850 to avoid the faults of the V850 Family CPU If the Xv850patch option is specified with the ca850 when starting the as850 from the ca850 the p option having the same num is automatically set by the as850 to the assembler source file output by the ca850 Cautions e For whether the fault that has occurred is of the CPU used refer to the documents supplied
208. eseaeeeaeete 293 3 23 General Format to Create tp gp ep Symbols A 296 3 24 Example of Commands for Creating One Each of tp gp ep Symbols ecceeeceeeeeeeeeteeeeeeeeeeneees 297 3 25 Example of Creating One Each of tp gp ep Symbols A 298 3 26 Example of Commands for Creating Two or More tp gp Symbols cceeceeeeeeeeeeeeeeeeeeeteeeeeees 300 17 LIST OF FIGURES Figure No Title Page 3 27 Example of Creating Two or More tp gp Symbols ccecceeeceeeeeeeeeeeeeeeneeeeaeeeeeeeeaeeseeeeeaeeseeeeeaeetea 301 3 28 Example of Link Directive Where label Reference is tp Symbol Offset A 302 3 29 Example of Assembler Codes of a o through eo 303 3 30 Default Link Directive CA830 V830 liria a a e aea eo Ta ER a Ea r aaea 306 3 31 Memory Location by Default Link Directive CARD 308 3 32 Default Link Directive with SIDATA CA850 V851 eeeesceseeeeeeeeeeeeeeeeeseeeeeeeeeeeeeaeeseaeeeaeeseaeeeaeetes 310 3 33 Memory Location by Default Link Directive CA850 with internal ROM sses 311 3 34 Default Link Directive without SIDATA CA850 V851 uu eeceeeeeceeeeeeeeeeeeeeaeeeeeeteaeeteeeeaeeseeeeeaeenea 312 3 35 Memory Location by Default Link Directive CA850 with internal DOMM 313 4 1 Output Example of Link Map vars eessen hacia teh ag ties ect Eed 318 VOLUME 6 HANDLING ARCHIVER 1 1 le leegen E ET 336 VOLUME 7 HANDLING HEX CONVERTER 1 1 Flow of Operation of hX enaena Robie Ban th en te es 342 3 1 Fil
209. eseaeesieeseaeeeaees 409 Section Types Specifiable by CA850 AE 410 Constituents of ELF Header and Their Meanings cceccceeeeeeeeeeneeeeeeceeeeeeeeeeeeeseeeeaeeseeeeeaeeenaees 413 Constituents of Program Header Table Entry and Their Meanings eecceeseeseeeeeeeeeseeeeereeeetees 414 Constituents of Section Header Table Entry and Their Meanings sseeeeesseesseereerreereerrerreereerens 415 Section Types and Their Meanings AAA 416 Meanings of link aind NO raisin elie i ek phe ld Ee aiaa 417 Constituents of Symbol Table Entry and Their Meanings eeeeseesseeseeseesreererreereerrernernerneerneeneee 419 Reserved Sections siririn a ween ais eee A ee A 421 VOLUME 1 GENERAL 21 CHAPTER 1 OVERVIEW This chapter explains the organization of this manual and the features of the CA Windows based compiler packages 1 1 Organization of This Manual This manual consists of the following volumes and appendix VOLUME 1 GENERAL Explains the organization of this manual and the operating environment of the CA830 CA850 compiler packages VOLUME 2 OPERATION METHOD Explains the handling method of the CA830 CA850 compiler packages for Windows and the Make Utility VMAKE of the command line interface VOLUME 3 HANDLING C COMPILER Explains the C compiler ca VOLUME 4 HANDLING ASSEMBLER Explains the assembler as VOLUME 5 HANDLING LINK EDITOR Explains the link editor Id VOLUME 6 HANDLING ARCHIVER Explains t
210. esponding command including arguments in the text box under lt lt Definition gt gt Click the OK button to set the alias and close the dialog box Click the Cancel button to close the dialog box without making a selection e Alias specifications are case sensitive e To use an existing alias instead of entering a new alias enter a blank space at the start of the text box 4 Set aly Operation CAUTIONS Scroll Prompt History Color Window Size Window Size x Opens the dialog box for setting the window size Window Width p H P Window Height D 8 p Cancel Help To change the VSH window size Drag the width height scroll button to the desired setting Or from the keyboard use arrow keys to change the setting incrementally The unit of measurement is the number of characters Click the OK the Cancel button to change the VSH window size and close the dialog box Click button to close the dialog box without changing the VSH window size If the VSH window size has been maximized its size cannot be changed via this dialog box 93 94 al Operation CAUTIONS Scroll Opens the dialog box for setting the number of lines to scroll backward and for setting the scroll interval Scroll Size Hr A Scroll Interval al EE 2 Cancel Help
211. ess of the specified address plus 1 is specified warning line num aligned odd value number1l to be even value number2 e Start specifying an address with V e V must not be followed by a blank space e V may be uppercase or lowercase e Do not use an expression to specify an address Automatic location of interrupt handler The Id adds a link directive to allocate an interrupt handler to the specified directive file in accordance with the interrupt request name defined in the device file If an interrupt handler is specified by the pragma directive or pragma rtos_interrupt directive in the C source file or a section that specifies an interrupt request name by using the sect ion pseudo instruction 4 is defined in an assembler source the section defined as an interrupt handler is allocated to the address stipulated by the device file At this time locating the interrupt handler takes precedence over locating the other segments a gt pragma interrupt INTP00 func lt Branch to func becomes INTPOO section section INTPO1 text lt Defines INTP0O1 section Internally added directive INTPOO LOAD R VOx120 INTPOO SPROGBITS AX INTPOO INTPO1 LOAD R VOx130 INTPO1 SPROGBITS AX INTPO1 J In the above example if direct is specified for the pragma interrupt the function becomes the INTPOO section instead of branching to the function
212. even when an object file name or archive file name is described the link map is referenced Output the link map by using an option of the link editor describe a name exactly the same as the file name displayed on the link map including the path name to the directive file and execute linking again 285 3 5 4 Using mapping directive 1 Mapping of sections 286 Specify the section type section attribute and as necessary section name and file name of the section to be allocated in a mapping directive that is specified in a segment directive For example to allocate a section having section type PROGBITS and section attribute AX in object files file1 o and file2 0 to segment SEG the following directive can be used Example gt SEG LOAD RX sec SPROGBITS AX filel o file2 o hi To allocate a section having section type PROGBITS section attribute AX and section name usrsec in object files file1 o and file2 0 to segment SEG the following directive can be used Example gt SEG LOAD RX usrsec SPROGBITS AX usrsec filel o file2 o Two or more mapping directives can be specified in one segment directive For example to allocate data attribute section and bss attribute section in object files file1 o and file2 0 to segment SEG the following directives can be used Example gt SEG LOAD RW secl S PROGBITS AW filel o file2 o SNOBITS AW
213. ex format file by using the hx Figure 1 1 Flow of Operation of hx Executable object file Intel hex Motorola hex Tektro hex format file 1 An object file in which an unresolved external reference does not exist 2 By using the o option the hex format file can be output to a specified file 342 1 2 Handling File As the hex formats the following formats can be specified 1 Intel hex format e Intel expanded hex format 2 Tektro hex format e Expanded Tek hex format 3 Motorola hex format e S type format standard address e S type format 32 bit address 343 CHAPTER 2 OPERATION This chapter explains the operations of the hx 2 1 Command Input Format from VSH Command Line hx A option A file name Can be omitted Pattern in immediately before can be repeated A One or more blank spaces 2 2 Types and Features of Options 2 2 1 Option list The following table lists options of the hx Specification Format Feature F devpath This option searches for the device file first in the directory devpath then in the standard directories If this option is omitted only the standard directories are searched Iname This option converts and outputs code in the section specified by the section name name If this option is omitted it converts code in all sections which correspond to a section type other than NOBITS and which have section attribute A5 This option sor
214. exceeds the end of the text section in the object When ld is started by ca the rompcrt o file and libr a file are specified to be linked by Id Xv850patch This option specifies the p num option for as850 according to the num specification for an assembler num V850 source file output by the ca850 to output a code corresponding to a CPU fault refer to page 206 The specifiable range for num is 1 to 3 Xword_switch This option creates one four byte branch table per case label in a switch statement Specify this option to prevent compile errors that would otherwise occur when the switch statement is long Two byte branch tables are created if this option is omitted This option outputs an assemble list to a file whose extension c is changed to v refer to page 208 This option outputs information for the source debugger When as is started by ca specifying this option is handled the same as when g has been specified for as This is equivalent to specifying Debug from the Option menu when the Project Manager is used This option limits the number of registers used by ca as n registers 22 22 registers 26 26 registers 32 registers are specified if this option is omitted bei This conversion is performed only when the second argument in strcpy is a character string In addition the first argument may required four byte alignment by the program the C compiler aligns the sec
215. f digits of entry point address is 2 and entry point address is 80 Q 355 CHAPTER 4 MESSAGES This chapter explains the output messages of the hx in alphabetical order The italic characters in the output messages and explanatory statements are determined during command processing 4 1 Message Format The message of hx is basically output in the following format hx message However a command name is not output to the warning message 4 2 Messages cannot create HEX rom data because there is no memory information ROM data cannot be created because there is no memory information cannot find device file The device file cannot be found cannot open file file File file cannot be opened cannot open output file file Output file file cannot be opened close error The file cannot be closed expect block length after b Specify a block length after b expect disp value after d Specify an offset value after d expect format type ITSs after f Specify I T S or s after f expect input file Specify an input file name expect output file o Specify an output file name after o 356 expect section name after l Specify a section name after l file name name is too long The length of file name name exceeds the limit illegal fill value The filling value is illegal illegal option character character must not be specified as an option file is archive file File file is an archive file and
216. f info GPTAB Section header table index of section to which corresponding data is allocated REL Section header table index of corresponding Section header table index of section to be relocated symbol table RELA Section header table index of corresponding Section header table index of section to be relocated symbol table SYMTAB Section header table index of corresponding string Symbol table index of symbol that appears first and table is not local 17 This section type is not used by this compiler package at present 417 B 5 Section This section explains the section that constitutes an object file in the ELF format A section is a major constituent of the object file containing a machine language instruction data symbol table string table debug information and line number information as its contents A section satisfies the following conditions 1 One section header table entry corresponding to the section header table exists in each section 2 In some cases a section for which only the section header table entry exists but that does not have an actual value in the object file exists section having section type NOBITS 3 A section having an actual value in the object file occupies a contiguous area in the object file 4 A section does not share an area in the object file In other words there is no area that belongs to two or more sections 418 B 5 1 Symbol table This section expl
217. f input file by replacing the s extension with o N 204 cn option Information indicating the target devices for an object are automatically embedded into objects created by the assembler A model specific magic number is embedded if only a particular type of device is the target device If an entire family of devices can serve as target devices then a common magic number is embedded An object that has been assembled by as when the cn option has been specified contains a common magic number and therefore can be linked to other objects for which a different device type has been specified as long as the specified device belongs to the same family Id does not output an error when they are linked Consequently any object that is created after the cn option has been specified can be used as an object common to any device in the specified device s family Figure 2 1 Image of Creating Common Object with as as850 cn Device specification A Common magic number Ox70FF CC O Executable object file Device specification B Model specific magic number 0x70D0 e Ee e Device specification C Model specific magic number 0x70D1 Cautions e It is not possible to link only these types of objects to create an executable object file An executable object file must contain an object file that includes a model specific magic number e Common same family magic numbers and model specific magic numb
218. f the rompsec section to be created e To specify section romp8s50 p data1 p data3 a out Includes the two sections data1 data3 in the a out file in the rompsec section of the default output file romp out 4 romp handles the directory at the dev position from the romp s installation directory as the standard directory of the device file 5 The output object file name cannot be specified from the Project Manager s option dialog The file name always becomes the name which is omitted the suffix of the first file in source list and is added out the same naming convention is used for the Id 385 CHAPTER 3 ALLOCATING AREA OF rompsec SECTION AND LINK PROCEDURE This chapter explains the codes used to create sections to be stored to ROM and how the addresses of ROM storing objects are resolved 3 1 Allocation Area of rompsec Section The romp packs the data section having the initial value in the input section section having the data or sdata attribute and the itext section and interrupt handler section located in the internal instruction RAM with the CA830 and creates an object file having a text attribute section named rompsec section that incudes the contents of the above mentioned sections and the address information on these sections refer to pages 382 and 383 Here is an example of a code rompcrt s to allocate the area for the rompsec section supplied by this compiler package Example of rompcrt s gt
219. filel o file2 o sec2 To allocate data attribute section and sdata attribute section in object files file1 o and file2 0 to segment SEG the following directives can be used Example gt SEG LOAD RW data SPROGBITS AW filel o file2 o sdata SPROGBITS AWG filel o file2 o E 5 5 5 a NOO If a section having section type NOBITS is specified before a section having section type PROGBITS a portion that does not have an actual value is sandwiched between these sections in the object file Consequently the contents of the segment cannot be loaded by using the value of the program header table entry If it is necessary to load the segment contents by using the program header table entry value specify the section having section type NOBITS after the section having section type PROGBITS Section having section type PROGBITS and section attribute AW Section having section type NOBITS and section attribute AW Section having section type PROGBITS and section attribute AWG 287 If the same section type section attribute input section name can be omitted and input file name can be omitted are specified for two or more segments and if the corresponding section exists the section is allocated to the segment specified first For example if no input file name is specified or if the same file name is specified for two segments and if the same section types and section
220. for that file by using the Id and then deletes the relocatable object file e If multiple c ic or s files are specified on starting the ca the ca links the relocatable object file that has been internally generated for that file by using the Id and preserves this file as a file from the name of the input file by replacing c ic or s with o However if compiling is executed by specifying options of size priority optimization or execution speed priority optimization the ca shares the information of the specified multiple c and ic files If even one of the specified c and ic files is changed or modified all the files must be re compiled e The s file is passed to the as as it is a source program directly described in an assembly language does not go through the machine dependent optimization module e All the files other than c ic and s files such as the a file and o file are all passed as ld Caution The input file names supported by Windows can be specified However cannot be used at the head of a file name with the CA because it is judged as a command option 150 1 3 Execution Object Creating Pattern As explained in 1 1 the ca can read a C source file and create an executable object file all at once because it start as and Id Besides the processing can be stopped before the as and ld are started by specifying VSH command line option and can output a compiler code or create a relocatable object file bef
221. g box that is used to switch language specifications refer to page 46 Opens the dialog box that is used to set the optimization level and type refer to page 48 Opens the dialog box that is used to make output object related settings such as data allocation to sdata sbss sections and kanji code specifications of the target refer to page 50 Opens the dialog box that is used to make output object related settings such as register mode and ROM storing object creation specification refer to page 53 Opens the dialog box that is used to set the level and item of warning message to be output refer to page 56 Opens the dialog box that is used to set the other parameters refer to page 58 41 Setting input options 0 Figure 2 7 Input Option Settings Dialog Compiler Options x 2 Preprocessor 3 Language C 4 Optimization CD Output 6 Output2 7 Message 0 Others Section Data File T Use Eile Xsec_file File Name Kanji Code Default Shift JIS C None Xk none Shift JIS Xk sjis EUC Xk euc Delete Source Option Cancel Help 1 Options Kanji Code Specifies the character code to be used for Japanese comments and character strings in the input file Error message is output if the codes other than the specified code exists in the input file If lt lt None gt gt is specified the code cannot be guaranteed The lt lt Default gt gt setting is Shift JIS
222. g box without making any changes To actually save histories it is necessary to select lt lt Save Exit Status gt gt from the Option menu and then lt lt Save History gt gt refer to page 97 Color Sets character color and background color Text Color Background Color y Use System Color If use of the system color is selected however the specified character color and background color are not used but the system color of Windows is used If use of the system color is selected V mark appears Use of the system color is specified in toggle mode e the system color is alternately selected and cancelled each time the button is clicked 5 Option The option menu executes the commands related to display of VSH A check mark V is shown to the left of commands displayed in a language other than English when they are displayed These commands are toggled switched between select cancel modes Option Show Current Directory Save Exit Status Save History Show Current Directory Save Exit Status Save History This displays the current directory name in the title bar Saves settings such as the window size position settings when exiting The same settings will be used the next time the window is opened Saves the history When VSH is activated next time the current history contents are saved by the number specified on the
223. g option 1 Opens the dialog box that is used to set the path of the include file in assembler refer to page 61 Opens the dialog box that is used to set the ordinary options of the assembler refer to page 63 Opens the dialog box that is used to set the other parameters refer to page 66 Figure 2 16 Option 1 Settings Dialog Assembler Assembler Options x C2 Option CO Others Include Search Path It Delete Source Option Cancel Help 1 Options Include Search Path LI 16 Refer to User s Manual Assembly Language of each family Specifies a directory that is searched for the file specified by the file input directive prior to the directory where the source file is placed When specifying several paths use a semicolon to separate the path specifications This area uses a drop down list type of display to list all directories that have been specified once up to 10 files To select a directory either click on the desired directory or use the arrow keys to select it When this option is omitted only the directory where the source file is placed is searched 61 62 2 Buttons OK Delete Source Option Cancel Help Enables the specified items and closes the dialog This button appears dimmed and cannot be selected when options for the overall project have been specified It can be selected when options are specified by sel
224. g the hole size with H e H must not be followed by a blank space e H may be uppercase or lowercase e Do not use an expression to specify hole size 45 A hole area is appended to the specified segment 271 7 Filling value Specify a value called a filling value used to fill the hole area of the hole which is created in allocating segments or is explicitly specified to be created Specify the filling value in the following format e Specifying a filling value can be omitted If omitted 0x0000 is used as the default value refer to Table 3 3 on page 265 e Ifthe filling value f is specified the Id outputs the following message ignores the filling value specified by the link directive and continues linking warning line num FILLING VALUE is illegal when f option specified ignored e Specify the filling value as a 2 byte 4 digit hexadecimal number e If the filling value is of less than 4 digits the higher digits are assumed to be 0 e Ifthe hole is less than 2 bytes the required digits are taken out of the lower value of the specified filling value e Start specifying the filling value with F F must not be followed by a blank space s F may be uppercase or lowercase e Do not use an expression to specify a filling value 46 This filling value is used if a filling value is not explicitly specified for a section to be allocated to that segment 272
225. gal file format unknown option string Illegal option string is specified weak symbol symbol not supported Symbol symbol having binding class WEAK is not supported zero size sbss or bss attribute symbol symbol The size of symbol symbol to be allocated to the sbss or bss attribute section is 0 333 MEMO VOLUME 6 HANDLING ARCHIVER 335 CHAPTER 1 OVERVIEW This volume explains the outline operation and output messages of the archiver ar included in this compiler package ar starts from the VSH command line 1 1 Flow of Operation The ar links specified relocatable object files to create one archive file also called a library file refer to Figure 1 1 If two or more object files whose functions are related to each other are linked to one archive file in an application system the archive file can be used as an independent library Figure 1 1 Flow of Operation of ar oa Object file Archive file Object file 1 2 Handling File The archive file created by the ar can be specified as an input file for the link editor Id included in this compiler package When an archive file is specified the Id searches the specified archive file for necessary object files and links only the object files that have been found By linking two or more object files related to each other to one archive file by using the ar the object files can be treated as one library 336 CHAPTER 2 OPERATION
226. global pointer and one instruction and by using ep relative access V850 that places data in the tidata byte tibss byte tidata word tibss word tidata and tibss sections in the range that can be referenced by the element pointer and a load store instruction with a short instruction length Cautions e One each tp symbol and gp symbol is always created internally by the Id to resolve addresses and values must be set to tp and gp by using these symbols upon starting the program e The Id850 reads the contents of the device file used and automatically sets the first address of the internal RAM to the element pointer ep of the V850 Family Therefore only whether a symbol is created or not is specified for the ep symbol Addresses or alignment conditions cannot be specified for the ep symbol 61 If a section allocated to a segment in the internal RAM or internal ROM is used the position independent code is not used because the addresses to which the section is allocated are fixed 62 Allocate data to each section by describing pragma section refer to V800 Series C Compiler Package User s Manual C Language or section definition pseudo instruction refer to User s Manual Assembly Language of each family or by specifying the size with the G option of ca refer to page 156 The data can also be allocated with a section file refer to page 408 63 sld sst instruction 291 3 6 2 Configuration of symbol d
227. gment type is specified line num string in section directive is illegal when r option specified ignored string must not be specified in the section directive and is ignored if the r option is specified line num string in segment directive is illegal when r option specified ignored string must not be specified in the segment directive and is ignored if the r option is specified line num string is illegal in file name field string must not be specified in the portion that specifies a file name line num string is illegal in section directive string must not be specified in the section directive line num string is illegal in segment directive string must not be specified in the segment directive line num string is illegal in segment name field string must not be specified in the portion that specifies a segment name line num string is illegal in symbol directive string must not be specified in the symbol directive line num string is illegal when f option specified ignored string must not be specified and is ignored when the filling value specification option f is specified line num name is expected at the beginning of directive Start a directive with a name line num section section already defined at line number Section section has been already defined on the numberth line line num section directive of section section needs string Section directive needs string
228. gram the correct value cannot be obtained 303 Mistake example gt f F N link directive TEXT1 LOAD RX textl PROGBITS AX text1 a o text2 PROGBITS AX text2 b o text3 PROGBITS AX text3 c o __tp_TEXT TP_SYMBOL TEXT1 TEXT2 b s section text2 start mov start r10 ld w t_lab rl10 r20 t_lab word 0x20 lt Value of t_lab is offset from t p_TEXT Ne D In the above example the value of t_lab is not an offset from the first address of the text2 section but an offset from the _tp_TEXT value Therefore the program cannot run correctly as itis In this case either of the following corrections must be made Exclude b o from the TEXT1 segment and allocate it to a segment that does not create the tp symbol S link directive TEXTIL LOAD RX textl PROGBITS AX text1 a o text3 PROGBITS AX text3 c o TEXTB LOAD RX text2 PROGBITS AX text2 b o __tp_TEXT TP_SYMBOL TEXT1 TEXT2 d ah Reference by combining a register to which the corresponding tp symbol value is set and the label reference TE D section text2 start mov __tp_TEXT r10 ld w t_lab r10 r20 t_lab word 0x20 Fi The ca always outputs codes by using a label reference that uses tp as a base for the label reference in the text attribute section In the case of a C source pr
229. gt ca850 cpu 3000 c file c asm s Reads file c and asm s to create relocatable object files file o and asm o gt 1d850 org_crt o file o asm o obj o lc Links org_crt o file o asm o and obj o to create executable object file a out At this time libc a is referenced 3 To start ca as and Id alone gt ca850 cpu 3000 c file c Reads file c to create relocatable object file file o gt as850 cpu 3000 asm s d Reads asm s to create relocatable object file asm o gt 1d850 org_crt o file o asm o lc Links org_crt o file o and asm o to create executable object file a out At this time libc a is referenced 152 CHAPTER 2 OPERATION This chapter explains how to operate the ca 2 1 Command Input Format from VSH Command Line ca A option A file name A file name or option Can be omitted Pattern in immediately before can be repeated A One or more blank spaces 2 2 Types and Features of Options 2 2 1 Option list The following table lists the options of the ca When starting from VSH if an option not listed in this table is given that option is regarded as the option of the Id and is passed to the ld as it is eR WI must be specified to pass the options marked in the option list of the Id on page 222 from the ca to the Id as they are Below listed options are available which are not existed in option dialog in Project Manager Specify ca from
230. h commande specification syntax is given Options Options are listed Description A more detailed description of each command function is given Examples An example is given The following symbols are used in Synopsis Text enclosed in square brackets can be omitted Indicates a delimiter between option arguments Indicates that the previous pattern can be repeated A Indicates one or more blank spaces 103 ATTRIB Change view file attributes ATTRIB ATTRIB Summary Change view file attributes Synopsis ATTRIB A option A drive path filename Options A Sets archive file attribute to ON A Sets archive file attribute to OFF H Sets hidden file attribute to ON H Sets hidden file attribute to OFF R Sets read only file attribute to ON R Sets read only file attribute to OFF S Sets system file attribute to ON S Sets system file attribute to OFF S Applies processing to all files included in all directories in the path None Displays file attributes Description Changes or displays the attribute set in the file When the filename is omitted the specified change view attributes are applied to all files in the current directory The following characters are used when displaying file attributes A Archive file H Hidden file R Read only file
231. h specified by the byte nword or word pseudo instruction is wrong illegal character A character that cannot be handled appears illegal expression The syntax of the expression is incorrect illegal expression string The element string of the expression is erroneous illegal expression label An expression in the format of label is used illegal expression label label An expression in the format of label label is used 211 illegal expression label or symbol Jabel An expression in the format of label or symbol label is used illegal expression label label An expression in the format of label label is used illegal expression labels have different reference types An operation is specified between label references of different formats label label and label illegal expression labels in different sections An operation is specified between labels belonging to different sections illegal expression labels must be defined Define an operation between labels in the same file illegal expression not nor An operation other than and is used illegal operand cannot use r0 as destination in V850E mode When the target device is V850E the zero register r0 cannot be used for the destination register illegal operand inconsistent bit position The bit position is inconsistent illegal operand identifier is reserved word Reserved word identifier is used as a name
232. hapter explains the display format of the dump command 3 1 Archive Header Date 0x3158DE73 Date of updating member Uid 2165 User ID 3 2 Archive Symbol Table 3 3 Archive String Table ARCHIVE HEADER Displays contents of archive header Gid Mode Size Member Name 188 0100664 0x2B8 atof o Group ID Permission of file Total number of Member name bytes of member ARCHIVE SYMBOL TABLE Displays contents of archive symbol table Offset Name Oxlf3c abs Offset in file to member Symbol name including symbol ARCHIVE STRING TABLE Displays contents of archive string table Offset Name 0x1100 foo o Offset Member name 363 3 4 ELF Header Class Entry Phentsize 1 0x0 0x20 Class Entry point address Entry size of program header table 3 5 Program Index Data Phoff Phnum 1 0x0 0 Byte order Offset in file of program header table Number of entries of program header table Header Table ELF HEADER Type Shoff Shentsz 1 Ox2A4 0x28 Type Offset in file of section header table Entry size of section header table Displays contents of ELF header Machine Flags Shnum 070377 0x84 6 Processor Flag Number of entries of section header table PROGRAM HEAD ER Displays contents of program header table Type Filesz 0 0x0 Segment type File size 3 6 Section
233. has been set with the Project Manager e Click the Option menu Click Assembler Options e Click the Option menu Click Source List Click the source file for which options are to be set Click the Options button The former is the setting for the assembler source file for the all target projects and the latter is the individual setting for that source file When source file specific settings are made overall option settings become invalid for the particular source file If the Delete Source Option button is clicked on the setting dialog of each source the option set for each source file is deleted and the option for all the projects set by the former method becomes valid Figure 2 15 Delete Source Option Button Pe Aah when setting options of entire project o Delete Source ie Cancel Help er aa when setting individual options in Source List o Delete Source Option gt Source ee Cancel Help 15 re mark is appended to the file that is set to the individual option setting in lt lt Source List gt gt 60 Three option buttons are displayed at the upper part of the assembler option setting dialog The display of the dialog is changed depending on which option button is selected 1 Option buttons for displaying option setting dialogs LA Option 1 IN Option 2 IO Others Settin
234. hat enables arguments to be passed to each module This has the same function as pragma cpu devicename There are two methods specification by the cpu option or specification by the pragma directive If both are specified but have different contents the specification by the cpu option takes priority Refer to the device file s User s Manual for description of device types that can be specified as devicename For details of the pragma directive refer to V800 Series C Compiler Package User s Manual C Language 159 2 2 2 2 2 NOA Specification Format Feature devpath dir This option searches for the device file starting in the directory dir then in the standard directories Only the standard directories are searched if this option is omitted When the command is started from the option dialog the device file s installation directory is automatically set for this option so this option can be specified only when starting from VSH help This option outputs a description of option to standard error output Istring This option specifies the archive file that is referenced by the Id Nothing is referenced if this option is omitted This option only executes the front end creates an ic file and then terminates processing If this option is omitted modules after the front end are also executed This option can be specified only when starting from VSH o A outfile This option spec
235. he archiver ar VOLUME 7 HANDLING HEX CONVERTER Explains the hex converter hx VOLUME 8 HANDLING DUMP COMMAND Explains the dump command dump VOLUME 9 HANDLING DISASSEMBLER Explains the disassembler dis VOLUME 10 HANDLING ROM STORING PROCESSOR Explains the ROM storing processor romp VOLUME 11 HANDLING SECTION FILE GENERATOR Explains the section file generator sf APPENDIX Explains the format of the section file and object file 22 1 2 Features of CA Windows based Compiler Package The CA830 CA850 Compiler Packages have the following features e Language specifications conforming to ANSI standard The C language specifications conform to the ANSI standard and are also compatible with the conventional C language K amp R specifications e High level optimization The C compiler assembler provide multi level optimization e Features for embedded control A utility is provided to facilitate storing the application system to ROM e Easy description The expanded language specifications facilitate the description of programs in C language The CA830 CA850 Windows based C compiler packages are provided with the following operating features e Activation from Project Manager CA can be activated from efficient integrated environment Project Manager The Project Manager is a control software that allows tools operating in Windows to activate efficiently and is included in this compiler package e Shell function added Beca
236. he command line In the command file the arguments to be specified can be described over multiple lines However options and file names must not be described over more than one line The command file cannot be nested Example of command file Dtest Describes define test o object Specifies object file name a c Specifies file to be compiled Example of specifying command file gt cat cfile cpu 3000 c 0s file c lt Contents of command file gt ca850 cfile lt Same operation as ca732 cpu 3000 c 0s file c 161 2 2 2 Efficient use of optimization The optimization levels that can be specified by the O option are described below along with instructions on using optimization efficiently Figure 2 1 Optimization Levels and Parameters Optimization Strong Time priority Ot Size priority Os Inline expansion size Wp N G Level 3 03 O No of loop unrolling Wo Ol Optional Ol Level 2 O2 Level 1 O1 Not optimization Optimization Weak Does not execute optimization Executes optimization in the basic block 4 Optimization in basic block is to execute optimization by using the information that can be obtained in the basic block This includes constant folding simplify expressions common subexpression elimination in the basic block and copy propagation in the basic block lt Example gt To replace an operation expression of
237. he function guide or others including in the Windows Organization This manual consists of the following contents e Overview of this compiler package e How to use this compiler package via Project Manager e How to use this compiler package in a command line e Command functions options and output messages Commands Included in Package C compiler ca Assembler as Link editor Id Archiver ar Hex converter hx Dump command dump Disassembler dis ROM storing processor romp Section file generator sf Cautions e This document describes two families CA830 and CA850 The functions peculiar to a certain family are specified by title names and symbols in the text such as V830 the description in this document apply to all the families and V850 Unless otherwise specified A description using a command name of a specific family is also applied to all the families unless otherwise specified e In a description that applies to all the families the package name and directory name are abbreviated as ca and libxxx These package names and file names should be taken as follows depending on the device used Package name CA CA830 or CA850 Command name ca ca830 or ca850 as as830 or as850 Directory name libxxx lib830 or lib850 e The functions peculiar to V850E in the V850 Family are specified by title name or the symbol such a
238. he modules following the Id are invalid e m gt G L O R S We a c l o Because execution is terminated at the front end the options related to the modules following pre optimizer are invalid e O 0 3st The option that is specified later is valid e w w 1 2 The option specified first is invalid 30 ca handles the directory at the dev position from the cas installation directory as the standard directory of the device file 31 Refer to the description of the library specification l option for the Id 32 When ld is started from ca ca automatically passes the standard library link Ic specification to Id 33 The executable object file name to be output cannot be specified from the Project Manager s option dialog Instead the out extension is added to the first file in the source list from which the suffix has been removed 160 2 If a code other than the default code shift JIS is used in the input file to be code converted by specifying the Xkt option then use the Xk option to specify the code to be used If the code to be used is not specified the default code shift JIS will be used and the code will not be converted Input file Output file Xk euc Xkt sjis A command file does not specify options and file names for commands as the arguments of the command line but specifies them by describing them in a file The ca treats the contents of the command file as if they were the arguments of t
239. hich segment segment is specified to be allocated overlaps the area to which preceding segment segmeni2 is allocated 78 Ignore section attribute G and match section attributes A W and X with segment attributes R W and X respectively 79 If this message is output the correct memory address may not be referenced Be sure to modify to the correct allocation 331 sorry archive file file in directive not supported The feature to specify an archive file in the link directive is not supported sorry string option not implemented ignored string option is not implemented and is ignored sorry shared library not supported A shared library is not supported start address number of section section overlaps previous section ended before address number2 The first address number of section section overlaps the area of the section allocated up to address number start address number of segment segment overlaps previous segment ended before address number2 The first address number of segment segment overlaps the area of the segment allocated up to address number string buffer overflow The area of the string buffer has run short symbol symbol has different align size in file file Link occurs in symbol symbol but differs in alignment condition from the symbol having the same name defined in file symbol symbol has different size in file file Link occurs in symbol sym
240. his compiler package e g in the start up module The element pointer symbol is set by the Id by reading the values peculiar to the target device from a specified device file 221 CHAPTER 2 OPERATION This chapter explains how to operate the Id 2 1 Command Input Format from VSH Command Line Id A option A file name A file name Can be omitted Pattern in immediately before can be repeated A One or more blank spaces 2 2 Types and Features of Options 2 2 1 Option list The following table lists the options of the Id For the details of each option refer to 2 2 2 on page 226 The options marked require WI to be specified for the ca when the Id is started from the ca by VSH command line or when these options are to be passed from the ca to ld refer to page 153 Some options which are listed on the following options but not present in the option dialog in the Project Manager exist When such options are required to be specified start the Id from VSH 222 1 File options These specifications set options related to files referenced by the Id Specification Format Feature D A dfile When this option has been specified links are made according to the link directive in the directive file dfile If this option is omitted the default link directive is used F A devpath This option sets the device file search to begin in the devpath directory before going to the standard directories
241. ied archive file This option displays the contents of debug information This option displays the contents of string table This option displays data from the section indicated by num This option displays data up to the section indicated by num This option displays the contents of members other than archive symbol table archive string table and object file existing in the specified archive file This option displays the ELF header contents of all members existing in the specified archive file This option displays the external symbol contents of the archive symbol table existing in the specified archive file This option displays the contents of all section headers existing in the specified archive file This option displays the contents of all program headers existing in the specified archive file This option displays the contents of the global pointer table This option displays the line number information This option displays the contents of strings existing in the archive string table in the specified archive file This option displays the contents of the section indicated by section name name 2 Specifying the A option is equivalent to specifying abcfghiklmrst 3 num is the section header table index 4 Symbol having binding class of GLOBAL 361 Specification Format Feature This option does not display the title This option displays the cont
242. ified when macro_name has only one character 3 Internal macros VMAKE includes the following two internal macros to facilitate description of rules for generating targets Note that internal macros are valid only in command lines a Indicates the complete target name of the target being revised Example object file c CA file c o Sp lt indicates object b Indicates a list of files requiring revision among the dependent files of the target being revised In other words this basically lists the files that must be regenerated to enable revision of the target Example lib a filel o file2 o file3 o ar850 rv lt The indicates a file list updated following lib a in file1 o through file3 o during make execution 145 MEMO 146 VOLUME 3 HANDLING C COMPILER 147 CHAPTER 1 OVERVIEW This volume explains the outline operation and output messages of the C compiler ca included in this compiler package 1 1 Flow of Operation The ca creates relocatable object files and object files executable on the target system from C source programs described in C source files The ca plays a role of the driver of the modules included in the package and performs operations such as macro expansion comment processing merging intermediate language files optimization creation and conversion of assembly language source programs into machine language instructions and link
243. ifies the object file name for outputting outfile When there are several output files this option is ignored If this option is omitted a out is regarded as the executable object file name This option can be specified only when starting from VSH temp dir This option specifies the working directory for creating temporary files that are used internally refer to page 29 This option can be specified only when starting from VSH This option handles cfile as a command file refer to page 161 If this option is omitted it is assumed that no command file has been specified Cautions 1 Some of the above mentioned options become invalid if specified simultaneously with another option Of the following options those on the right of gt become invalid if they are specified with the options shown on the left of gt e E gt P s U gt D e E P gt G L O R S We a c l m o Because execution is terminated after preprocessing has been performed the options related to the modules following the front end are invalid e S gt L R W all a c l o Because execution is terminated at the machine dependent optimization module the options related to the modules following the as are invalid e V help The option that is specified later is invalid Furthermore if this option is specified all the other options become invalid e c gt L R WI I o Because execution is terminated at the as the options related to t
244. ifying an address and if the interrupt processing to be executed at reset or start up module is not located at address 0x0 the data of the SCONST segment is allocated to handler address 0x0 SCONST LOAD R VOx160 sconst SPROGBITS A sconst e To create DATA segment to be allocated to external memory with V851 with internal ROM as the target device Specify the first address of the external memory 0x100000 N E SCONST LOAD RW V0x00000 data PROGBITS AW sdata SPROGBITS AWG SNOBITS AWG SNOBITS AW sbss Dass Ne J e To create SCONST segment of rO relative and referenced by one instruction with the V830 Family Set address Oxffff8000 within 32 KB from rO SCONST LOAD R VOxffffFf8000 sconst S PROGBITS A sconst 269 If two or more segments exist and an address is specified for one of them the segment for which an address is specified is allocated from the specified address unless the specified address overlaps the address of the previously specified segment If overlapping occurs the Id outputs the following message and stops linking fatal error start address number1 of segment segment overlaps previous segment ended before address number2 Specify the address in the following format e Specify an even address If an odd address is specified the Id outputs the following message and continues linking assuming that an addr
245. igned Strict ANSI C Rule ansi Check this box to compile strictly according to the language specification in the ANSI standards refer to page 155 46 Strict Integer Extension Xe 2 Buttons OK Delete Source Option Cancel Help When this box is checked mu mulu and ___div ____divu from the runtime library are used instead of mulh and divh instructions for integers having data lengths of 16 bits or less Multiplication and division are performed strictly according to the ANSI standards although this slows down the processing speed If this check box is not selected the mulh and divh instructions are used V850 Enables the specified items and closes the dialog This button appears dimmed and cannot be selected when options for the overall project have been specified It can be selected when options are specified by selecting source files via the Project Manager s lt lt Source List gt gt dialog When itis selected this button deletes any options specified for a particular source file and applies only overall options Ignores the specified items and closes the dialog Opens the Help window 5 The runtime library in the CA850 is provided as this compiler s standard library in order to fulfill the ANSI standards with regard to instructions that are not included in the V850 Family architecture For details of the runtime library
246. ile file is nested It must not be nested overflow error exprtab The work area for processing an expression has run short Simplify the expression overflow error too many expression items The work area for processing an expression has run short Simplify the expression parameter mismatch The number of actual parameters is insufficient for macro call parameter table overflow More than 33 actual parameters are used read error The file cannot be read seek error The file cannot be sought symbol already defined as label The specified symbol has been already defined as a label syntax error The syntax is wrong 214 syntax error string The syntax of string is wrong token too long The length of the token exceeds the limit The limit value is 1024 too many files Two or more files must not be specified identifier undefined Undefined identifier identifier is referenced unexpected EOF in macro The corresponding endm pseudo instruction does not exist unexpected EOF in repeat irepeat The corresponding endm does not exist unknown cpu type Assembly cannot be executed because no target device is specified unreasonable macro_call nesting The currently defined macro in a macro body is called usage as cpu cpuname F devicefile Gnum cn OVavw I listfile o output file file Input the command line like this volatile option must be cleared before section change Do not execute section
247. ile names specified by an argument upon starting the Id is different from the sequence specified by the mapping directive the sequence specified by the argument takes precedence Figure 3 18 General Format to Link Object Files output section name section type A section attribute A input section name file name A file name For example when object files lei o file2 0 and file3 o that include the sections in the sequence shown in Figure 3 20 are linked by specifying the directive shown in Figure 3 19 the object files are linked in the format shown in Figure 3 20 Figure 3 19 Example of Commands for Linking Object Files SEG LOAD RW secl SPROGBITS AW secl filel o file3 0 file2 o sec3 SPROGBITS AWG sech file2 o SNOBITS PAW sech file2 o sec4 Figure 3 20 Example of Linking Object Files file2 o SEG file3 0 segment Lower address 60 A segment is not created for section sec but is linked after segment SEG in the sequence in which it appears 289 3 6 Symbol Directive This section explains the feature configuration and usage of the symbol directive 3 6 1 Feature of symbol directive The symbol directive can be used to instruct the following item of information Note that the element pointer ep exists only in the V850 Family e Creating a text pointer symbol tp symbol having the address value to be set to the text pointer tp as a v
248. ile1 o file2 0 Outputs the version number of the Id850 and the execution status of linking of object files lei o and file2 o 251 24 w Suppresses output of warning message Format W Feature Does not output warning messages Outputs only fatal error messages Default assumption Outputs warning messages Example e 1d850 w file1 o file2 o0 Does not output warning messages while linking object files file1 o and file2 o 252 25 Specifies command file Format ctfile must not be followed by a blank space e Arguments to be specified can be described over two or more lines in the command file refer to page 161 but options and file names must be described on one line Feature Treats cfile as the command file e Describes the character string specified on the command line in the command file and specifies according to this command file Default assumption Assumes that a command file is not specified Example e 1Id850 cfile Links cfile as a command file The contents of cfile are as follows o ofile filel o file2 o 253 CHAPTER 3 LINK DIRECTIVE This chapter explains the link directives that can be used as instructions to the Id 3 1 Feature of Link Directive A link directive can be used to give the following information to the Id 1 Configuration and attribute of an output section that is created by linking input sections sections included in specified object files or in the cor
249. illegal use of static Storage area class specifier st atic is incorrectly used illegal use of register Storage area class specifier register is incorrectly used illegal use of extern Storage area class specifier extern is incorrectly used Void function cannot return value A return value is specified for a void type function Function has illegal storage class The storage class specified for the function is incorrect Array of function is now allowed An array of functions is disallowed 179 E2283 E2284 E2285 E2286 E2288 E2290 E2292 E2296 E2300 E2301 E2303 E2304 E2305 E2401 E2402 180 illegal return type function The return value of a function must not be used as a function type illegal return type array The return value of a function must not be used as an array type Void in parameter list void type is specified within the arrangement of the argument declaration of the function declaration void type can be used only singly Function requires return value No return value is specified for a function having a return value return type mismatch type type2 The type of return value type2 indicated by the return statement does not match return type type of the function argument type mismatch type7 type2 The type of actual argument type 2 does not match the type of dummy argument type at the time of the function
250. indow and the CA commands internal commands of VSH and execution commands of Windows can be used on the command line 3 2 Activation of VSH To activate VSH click the VSH icon twice that was registered when this compiler package was installed Figure 3 1 VSH Window SC TN vsh Eaveh Of ES Edit History Alias Set Option Help c gt E It is not possible to activate more than one VSH shell at the same time 84 3 3 Function of VSH VSH includes the following features e Enables command line editing e Enables displays that can be scrolled vertically and horizontally e Includes a history function to recall previous input e Includes an alias function to assign aliases for command names e Supports 31 types of internal commands refer to page 102 e Supports commands from MS DOS applications that include Windows type executable files and PIF program information files as external commands Note that although VSH is a shell like a command com of MS DOS it is a Windows based utility which means that MS DOS commands cannot be activated directly from the VSH shell 85 3 3 1 Command line editing function When the VSH window is displayed internal commands execution commands of Windows and CA commands can be input via the command line interface at the blinking cursor position From the VSH window ordinary character keys and several edit keys can be used for command line editing Table 3 1 lists the edit keys CAUTIO
251. ine language instruction or data 14 Refer to C Compiler Package User s Manual Assembly Language of each family 209 CHAPTER 4 MESSAGES This chapter lists the messages output by the as in alphabetical order Some messages are not output depending on the family used The italic characters in the output messages and explanatory statements are determined during command processing 4 1 Message Format The as outputs the messages in the following formats as file name message 4 2 Messages must be followed by defined symbol An identification name other than a symbol or undefined symbol name is specified after else unexpected The pseudo instruction corresponding to the else pseudo instruction does not exist endif unexpected The pseudo instruction corresponding to the endif pseudo instruction does not exist endif unmatched The pseudo instruction corresponding to the conditional assemble pseudo instruction does not exist endm unexpected The pseudo instruction corresponding to the endm pseudo instruction does not exist exitm not in repeat irepeat The exitm pseudo instruction is not enclosed by repetitive assemble pseudo instructions exitma not in repeat irepeat The exitma pseudo instruction is not enclosed by repetitive assemble pseudo instructions if ifn etc too deeply nested A conditional assemble pseudo instruction is nested 17 times or more option volatile not found The assembler c
252. ined in the definition of the function and at the part where inline expansion is executed In this case a label multiple defined error occurs The functions specified by pragma block interrupt pragma interrupt pragma rtos_interrupt pragma rtos_task pragma text and pragma itext do not execute inline expansion At this time messages are not output Executes optional optimization Execute powerful optimization such as code scheduling and redundant instruction elimination However the compile speed drops Ol is valid when specified with optimization level 2 or above ra N Caution Source file are compiled from the Project Manager one file at a time Therefore the source files are not merged and optimized even if size priority Os or execution time priority Ot optimization is specified On the other hand when source files are compiled from the VSH command line with Os or Ot specified with two or more source files input the files are merged and optimized In other words the sequence of the functions of the other files are re arranged and the functions of the other files are expanded in line To merge files compile the files on the VSH command line A As shown above although there are many levels and parameters involved in optimization of ca the basic methods when specifying optimization are as follows e Emphasize size e Emphasize execution speed even at the expense of size Although nearly all of th
253. ing object files The ca performs processing in the following sequence refer to Figure 1 1 1 2 The front end cafe performs macro expansion and comment processing of a C source program and converts the program into an intermediate language OPTIC program The pre optimizer popt re arranges the functions in the intermediate language OPTIC program If this command is activated from the VSH command line and if size priority or execution speed priority optimization is specified two or more intermediate language OPTIC programs are merged into one If execution speed priority optimization is specified inline expansion of the functions in the intermediate language OPTIC program is executed The global optimization module opt optimizes the intermediate language OPTIC program The code generation module cgen converts the intermediate language OPTIC program into an assembly language source program The machine dependent optimization module impr optimizes the assembly language source program The assembler as converts the assembly language source program into machine language instructions and creates a relocatable object file The link editor Id links the relocatable object file and creates an executable object file 1 The processing flow slightly differs depending the specified optimization level as shown in Figure 1 1 2 Because one file is compiled at a time when it is compiled from the Project Manager files are not
254. ing cannot be executed because a target device is not specified duplicated cpu type A target device specifications is duplicated by an option or the pragma directive 189 F2623 F2624 F2625 F2626 F5001 F5005 F5104 F5106 F5901 F5902 F6000 F6002 F6005 F6203 F6300 190 cannot find device file A device file corresponding to the specified target device is not found or a wrong target device has been specified device file read error Reading of the device file has failed The device file may have been destroyed illegal placement pragma cpu The position of the pragma directive that specifies a device name is illegal Describe the device specification before the syntax of the C language illegal cpu type type Correspondence of device specification is not established Specify a device corresponding to the C compiler that is used unknown option option An illegal option option is specified invalid argument of option option The argument of option option is illegal out of memory The memory capacity has run short exception exception occurred at compile time An exception exception related to floating point operations occurred during compiling cannot open file file File file cannot be opened cannot write file file errno num Error of error number num occurs while file fi e is written cannot open file file File file cannot be op
255. inues linking normally fatal error Fatal error The Id stops linking syntax error Error concerning syntax of link directive The Id stops linking 77 The Id does not output the messages of this type if it has been started with the w option specified 323 6 2 Messages The messages output by the Id are shown below in alphabetical order Note that some messages are not displayed depending on the family used is illegal Only cannot be specified can not allocate hash table Allocating the hash table has failed can not allocate memory number Allocated memory of number bytes has failed can not allocate memory builtin new error Allocating of a memory area has failed can not allocate symbol table entry page Allocating of a symbol table entry page has failed can not allocate vector table Allocating of a vector table has failed can not create output file file Output file file cannot be created can not find archive file file Archive file file cannot be found can not find archive member at offset offset specified in archive symbol table entry An archive member is not found at the position of the offset offset specified by the archive symbol table entry The chances are that the contents of the archive symbol table have been destroyed can not find devicefile The device file cannot be found can not find entry point symbol symbol specified with e option Symb
256. ion ceccececeeeeeeeeeeeeeeeceeeeeaeeeeeeeeaeeseaeeeaeeseaeeeeeseaeeseeseaeesieeseneeees 88 3 4 List of VSH Internal Commande kA 102 VOLUME 4 HANDLING ASSEMBLER 3 1 Section Attributes and Their Meanings ccceeecceeeceeeeeeeeeeeeeeeeeeeceeseaeeseeeeeaeeseeeeeaeeseaeeeeessaeeneeeeenees 209 VOLUME 5 HANDLING LINK EDITOR 3 1 Types 0f Sections Asien avai bia iin iden Sala ad natin din ah ae 257 3 2 Items That Can Be Specified and Their Specification Formats cccceesceeeeeeeseeeeeteneeeeeeeneereas 264 3 3 Default Value of Each Hem vicccsesccciecceeeecteceevcee eecueceeceedexienceeeccraes tun cvediceevecis dueeieelvnsdeviesoceovetigeeseaneeeses 265 3 4 Segment Attributes and Their Meanings ssseessesieseetesissitsttetitstnstrettnttnntrnstnntnnetnntnnennntnnennne nne 268 3 5 Items That Can Be Specified and Their Specification Formats A 278 3 6 Section Attributes and Their Meanings ccceeccseeceeeeeeeeeeeeeeeeeeeseeeeaeeseeeeaeeseeeeeaeeseaeeeeessaeseeeeenates 282 5 1 Special Symbols in Normal Object File 321 VOLUME 10 HANDLING ROM STORING PROCESSOR 1 1 APPENDIX A 1 A 2 A 3 B 1 B 2 B 3 B 4 B 5 B 6 B 7 20 Reserved Sections Packed by romp cceccesseceeeeeeeeeteaeeeeeeeaeecsaeeeaeeseeeeaeeeaeeeseeseaeeeeeseaeeeeeeseaeeed 380 Format of Section L EEAS E A T TT 409 Section Types Specifiable by CA830 0 eeceescecseeeeneeeseeeeeeeeaeeeaeeceaeeeaeeseaeeeaeeseaeesa
257. ion CA830 294 6 Segment name This is used to specify the segment to be created in creating the tp symbol or gp symbol e Specify a segment of gp relative reference as the subjected segment name of the gp symbol For example do not specify a segment that allocates the sedata sebss section e Specification of the subjected segment may be omitted If omitted all the sdata data sbss bss attribute sections in the object file are subjected If omitted and if a section of data bss attribute such as sedata sebss section and rO relative or ep relative reference is created that segment is also subjected to gp symbol creation and the value of the gp symbol can differ from that that has been expected When creating a section other than that of gp relative be sure to specify an appropriate segment as the subjected segment name of the gp symbol e To specify two or more segment names delimit each from the others by a blank space 295 3 6 4 Using symbol directive The tp symbol and gp symbol are created as follows e One each of the symbols is created for two or more segments e A segment is specified for one each of the symbols and one each of the symbols is created for each of those segments Only one ep symbol is created because it is an address of the internal RAM Figure 3 23 General Format to Create tp gp ep Symbols symbol name TP_SYMBOL A V address AA alignment condition segment name A segment name
258. ion has been specified static structures or external structure variable values greater than 16 bytes which have been allocated to a section in external memory are assigned to variables in the sidata section allocated in on chip data RAM and output bdld instructions during ca s assembly language creation This results in the following effects e The size of the command code needed for transferring is reduced e If the external memory data to be transferred is not in a cache it can be transferred more quickly e If the target data size is a multiple of 16 bytes the cache contents do not change Description example of bdld instruction output using option struct data int i 4 hi struct test struct data image pragma section sidata begin struct data a Transfer destination allocated to sidata section by C compiler pragma section sidata end struct test b void func a b image 166 Output assembly language sbss com ee Ly kG Sidata align 16 globl a 16 zdi space 16 text _func movea a zero r10 movea SD Gpr ELI bdld r11 r10 Cautions e When this option has been specified not only static structures and external structures that are at least 16 bytes long but also static arrays and external arrays that are at least 16 bytes long are aligned into 16 byte segments Accordingly some of the data area is wasted which may increase the overall code size
259. ious line or may be greater than the address of an executable instruction in a subsequent line 165 2 2 4 Output of bdid instruction V830 In the above example the scope of a is the entire function f However a is used only between address 1 and address 2 In this case if a is allocated to a register and optimization causes it to be deleted from the stack frame a will become invisible outside of the area between address 1 and address 2 This phenomenon occurs in order to make more efficient use of registers by making the register where a has been allocated available except for the section between address 1 and address 2 for allocation of other variables 5 Note that since the debugger does not support optimization results from the assembler such results cannot be used as information for debugging 6 During compilation the processing of debugging information uses a large amount of memory which may cause an out of memory condition to occur 7 Step execution cannot be performed when using sections that have been merged into one line during inline expansion 8 Step execution cannot be performed when using sections that have been merged into one main loop section during loop unrolling Also the merging of loops into one main loop section means that the number of loops that exist after expansion rather than the number of loops that had existed before expansion When the Xbdld opt
260. irective The configuration of the symbol directive is as follows Figure 3 21 Configuration of Symbol Directive symbol name symbol type amp base symbol name A V address AA alignment condition segment name A segment name The value of the created gp symbol is determined by the following rules refer to Figure 3 22 Specified address if an address is specified Offset from the address specified by the following rules from an address indicated by a tp symbol if an address is not specified if the tp symbol is specified by specification of a base symbol name and if the specified tp symbol exists An address of the first address of an sdata attribute section 32 Kbytes allocated to the lowest address of the subjected segment if the sdata attribute section exists in the segment An address of the first address of an sbss attribute section gt 32 Kbytes allocated to the lowest address of the subjected segment if the above condition is not satisfied and if the sbss attribute section exists in the segment An address of the first address of a data attribute section 32 Kbytes allocated to the lowest address of the subjected segment if the above condition is not satisfied and if the data attribute section exists in the segment An address of the first address of a bss attribute section 32 Kbytes allocated to the lowest address of the subjected segment if the above condition is not sa
261. is complete bug free and up to date we readily accept that From errors may occur Despite all the care and precautions we ve taken you may Name encounter problems in the documentation Please complete this form whenever Company you d like to report errors or suggest improvements to us Tel FAX Address North America NEC Electronics Inc Corporate Communications Dept Fax 1 800 729 9288 1 408 588 6130 Europe NEC Electronics Europe GmbH Technical Documentation Dept Fax 49 211 6503 274 South America NEC do Brasil S A Fax 55 11 6465 6829 Hong Kong Philippines Oceania NEC Electronics Hong Kong Ltd Fax 852 2886 9022 9044 Korea NEC Electronics Hong Kong Ltd Seoul Branch Fax 02 528 4411 Taiwan NEC Electronics Taiwan Ltd Fax 02 719 5951 Thank you for your kind support Asian Nations except Philippines NEC Electronics Singapore Pte Ltd Fax 65 250 3583 Japan NEC Corporation Semiconductor Solution Engineering Division Technical Information Support Dept Fax 044 548 7900 would like to report the following error make the following suggestion Document title Document number Page number If possible please fax the referenced page or drawing Document Rating Clarity Technical Accuracy Organization Excellent
262. is used to specify a filling value illegal ELF file type must be relocatable or shared library file The file types of the object file that can be treated as an input file are only the relocatable object file or library file illegal ELF version The ELF version of the specified object file is not the version that can be handled by the Id 326 illegal linkage status number Illegal linkage status number occurs The chances are that the symbol type of the symbol table entry is illegal illegal operand access width mismatch An internal peripheral function register with a different access width is specified as the operand illegal operand cannot read I O register which does not have read access The internal peripheral function register specified as the operand is inhibited from being read illegal operand cannot use bit I O register A flag bit of an internal peripheral function register must not be specified as an operand illegal operand cannot write I O register which does not have write access The internal peripheral function register specified as the operand is inhibited from being written illegal operand inconsistent bit position The bit position specified by the bit manipulation instruction contradicts illegal target machine byte order The byte order of the input file is not the byte order that can be handled by the Id illegal target machine class The class of the input file cannot be handled by the Id il
263. ity optimization e Expansion of strcpy If the target application makes frequent use of the strcpy function for copying character strings specifying the Xi option to perform expansion of strcpy can shorten execution time However it will increase the code size 36 Refer to V800 Series C Compiler Package User s Manual C Language 37 Refer to page 408 164 3 Reducing code size during execution time priority optimization Ot Wp r In some cases merging of source files during inline expansion results in the generation of unnecessary functions In such cases specifying the Wp r options refer to page 172 can reduce unnecessary functions and thereby reduce the code size 2 2 3 Effects of debugging on optimization Note with caution that optimization can have the following effects when using the source debugger Optimization level 1 O1 1 Copy propagation and common subexpression elimination can eliminate variable references where they appear in the source program and have an effect on the debugging information that the debugger uses Optimization level 2 O2 1 The line number information is also changed for lines which contained statements that have been deleted or rearranged The variables range of existence and positions may have changed which can have an effect on the debugging information that the debugger uses Optimization level 3 O3 Execution time priority optimiz
264. ixed to the name of the specified file 200 CHAPTER 2 OPERATION This chapter explains how to operate the as 2 1 Command Input Format from VSH Command Line The as is started from the ca as the default assumption It can also be started in the following format as A option A file name Can be omitted Pattern in immediately before can be repeated A One or more blank spaces 2 2 Types and Features of Options 2 2 1 Option list The following table lists the options of the as To pass the following options from the ca to as as they are Wa must be specified with the ca when starting from VSH Some options which are listed on the following options but not present in the option dialog in the Project Manager exist When such options are required to be specified start the as from VSH 1 Optimization option This specification sets option related to optimization Performs optimization to rearrange instructions while avoiding hazards related to registers and flags refer to g option 201 2 Output options These specifications set options related to object code that is output by the assembler Specification Format Feature This option specifies inheritance of V810 Family instructions for assembly The output instruction code is the same as the V810 Family s floating point operation instruction and bit string instruction and an emulation library is used for processing If this option is omitt
265. ject have been specified It can be selected when options are specified by selecting source files via the Project Manager s lt lt Source List gt gt dialog When itis selected this button deletes any options specified for a particular source file and applies only overall options Ignores the specified items and closes the dialog Opens the Help window 65 Setting other options Figure 2 18 Other Option Settings Dialog Assembler Assembler Options x 1 Option 2 Option2 Any Option M Use Temporary Command File Command Line Options cpu 3000 g Delete Source Option Cancel Help 1 Options Any Option Use Temporary Command File Command Line Options To avoid CPU fault P option can be described refer to page 206 3 V850 The other descriptions are not supported at present In the Windows environment the length of character strings used to specify options for command is restricted to 126 characters If this check box is selected the option character string is temporarily output to a command file refer to page 161 which enables the operation to be completed without observing the restriction on the character string length This option is checked as default assumption Displays assembler options set in each dialog with the command line options This area is for reference and writing is disabled 23 For whether the fault that has occurred is of
266. l Information Some information contained in this document may vary from country to country Before using any NEC product in your application please contact the NEC office in your country to obtain a list of authorized representatives and distributors They will verify e Device availability e Ordering information e Product release schedule e Availability of related technical literature e Development environment specifications for example specifications for third party tools and components host computers power plugs AC supply voltages and so forth e Network requirements In addition trademarks registered trademarks export restrictions and other legal issues may also vary from country to country NEC Electronics Inc U S Santa Clara California Tel 408 588 6000 800 366 9782 Fax 408 588 6130 800 729 9288 NEC Electronics Germany GmbH Duesseldorf Germany Tel 0211 65 03 02 Fax 0211 65 03 490 NEC Electronics UK Ltd Milton Keynes UK Tel 01908 691 133 Fax 01908 670 290 NEC Electronics Italiana s r 1 Milano Italy Tel 02 66 75 41 Fax 02 66 75 42 99 NEC Electronics Germany GmbH Benelux Office Eindhoven The Netherlands Tel 040 2445845 Fax 040 2444580 NEC Electronics France S A Velizy Villacoublay France Tel 01 30 67 58 00 Fax 01 30 67 58 99 NEC Electronics France S A Spain Office Madrid Spain Tel 01 504 2787 Fax 01 504 2860 NEC Electronics Germany
267. l nt F Delete text Attribute Section d T Output Memory Map m Cancel Help 1 Options Packing Section p The contents of the specified section and the corresponding address and size data are entered in the rompsec section If the specified section does not exist in the object file a message is output and processing is stopped If this option is omitted it is assumed that all sections that contain a data attribute or sdata attribute have been specified In addition for the CA830 the text attribute section for the interrupt allocated to on chip instruction RAM and the itext section is also assumed as being specified When several sections have been specified use a semicolon to separate the specified sections The specified sections are entered to the rompsec section in the order they were specified This area uses the drop down list type of display to list all sections that have been specified once up to 10 sections Either click on the desired section or use the arrow keys to select it Entry Label b The specified label value is used as the first address of the created rompsec section If the specified label does not exist in an object file a message is output and processing is stopped If this option is omitted it is assumed that__S_romp has been specified This area uses the drop down list type of display to list all labels that have been specified once up to 10 labels Either click o
268. lays file contents using numbers and ASCII characters When addresses are specified the contents within the specified address range are displayed If a start address is specified an end address specification cannot be omitted Examples A gt DUMP A OUT lt Displays the complete contents of the A OUT file in the 00000000 TE is 46 426 02 OL A gt DUMP D MAIN o 80 00000050 00 30 06 50 23 FF current directory lt Displays using decimal numbers the contents from address 80 to the end of the MAIN O file in the current directory 116 ECHO Display character string ECHO ECHO Summary Display character string Synopsis ECHO character string Description This command displays the specified character string Examples A gt ECHO ABCde lt Displays ABCde ABCde 117 ERASE Delete file ERASE ERASE Summary Delete file Synopsis ERASE A option A drive path filename Options IY Deletes without opening a dialog box to prompt for confirmation I Y Opens a dialog box to prompt for confirmation before deleting default Description This command deletes the specified file s The ERASE command contains the same function as the DEL command does Examples A gt ERASE B WORK FILE C lt Deletes FILE C in the WORK directory of the drive B A
269. le specifies the name of a file which receives the assemble list that is created when the a option has been specified If the a option has not been specified this option is invalid If this option is omitted and the a option has been specified the created assemble list is output to standard output This is the name of the object file from which ofile is created If this option is omitted the extension S is replaced by o so that the created object file name is created from the name of the input file This option can be specified only when starting from VSH cfile This option handles cfile as a command file refer to page 161 If this option is omitted it is assumed that no command file has been specified 9 The as handles the directory at the dev position from the ass installation directory as the standard directory of the device file 10 Refer to User s Manual Assembly Language This option can be specified by the cpu option or the option pseudo instruction If both are specified but have different contents specification by the cpu option takes priority For details of pseudo instructions refer to C Compiler Package User s Manual Assembly Language of each family Refer to the device file s User s Manual for description of devices that can be specified as devicefile The output object name cannot be specified from the Project Manager s option dialog The file name is always created from the name o
270. led too long argument Arguments exceed 128 bytes when starting module The arguments must be command file file illegal output file name The output file name file specified by the o option must not be the same as an input file name Change file cannot open file file File file cannot be opened cannot create temporary directory A work directory for creating the temporary file cannot be created cannot open temporary file file Temporary file file cannot be opened file illegal output file name of Xcre_sec_data The output file name file specified by option Xcre_sec_data must not be the same as an input file name Change file V850 illegal command path The specified command path is incorrect 187 F2002 F2003 F2004 F2005 F2006 F2007 F2010 F2011 F2020 F2040 F2105 F2106 F2110 F2112 188 compiler limit too long command path num Compiler limit The length of the specified path exceeds the limit The maximum value of this processing system is 1024 out of memory The memory capacity has run short too many errors Compiling has stopped because errors exceeding the specified number of times have occurred cannot open output file file Output file file cannot be opened cannot open input file file Input file file cannot be opened cannot write file file errno num Error of error number num occurs while fil
271. lee differ during inline expansion Return value type mismatch is detected where caller calls callee The types of the return values of caller and callee differ during inline expansion interrupt request name already specified Interrupt request name name has already been specified inconsistent section for symbof The section contradicts symbol out of memory The memory capacity has run short cannot recover from previous errors Processing cannot continue as a result of an error that previously occurred F1102 F1103 F1104 F1105 F1106 F1201 F1202 F1203 F1292 F1302 F1303 F1304 F1306 F1309 F2001 invalid argument of option option The argument of option option is illegal nested command file file Command file file is nested It must not be nested Argument of reg option requires 26 or 22 Specify either 26 or 22 as the argument of the reg option cannot use option option with option2 option Options option and option2 must not be specified at the same time cannot specify output file name of Xcre_sec_data with many source files When inputting two or more source files the output file name of option Xcre_sec_data must not be specified V850 fork failed The fork of the process failed module not found module module that must be started cannot be found module exec failed Execution of module module has fai
272. legal target machine type The type of the input file cannot be handled by the Id string in segment directive of non LOAD segment is illegal string must not be specified in the segment directive that does not specify LOAD as the segment type input files have different register modes A file with a different register mode is input library path is too long path maximum size is 576 The path for search is too long The path for specification should be 576 characters or less line num is expected P is necessary line num or is expected to follow name The name that begins a directive must be followed by or line num is expected at the end of directive is necessary at the end of the directive line num is expected to follow section name on is necessary at the end of an output section name 327 line num aligned odd value number to be even value number2 Odd value number 7 is aligned to even value number2 line num illegal character number An illegal character number exists in the link directive line num illegal section attribute character character that must not be specified as a section attribute is specified line num illegal section type string string that must not be specified as a section type is specified line num illegal segment type string string that must not be specified as a se
273. les of using the hx e To output converted hex format to a specified file hx850 fT Sxz o tek hex a out Converts object file a out to the expanded Tek hex format and outputs the file to file tek hex At this time the symbol table including the local symbols is also converted and output Moreover as many null characters 0 as the size of a section for data with no initial value specified for example bas section and sbss section are generated e To output converted hex format to standard output hx850 fl l text a out Converts the code of the text section in object file a out into the Intel expanded hex format and outputs it to the standard output 345 CHAPTER 3 TYPES OF OUTPUT FILES This chapter explains the type of the output files of the hx 3 1 Intel Expanded Hex Format A file in the Intel expanded hex format consists of four types of records start address record expanded address record data record and end record Figure 3 1 shows the file configuration in the Intel expanded hex format Figure 3 1 File Configuration in Intel Expanded Hex Format Start address record Expanded address record Data record Data record Expanded address record Data record Data record End record 9 Each record is output in ASCII code 10 The expanded address record and data record are repeated 346 Each record consists of fields as follows CC AAAA TT field SS NL a ID
274. library eccceecceeessceneseeeeeeeeeeeesseenes 242 Register mode cceccceseeeeseeceeeseeeeeeeeeeeeeteeneneeeerees 53 Register mode information sses 365 Relocation information eecesseeeesereteeneeeeeneees 365 Remove directory cccceeeeeeeeeeeeeteeeeeeeeeeeeaes 129 134 REN EE 130 DEN A E E E A A E E EE A EE 131 Rename directory assssssssrnesercssricesnnerenarrineeransennnnnnn 132 Rename fileco ersen ae rs eaea 130 131 RENDIR ivres riedi ebai e a ei e tects chess 132 Reserved section 257 321 421 Reserved symbol ccccccceeeeeeteeeeeeteeeeaees 221 320 DM E AEEA eebe EE 133 Kiel E 134 ROM Storing EE 378 FOIMPSEC SECON niine 386 S El ME 379 Save push directory Stack ceceseeeeseeseeeteeeeeeees 127 SDSS section 156 250 321 345 sbss attribute section 202 226 257 292 SCONSE SECTION ccccccceeeeeeeeeeeeee 266 279 314 321 Zare ebe gedet uereg eege tha meets 94 data Section cccccccccccccceceseessececeeeeeeeeeaeneess 156 321 sdata attribute section 202 226 257 287 292 TR UE 29 Gebees SECTION cccccceceeeeeeeeeeeee 266 279 314 321 SOCOM E 256 418 Section attribute oo eee eeeeeeeeeceeeeeeessaeeeeeeeatees 415 ee el 408 Section header table 364 Section header table Index 419 Section VPC fa ed keris ce aie 416 417 sedata SECTION cccccceeeeeeeeeeeeee 266 279 314 321 Segments eege e gen tis bide 25
275. list and specifies a file name when the frequency information file is created The VSH specifies this option with file for each C source file The C source file is compiled one at a time with c specified 2 For details of using the optimization function refer to page 162 3 Specify a decimal number as the num value The range of values that can be specified as num are output by the Id A option 4 Refer to V800 Series C Compiler Package User s Manual C Language 5 The output comments are for reference only and do not necessarily correspond exactly to the code For example comments concerning global variables local variables function declarations etc may be output to incorrect positions If the optimization level is 1 the code may be deleted and only the comment will remain P Frequency data for variables in C source files is output Nothing is done to an assembler source file 156 Specification Format Feature This option sets a four byte alignment condition for arrays including character strings and structures and converts strcpy function calls to block transfers This increases the objects execution speed but it also increases the code size This option uses the jmp instruction to perform a branch for an ordinary interrupt function defined in C language or for the RTOS interrupt handler If the number of functions is in the range that cannot be branched by the jr instruction and Id output
276. loses a file name with the directory where the source file exists is searched first For the details of file search of header file loading refer to V800 Series C Compiler Package User s Manual C Language 44 2 Buttons Undefine Macro U Limit of Number of Macro Xm Use Trigraph t Use C Style Comment Xcxxcom OK Delete Source Option Cancel Help This area uses the drop down list type of display to list all macros that have been specified at least once up to 10 macros To select a macro either click the desired macro or use the arrow keys to select it Use this to specify the macro name name to be rendered invalid It is assumed that undef name is entered before a C language source program When specifying several macros to be rendered invalid separate them with a semicolon This area uses the drop down list type of display to list all macros that have been rendered invalid up to 10 macros To select a macro either click the desired macro or use the arrow keys to select it Specifies the upper limit of the number of macro identifiers with a decimal number of up to 32767 The default value is 2047 Replaces the trigraph series In addition to ordinary comments this allows any text from to the end of the line to be handled as comments C comment style Enables the specified items and closes the dialog
277. lt PRJTMAKEss or click the Run menu and Stop Build in the Project Manager 81 82 2 Rebuild The rebuild function can be selected via the following operation e Click the Run menu Click Rebuild When the rebuild function is selected a make file is generated and all objects that are make targets are newly generated This function is the same as the build function except that make files are generated unconditionally i e regardless of whether or not the source files and option settings have been changed 3 Build specified target This function can be selected via the following operation e Click the Run menu Click Build Target Click target for build using the displayed dialog Click Build When build specified target has been selected a make file is generated and only the make target that has been specified among the several make targets is newly generated This function is the same as the build function except that only the specified target is generated unconditionally 83 CHAPTER 3 USE OF COMMAND SHELL This chapter describes how to operate the VSH command shell and activate the VSH internal command and CA command 3 1 What is VSH VSH is a utility that is provided for activating the CA commands which are applications by the command line interface on Windows Activate VSH on the Windows to open the VSH w
278. lt files gt lt file_name gt Not described lt names gt lt segment_name gt Legal segment name character string Legal section name character string Legal file name character string Legal symbol name character string Legal octal decimal nexadecimal number character string 317 CHAPTER 4 LINK MAP This chapter explains the link map output by the Id If the Id is started with the display option m of the link map specified it outputs a link map indicating the locations of sections to the standard output Figure 4 1 shows an output example of the link map that is output if object files crtN o main o and func o are linked with specified reference of archive file libc a Figure 4 1 Output Example of Link Map O UTPUT ECTION We eet sdata sbss symtab strtab shstrtab 1 I KKK KKK LINK PUT ECTION text text peat text sdata sbss sbss symtab strtab shstrtab 2 VIRTUAL ADDRESS 0x00000000 0x00000000 0x0000001c 0x00000048 0x00000060 0x00000088 0x00000088 0x00000098 0x00000098 0x0000009c 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3 SIZE 0x00000082 0x0000001la 0x0000002c 0x00000018 0x00000022 0x0000000e 0x0000000e 0x00000008 0x00000004 0x00000004 0x000001a0 0x000001a0 0x000000b5 0x000000b5 0x0000002e 0x0000002e 4 EDITOR ALLOCATION MAP x xxx
279. maller of the two is first This option specifies the section file name for output of name If this option is omitted the section file is output to standard output 8 For details of comments refer to page 403 402 Specification Format Feature This option arranges the variable names in section files to be output in the order of the dictionary of the variable names If two variables have the same name they are arranged in the order of the dictionary of their file names and function names ssection This option arranges the variable names in section files to be output in the order of the dictionary of the section names where they are allocated If two variables have the same section name they are arranged in the order of their highest use frequency This option arranges the variable names in section files to be output according to their size smallest first If two variables have the same size they are arranged in the order of their highest use frequency This option displays the execution process of the section file generator This option handles cfile as a command file refer to page 161 If this option is omitted it is assumed that no command file has been specified Caution Some of the above options are invalid if specified with the other options at the same time e If two or more options related to sorting o and cl are specified the one specified later is valid and the others are
280. mber of a set illegal LHS of operator operator must be modifiable L value An illegal substitution destination is described to the left of operator operator illegal type combination for operator type type2 The combination of types for the operator operator type and type2 is incorrect Operands of operator operator must have same type type7 type2 Use the same type type and type2 for the right and left of the operator operator Operand of must be function type The operand of the operator must be a function Operand of operator must be pointer type The operand of the operator operator must be of pointer type Operand of must be struct union object Use the operator for a structure or union Operand of gt must be pointer to struct union object Use the gt operator for the pointer to a structure or union Operand of sizeof must not be function nor bit field The operand of sizeof cannot specify a function or bit field unknown size struct union or array A set whose size is unknown is specified for an operator requiring object size unknown size function A function whose size is unknown is specified for an operator requiring for object size cannot convert non L value array to pointer An array which is not a left side value cannot be converted into a pointer unrecognized interrupt request name nam
281. me path When using 5 in Synopsis this command is the same as the RENAME and REN commands 123 MOVE Move file MOVE Examples A gt MOVE FILE1 C TMP FILE2 C lt Moves FILE1 C to FILE2 C in the TMP directory A gt MOVE B WORK TMP lt Moves all files in the WORK directory of the drive B to the TMP directory of the drive A A gt MOVE B WORK FILE C TMP lt Moves FILE C in the WORK directory of the drive B to the TMP directory of the drive A A gt MOVE WORK TMP lt Changes the WORK directory in the drive A to TMP directory in the same drive A gt MOVE WORK FILE1 C FILE2 C lt Changes FILE1 C in the WORK directory of the drive A to FILE2 C in the same directory 124 MV Move file MV MV Summary Move file Synopsis 1 2 3 4 5 MV A option A drive path filename1 A drive path filename2 MYV A option A drive path1 A drive path2 MV A option A drive path filename A drive path MV A option A drive pathi A path2 MV A option A drive path filename1 A filename2 Options f i Forcibly moves file even when move destination file is a read only file Opens a dialog box to prompt for confirmation before replacing existing file s at move destination Description When using 1 in Synopsis this command moves the specified filename1 to filename
282. ment following num is not specified in function call function E2421 unexpected argument num for function call function Excess argument is specified after num in function call function E2422 undefined static function function Called static function function is not defined in a file E2510 cannot cast type to type2 Casting from type to type2 cannot be executed E2511 expression must be arithmetic or pointer type expression must be of arithmetic or pointer type E2512 expression must be arithmetic type expression must be of arithmetic type E2513 expression must be pointer type or zero expression must be of pointer type or zero E2515 expression must be integral type expression must be of integer type E2516 expression must be constant expression expression must be a constant expression E2517 One of the operands for must be pointer type and the other must be of integral type One of the operands for must be of pointer type and the other must be of integer type E2518 illegal operand for unary amp The operand of the unary operand is incorrect 181 E2519 E2522 E2523 E2524 E2526 E2530 E2532 E2533 E2535 E2550 E2551 E2552 E2553 E2630 E2631 E2632 182 exception has occurred at compile time Exception exception related to floating point operation occurred during compiling name is not a member name is not a me
283. mpiler package directory libxxx and r32 under libxxx in Figure 2 1 is called the standard directory for the library directory incxxx is called the standard directory for the include file and the standard directory for the device file becomes the dev directory in the same level 27 2 4 Library File The header files and standard mathematical libraries of this compiler package are libc in the following copyright statement transplanted by Cygnus Support for the V810 Family and then by NEC Corporation for the V830 Family and V850 Family S Copyright 1992 1993 1994 Cygnus Support libc includes software developed by Berkley University in California and others Copying this document and distributing the copy are permitted only if the copyright statement and this permission statement remain in all copies The permission to copy and distribute copies of the revised edition of this document verbatim is granted under the conditions of the GNU General Public License This GNU General Public License includes a stipulation that all the results obtained by using libc are to be distributed according to the same permission statement The permission to translate this document into other languages and to copy and distribute the copy of the translated version is granted under the condition of the revised edition mentioned above This document in the above mentioned statement means an explanation of each function i
284. n type overflowed relocation field The value value relocated by a relocation entry file file section section offset offset relocation type relocation type exceeds the range of the relocation field The chances are that the sdata sbss attribute section is allocated exceeding the memory range that can be referenced by 16 bit displacement refer to page 226 330 relocation entry in relocation section section used to relocate section section2 has illegal r_offset offset ignored The entry in relocation information section section used for relocation of section section2 has illegal relocation offset offset This entry is ignored relocation entry in section section has unknown relocation type number ignored this entry The relocation entry in section section has an illegal relocation type number This entry is ignored section attribute attribute of section section and segment attribute attribute of segment segment do not match The section attribute attribute of section section does not agree with the segment attribute of segment segment to which this section is specified to be allocated section section has unknown section type number Section section has illegal section type number section section with section type section type not supported ignored Section with section name section having section type section type is not supported by the Id and is ignored segm
285. n be specified only when starting from VSH cfile This option handles cfile as a command file refer to page 161 If this option is omitted it is assumed that no command file has been specified Id handles the directory at the dev position from the de installation directory as the standard directory of the device file Id handles all directories from the de installation directory to the directory at the libxxx position and the directory at the libxxx r32 position as the standard directories for libraries Refer to the device file s User s Manual for description of device types that can be specified as devicename Specify library links after the object file links Also specify the Ic link for standard libraries after the Im link for mathematical libraries in the order of m c in the option dialog 10 Refer to V800 Series C Compiler Package User s Manual C Language 223 2 Check options These specifications set check related options for linking Specification Format Feature This option ignores several kinds of errors that occur during relocation processing If this option is omitted a message is output and link processing stops This option outputs a message to all external symbols defined in duplicate and stops link processing If this option is omitted a message is output to the first external symbol defined in duplicate and link processing is stopped This option does not
286. n object file in the ELF format A segment is the minimum unit in which a program is loaded to memory and consists of two or more linked sections each having the same attribute refer to page 264 422 A LE et gie EE 282 leegent Metadata a de 91 Alignment condition 211 Check inorde ii ee Aes 250 Archive header cceccececeeeeeecneeeeeeeeeeneeeeeeeeseneneeees 363 Archive string table AA 363 Archive symbol table AAA 363 Assemble Jet 202 208 Assembler reserved register ri 216 ATTRIB Sei e a 104 Auto generation of make le 81 Automatic location of interrupt handler 270 283 305 B Binary dUMpP ince heat ae eet 116 leet SET 419 DSS SECHON vivid saene 250 321 345 bss attribDUte sechon 257 287 292 110 e ETE E eee enc Peer E AAA AE 81 Build specified target AN 83 Cc CAT EE 105 E BEE 106 Cdatal sectionis seiate 266 279 314 321 cdata2 section ccccccceeeeeeeeeeeeee 266 279 314 321 cdata3 section cccccccceeeeeeeeseeeee 266 279 314 321 Change display current directory 00 106 107 Change view file attributes 0 ee eeeeeeeeeeeneeeeeeee 104 CHDIR scene niet apes ake eat es ae 107 Code generation module sssssssssssseeeeinsseeneene 148 175 Colors tess erte EE 96 CGommand le 101 161 204 223 253 338 345 362 374 385 403 COMMON objet 205 Concatenate les 105 const sechlon 266 279 314 321 const attribute SECTION eee e
287. n the desired label or use the arrow keys to select it 77 78 2 Buttons Delete text Attribute Section d Ignore Address Repetition i Output Memory Map m OK Cancel Help This creates an object file that contains only a rompsec section without entering a section that contains a text attribute in the created file If this option is omitted a section that contains a text attribute is entered A duplication check is not performed between the addresses of input files and output files A memory map of the created object file is output to standard output Enables the specified items and closes the dialog Ignores the specified items and closes the dialog Opens the Help window Setting other options Figure 2 23 Other Option Settings Dialog ROM Storing Processor ROM Processor Options Ea 1 Option Any Option M Use Temporary Command File Command Line Options PT cme ms 1 Options Any Option This is not supported at present Use Temporary Command File In the Windows environment the length of character strings used to specify options for command is restricted to 126 characters If this check box is selected the option character string is temporarily output to a command file refer to page 161 which enables the operation to be completed without observing the restriction on the character string length This option is checked
288. nager to specify CA command options and to generate make files 2 1 What is the Project Manager The Project Manager is a control software program that helps Windows based programs run more efficiently and enables various operations from editing a source program to compiling executing and debugging to be performed in a series see Figure 2 1 Figure 2 1 Project Manager and Development Tools Project Manager Option settings for compiling Editor setting Build make project Additional source files Reference and edit e i For details of the Project Manager refer to the Project Manager User s Manual 33 2 2 Activation of Project Manager To activate the Project Manager use the lt lt Project Manager gt gt icon that was registered when this compiler package was installed Figure 2 2 Window for Activation of Project Manager 34 2 3 Project Settings The Project Manager manages the application modules to be developed and development environments in units of projects The Project Manager also manages settings for a project by recording them into a project file By setting a project a project file is generated by Project Manager The settings listed below which are required for creating application load modules are automatically recorded in the Project Manager e Required source files e Target device to be used e Editor and tools to be used Compile option
289. nally creates a virtual section GoCommon and temporarily allocates the data to this section Actual size of section The actual size of the section for which the area of the hole generated due to data alignment is considered Assumed size of section The size of the section that is assumed if the ca is started with the Gnum option specified with the value shown in the column at the right to this column is specified as num Because the calculation of this size assumes an alignment condition of more than 4 bytes without taking the actual alignment condition into consideration the value shown in this column does not necessarily agree with the actual size of the section actually created 23 Object file with the r option specified 228 e Value of num of Gnum option assumed The value of the Gnum option num upon starting ca and as that is assumed as a result of calculating assumed size of section shown on the column at the left to this column f Judgment result Result of judgment as to whether the size of the section falls in a range of 15 bits 0x0 to Ox7fff if the ca is started with the Gnum option specified with the value shown in the column at the left to this column as specified as num 4 If the size falls in the range OK is displayed if it does not nothing is displayed Default assumption Does not output Caution e The information output by this option is only a criterion and the result of the
290. ncluded in the standards and mathematical libraries explained in V800 Series C Compiler Package User s Manual C language The ROM storing library as well as the run time library and emulation library added to the standard library are the original functions of NEC Corporation 28 2 5 Cautions e This compiler package creates a temporary file used internally under the following directory The number indicates the priority To start from Project Manager 1 Work directory set by lt lt Other settings gt gt of lt lt Project Manager option setting gt gt dialog which is displayed by Option gt Project Manager Options 2 Directory specified by environmental variable TEMP 3 Root directory of current drive To start from the VSH command line 1 Directory specified by temp option of C compiler ca 2 Directory specified by environmental variable TEMP 3 Root directory of current drive e When file name is specified by the ca or Id both of and are regarded as delimiter of directory path When the drive name is omitted the files is searched in the following drives To start from Project Manager The number indicates the priority 1 Drive of work directory specified by lt lt Other settings gt gt of lt lt Project Manager option setting gt gt dialog 2 Drive of project directory specified by lt lt Project Setup gt gt dialog To start from the VSH comman
291. nd then in the standard directory when searching for the header file If this option is omitted only the standard directory is searched Uname When this option is specified it is assumed that undef name is entered before the C source program Xcexxcom In addition to ordinary comments this interprets all characters that appear after and before the end of the line as comments C comment style Xmnum This option specifies an upper limit for the number of macro identifiers A decimal value up to 32767 can be specified as num A default value of 2047 is used if this option is omitted This option replaces a trigraph sequence D The installation directory is incxxx directory When the file name is enclosed in double quotation marks the directory where the source file exists is searched first For details of file searching to fetch header files refer to V800 Series C Compiler Package User s Manual C Language This is a three character trigraph sequence that is replaced by single characters as stipulated in the ANSI standard Refer to the documents related to the ANSI standard 154 3 Language options These specifications set options related to switches available in the C language Specification Format Xbitfield string Feature This option specifies whether specifications in int type bit fields that do not indicate the type specifier signed or unsigned are regard
292. neseneeeeseeeneeseeees 221 Element pointer symbol 221 254 291 314 ELF header urasta sitet dd 364 413 Entry point address AAA 225 238 EP SYMBOL eiiiai hah otek ate 294 IS 118 Example of Mapping Image sses 259 E RER 119 Exit VSH ween nae eee ee a ee 119 External commande 85 100 External symbol ssssssessssessssssrressrrrrneessee 224 234 235 423 E E Hesse A Eege ege 150 SUIeA CH 225 239 254 Flow Of operation eee eeeseessseeeeeseeeeeeneeeeenneeeenaeees 148 Forced termination 0 cccccceceeseeceeeeeseeeeeeeeeeeeeaees 100 Front end EE 148 160 175 G Grattribute a ee ee ete 282 Global optimization module 148 159 173 175 Global pointer ccccceeseeeessteeeesteees 221 226 254 Global pointer symbol ssssssssas11 221 254 290 314 Global pointer table 0 ee eeeeeeeeeeeees 249 366 416 QP symbol value 00 eee eee eeeseeteeeeereeeeeenneereaes 292 EIS d TEE 294 H Helps ais tite ee i A eet 98 Hex file OUTPUT Gester ee de ee eet 138 HexTormat EE 343 Expanded Tek hex Tomat 352 e EI Be ee 353 symbol block vcc s scclaceeuse iene 353 termination block 355 Intel expanded hex Tomat 346 data TOGO icici ele nee ie 348 end r cotd EE 348 expanded address record cccceeeeeeeees 347 start address record seeren 347 Motorola S type hex Tomat 349 ele 90 History memory size eeeeeeeeeeeeeeneeeeeeaeeeeeeeeeeneeeeees 96 History SAVE size eee ceee
293. nment condition in linking undefined external symbols If a difference is found either of the following messages is output and linking continues normally warning symbol symbol has different size in file file warning symbol symbol has different align size in file file Caution e The Id supports multiple definition of undefined external symbols The multiple defined undefined external symbols are allocated to the sbss section or bes section after link If the symbol size or alignment condition to be linked differs the maximum size of the symbol among those to be linked is assumed as the size and the maximum common multiple of the alignment condition of the symbols having the same name of the symbols to be linked is assumed as the alignment condition Example e 1d850 t file1 o file2 o Does not check the size and alignment condition in linking undefined external symbols while linking object files nei o and file2 o 38 Symbol having a binding class of GLOBAL and section header table index of GRCOMMON or COMMON 39 Reserved section having a section name of sbss section type of NOBITS and section attribute of AWG 40 Reserved section having a section name of bss section type of NOBITS and section attribute of AW 250 23 v Outputs execution status Format V Feature Outputs the version number and execution status of the Id Default assumption Does not output Example e 1d850 v f
294. not aligned into 16 byte segments i pragma section sidata begin struct data a pragma section sidata end struct test b void func a b image 170 Output assembly language _func sbss Com Sidata align globl space vest movea SEs St et S E SE eR She TEE OS SEs Pre 207 16 16 zap 16 16 a zero S_b 4 gp EBL2 17 213 C13 Pri QP eT ge A rida Ss Biri 2 7 St 215 Seis SES ge t1 rlo L2 ri1 ELT E2 lt Member image is displayed as offset from the fourth byte of the structure 171 2 2 5 Argument of W option This section explains the option to be passed by the ca as an argument to each module For the options of the assembler as and link editor Id refer to the explanation on the options on page 201 and page 222 e Pre optimizer popt Wp D Gnum Nnum r funcname Reduces the capacity of the memory used for compiling Limits the stack size of the function subject to inline expansion to the size num in intermediate language and does not execute inline expansion of a function greater than num For the criterion of num refer to the explanation on the l option below If this option is not specified G32 is assumed Limits the intermediate language size of the function subject to inline expansion to num and does not execute inline expansion of a function greater than num Fo
295. ns a 0 if the target has been revised and returns a 1 if it has not been revised It is not executed This performs execution without displaying the command Specify the name of the target to be generated as target If this specification is omitted the first target written in the make file is generated For macro enter the macro to be defined using the syntax macro macrocharacterstring However when defining a macro from the command line blank characters cannot be included in macro character strings for example CA ca830 g is invalid Use a make file to make such definitions refer to page 144 141 4 4 Make Files This section describes the rules for describing make files that are used by VMAKE Note that VMAKE is not able to use make files that were generated via the Project Manager 4 4 1 Comments The symbol is used to indicate comments Lines that begin with are regarded as comments which are ignored during execution When a appears anywhere in a line the rest of the line is regarded as a comment 4 4 2 Continuation of lines NI is used to indicate continuation of a line If a appears at the end of a line other than a comment line the line is regarded as being continued onto the next line In such cases any blank spaces before the in the first continuation line the itself and any blank spaces in the next line ar
296. ntil the total section size of 256 bytes is reached and output to the section file However selection is stopped if the byte data have reached 128 bytes If this option is omitted all variables that have appeared are output to the section file V This option outputs the section file generator s version number to standard output and then terminates processing cl A num This option specifies the comment level of the section file to be output The following values can be specified as num 0 No comment output 1 Outputs file creation information date etc and variable information and its explanation The variable information includes the section name size and use frequency If the section name is not determined by an external variable is output Outputs a format guide in addition to level 1 If O has been specified variables judged not to fit in the tidata section are output as comments If this option is omitted comment level 1 is assumed This option outputs a description of the section file generator s options to standard output and then terminates processing This option is the same as the h option This option arranges variable names in section files to be output in the order they appear instead of sorting them If this option is omitted the variable names are arranged in order of highest use frequency If two variable names have the same amount of use frequency they are arranged so that the s
297. o the original position to enable ordinary input and editing operations The vertical scroll bar can also be operated from the keyboard Table 3 2 lists the scroll keys Table 3 2 Keys for Operating Vertical Scroll Bar Keys Function L T Scrolls one line downward Scrolls one line upward ROLL DOWN Scrolls one page downward ROLL UP Scrolls one page upward CTRL HOME Scrolls to top of scroll area CTRL HELP Scrolls to bottom of scroll area 2 Horizontal scroll When the entire width of the contents cannot be displayed in the window such as when the window is resized to a narrower width a horizontal scroll bar appears in the VSH window to enable the hidden contents to be viewed When scrolling backward the character cursor is temporarily deleted Pressing a character key or edit key returns the display to the original position to enable ordinary input and editing operations The horizontal scroll bar cannot be operated from the keyboard 87 3 3 3 History function The history function enables commands previously input from the command line to be recalled and reactivated This function can be executed from the keyboard or via a menu The following describes the keyboard operation for executing this function The menu based operation is described in page 90 Table 3 3 lists the keyboard operations Table 3 3 Keys for Operating History Function
298. ocating data between on chip memory and the section referenced by gp r0 for one instruction If the section allocation of data is not performed by the program it will be allocated during compilation by the section file as tidata V850 sidata sedata sconst sdata Execution time priority optimization Ot Ol Specify both the time priority option Ot and the optional optimization option Ol To have the application such as a data processing application shorten the execution time even at the expense of the code size use the Ot option to perform inline expansion and loop unrolling In this case also optimization is further strengthened by specifying the optional optimization option e Caution H using the execution time priority optimization option causes the code size to become much too big use the Wp Gnum or Wo Ol option refer to page 172 to adjust the inline expansion and or loop unrolling results To specify inline expansion of specified functions only regardless of the options use pragma inlines This will continue to specify size priority but will still give priority to fast execution times for the specified function calls only Depending on the application the mask register function may be used as in 1 Size priority optimization to strengthen optimization In addition the following function may be used to further strengthen execution time prior
299. of program header table shentsize Size of entry of section header table shnum Number of entries of section header table shstrndx Section header table index of string table shstrtab holding section name 413 B 3 Program Header Table This section explains the program header table that constitutes an object file in the ELF format The program header table is an array of program header table entries having information on all the segments included in the object file refer to Table B 2 An index to this array is called a program header table index and the program header table entries are referenced by using this program header table index Table B 2 Constituents of Program Header Table Entry and Their Meanings Constituent Meaning type Segment type of corresponding segment LOAD if segment is loaded to memory NOTE if segment has auxiliary information offset Offset in file of corresponding segment vaddr Virtual address of corresponding segment paddr Physical address of corresponding segment filesz Size of corresponding segment on file memsz Size of corresponding segment on memory flags Segment attribute of corresponding segment R for segment that can be read W for segment that can be written X for executable segment align Alignment condition of corresponding segment 12 Subscript 13 If a section having section type NOBITS section not having an actual value in the object
300. ogram therefore the above error does not occur as long as the tp symbol is created for the segment to which that section is allocated by the link directive 3 7 Default Link Directive If the link directive is not specified upon starting the Id the Id links object files by using the default link directive the Id has as internal information This compiler package includes the sample file of default link directive as a reference for creating link directive e Installation directory smpxxx caxxx dir file Each segment described in the default link directive is created allocated starting from the lower addresses in the sequence in which the corresponding input sections if any appear Some segments are allocated to addresses in the sequence in which the segments are described by the link directive and the others are allocated in accordance with the contents of the device file or the Id s internal information If an interrupt handler is defined by using an interrupt request name defined in the device file a link directive that allocates the function to predetermined handler addresses is automatically created inside the Id regardless of whether the default directive or a specified directive is used Caution The dir file shown above is only a sample file This file is not actually referenced by the Id if no link directive has been specified If no link directive has been specified the Id references the device file and follows the defa
301. ol symbol specified by entry point address specification option e cannot be found can not find output section needed in deciding TP GP symbol s symbol value in segment segment The output section necessary for determining the value of the tp gp symbol for segment segment is not found can not find numberth symbol table entry for relocation of reference at offset offset in section section this relocation is ignored The numberth symbol table entry to relocate a reference existing in offset offset of section section is not found This relocation is ignored 324 can not get raw data of section section Getting the raw data of section section has failed can not get size of directive file file Getting the size of directive file file has failed can not link mask reg using objects with mask reg not using objects file is mask reg using object An object file using the mask register and an object file not using the mask register cannot be linked File file is an object file using the mask register can not link new_fcall objects with old_fcall objects file is new_fcall object An object file of the new function calling specifications and an object file of the old function calling specifications cannot be linked File file is an object file of the new function calling specifications This message is output when option ol that specifies linking of the library of the old version is specifie
302. ole created as a result of allocating a segment or a hole explicitly specified to be created 3 4 2 Configuration of segment directive The configuration of the segment directive is as follows Figure 3 8 Configuration of Segment Directive segment name segment type A segment attribute A V address AL maximum memory size A H hole size A F filling value AA alignment condition mapping directive e Sequentially describe the segment directives from the directive for the segment that is allocated to the lowest address to the directive for the segment that is allocated to the highest address e The items that can be specified for a segment directive and their specification formats are shown in Table 3 2 Table 3 2 Items That Can Be Specified and Their Specification Formats Item Specification Format Segment name Segment name Segment type ILOAD Segment attribute R W X Address V address Maximum memory size L maximum memory size Hole size H hole size Filling value F filling value Alignment condition 264 A alignment condition These items are delimited by a blank space Example gt SEG LOAD RN VOx0O0 LOxfffftffff HOxO A0x8 Specification of a segment type and segment attribute must not be omitted The other items may be omitted If an item is omitted the Id executes linking by using the default
303. omitted it displays a list of all files and directories in the current directory When using 2 in Synopsis this command displays a list of specified filenames If the filename specification is omitted it displays a list of all files and directories in the current directory If no options are specified for the Synopsis 1 and 2 this command displays the name size and last revised date and time for one file or directory per line Examples A gt DIR A R O N lt Displays a alphabetical list of read only files in the current Directory is A DBLSPACE BIN TO MSDOS 114 SYS SYS directory 65270 95 01 12 06 20 65536 95 01 12 06 20 39664 95 01 12 06 20 DIRS Display directory stack DIRS DIRS Summary Display directory stack Synopsis DIRS Description This command displays the contents of the directory stack Examples A gt DIRS lt Displays the directory stack a windows c work tmp 31 The output is displayed in lowercases 115 DUMP File binary dump DUMP DUMP Summary File binary dump Synopsis DUMP A option A drive path filename A startaddress A endaddress Options D Regards the address specification as a decimal number If omitted the address specification is regarded as a hexadecimal number Description This command disp
304. omitted only the standard directories are searched This option can be specified only when starting from VSH This option outputs the ROM storing processor s version number to standard output and then terminates processing This option can be specified only when starting from VSH This option outputs a description of options for the ROM storing processor to standard output This option can be specified only when starting from VSH This option does not check duplication of addresses of input file and output file This option outputs the memory map of the object file to be created to standard output o A Ofile This option specifies ofile as the name of the created object file If this option is omitted it is assumed that romp out has been specified This option can be specified only when starting from VSH This option handles cfile as a command file refer to page 161 If this option is omitted it is assumed that no command file has been specified 2 3 Examples of Use Here are examples of using the romp e Basic usage romp850 a out Includes all the data sections having the data or sdata attribute in the a out file in the rompsec section of the default output file romp out e To specify output file name romp8s50 o new out a out The output file name is assumed to be new out e To specify first label romp850 b _romstart a out Uses the value of label _romstart as the first address o
305. on if not the inline expansion is ignored 197 W7107 Return value type mismatch is detected where caller calls callee The types of the return values of caller and callee differ during inline expansion If the type of callee can be changed it is converted into the type of caller if not the inline expansion is ignored 198 VOLUME 4 HANDLING ASSEMBLER 199 CHAPTER 1 OVERVIEW This volume explains the outline operation assemble list and output messages of the assembler as included in this compiler package 1 1 Flow of Operation The as assembles an assembly language source program in a specified assembler source file and creates a relocatable object file refer to Figure 1 1 Figure 1 1 Flow of Operation of as Co C Assembler source file Relocatable object file 1 2 Handling File With the as the following file can be specified as an input file file s assembler source file called s file e The relocatable object file created by the as has a name created from the name of the input file by replacing S with ol e If the relocatable object file created by the as includes an unresolved external reference the relocation for it remains unresolved e An executable object file resolving all relocations called execution format is created by linking the relocatable object file by using the link editor Id included in this compiler package 1 If the specified file is not an s file o is suff
306. on File The sequence to use the section file by using sf is as follows 1 Compile the file by specifying option lt lt Frequency Information File gt gt Xcre_sec_data of the C compiler As a result of compiling a file with extension sec with a specified file name if a file name is specified having information on the frequency at which each variable in the C source file is referenced is created Example of specification from PM Frequency Information File X Create File Xcre_sec_data Ll Specify File Xcre_sec_data File Name E Example of activation from VSH gt ca850 Xcre_sec_data a c b c c c When sf is started with the created sec file input a section file that specifies section allocation to the tidata section is created Example of activation from VSH gt sf850 a sec b sec c sec o secfil Because all variables are allocated to the tidata section as default assumption modify the section file as necessary If the O option is specified on activating sf the variables that can be accommodated in the memory range of the tidata section can be automatically selected in sequence starting from the one that is referenced most Re compile the file by specifying option lt lt Section Data File gt gt Xsec_file of the C compiler An object file allocated to the section is created in accordance with the input section file Example of specification from PM
307. on attribute AW 21 For example data and bas sections sconst etc of rO relative are excluded 2 In this case the Id outputs no special message For confirmation use the link map etc refer to Chapter 4 on page 318 The Id outputs a message during relocation and stops linking if data allocated to an area exceeding this range is referenced N 226 To solve this problem the ca allocates data of less than num bytes to the sdata sbss attribute section when the Gnum option is specified and the as generates a machine language instruction that assumes that data of more than num bytes is allocated to the sdata sbss attribute section By using this feature as many data as possible can be allocated to the sdata sbss attribute section if all data cannot be allocated to that section If this option is specified the Id outputs information that can be used as the criteria upon setting num By using this information you can reduce the number of trials and errors and enhance the efficiency for the series of processes Explanation on output information An example of output information where this option is specified when creating an executable object file without the r option specified and an example of output information when this option is specified when a relocatable object file with the r option specified is created are shown below Example of output information on executable object file gt KEKEREKE LINK EDITOR GP INFORMATION
308. ond argument since it is a character string Refer to the descriptions of interrupt exception handlers and RTOS interrupt handlers in V800 Series C Compiler Package User s Manual C Language Refer to V800 Series C Compiler Package User s Manual C Language This option is intended to prevent CPU faults Refer to the CPU documents to determine whether or not the CPU is susceptible to such faults This option is used to store the object file to ROM For details of using this option refer to page 386 If an assembler source file is input when ca is started assembler source debugging is performed by the debugger This option switches the register mode of the software register bank function For details of the software register bank function refer to V800 Series C Compiler Package User s Manual C Language Ei 2 2 2 2 O N o 157 6 Message options These specifications set options related to messages that are output during compilation Specification Format Feature This option outputs a warning message in response to initialization of a pointer type external variable which uses a variable address that is not an automatic variable or which uses a function address This option displays ca s execution status This option suppresses output of warning messages This option specifies the level of the warning message The following numbers can be specified as num 0 Suppress message same as w 1 Output
309. onding section 14 Subscript 415 B 4 1 Section type The section types indicated by constituent type of the section header table and their meanings are shown in Table B 4 Table B 4 Section Types and Their Meanings Section Type Meaning GPTAB Global pointer table size with first entry aligned with num of Gnum specified for compiler and assembler and 0 and second entry and those that follow aligned with size and word of data NOBITS Section for data not having actual value in object file e g data for which no initial value is specified PROGBITS Section for data having actual value in object file e g data for which machine language instruction or initial value is specified REGMODE Section existing in relocatable object file created by using register mode feature gt information on number of registers internally used by C compiler is stored REL Relocation information RELA Relocation information SYMTAB Symbol table Refer to B 5 1 STRTAB String table Refer to B 5 2 15 Refer to the explanation on the reg option of the ca 16 This section is not used with this compiler package at present 416 B 4 2 Constituents dependent on section type link info The meanings of the constituents of the section header table link and info that are dependent on section type type are shown in Table B 5 Table B 5 Meanings of link and info Section Type Meaning of link Meaning o
310. ons These specifications set options related to assembly language output by ca Specification Format Feature Data that is less than num bytes is allocated to the sdata section or the sbss section If this option is omitted all data is allocated to the sdata section or the sbss section However any data that is specified for a sdata or sbss section ina pragma section directive 4 or a section file refer to page 408 is allocated to the sdata or sbss section regardless of the data size Xbdld If the values for static structures or external structure variable exceeding 16 bytes that are allocated to sections in external memory are substituted with values of sidata section variables from RAM the bdld instruction will be output when ca performs an assembly language creation refer to page 166 Xc This option outputs the C language source programs as comments to the assembler source file to be output Xcre_sec_data This option outputs a variable frequency data file used with section file generator refer to page file V850 397 6 If file is specified the specified file name is output If file is omitted the same file name is output but with sec as the extension instead of c When several C source files exist and a frequency information file is to be created with a file name specified for each file the Project Manager opens the option dialog for each C source file from the source file
311. ontrol pseudo instructions option volatile nooptimize and option novolatile optimize are not used in correct correspondence tidata size overflow The total size of the tidata byte section tidata word section and tidata section exceeds 256 bytes V850 210 tidata byte size overflow The size of the tidata byte section exceeds 128 bytes V850 tidata word size overflow The size of the tidata word section exceeds 256 bytes V850 can not find device file Either the device file corresponding to the specified target device is missing or the specified device is wrong Or no device is specified can not open file file File file cannot be opened close error The file cannot be closed The chances are that the disk capacity has run short duplicated cpu type A target device is specified in duplicate by an option or pseudo instruction duplicated cpu type ignored option cpu The target device specified by the cpu option differs from that specified by the option pseudo instruction The cpu option takes precedence and the target device specified by the option pseudo instruction is ignored floating exception function An error of a floating point operation occurs in the function function of the floating point operation library internally used by the as illegal alignment value The specification of the alignment condition contains an error illegal bit width The bit widt
312. op down list type of display to list all files that have been specified once up to 10 files Either click the desired file or use the arrow keys to select it CAUTIONS If the path is not specified in the link directive file or start up module project directory that is specified during project creation is searched If the file locates in other directory path specify the absolute path name or relative path name from the project directory 2 Buttons OK Cancel Help 25 Refer to V800 Series C Compiler Package User s Manual C Language 26 Install directory libxxx rxx crtN o 70 Enables the specified items and closes the dialog Ignores the specified items and closes the dialog Opens the Help window Setting options A Figure 2 20 Option Settings Dialog Link Editor Linker Options x C1 File n CO Others Entry Symbole T Verbose Mode v C Suppress Warning w Filling Number of Hole f D T Ignore Relocation Frot T Check All Multi Defined Symbol M T Output Link Map m T Ignore Undefined External Symbol Error t F Strip Debug Information s T Ignore External Symbol Error T T Check Function Call Style fc cawe ies 1 Options Entry Symbol e Use this text box to specify a symbol to be set as the entry point address If the specified symbol is not found the link editor outputs a message and stops linking This area uses the d
313. option or R option has been specified the contents of all subdirectories in the directory specified by path1 are recursively copied to the directory specified by path2 When using 3 in Synopsis this command copies the specified file s to the directory specified by path Examples A gt CP WORK B WORK2 lt Copies all files in the WORK directory to the WORk2 directory in the drive B A gt CP p WORK FILE1 C WORK2 lt Copies FILE1 C in the WORK directory to the WORK2 directory in the drive A The last revised time is not updated 109 DATE Display date DATE DATE Summary Display date Synopsis DATE Description Displays the current date Examples A gt DATE lt Displays the current date Current date is Wed 05 24 1995 110 DEL Delete file DEL DEL Summary Delete file Synopsis DEL A option A drive path filename Options IY Deletes without opening a dialog box to prompt for confirmation I Y Opens a dialog box to prompt for confirmation before deleting default Description This command deletes the specified file s The DEL command contains the same function as the ERASE command does Examples A gt DEL WORK FILE C lt Deletes FILE C in the WORK directory A gt DEL Y B WORK FILE C lt Deletes FILE
314. or More tp gp Symbols TEXT1 LOAD RX textl S SPROGBITS AX crtN o main o TEXT2 LOAD RX text2 SPROGBITS AX func o TEXT3 LOAD RX text3 SPROGBITS AX libfunc o a usrlib libusr a DATA1 LOAD RW sdata SPROGBITS AWG DATA2 LOAD RW sbssl SNOBITS AWG crtN o DATA3 LOAD RW sbss2 SNOBITS AWG SIDATA LOAD bw tidata SPROGBITS AW tidata Sidata PROGBITS AW sidata __tp_symboll TP_SYMBOL EXT1 __tp_symbol2 TP_SYMBOL EXT2 __tp_symbol3 TP_SYMBOL EXT3 __gp_symboll GP_SYMBOL amp __tp_symboll DATAL __gp_symbol2 GP_SYMBOL amp __tp_symbol2 DATA2 __gp_symbol3 GP_SYMBOL amp __tp_symbol3 DATA3 ep DATA EP_SYMBOL 300 Figure 3 27 Example of Creating Two or More tp gp Symbols main o sidata SIDATA val tidata segment N _ ep DATA gt func o DATA3 N vi sbss2 segment __tp_symbol3 gp_symbol3 Ki bss1 DATA2 nes segment __tp_symbol2 gt __gp_symbol2 GG DATA sdata segment __tp_symbol1 ___gp_symbol1 libfunc o text3 TEXT3 segment __tp_symbol3 CH __tp_symbol2 R text1 TEXT1 segment __tp_symbol1 gt Lower address 301 3 6 5 tp symbol offset in label reference The C compiler ca assumes that the text pointer tp has the first address of the segment to which the text a
315. or directories The input format for external commands is shown below 9 drive_name path_name filename A command_parameters 3 4 3 Operations related to all commands 1 2 Forced termination of command execution During the execution of acommand from VSH if a mouse pointer is displayed in the VSH window pressing the following keys will force termination of the command being executed PC 9800 Series STOP CTRL C IBM PC AT compatibles Ctrl Break Ctri C For a table of correspondences with keys in other types of computers see the Windows Manual Temporary pause of command output During the execution of acommand from VSH if a mouse pointer is displayed in the VSH window pressing the following keys will temporarily pause output to the VSH window from the command being executed This output can be restarted by pressing the same key again PC 9800 Series ICTRL S IBM PC AT compatibles Ctrl S For a table of correspondences with keys in other types of computers see the Windows Manual 29 The contents in brackets can be omitted indicates one or more blank spaces 100 3 Command files Files that are specified directly after parameters that begin with are handled as command files However use of command files is not possible for the ECHO command For details of command files refer to the des
316. or which no initial value has been specified null characters 0 are created corresponding to the section s size 5 hx converts in section units rather than segment units 6 The range of specifiable values is 1 to 255 for Intel expanded hex format 1 to 251 for Motorola S type hex format standard address 1 to 250 for Motorola S type hex format 32 bit address and 16 to 255 for expanded Tek hex format 7 The default value is 31 for Intel expanded hex format 80 for Motorola S type hex format and 255 for expanded Tek hex format 8 Intel expanded hex format S Motorola S type hex format standard address s Motorola S type hex format 32 bit address T Expanded Tek hex format 344 Specification Format Feature This option outputs to a file called ofile If this option is omitted it outputs to standard output This option sets local symbols as targets for symbol table conversion and output This option is valid only when specified with the S option If this option is omitted only global symbols are targets This option creates null characters 0 to fill the section size for section having section type NOBITS and section attribute A section for data with initial value not specified such as bss section and sbss section This option handles cfile as a command file refer to page 161 If this option is omitted it is assumed that no command file has been specified 2 3 Examples of Use Here are examp
317. ordance with the default link directive refer to pages 306 310 and 312 of each family Example e 1d850 D dfile file1 o file2 0 Links object files file1 o and file2 0 in accordance with the link directive in directive file dfile 230 3 E Specifies ignoring error during relocation Format E Feature A message such as that shown below is output and linking continues if the value resulting from calculation of an address of an unresolved external reference is illegal or if the relation between the value and the located section is illegal warning relocated value value of relocation entry file file section section offset offset type relocation type overflowed relocation field e The value resulting from an address calculation that is judged to be illegal is not used for an unresolved external reference that is considered as an error and the original value remains Default assumption Outputs a message and stops linking if the above mentioned error occurs Example e 1d850 E file1 o file2 o Outputs a message in response to a relocation error in the linking of file1 o and of file2 0 and continues the link processing 231 4 F Specifies directory from which device file is searched Format F A devpath s F must be followed by a blank space e The number of characters of devpath should be less than 512 e This option can be specified only at the start from VSH Feature Searches directory devpath and the s
318. ordinary warning message 2 Output detailed warning message The w1 specification is assumed if this option is omitted wstring This option specifies outputting or suppressing a warning message for each parameter regardless of wstring the level A warning message is output when has been specified or is suppressed when has been specified The following character strings can be specified as string bitfield_align When bit field members have exceeded the boundary set by the alignment condition and have been allocated starting from the next boundary callnodecl When calling an undeclared function nopic When using a variable address that is not an automatic variable or a function address to initialize a pointer type external variable pragma When a non executable pragma description appears sharp When a sharp symbol appears in a source line An error occurs if neither nor has been specified The specification is according to the wnum level if this option is omitted 158 7 Other options These specifications set other options These options specify ca s operation stage reference files etc Specification Format Feature This option includes source program comments in C language source program preprocessing output This option can be specified only when either the E option or the P option has been specified This option can be specified only when starting from VSH This option executes pr
319. ore linking The former is suitable when an option specification is not complicated at the start from VSH command line The latter is suitable when a lot of options are specified for the as and Id or independent o files is desired to create in order In Project Manager normally lt lt Build gt gt lt lt Rebuild gt gt of execution menu starts to Id and employs the method of which the build specifying o file by lt lt Target specification build gt gt creates an individual object c option of command line Refer to VOLUME 2 and User s Manual of Project Manager Awareness of the start of as or Id is not required as in VSH but an option stopping before as start is not supported in compiler option on the Project Manager Examples of start from VSH command line are shown below Refer to the next chapter on details of option 1 To execute everything from cat gt ca850 cpu 3000 file c obj o d Reads file c and obj o to create executable object file a out At this time crtN o is linked as the start up module and libc a is referenced gt ca850 cpu 3000 R org_crt o file c obj o Reads file c and obj o to create executable object file a out At this time org_crt o is linked as the start up module and libc a is referenced 4 For the start up module in the above example refer to V800 Series C Compiler Package User s Manual C Language 151 2 To start from ca to as and to start Id alone
320. ormation 0x70000000 Gptab Global pointer table in which the first entry contains a num of Gnum specified for ca or as and the Oth 2nd and subsequent entries indicate the size when aligned with data size and word 0x70000001 Regmode 4 Bind in symbol table Section that exists in a relocatable object file created using the register mode function Information concerning the number of registers used internally by the ca is stored Symbol that is not used to resolve external reference Symbol that is used to resolve external reference 5 Type in symbol table Display when v is specified Object Meaning Ordinary object label Func Function name Section Section File Ordinary file name Devfile 6 Shndx in symbol table Display when v is specified Undef Device file name Meaning Undefined symbol GpCommon Undefined external symbol that is referenced by global pointer gp and 16 bit displacement Abs Symbol indicating constant Common 8 Refer to reg option of ca 368 Undefined external symbol that is referenced by global pointer gp and 32 bit displacement CHAPTER A MESSAGES This chapter explains the output messages of the dump command in alphabetical order The italic characters in the output messages and explanatory statements are determined during command processing
321. orts multiple definition of undefined external symbols The defined multiple external symbols are allocated to the sbss or bas section after they have been linked If the symbol size or alignment condition of the symbols to be linked differ the maximum size of the symbols to be linked is used as the size and the least common multiple of the alignment condition is used as the alignment condition Ignore External Symbol Error T Check Function Call Style fc 2 Buttons OK Cancel Help 27 Refer to V800 Series C Compiler Package User s Manual C Language This suppresses checking size when linking undefined external symbols If this option is omitted the size is checked If a difference in size is detected a warning message is output and linking continues At this time the symbol size of a file for which a symbol is actually defined is valid Checks whether the calling specifications of the old version and the calling specifications of the new version do not exist in mix in all input object files If this option is not specified only the object file created from the C source file is checked Enables the specified items and closes the dialog Ignores the specified items and closes the dialog Opens the Help window 73 Setting other options Figure 2 21 Other Option Settings Dialog Link Editor Linker Options 1 File 2 Option Any Option M Use T
322. owever it is assumed that Id850 is placed in nectools bin Caution Since the mathematical library references the standard library make sure that Je is placed after m 46 2 4 Example Here are some examples of using the ca e To start from ca to Id to create an executable object ca850 cpu 3000 Utest o object a c C source file a c is compiled and executable object file object is created At this time it is assumed that undef test is described before the C source program in a c The V851 is used as the target device ca850 cpu 3000 WI D dirc file c Im C source file file c is compiled and executable object file a out is created At this time directive file dirc is instructed to the Id and mathematical library libm a is linked e To start from ca to as but not Id to create relocatable object file ca850 cpu 3000 c file c C source file file c is compiled and relocatable object file file o is created 45 To start Id from ca in VSH Ic is passed to the Id as the default assumption even if it is not specified by the W option To start Id from ca start up module crtN o is passed to the Id as the default assumption unless R is specified 48 Refer to V800 Series C Compiler Package User s Manual C Language 174 CHAPTER 3 MESSAGES This chapter explains the messages output by the ca 3 1 Message Format Example E2103 Le Error code Error occurs in front end Error due to syntax error or violation of compiler
323. p window 43 o Setting pre processor options 0 Figure 2 8 Pre processor Option Settings Dialog 1 Input de 3 Language 4 Optimization p guag p Compiler Options C5 Output 6 Output2 7 Message 0 Others Include Search Path It Define MacroJ D Undefine Macrof U Limit of Number of Macro Xm 2047 T Use Trigraph t C Use C Style Comment Xcxxcom Delete Source Option Cancel Help 1 Options Include Search Path LI This specifies one or more directories to be searched before the standard directory when searching for header files When specifying several paths use a semicolon to separate the path specifications This area uses the drop down list type of display to list all directories that have been specified at least once up to 10 paths To select a directory either click on the desired directory or use the arrow keys to select it When this option is omitted only the standard directory will be searched Define Macro D Uses the macro_name name definition_value def format to define macro names If the def specification is omitted a value of 1 is assumed as def Example test 2 It is assumed that define name def is entered before a C language program When specifying several macros separate them nm with a semicolon 3 The standard directory is the installation directory incxxx 4 In the format that enc
324. per part of the link editor option setting dialog By selecting an option button the display of dialog is changed 1 Option buttons for displaying option setting dialogs 1 File Opens the dialog box that is used to set the options related to the files to be referenced or linked by the link editor refer to page 69 2 Option Opens the dialog box that is used to set the ordinary options of the link editor refer to page 71 0 Others Opens the dialog box that is used to set the other parameters refer to page 74 68 Setting files Figure 2 19 File Settings Dialog Linker Options 2 Option 0 Others Library Search Path L Link Directive File D 1 Options Library EI Specifies the string portion of the archive file library file libstring a to be accessed When specifying several files separate each name with a semicolon such as m usr This area uses the drop down list type of display to list all libraries that have been specified once up to 10 libraries To select a library either click the desired library or use the arrow keys to select it The specified archive file is searched from the standard directory of the directory or library specified by lt lt Library Search Path gt gt The link editor outputs no message and continues linking even if the specified file is not found CAUTIONS The standard library c is referenced as default assumption even
325. pplication Executes interfunctional optimization by merging two or more files re arranging functions in merged files and information on optimized functions in addition to optimization by O3 Also suppresses 4 byte alignment at the label or beginning of function Although inline expansion or loop unrolling that increases the size is not performed the loop that is executed only once is expanded to prevent overhead of the end condition judgment t Executes execution speed priority optimization However the size increases In addition to O3 optimization executes interfunctional optimization of Oz and also executes tail recursion optimization inline expansion and loop unrolling If the return statement at the end of a function calls the function itself tail recursion optimization converts the function into a loop to reduce the stack required for calling the function Inline expansion expands the entity of a function at a part calling the function increasing the possibility of optimization and decreasing the overhead from the call Loop unrolling expands the entity of a loop two or more times increasing the possibility of optimization and decreasing the overhead from condition judgment and branch Although the code size increases when inline expansion and loop unrolling are executed the execution speed is expected to increase If Ot is specified and a function including the asm statement which defines label is used the same label is def
326. put No Output w Suppress warning messages Level 1 Output ordinary warning messages default Level 2 w2 Output detailed warning messages Verbose Mode v Displays execution status in C compiler Individual Warnings Specifies output or suppression of output of a warning message of each item regardless of the level The warning message is output when the check box in this area is checked The warning message is not output when the check box is displayed in gray Bit Field Alignment wbitfield_align Outputs a warning message if the member of a bit field is allocated from the next boundary because it exceeds the boundary of alignment condition Call of Not Declared Function Outputs a warning message if a function not declared weallnodecl is called Use of Non PIC wnopic When this box is selected a warning is output upon initialization of a pointer type external variable which uses a variable s address that is not an automatic variable or which uses a function s address 56 2 Buttons Unrecognized pragma wpragma Non White Space before Sharp wsharp OK Delete Source Option Cancel Help Outputs a warning message if description of pragma that cannot be executed is found Outputs a warning message in respect to character appearing in the middle of the source line Enables the specified items and closes the dialog This button appears dimme
327. r the criterion of num refer to the explanation of the I option below If this option is not specified N128 is assumed Unconditionally executes inline expansion of static functions that are referenced only once Displays information on functions The displayed information serves as the criteria of the values specified by the G and N options mentioned above For example if the stack size of a called function is less than the value specified by G inline expansion is executed If the code size of a called function is less than the value specified by N inline expansion is executed Using function funcname as an entry function deletes the unnecessary functions of those called from the entry function after expansion Specify funcname by prefixing on _ to a function name If funcname is not specified Caution Note that the function called only by an assembler statement is not recognized to be main is assumed called as a result the function is deleted as an unnecessary function 41 To start the Id from the ca Ic is passed to the Id as default assumption even if it is not specified by the W option 172 e Global optimization module opt Wo Ol num Expands a loop such as for and while num times Execution of a loop which is executed N times N is a constant is converted into execution of a loop including both the execution of a code the number of times equal to the result of N num an
328. r0 is used as a destination register Warning register r1 used as destination register An assembler reserved register r1 is used as a destination register Warning register r1 used as source register An assembler reserved register r1 is used as a source register Warning register r30 used as destination register of mul div mulu divu instruction An instruction work register r30 is used as the destination register of the mul div mulu or divu instruction V830 Warning sorry string option not implemented ignored The string option is not implemented and is ignored write error The file cannot be written 216 VOLUME 5 HANDLING LINK EDITOR 217 CHAPTER 1 OVERVIEW This volume explains the outline operation link directive link map supplementary information and output messages of the link editor Id included in this compiler package 1 1 Flow of Operation Generally an application program of a certain size is divided into several source files and codes so that it can be easily handled Because the ca starts the as and ld internally an executable object file can be created by inputting two or more source files and relocatable object files However each source file can also be compiled and assembled without starting the as and Id When each source file is compiled and assembled the created object files are linked by starting the Id In the Project Manager normally lt lt Build gt gt or lt
329. range of the memory to which the rompsec section is allocated does not overlap the address range of the next segment or overflow from the segment of the text as a result of the rompsec section The size of the rompsec section to be created can be calculated by the following expression decimal in byte units Size of rompsec section 8 16 x number of sdata data attribute sections size of sdata data attribute sections V850 Size of rompsec section 8 16 x number of sdata data attribute sections number of sections located in internal instruction RAM size of sdata data attribute sections size of section located in internal instruction RAM padding size 1V830 For example if a 50 byte sedata section 30000 byte sdata section and 10000 byte data section exist the size of the rompsec section is as follows Size of rompsec section 8 16 x 3 50 30000 10000 40106 An example of changing the link directive is shown below 9 For the details of the link directive refer to CHAPTER 3 LINK DIRECTIVE in VOLUME 5 HANDLING LINK EDITOR 10 All sections that are allocated to internal instruction RAM by link directive such as interrupt handler sections corresponding to handler addresses in internal instruction RAM and itext section 11 The padding size is from 0 to 6 bytes per section allocated to internal instruction RAM To add a precise amount of size of rompsec section first use a directive wi
330. rary supplied by this compiler references libc a of the standard library Therefore when command is started from VSH specify Jo that specifies reference of the standard library after Jm specifying reference of the mathematical library In the option dialog specify in the order of mc Example e 1d850 file1 o file2 0 lc Links object files fiel o and file2 0 and the object file in archive file libc a necessary for resolving an unresolved external reference in file1 0 and file2 0 placed in the standard directory 33 The Id treats the directory at the libxxx position from the directory to which the Id has been installed and the directory at the lipxxx r32 position from the install directory as the standard directory for the library 34 This is equivalent to directly specifying archive file libc a in the standard directory without using this option 242 15 m Outputs link map Format m Feature Outputs to the standard output the link map that indicates allocation of the section input section included in the specified object file to a memory space and the allocation of a section output section that constitutes an object file created by linking the input file to a memory space refer to Chapter 4 on page 318 Default assumption Does not output Example e 1d850 m file1 o file2 0 Links object files file1 o and file2 0 and outputs the link map of the input and output sections to the standard output 243
331. rce file 32 Refer to V800 Series C Compiler Package User s Manual C Language 240 13 help Explains options Format help e This option can be specified only at the start from VSH Feature Outputs the explanation of the options of the Id to the standard output Default assumption Does not output Example e 1Id850 help Outputs the explanation of the options of the Id850 241 14 I Specifies archive file Format lstring e must not be followed by a blank space Feature References archive file libstring a to resolve an unresolved external symbol reference e Ifthe L option is specified before this option the Id searches the directory specified by the L option for archive file also called a library file libstring a If the archive file is not found in that directory the Id searches the standard directory If the L option is not specified before this option the Id searches the standard directory e Ifthe archive file specified by using this option is not found in the above mentioned directories the Id outputs no message and continues linking Default assumption Does not reference Caution e The Id references only the archive file specified for an external reference that is not resolved at the point where this option is specified Therefore specify this option after the object file that references the specifying archive file when starting from the VSH command e The mathematical lib
332. refer to V800 Series C Compiler Package User s Manual C Language 47 o Setting optimization options 0 Figure 2 10 Optimization Option Settings Dialog Compiler Options 1 Input 2 Preprocessor 5 Output 6 Output2 3 Language 7 Message C0 Others Optimization Level No Optimization 00 Level 1 Level 2 02 Level 3 0 C Execution Time Optimization Ot C Code Size Optimization Os F Optional Optimization Ol Inline Expansion Code Threshold Wp N Stack Threshold Wp G T Expand Static Function Wp S T Output Function Report Wp l i Number of Loop Unrolling Wo Ol F Pack Alignment Wi P Delete Source Option Cancel Help 1 Options Optimization Level O Optional Optimization Ol Code Threshold Wp N 48 Use this area to specify the optimization level and related items refer to page 156 The default setting is level 1 Check this box to perform optional optimization This emphasizes optimization measures such as code scheduling and redundant instruction elimination However the compiling speed is This box can be selected where optimization level 2 or above or execution time priority or size priority optimization is selected reduced Limits the intermediate language size of a function subject to inline expansion to the specified number of bytes and does not execute inline expansion a function ex
333. reference or use command output results to VSH the following should be done with regard to ca preprocessing and hx output e Specify P when outputting results of ca preprocessing only to a file Example ca830 P file c lt Outputs results of preprocessing only to file i e Specify o when outputting hx results to a file Example hx830 o file nx a out lt Outputs hx results to file hx 35 Unlike in UNIX based systems there is no standard error output 138 CHAPTER 4 USE OF MAKE UTILITY This chapter describes how to use VMAKE and how to enter make file descriptions 4 1 What is VMAKE VMAKE is a utility that operates in the VSH shell and is used for managing updating and regenerating application programs This utility references make related script files called make files and automatically activates programs such as the C compiler ca assembler as link editor Id or ROM storing processor romp according to the rules specified in the make files Figure 4 1 Position of VMAKE Make file CA commands Make utility Command shell VSH p sce interna commands commands 4 2 Features of VMAKE VMAKE includes the following features e Includes a command interpreter to enable direct execution of CA commands and internal commands e Supports description and macros for basic dependencies 139 4 3 Operation This section describes how to use VMAKE VMAKE is acti
334. responding object file in a specified archive file and constitutes an Qos output object file Configuration and attribute of a segment created by linking the output sections created in the above step Address and alignment condition used to allocate the segment created in the above step to the memory space of the target machine Size of the hole created as necessary when sections and segments are allocated to a memory space Filling value of the hole that is created during allocation of sections and segments Creation of a text pointer symbol having an address value to be set to the text pointer tp a global pointer symbol having the address value to be set to the global pointer gp or the offset value of the address value to be set from the text pointer tp and an element pointer symbol having the address value to be set to the element pointer ep Reference This compiler package includes the file of sample link directive refer to 3 7 on page 305 as follows V850 Installation directory smpxxx caxxx dir When describing the link directive refer to the sample link directive 41 A link directive is explicitly specified by using the D option upon starting the Id 254 3 2 Configuration of Link Directive Link directives are divided into three types segment directives mapping directives and symbol directives Information item 1 explained above is given by a mapping directive 2 4 and
335. ret ret _rcopy amp _S_romp 1 lt Xr specifies global label having absolute value Ne p The label references an absolute address when the ROM storing option of the ca is specified as shown above Therefore the compiler makes the following output if _rcopy is called by an assembly language source program Compiler output of above example with Xr specified e N extern _ S_romp 4 lt Declared as external label mov __S_romp r6 lt Calls _rcopy with absolute address of __S_ romp as first mov l r7 argument and 1 as second argument jal __rcopy Ne J 14 When calling from the start up module 393 CHAPTER 5 MESSAGES This chapter explains the output messages of the romp in alphabetical order The italic characters in the output messages and explanatory statements are determined during command processing 5 1 Message Format romp messages are basically output in the following format romp message 5 2 Messages option unknown option Option option must not be specified option needs argument ignored The argument for the option is insufficient option is ignored address of symbol symbol must be same in all files The address of symbo must be the same in all of the input files b option is specified more than once The b option is specified more than once b option needs one argument The argument for the b option is insufficient file bad magic The input file file i
336. rop down list type of display to list all symbol names that have been specified once up to 10 symbol names Either click on the desired symbol name or use the arrow keys to select it If this option is not specified the entry point address value is determined by the following rules e Value of symbol _start if the symbol exists e The first address of the text attribute section allocated to the lowest part in the object file created if symbol _start does not exist O if the text attribute section does not exist 71 Filling Number of Hole f Output Link Map m Strip Debug Information s Verbose Mode v Suppress Warning w Ignore Relocation Error E Check All Multi Defined Symbol M 72 Specifies the filling value of a hole to be created as a 4 digit hexadecimal number 2 bytes Specification by this option takes precedence over the filling value specified by the link directive file refer to page 254 Specify a filling value according to the following rules e If the value is of less than 4 digits prefix as many 0 as required e If the size of the hole is less than 2 bytes take out the necessary number of the low order digits from the specified filling value e If the filling value is omitted the default value is 0x0000 Outputs a link map refer to page 318 that shows the allocation of memory space in the input and output sections Creates an object file without the deb
337. rs Register Mode CG 32 Register Mode C26 Register Modef reg26 C22 Register Modef reg22 F Inline Expansion of strepy Xi T Change Jump Code of Interruption xj C Use Mask Register xmask_reg F Use Old Style Function Call Xold_fcall T Create Object for ROM Xr T Use Word Switch Table xword_switch Add Output of bdld Instruction Xbdld in the case of CA830 Delete Source Option Cancel Help 1 Options Register Mode The number of registers used by ca can be set by the user as 26 or 22 only The default setting is 32 registers Because the setting by this option is also recognized by the link editor the library in an appropriate mode is referred Output of bdid Instruction Xbdld When a 16 byte or larger static structure or external structure variable value which is allocated to the section for external memory is substituted as a variable to the sidata section allocated to internal data RAM the bdld instruction is generated in assembly language using ca and output refer to page 166 V830 8 This switches the register mode of the software register bank function Refer to V800 Series C Compiler Package User s Manual C Language for the software register bank function 53 Inline Expansion of strcpy Xi Change Jump Code of Interruption Lal Use Mask Register Xmask_reg The function call of the strcpy function is converted into block transfer Thi
338. s V850E Related Documents V800 Series C Compiler Package User s Manual C Language CA830 C Compiler Package User s Manual Assembly Language CA850 C Compiler Package User s Manual Assembly Language V800 Series Microprocessor User s Manual Project Manager User s Manual Published by NEC Corporation Attached manuals to Microsoft Windows such as Microsoft Windows Operating System Function Guide Programming Language C 2nd edition conforming to ANSI standard B W Kernihang D M Riche translated by Haruhisa Ishida Published by Microsoft Corporation Published by Kyoritsu Publishing Co CONTENTS VOLUME T GENER E 21 CHAPTER OVERVIEW seg rea ANE ceca ees eae ee Sa ENEE Een Eege 22 1 1 Organization of This Manual ccccseccssseeeeeeeeesseeeeneeeeeseceeseseeeeeeseeseseeeeeeseesesseeeeneees 22 1 2 Features of CA Windows based Compiler Package c ccsssssseeeesteeeseeeeenees 23 CHAPTER 2 INSTALLATION scccviissisceccessstcocevesssceacvietsaciubovasstcddes AE EES 25 2 1 Operating Environment ccccssseeeeeseeeesneeeeeseeeeseaeeenseeeeseaeseseeeesesaeseseeeeeseeseseceeeneenaes 25 22 Wstallat t eege eegen dee SE edocs Renters eet ecient Ee 26 2 3 Directory Configuration cccccsecceseeeesseeeeeseeeeseeeeenseeeesecaesesneeesesaeseseeeeeeseeseseeeeensenees 27 2 4 Library leegen 28 225 ee EE 29 VOLUME 2 OPERATION METHODS ett Seu Eed ee 31 CHAPTER 1 OVERVI
339. s an error this option can be used to restart compilation The jr instruction is used if this option is omitted Xkt code This option converts and outputs Japanese character strings to the specified code This is valid for converting kanji code used when developing an application to a different code in a target application refer to Caution on page 161 The following can be specified as code e euc EUC n none No code conversion s sjis Shift JIS The indicates that either left or right of it must be specified Comments output by specifying Xc are not converted regardless of this option s specification If this option is omitted code is not converted Xmask_reg This option specifies use of the mask register function When this option has been specified m is automatically set for the as Xnoabcond V830 This option does not output abcond instruction during assembly language creation by ca Xnopldsr V830 This option outputs two nop instructions immediately before the der instruction during assembly language creation by ca Xold_fcall V850 This option outputs code according to an old version s function call specification If the V850E is used as the target device this option cannot be specified Xr The label of the first argument for _rcopy specifies the first address aligned according to the four byte alignment condition that
340. s causes the object execution speed to become higher but the code size also becomes larger However conversion is performed only when the second argument of strcpy is a character string Moreover the first argument must be 4 byte aligned by the program as the second argument is a character string the C compiler has already aligned the second argument This option changes the instruction for branching to the interrupt function from the jr instruction to the jmp instruction refer to page 157 When the function itself is in the range where branching from the jr instruction is not possible and Id outputs an error recompilation is performed using this option This option sets the use of the mask register function Specifying this option automatically sets the check during linking by link editor and an error results if a mask register enabled object and mask register disabled object coexist This option cannot be selected separately for each source file setting This option is always set as the overall option CAUTIONS Even in applications where both the C source file and assembler source file are used or in applications where only the assembler source file is used Use Mask Register must be specified by both the C compiler option and assembler option Use Old Style Function Call Xold_fcall This option outputs the codes that comply with the old version call specifications of the C compiler By specifying thi
341. s for the segments to which the following reserved sections are allocated are fixed The other segment names must not be used sidata section sibss section tidata section tibss section tidata byte section tibss byte section tidata word section tibss word section sedata section sebss section sconst section const section cdata1 section cdata2 section cdata3 section udata1 section udata2 section udata3 section itext section l Jed Aod e d ad SIDATA segment SEDATA segment SCONST segment CONST segment CDATA1 segment CDATA2 segment CDATA3 segment UDATA1 segment UDATA2 segment UDATA3 segment ITEXT segment For the details of the section type refer to page 257 V800 Series C Compiler Package User s Manual C Language and C Compiler Package User s Manual Assembly Language of each family 2 Segment type Specify the segment type of a segment to be created e The segment type that can be specified is only LOAD that is the segment type loaded to memory If any other segment type is specified the Id outputs the following message and stops linking syntax error line num illegal segment type string e Specification of a segment type must not be omitted If omitted the Id outputs the following message and stops linking fatal error segment directive of segment segment needs SEGMENT TYPE yp e Start specifying
342. s illegal and cannot be input cannot find device file The device file cannot be found cannot open command file file The command file file cannot be opened file name name is too long The length of file name name exceeds the limit file illegal input file name The input file file cannot be input because its name is the same as the output file illegal input file type file file is archive file The input file file cannot be input because it is an archive file 394 memory allocation fault Allocating of a memory area has failed nested command file file The command file file is nested It must not be nested file not absolute object A relocatable object file is specified as an input file o option needs one argument The argument for the o option is insufficient p option needs one argument The argument for the p option is insufficient packing section not found The specified section is not found in the object file processor type must be same in all files An illegal input file is specified section section and section2 section overlapped Sections section and section2 overlap file section section can not be packed Section section in file cannot be specified by the p option section section is already defined by p option and therefore this section is ignored Section section has been already specified by the p option and is ignored section section not found Section section specified by the p option
343. s option the specification of Use Mask Register becomes invalid The old style library is referenced automatically in library references by a link editor This option cannot be selected separately for each source file setting This option is always set as the overall option V850 This option cannot be specified when using the V850E for the target device CAUTIONS If one wishes to use the old style call specifications this option must be specified with C compiler option even in application using both C source files and assembler source files or only assembler source files in order to reference the old style library 9 Refer to V800 Series C Compiler Package User s Manual C Language 54 2 Buttons Create Object for ROM Xr Use Word Switch Table Xword_switch OK Delete Source Option Cancel Help 10 Aligned with 4 byte alignment condition Refer to page 386 This option is required when creating an object to be stored in ROM Following link processing the processor for ROM writing is started The generated object file out file contains ROM writing information The label of the first argument of rcopy should be designed so as to indicate the first address after the text section end in the object In addition this option indicates that rompcrt o file and libr a file are to be linked with Idi This option cannot be selected s
344. s option is omitted it is assumed that 0x0 has been specified This option displays a title indicating the displayed contents This option displays comments etc This option handles cfile as a command file refer to page 161 If this option is omitted it is assumed that no command file has been specified 2 3 Cautions e If labels of the same address exist in the object file the label appearing latter in the symbol table takes precedence e If the program starts from address 0 and if output of the symbol at address 0 is necessary upon output for an object that does not have a symbol indicating address 0 __ dummy may be output as the symbol of address 0 2 4 Examples of Use Here are examples of using the dis e To display with codes dis850 aoct a out Inputs object file a out and displays addresses offsets from symbols codes and titles with assembly language instructions e To output version number dis850 V Outputs the version number of the dis850 that has been started to the standard output and terminates the dis850 374 2 5 Output Example Here is an output example of the dis gt dis830 Address 0x00000000 0x00000004 0x00000006 O0x0000000A 0x0000000C 0x00000010 0x00000012 0x00000014 0x00000016 Ox0000001A O0x0000001C 0x00000020 0x00000022 0x00000024 0x00000028 0x0000002C 0x0000002E 0x00000032 0x00000034 0x00000038 0x0000003A 0x0000003C 0x0000003E 0x00000040 0x00000044
345. same function as the MD command does Examples A gt MKDIR B TMP lt Creates the TMP directory in the drive B A gt MKDIR TMP SRC lt Creates the TMP SRC directory in the drive A 122 MOVE Move file MOVE MOVE Summary Move file Synopsis 1 MOVE A option A drive path filename1 A drive path filename2 2 MOVE A option A drive path1 A drive path2 3 MOVE A option A drive path filename A drive path 4 MOVE A option A drive path1 A path2 5 MOVE A option A drive path filename1 A filename2 Options IY Replaces existing file s at move destination without prompting for confirmation I Y Opens a message box to prompt for confirmation before replacing existing file s at move destination default setting Description When using 1 in Synopsis this command moves the specified filename1 to filename2 When using 2 in Synopsis this command moves all of the files in the directory specified by path1 to the directory specified by path2 When using 3 in Synopsis this command moves the file specified by filename to the directory specified by path When using 4 in Synopsis this command changes the directory name specified by path1 to path2 in the same drive When using 5 in Synopsis this command changes the file specified by filename1 to filename2 in the same drive and the sa
346. same or other directive Mistake example gt SEG LOAD RX RW 268 4 Address Specify an address from which the created segments are allocated to a memory space Sequentially specify addresses starting from the lower address Describe the segments from the allocated one to the lowest address Specifying addresses can be omitted If omitted the segments are allocated to a memory space starting from address 0x0 in the sequence in which the segments are described in the directive file If the address for the second segment or those that follow is omitted the segments are allocated starting from the end address of the immediately preceding segment The segments for which addresses are fixed such as those in the internal memory and those of rO relative that referenced by one instruction must be allocated to addresses in the same manner as the memory location of the microprocessor Specify the addresses and attributes of these segments by referring to the User s Manuals of the microprocessor and device files and default directive refer to 3 7 on page 305 Example of segment requiring address specification or with fixed description location e To create SCONST segment to be allocated to internal ROM with V851 with internal ROM as the target device Allocates the segments to the internal ROM by specifying an address less than address Ox7fff or by describing the segments before If described at the beginning without spec
347. se specify an external memory address for the segment by using the directive file and allocate the DATA segment to the external memory 315 3 9 Syntax of Link Directive The syntax of the link directive when described by the BNF method is as shown below lt directive_file gt lt directives gt Not described lt directives gt lt segment_directive gt lt segment_directive gt lt seg_parameters gt lt section_map gt lt section_directive gt lt scn_parameters gt lt symbol_directive gt lt symbol_parameters gt lt address gt lt alignment gt lt hole_size gt lt fill gt lt length gt lt memory_attribute gt lt section_attribute gt lt segment_type gt 316 lt section_directive gt lt symbol_directive gt lt directives gt Not described lt segment_name gt lt segdir_specifier gt lt segment_type gt lt memory_attribute gt lt seg_parameters gt lt directive_end gt Not described lt seg_parameters gt lt address gt lt alignment gt lt hole_size gt lt fill gt lt length gt lt region_begin gt lt section_map gt lt region_end gt Not described lt section_map gt lt section_directive gt Not described lt output_section_name gt lt scndir_specifier gt lt section_type gt lt section_attribute gt lt scn_parameters gt lt directive_end gt Not described lt scn_parameters gt lt address gt lt alignment gt
348. sed refer to the documents supplied with the CPU 14 Refer to page 205 58 2 Buttons Use Temporary Command File Command Line Options OK Delete Source Option Cancel Help In the Windows environment the length of character strings used to specify options for command is restricted to 126 characters If this check box is selected the option character string is temporarily output to a command file refer to page 161 which enables the operation to be completed without observing the restriction on the character string length This option is checked as default assumption Displays C compiler options set in each dialog with the command line options This area is for reference and writing is disabled Enables the specified items and closes the dialog This button appears dimmed and cannot be selected when options for the overall project have been specified It can be selected when options are specified by selecting source files via the Project Manager s lt lt Source List gt gt dialog When itis selected this button deletes any options specified for a particular source file and applies only overall options Ignores the specified items and closes the dialog Opens the Help window 59 2 5 2 Setting assembler options The assembler option setting dialog box for the assembler source file can be displayed by performing either of the following operations after a project
349. seeseeeeeeseseeeneeeeeaeeeenes 414 BA Section Header Table sisi isncsiicticeeshecsieceeee NENNEN 415 BAU Sector ty Dee ee EEN 416 B 4 2 Constituents dependent on section type link info cseceeesseeeseeesetenseeenseeneeeens 417 Bid Bechon enne EEN AEN EENEG Ee 418 B 5 1 Symbol table ere EENS SEENEN 419 B 5 2 String table ees edd ee fubbs secciaes aipania saada dan isana 420 B 5 3 ReServed SOCtION ccsescessseeesscceressesessneesnseesensnesesseeesesnceseneneseseneesassoeeenenenesecsereneeesess 421 BiG SOOQMCM E 422 JK 423 15 LIST OF FIGURES Figure No Title Page VOLUME 1 GENERAL 1 1 Package Organization FigU E isimini en dente eet Ai eed eee re ae 24 2 1 Directory Configuration 2e ani B attendant hil didi a ee Dee Seen Ee Zen Geer 27 VOLUME 2 OPERATION METHODS 1 1 Outline of CA Package Operations E 32 2 1 Project Manager and Development Tools AAA 33 2 2 Window for Activation of Project Manager 34 2 3 Outline of CA Option Specification from Project Manager essssseeseeseeseeeessieersriesirsrrseresrsrrnerneens 37 2 4 Window for Setting Project File 38 2 5 Project Manager s Option Menu after Setting project 0 eee eeeeceeeeeeeeeeeeeeeeseeeeeeeteeeeeaeeteaeeeeeetaaes 38 2 6 Delete Source Option Button peresan eaae aa a eaa r A Erara ea aE Ao raara e aea aAa ao aiee Noa ai anean ahes 40 2 7 Input Option Settings Dialog eses ma aaa aea e ee AE E E aaa 42 2 8 Pre processor Option Set
350. setting menu This can be set only when lt lt Save Exit Status gt gt is set 97 6 Help Uses the help function For details of using Windows based help functions refer to Microsoft Windows Operating System Function Guide Contents Search for Help on F1 How to Use Help About vsh Contents Displays a list of help topics Search for Help on F1 Opens a dialog box to search for a particular topic How to Use Help Opens descriptions of how to use the help function Select this item when first using the on line help function About vsh Opens a dialog box displaying the VSH version and copyright information2 About vsh ES D V Shell E1 30c 8 Apr 97 Copyright C NEC Corporation 1995 1997 p 28 This dialog is just an example it does not show the actual version number 98 3 4 Activation of Commands from VSH This section describes the VSH particular methods for activating various commands from the command line In this description operations are divided into three categories 1 operations related to internal commands only 2 operations related to external commands only and 3 operations relating to internal commands external commands and CA commands See the Windows Manual concerning operations relating to external commands that are not covered in this chapter For operations relating to CA commands that are not covered in this chapter see the
351. snunnennnnnnnnnnnnnnnnnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnmnnn 366 3 13 Debug Information sssssnsssununnennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnmnnn nnmnnn 366 S214 dnll EAE E E AE E E T 366 3 15 Element Values and Meanings sssssssssununneununnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnna 367 CHAPTER 4 MESSA Ee 369 4 1 Message Format sees eege EE EEN ENEE 369 42 ET TE 369 VOLUME 9 HANDLING DISASSEMBLER ccccccsseeeeesseeessneeesseeesseeeseseneeeneeeseseoneeneeeenees 371 CHAPTER T OVERVIEW see r ates Eege eer Eege 372 1 1 FLOW otOppratgon eege Eege eege See EE 372 CHAPTER 2 OPERATION eege a enee ee dee EENS EENEG 373 2 1 Command Input Format from VSH Command Line cccesecesseeeeeeeeeeeeseeeneeeees 373 2 2 Types and Features Of Options ccccssecceeseeeeseeeeeeeeeeeseeeeeseeeesseeseeseeeeeneesenneeeenenees 373 2 2 1 Option liStisccccisies eter eral heat eee eee eee 373 Bos e EE 374 2 4 Examples Of USe ucccccccc teccesescccdecesec Eege EES 374 2 5 Output Example kssin onara onire EENS 375 CHAPTER l MESSAGES eet r aaea a a aar aa E a Eeer 376 3 1 Message Forimat sssscccccssceeceeesseeeeeeeesseeeeeeeesseeeesessneeeeeensaneeseeseseeeeeesesseeeseeensaneeeeeeeas 376 3 2 Messages ncc aT EA EEEa ar A eaa E a a 376 VOLUME 10 HANDLING ROM STORING PROCESSOR cccsssecceeceessseseeeeeeeeeeeeeeeeeeees 377 CHAPTER 1 OVERVIEW tte a e rea EE
352. ss NOBITS sedata sebss AW tidata byte AW tibss byte AW tidata word AW tibss word 2AW tidata 2AW tibss AW sidata AW sibss A GP_SYMBOL amp __tp_TEXT DATA A H oe EP_SYMBOL 310 Figure 3 33 Memory Location by Default Link Directive CA850 with internal ROM sconst tidata byte If SIDATA segment is created SIDATA segment tidata byte lt ep DATA SEDATA segment CONST segment DATA segment text TEXT segment __ tp TEXT gt segment 0x0 311 Figure 3 34 Default Link Directive without SIDATA CA850 V851 SCONST LOAD R sconst SPROGBITS A sconst TEXT LOAD RX text PROGBITS AX CONST LOAD R VOx100000 const S PROGBITS A const SEDATA LOAD RW VOxff6000 sedata SPROGBITS AW sedata sebss SNOBITS AW sebss DATA LOAD RW VOxffe000 data PROGBITS AW sdata PROGBITS AWG sbss SNOBITS AWG bss SNOBITS AW __tp_TEXT H TP_SYMBOL __gp_DATA GP_SYMBOL prp TEST DATA ep DATA H EP_SYMBOL D I 312 Figure 3 35 Memory Location by Default Link Directive CA850 with internal ROM If SIDATA segment is not created DATA segment lt ep DATA SEDATA segment OxFF6000 0x100000 segment TEXT segment segment 313 Each family performs the following processing by using
353. ss SNOBITS AW LOAD RX VOxfe000100f itext SPROGBITS AX itext LOAD RX VOxfe001000f text SPROGBITS AX LOAD R const S PROGBITS A const LOAD R VOxffff8000 sconst SPROGBITS A sconst EXT TP_SYMBOL __gp_DATA GP_SYMBOL amp __tp_ EXT DATA 307 308 Figure 3 31 Memory Location by Default Link Directive CA830 udata2 OxFFFFFFFF Interrupt OxFFFF8000 segment segment text TEXT segment sconst VAN tp TX 0xFE001000 X S ITEXT text segment e 9 meme e Sg __tp TEXT DATA SE segment 0x80000000 AS ee oa ER Segment UDATA2 udata2 0x40000000 segmen cdata1 0x20000000 segment 0x10000000 segment E segment SEDATA segment 0x00001000 soar 0x0 2 With CA850 e If the SIDATA segment is created refer to Figure 3 33 on page 311 The s IDATA segment is allocated to the first address of the internal RAM The DATA segment is allocated to an address suitable for the type of the device in accordance with the de vice file For example in the V851 that has an internal ROM the DATA segment is allocated to the first address of the external memory The s The C EDATA segment is allocated to an address lower than the first address of the internal RAM A850 includes v850def dir file for a sample which is the default directive when the target device is the V851 e If the SIDAT
354. ss anie taastas asaan aeaaea Paanan a taSs EES Eege 208 CHAPTER 4 MESSA GE eege e a ee E ar a a r eaa Kee 210 4 1 MeSSage d lt LEE 210 4 2 ET TE 210 VOLUME 5 HANDLING LINK EDITOR NieesNeen gt eegeteeee eege dee 217 CHAPTER OVERVIEW eeneg EENEG dee 218 Tel Fow Of Operation senge deed 218 1 1 1 Link proc dure sarare aaen aaaea aaae adana aa A Eaa Ea KEE a aaaea ANARE ESEE eat 220 CHAPTER 2 DPE AT ENNEN dee 222 2 1 Command Input Format from VSH Command Line cccescccesseeeeeseeeeseteeeneeeees 222 2 2 Types and Features Of Options cccssececeseeessseeceeeeeeeseaeseneeeeesseeseeneeeeeeseesenseeeeneeees 222 22224 lt OPtion E 2 csc ETT T TTTS 222 1 File OPtloO ns isissecscssctdcsnnisisescivcascecasstanesanactiveandevanwusnsnewivatecdanscaretaunnwsdepecatouensateresnedeaes 223 2 CHECK Opti EE 224 3 Message options ccseseeesseeeeneeeeeeseeeeeseeeeeaseeesaseeeeeseeeeeaseeeeaseneeeaseensasenesasenenenseeees 224 4 Other OPO eege eegen Bereet 225 2 2 2 USING OPtiONS eeccseseesseeeeesseeneseeeeenseeeeesseeeeseeeesaseeesenseeseaseeeseseeeeeaseneeaseeeeeneeeeeaseneeasene 226 CHAPTER 3 LINK DIRECTIVE Eegeregie Eeer 254 3 1 Feature of Link DireCtive ccssseeccesseeeeeeeeseeeeeeeeseeeeeeeenseeeeeeseeseeeeeesesseeeeeseeseeesenenss 254 3 2 Configuration Of Link Directive cseecceseceeeeeeeeeeeeeesneeeeneeeeenseeseeneeeeeeseeseseeeeeenees 255 3 3 Section and Gegment 5SeEeREEEEERRREER
355. ssembler option 20 Refer to g option on page 202 21 Refer to V800 Series C Compiler Package User s Manual C Language 64 Use New Style Function Call f Creates an object file having information of calling function of new version This option is valid when using an assembler source file created with the old version of the C compiler of the V850 Family or when using the assembler source file created with the old version of the C compiler of the V810 Family in the V830 Family When this option is specified specification of Use Mask Register is available This option cannot be selected for each source file and is always selected for all source files CAUTIONS In an application where both the C source file and assembler source file are used or in an application where only the assembler source file is used and if this option is not specified and assembly is executed with the calling specifications of the old version when the V850 Family is used the Use Old Style Function Call option must be specified by the C compiler option to reference the library of the old version 2 Buttons OK Delete Source Option Cancel Help 22 Refer to V800 Series C Compiler Package User s Manual C Language Enables the option that was selected via the dialog and closes the dialog This button appears dimmed and cannot be selected when options for the overall pro
356. ssion following if compiler limit too many conditional inclusion nestings num The number of times of nesting between i f and endif exceeds the limit The maximum value of this processing system is 255 misplaced else or e1lif The position of else or e1if is inappropriate misplaced endif The position of endif is inappropriate illegal include directive syntax The description of include is not correct 177 E2170 E2171 E2173 E2174 E2175 E2177 E2180 E2210 E2211 E2213 E2214 E2220 E2221 E2236 E2237 E2238 178 illegal integral floating constant The notation of the integer floating point constant is incorrect constant out of range The range in which a constant value can be expressed is exceeded illegal octal digit The description of an octal number is incorrect illegal hexadecimal digit The description of a hexadecimal number is incorrect octal digit out of range The range that can be expressed in octal number is exceeded empty character constant The character constant is vacant Code of file file is not code data Code in file file is not code code A character that is illegal as a Japanese character code exists name not defined name is not defined redeclaration of name name is re declared Declarator not specified No declarator is specified Void object is not allowed void obj
357. ssnunennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnne 137 3 6 2 Output file specification in VSH s ss sssnsennsunsunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnunnnnnnnnnnnnnnnnnnnnnn nannaa 138 CHAPTER 4 USE OF MAKE UTILITY eege eege e EES 139 4 1 What is VMAKE 2 ecetet iadaaa ana ien a Eaa aaia KE aaa aE RENAA aAA EEEN Oana KE aaar aaa 139 4 2 Features Of VMAKE ar aa raae ae raaa aE aa EO aaa aara eaa dae anaa a aed hanai inaa anaa nani 139 4 3 Operateur E 140 4 3 1 VMAKE input SYNtaXx cecceessseeeeseeeeeeeeeeeeseeeeeseeeesnseeeeesseeeaseneeeaseeesesseessaeeeneaseeesenseeneneeees 140 4 3 2 List Of OPTIONS caT aeea aaa a arana Ee Ea a ea aaan aa raaa paa eaae E Ea PAEA nahana naana 141 AA Make e a A E A E A teemuceceelseneces 142 AAA COMMENTS isisisi nnani nananana ienna anna anaana aaan Nna Nanaia 142 AT Continuation Of MMOS sessies cece seek anasan ee EES 142 4 4 3 Description Of targeis cceceeseseneseeeeeseeeenseeeeeneeeeeaseeesaseeeeesseeeeaseeesaseeeeenseeeeaseneeeseees 142 4 4 4 COMMANA Ines eeeseseeseeeeeeenseeeseeeeseesnenesseesnaneaseeeneeesseeeaseesneeeaseeseeesesneeaseesseesaeneesaesaas 144 4 4 5 MACKS oosina reaa setueasaudicsueders araea Ena aaa SEa a AKEE EEEE EANAN EAEE 144 VOLUME 3 HANDLING C COMPILER sssssasssnnssnunnnneennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nenna 147 CHAPTER TOVERVIEW Eege see a E E EA A EE i AA een ta 148 Lid A EOT IIE a P T E T T 148 1 2 Handling File sinesi a aa aa i Aa aaa
358. stack Specify a decimal integer value of 1 or greater as n If this option is omitted the contents of the first stack are popped Description This command pops the contents of a directory stack and changes the current directory to the path of the first stack following the one that was popped It also displays the contents of the current directory and stack Examples A gt POPD lt Pops the contents of the first directory stack a tmp a work a nectools Changes the current directory A gt POPD 2 lt Pops the contents of the second directory stack a tmp a work Changes the current directory 32 The output is displayed in lowercases 126 PUSHD Save and push directory stack PUSHD PUSHD Summary Save and push directory stack Synopsis 1 PUSHD A drive path 2 PUSHD A option Options n Pushes enters the contents of the nth stack to the start of the stack Specify a decimal integer value of 1 or greater as n Description When using 1 in Synopsis this command pushes the specified path to the start of the directory stack and changes the current directory to the directory specified by path When using 2 in Synopsis this command replaces the stack contents and changes the current directory to the path of the new start of the stack If both path and option are omitted the current directory contents are pushe
359. strcemp o a nectools 1lib850 r32 libc a e Specifying of a file name may be omitted Example gt sec SPROGBITS AX e If the file name is omitted the ld assumes that all the object files are specified For example the above example is equivalent to the example below if the Id is started with object files file1 o file2 o file3 0 and file4 o specified Example gt sec SPROGBITS AX filel o file2 o file3 0 file4 o In the next example the section with section type PROGBITS and section attribute Ax in all the files is equivalent to sec and section sec2 is not created Example gt secl SPROGBITS AX sec2 SPROGBITS AX filel o If two or more file names are specified the specified file names are allocated from the lower address toward the higher address in the sequence in which the file names are specified If the sequence of the files specified by arguments on starting the Id differs from the sequence specified by the link directive the file name sequence specified by the argument takes precedence Example of sequence specified by argument that takes precedence gt link directive sec SPROGBITS AX filel o file2 o file3 o command specification 1d732 file3 0 file2 o0 filel o 4 file3 0 file2 0 and file1 o are allocated in that order starting from the lower address Caution If allocation to an expected section is not carried out
360. symbol name GP_SYMBOL A amp base symbol name A V address AA alignment condition segment name A segment name symbol name EP_SYMBOL 1 To create a symbol subjected to two or more segments To create one each of the tp gp and ep symbols in an output object file specify two or more segments in the symbol directive or omit specification of the segment name For example if object files crtN o main o and func o and object file libfunc o in archive file a usrlib liobusr a are linked by specifying the directive shown in Figure 3 24 one tp symbol __tp_TEXT is created for three segments TEXT1 TEXT2 and TEXT3 and one gp symbol op DATA is created for three segments DATA1 DATA2 and DATA refer to Figure 3 25 Note that the example in Figure 3 25 is for the CA850 and that the SIDATA segment is subject to the ep symbol 296 Figure 3 24 Example of Commands for Creating One Each of tp gp ep Symbols TEXT1 LOAD RX textl S PROGBITS AX crtN o main o TEXT2 LOAD RX text2 SPROGBITS AX func o TEXT3 LOAD RX text3 S PROGBITS AX libfunc o a usrlib libusr a DATA1 LOAD RW sdata SPROGBITS AWG j DATA2 LOAD RW sbssl SNOBITS AWG crtN o DATA3 LOAD RW sbss2 SNOBITS AWG j SIDATA LOAD RW tidata SPROGBITS AW tidata Sidata SPROGBITS AW sidata __tp_TEXT TP_SYMBOL TEXT1 TEXT2 TEXT3
361. t implemented option option ignored Option option is not supported It is ignored G option needs size gt 0 ignored Size must be specified for the G option It is assumed that has been specified file file with unknown suffix passed to Id File file is a file with an unknown suffix It is passed to Id sorry suffix file not supported ignored File with suffix suffix is not supported It is ignored 191 W1119 W1120 W1122 W1308 W2042 W2127 W2132 W2150 W2161 W2162 W2172 W2176 W2212 192 option option overrides option2 option Option option2 becomes invalid because option option is specified option option obsolete use option2 instead Option option is an option of the old version Use option option2 Ol option is valid only when optimization level is O2 or higher The Ol option is valid only if the optimization level is 2 or higher output file of option overrides output file of option2 The output file of option option is overwritten because the output file of option option2 is specified illegal argument for _rcopy The argument of copy routine _rcopy is illegal redefined macro name name Macro name name is re defined The name defined later is valid macro recursion name Macro is expanded only one time Macro recursion is found The macro is expanded only once unexpected character s following directive directi
362. ta S SPROGBITS AW sedata sec S PROGBITS AW sec lt directive to allocate sec section L For the contents of section type refer to page 257 V800 Series C Compiler Package User s Manual C Language and C Compiler Package User s Manual Assembly Language of each family data by the section pseudo instruction of the assembly language this sec section must not be allocated to the 2 Section type Specify the section type of the input section to be allocated to the output section e Either of the following section types can be specified PROGBITS section type of the section having the actual value in the object file data with text and initial value NOBITS section type of the section not having the actual value in the object file data without initial value If any section type other than these is specified the Id outputs the following message and stops linking syntax error line num illegal section type string e The section type must not be omitted If omitted the Id outputs the following message and stops linking syntax error line num section directive of section section needs SECTION TYPE e Be sure to start specifying a section type with If only is specified however the Id stops linking e must not be followed by a blank space 281 3 Section attribute Specify the section attribute of the input section to be allocated to
363. tandard directory in that order for a device file specified by the cpu option e If this option is specified more than once the directories are searched in the order in which they are specified e When starting command from the option dialog the device files are searched only in standard directory This option does not function in this start Default assumption The standard directory is searched Example e 1d850 cpu 3000 F dev file1 o file2 0 Object files lei o and file2 0 are linked At this time the directory dev below the current directory first is searched for device file corresponding to device name 3000 V851 If the device file is not found there the standard directory is searched 26 The Id treats the directory at the dev position from the directory to which the Id has been installed as the standard directory of the device file 232 5 L Specifying directory from which archive file is searched Format Ldir e L must not be followed by a blank space e The number of characters of dir should be less than 512 Feature If the I option is specified with this option directory dir and then the standard directory are searched in that order for the archive file also called a library file specified by the I option e If the Id is started from VSH command line this option must be specified before the l option e If this option is specified more than once the directories are searched in the order in whi
364. terrupt internal instruction RAM romp830 rompsec section Copy information __S_romp py ee text section text section itext section Interrupt internal instruction RAM sdata section data section udata section cdata section sedata section Sidata section lt _ gt Hex file ROM writer Target system Figure 1 4 Image of ROM Storing example of V850 Family Executable object output by ca Executable object output by romp Peripheral I O Peripheral I O sidata section tidata section sedata section sdata section data section sidata section romp850 rompsec section Copy information __S_romp gt __S_romp gt py T text section text section const section const section sconst section sconst section Interrupt Interrupt 0x0 0x0 hx850 lt _ gt Hex file ROM writer ROM Target system 383 CHAPTER 2 OPERATION This chapter explains the operations of the romp 2 1 Command Input Format romp A option A file name A file name Can be omitted Pattern in immediately before can be repeated A One or more blank spaces 2 2 Types and Features of Options 2 2 1 Option list The following table lists the romp options 1 Output options These specifications set options that change the contents of objects output by romp Specifica
365. th an estimated size value to create an object then execute romp830 Next use dump830 to check the object file created by romp830 adjust the size in the rompsec section and use another directive with that precisely adjusted size to create another object 387 Link directive before ROM storing processing a SEDATA LOAD RW sedata SPROGBITS AW sedata 1 TEXT LOAD RX VOx10000 text S PROGBITS AX lt Size of text is checked by dump e g if size is 0x10000 DATA LOAD RW lt DATA from address 0x20000 data S PROGBITS AW sdata S PROGBITS AWG sbss SNOBITS 2 AWG bss SNOBITS AW hi __tp_TEXT TP_SYMBOL __gp_DATA GP_SYMBOL amp __tp_TEXT DATA 388 Link directive for ROM storing processing lt sedata Data is packed after text section as rompsec section Specify address taking size of rompsec section into consideration 4 byte alignment a SEDATA LOAD RW sedata SPROGBITS AW hi TEXT LOAD RX VOx10000 text SPROGBITS AX hi DATA LOAD RW VOx29CAC data SPROGBITS AW sdata SPROGBITS AWG sbss SNOBITS AWG Das SNOBITS AW hi __tp_TEXT H TP_SYMBOL __gp_DATA GP_SYMBOL amp __tp_TEXT DATA Se E A command startup example for creating a rompsec section is shown below Command startup from Project Manager PM Go to the PM s menu and select
366. the tidata section as default assumption However because the memory range to which the tidata section is allocated is 256 bytes the memory range must be adjusted on judgment of the user in case the section does not fit in the above range If the O option is specified by sf however only variables that can fit in the range of tidata section are output in the sequence of frequency at which the variables are used refer to the option list on page 402 e Only the frequency information file in the status in which it has been output by the ca can be input by sf If the frequency information file whose contents have been changed is input the operation is not guaranteed 401 CHAPTER 2 OPERATION This chapter explains the operation of the sf 2 1 Command Input Format sf850 A option A file name A file name Can be omitted Pattern in immediately before can be repeated A One or more blank spaces 2 2 Types and Features of Options 2 2 1 Option list The following table lists the option of the sf Specification Format Feature This option specifies that only the number of variables that can be allocated to the tidata section will be selected in order of highest use frequency and output The maximum data size that can be allocated to the tidata section is 256 bytes which are internally divided into tidata byte byte data 128 bytes and tidata word word data When this option is specified variables are selected u
367. the destination register when rO has been specified as the destination register when r20 or r21 has been specified as the destination register when using the mask register function or under as830 when r30 has been specified as the destination register for the mul mulu div or divu instruction 203 4 Other options These specifications set other options Specification Format Feature F A devpath This option sets the device file search to begin in the devpath directory before going to the standard directories If this option is omitted the search goes directly to the standard directories If the as is started from the ca ca s devpath is specified When the command is started from the option dialog the device file s installation directory is automatically set for this option so this option can be specified only when starting from VSH This option sets a search for any file input by the include or binclude pseudo instruction to begin in the dir directory before going to the directory where the source files are placed If this option is omitted only the directory where the source files are placed is searched cpu A devicename This option specifies the target device When using the Project Manager this is equivalent to specifying the device during a project setup If this option is omitted assembly is stopped unless this option has been specified by the option pseudo instruction l A ffile Ifi
368. the previous search rather than the character string that goes to the end of the line If the character cursor position is moved the range of characters over which it was moved becomes the character string that is used in the subsequent search Figure 3 2 History Search Examples gt ca850 cpu 3000 main C i 3 Move the cursor to the position before 3 and press Ctrl P search using ca850 cpu gt ca850 v 3 Press Ctrl P without moving the cursor search using ca850 gt ca850 cpu 3001 file C i 2 The cursor is at the end of the line gt ca850 ou 1 Press Ctrl P when the cursor is at this position search using ca850 3 3 4 Alias function The alias function enables other names aliases to be established for commands including arguments Frequently used commands thus can be activated using abbreviated character strings Aliases are set up via menus The setup method is described in page 91 89 3 3 5 Menus This section describes the menus supported by the VSH window 1 Edit Edits the line displayed on the VSH command line 2 History SelectAll Copy Ctrl C Copies the selected portion to the clipboard This option is valid when any line is selected on the command line Select All Select all the lines displayed on the VSH Opens a dialog box to display the history information d Operation 90 cd c wworkl Is ca850 cpu 30
369. tings Dialog 44 2 9 Language Option Settings Dialog cceeececceceeeeeeeeeneeeeeeeeeeceeeseaeeseaeesaeeeeaeesaeeseeeeeeeeeaeeeneeseneeeeeeeeaes 46 2 10 Optimization Option Settings Dialog seseriai eners oneni i e aaaea i E SETER Eai Sea hiots 48 2 11 Output t Option Settings Dialog 2 i 4chias ee ie erie ei nile 50 2 12 Qutput2 Option Settings Delage eee deeg al add E genee Eed 53 2 13 Message Option Settings Dialog cceeeesceseseeeeeeceeeeeeeeeeeeeeseeeeaeesaeeseaeeseeseaeseeeeseaeeseeeseaeeseeeeeaeenaes 56 2 14 Other Option Settings Dialog C Compiler eee ceceeeeeeceeeneeeeeeeeneeseeeeeaeeseaeesaeeseaeeseeeenaeessaeeneesnaees 58 2 15 Delete Soutce Option Button NEE eege Ee end ta Eege eene ala naan 60 2 16 Option 1 Settings Dialog Assembler 0 0 ce eeeeeeeeeeeeeeteneeteeeeeeeecaeeeaeeseeeeeeeseaeeseeseaeeseeesteeteeeeeeee 61 2 17 Option 2 Settings Dialog Assembler 0 0 eeeeeeeeeeeeeeeeeeeeeeeeeeeceaeeeeeeeeeeeaeeseaeeseeseaeesneeseeeseeetetee 63 2 18 Other Option Settings Dialog Assembler eeceeeceeeceeeneeeeeeeeeeeeaeeeeeeteeeeseeseaeeseeeseaeeeneeeseeseeeeeeee 66 2 19 File Settings Dialog x etgeteieues tet eile casein en eid ened eg ani eee indent 69 2 20 Option Settings Dialog Link Editor 71 2 21 Other Option Settings Dialog Link Editor eee eeeececeeeeeeeeeeeeeeeeseeeeeaeeseaeeeaeeseaeeseeeeaeesieeeneeennees 74 2 22 Option Settings Dialog ROM Storing Processor cce
370. tion Format b A label Feature The label abe is used as the first address of the created rompsec section If the specified label does not exist in the object file or if the b option has been specified several times a message is output and processing is stopped If this option is omitted it is assumed that __S_ romp has been specified This option creates an object file that contains only the rompsec section and does not contain any sections that have the text attribute If this option is omitted a section that has the text attribute is also included p A section 384 This option includes the contents of the section name section along with its address and size information in the rompsec section If this option is specified more than once these items are included in the rompsec section in the order of their specification If the specified section does not exist in an object file a message is output and processing is stopped If this option is omitted it is assumed that all of the sections that have the data or sdata attribute and with the CA830 the text attribute section and itext section for interrupts which have been located to internal instruction RAM have been specified 2 Other options These specifications set other options Specification Format F A devpath Feature This option searches for the device file first in the directory devpath then in the standard directories If this option is
371. tion PROGBITS data data section PROGBITS gptabname Global pointer table GPTAB itext itext section PROGBITS regmode Register mode information REGMODE relname Relocation information REL relaname Relocation information RELA sbss sbss section NOBITS sconst sconst section PROGBITS sdata sdata section PROGBITS sebss sebss section NOBITS sedata sedata section PROGBITS shstrtab String table holding section name STRTAB sibss sibss section NOBITS sidata sidata section PROGBITS strtab String table STRTAB symtab Symbol table SYMTAB text text section PROGBITS tibss tibss section NOBITS tibss byte tipss byte section NOBITS tibss word tibss word section NOBITS tidata tidata section PROGBITS tidata byte tidata byte section PROGBITS tidata word tidata word section PROGBITS udata1 udata1 section PROGBITS udata2 udata2 section PROGBITS udata3 udata3 section PROGBITS vdbstrtab Symbol table for debug information STRTAB vdebug Debug information PROGBITS vline Line number information PROGBITS 21 name of gptabname relname and relaname indicates the names of the sections corresponding to the respective sections 22 Information used for the processing of the A option of the link editor 421 B 6 Segment This section explains the segment that constitutes a
372. tion type relocation type is not specified Calculation is performed assuming that the gp symbol value is 0x0 no LOAD segments exist for mapping input section section in file file this section is mapped to non LOAD DUMMY segment with no program header A segment having segment type LOAD to which section section in file file can be allocated does not exist This section is allocated to the dummy segment that does not have a program header and cannot be loaded number specified in filling value field must begin with Ox or OX Start the number to be specified as a filling value with either Ox or OX string option ignored string option is ignored string option is illegal when string2 option specified ignored string option must not be specified when string2 option is specified string option is ignored string option must be specified before files Specify string option before specifying a file string option needs argument ignored string option needs an argument and is ignored relocated value value of relocation entry file file section section offset offset type relocation type for branch command become odd value Value value relocated by the branch relocation entry file file section section offset offset relocation type relocation type is an odd number relocated value value of relocation entry file file section section offset offset type relocatio
373. tisfied and if the bss attribute section exists in the segment 0x0 if none of the sbss bss sdata and data attribute sections exist Address determined by the above five rules if no address is specified and if the tp symbol is not specified by specification of a base symbol name or if the tp symbol does not exist even if it is specified a Be sure to end the symbol directive with 64 Section having section type PROGBITS and section attribute AWG 85 Section having section type NOBITS and section attribute AWG 86 Section having section type PROGBITS and section attribute AW 87 Section having section type NOBITS and section attribute AW 292 Figure 3 22 Rules to Determine gp Symbol Value Specifies addess gp symbol value specified address value Yes No gp symbol value is offset to an address of first Specifies base address of lowest sdata symbol name attribute section 32 Kbytes in subjected segment sdata attribute section exists gp symbol value an address of first address of lowest sdata attribute section 32 Kbytes in subjected segment gp symbol value offset to an address of first address of lowest sbss attribute section 32 Kbytes in subjected segment sbss attribute section exists Specifies base symbol name gp symbol value an address of first address of lowest sbss attribute section 32 Kbytes in subjected segment
374. ts and outputs sections in the ascending order of addresses This option converts and outputs the symbol table sections This option is valid only when expanded Tek hex format has been specified fT has been specified This option converts and outputs all of the code in the ROM area defined by the device file to Intel expanded hex format Any unused area is filled with num num specifies a hexadecimal number that begins with either 0x or OX If num is omitted the unused area is filled with Oxff This option outputs hx s version number to standard output and then terminates processing The decimal number specified as num is regarded as the maximum block length value or in the case of the Intel expanded hex format or the Motorola S type hex format the number of code bytes indicated in one data record If this option is omitted the default value for each hex format is used This option offsets the address to be output from num For num specify either a decimal number or a hexadecimal number that begins with either Ox or 0X This option uses the hex format specified by character c If this option is omitted the Motorola S type hex format standard address is used 3 hx handles the directory at the dev position from the hx s installation directory as the standard directory of the device file 4 If a section section having section type NOBITS and section attribute A is specified for the data f
375. ttribute section is allocated for example the TEXT segment of the default link directive as a value Therefore the following code is output when a label defined in the text attribute section is referenced referencing the switch table etc movea Label tp r10 Usually the assembler as and link editor Id set an offset in the label in the section where the label is defined as a label value for a label reference without a symbol such as or appended as shown above However if the label is defined in the text attribute section and if the tp symbol is created by the link directive for the segment to which the section is allocated the offset from the tp symbol is set as a label value In other words a label reference in a segment where the tp symbol is created is processed as a tp symbol offset rather than as an offset in a section Figure 3 28 shows an example of a link directive that references the tp symbol offset Figure 3 28 Example of Link Directive Where label Reference is tp Symbol Offset TEXT1 LOAD RX textl SPROGBITS AX textl a o text2 SPROGBITS AX text2 b o text3 SPROGBITS AX text3 c o TEXT2 LOAD RX text SPROGBITS AX text __tp_TEXT TP_SYMBOL TEXT1 TEXT2 At this time suppose that the assembler codes of the object files a o through c o specified for the mapping directive in the example in Figure 3 28 are as shown in Figur
376. tween when specifying the section name of pragma section It is assumed that no section name is specified and allocated to the reserved section of the specified attribute sorry not implemented option option ignored Option option is not supported at present and is ignored immediate for shift operator is out of range The value of the immediate value specified for the shift instruction exceeds the range of the value that can be specified It is assumed that only the lower valid digits have been specified and processing continues first argument of _rcopy is illegal The first argument of copy routine _rcopy is illegal sorry not implemented option option ignored Option option is not supported at present and ignored redeclaration of symbol symbol is re declared Symbol symbof has different size num1 and num2 Different sizes num and num2 of data symbol symbol are merged Symbol symbof has different alignment size num and num2 Changed to least common multiple value num3 Different alignment size num and num2 of data symbol symbol is merged The size is changed to the maximum common multiple num3 cannot hide symbol symbor Symbol symbol cannot be hidden Argument type mismatch is detected where caller calls callee The types of the arguments of caller and callee differ during inline expansion If the types can be changed they are converted into the types for definiti
377. uest name unexpected end of line missing Enclose a section name in a section file with unexpected character s token An unnecessary token token exists in the section file Check the format of the section file Variable function or file name is missing The description of the variable information of the section file is illegal 185 E2715 E2716 E2717 E2745 E2746 E2747 E7201 E7202 E7203 E7204 E7205 E7206 E7207 E7208 F1001 F1002 186 illegal function variable name symbor Symbol symbol is an illegal function name or variable name Section name is not specified A section name is not specified unrecognized section name section Illegal section name section is specified Both text and itext are specified Both text and itext section allocation cannot be specified for a function V830 Too long section name 256 The section name is too long Specify the name with 256 characters or shorter inconsistent section name for symbor The section name contradicts symbol symbol multiple defined symbol symbor Multiple defined symbol symbol exists redeclaration of symbol symbol is re declared undefined symbol symbol symbol is undefined undefined label Lnum The label Lnum is undefined Argument type mismatch is detected where caller calls callee The argument types of caller and cal
378. ug information line number information and global pointer table This option can be specified only in the non debug mode If Debug is selected from the Option menu this option appears dimmed and cannot be specified Displays the execution status of link editor Suppresses output of warnings Only messages concerning fatal errors will be output Ignores errors relating to relocation When the value resulting from an address calculation for an undetermined external reference is judged as invalid that value is not entered i e is ignored and the previous value is left in place e The value of the result of address calculation which has been judged invalid is not entered for unresolved external reference that is judged as an error and the original value remains e If this option is omitted linking is stopped Outputs a message describing all external symbols that have duplicate definitions and stops linkage If this option is not specified a message describing only the first external symbol with a duplicate definition that is encountered is output and linkage is stopped Ignore Undefined External Symbol Error t Ignores checking the size and sequence requirements for linkage of undefined external symbols If this option is omitted the symbol size and alignment condition are checked If a difference is found a warning message is output and linking continues U CAUTIONS The link editor supp
379. ult memory addresses allocation that is defined for each target device 71 For the details of the device file refer to the User s Manual of the device file 305 1 With CA830 e Segments are sequentially allocated starting from address 0x0 in the sequence described by the default link directive The address of the default link directive is determined by referencing the device file Figure 3 30 shows an example of the V830 e The CA830 includes v830def dir file for a sample which is the default directive when the target device is the V830 Figure 3 30 Default Link Directive CA830 V830 1 2 SIDATA LOAD RW VOx0 Sidata SPROGBITS AW sidata Sibss SNOBITS AM sibss SEDATA LOAD RW VOx1000 sedata PROGBITS AN sedata sebss SNOBITS AM sebss CDATA1 LOAD RW V0Ox8000 cdatal SPROGBITS AW cdatal CDATA2 LOAD RW VOx10000000 cdata2 SPROGBITS AW cdata2 CDATA3 LOAD bw V0x20000000 cdata3 SPROGBITS AW cdata3 UDATA1l LOAD RW V0x40000000 udatal SPROGBITS AW udatal UDATA2 LOAD bw V0x50000000 udata2 SPROGBITS AW udata2 306 Figure 3 30 Default Link Directive CA830 V830 2 2 UDATA3 D I DATA CONST SCONST tp TI LOAD RW V0x60000000 udata3 SPROGBITS AW udata3 LOAD RW VOx80000000 data PROGBITS AW sdata PROGBITS AWG sbss SNOBITS AWG b
380. ument of W Option ssssussssnnsnunsnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnunnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn 172 2 3 Cautions on Specifying Options cceeccesscceseeeeeeeeeeesseeeeneeeeesseaeseseeeeeseeeseeneenenenees 174 224 TU TE 174 CHAPTER 3 MESSAGES a aeaa sett ee Reh EEN Ee 175 3 1 Message La LU LEE 175 3 2 ET E 176 VOLUME 4 HANDLING ASSEMBLER wisssiscescssvcsisisstnscssecectsacestavcstacviendacsicvternenthavieacsseriden 199 CHAPTER 1 OVERVIEW a arar a eraa ESENEEAEEE turienei arais 200 TI How otOp raton a aa deed eege 200 Tte Handing Fes seirian iensceeendeenrecccctensgeeedsuenareuecuenedenttuuerseseecpueseeeensuensteeetsien 200 CHAPTER 2 DRETT sduadeeusaetsataedtaceeensceeecces 201 2 1 Command Input Format from VSH Command Line ccceseceesseeeeeeeeeeseeeeeneeeees 201 2 2 Types and Features Of Options cccccsseecceseecesseeeeeeeeeesneeenseeeesseesseseeeesseeeseseeeeeenees 201 SL Option Jet gedeien Eeeieeed eege eege eege ed 201 1 Optimization Option i n cccesciceecsceciecsc ects cine cctenecccsneeesctvscecesceeedeesaneeececucucsneennnweceates 201 2 OUTPUT OPtl OMS oo ae 6s soce ds seecececsceesceetsncte does nasan cnnesancecaessnncescecsasnesntesndecunuenuceescaevenentoctss 202 3 Message options cecseseeeseeeeneeeeeeseeeeeseneeeaseeeeaseeeeeseeeeeaseeesaseeeeeaseeeasenesanenenenseeees 203 4 ee e LE 204 2 3 Example geess Ee e ieee eed een ties 207 CHAPTER 3 ASSEMBLE LIST gee
381. use shell function VSH is added in CA the activation from command interface is possible 23 Figure 1 1 Package Organization Figure Project Manager Shell for CA VSH Specifying Option Too DLL Command line initiation CA Package Command Seet E a aa Archiver C Compiler a Hex converter Assembler Disassembler Link Editor R D ROM storing processor Dump command Section file generator V850 D D D D D D D D D nn mn nmn mn mn nmn nmn ng The Project Manager runs on Windows and supplies graphical application development environments so that an application load module can be created by specifying an option of the C compiler assembler or link editor can be specified from the Project Manager to automatically execute their commands The V800 Series C compiler package also supplies a shell VSH function as an application development environment on the command line VSH allows utility tools such as archiver and hex converter in addition to the C compiler assembler link editor and ROM storing processor to run like the command line of MS DOS prompt 24 CHAPTER 2 INSTALLATION This chapter explains the operating environment installation of supplied medium and points to be noted of this compiler package 2 1 Operating Environment This compiler package runs in the following environments Machine Machine which can operate Microsoft Windows 95 Operating System Microsoft Windows 95
382. value shown in Table 3 3 Be sure to end a segment directive with Table 3 3 Default Value of Each Item Item Default Value Address Address 0x0 for first segment and values following end of segment for other segments Maximum memory size 0x100000 Hole size 0x0 Filling value 0x0000 Alignment condition 0x8 42 In some examples of the segment directive given later specification of the mapping directive is omitted This is only for simplifying the explanation In actuality if the mapping directive was not specified the segment directive would be ignored 265 3 4 3 1 266 Explanation of each item that can be specified for segment directive Segment name Specify the name of a segment to be created e Because the address allocated to a segment is dependent on the sequence in which the segment is described it is recommended that if the segment name to be described is that of a segment whose address is fixed the sequence be the same as the segment sequence of the default link directive refer to pages 307 through 313 e To specify addresses for segments sequentially describe them from the allocated one to the lowest one refer to page 269 e An identifier of an appropriate length consisting of appropriate characters shown on page 255 can be used for a segment name A segment name does not remain as information in the output object file e The segment name
383. various command functions see the command specific descriptions in Volume 3 and later volumes e Volume 3 and later volumes contain lists of options for the various commands including some options that are not shown in the dialogs These include options that do not have to be activated from the Project Manager and options that cannot be specified from the Project Manager because they are fixed refer to page 29 for work directory description For example the device specification cpu that is in the option list for the ca and as commands is not included since the device specification is already made when setting a project via the Project Manager e Debugger options such as g of ca and as are not included in the option dialog described in the next section With the Option menu the debug mode can be switched Checking be Debug on the menu sets the debug mode and not checking sets the non debug mode The default setting is debug mode 2 5 1 Setting compiler options The C compiler option setting dialog box for the C source file can be displayed by performing either of the following operations after a project has been set with the Project Manager e Click the Option menu Click Compiler Options e Click the Option menu Click Source List Click the source file for which options are to be set Click the Options button Th
384. vated from the VSH window s command line 4 3 1 VMAKE input syntax VMAKE A option A target A macro Text enclosed in square brackets can be omitted Indicates that the previous pattern can be repeated A Indicates one or more blank spaces In the above synopsis target specifies the name of the object file or source file to be generated by the command that is activated from VMAKE This name is specified in a make file Examples A gt vmake f make org userlm lt References the make org file and generates the target userim A gt vmake userlm lt References the makefile file and generates the target userim 140 4 3 2 List of options The types of options and their functions are listed below Specification Function This displays the VMAKE version It is not executed This displays the reason for generating a target f A file This specifies the file file as a make file If this option is omitted the specification makefile is assumed This generates a target without referring to the activated commande termination status If this option is omitted it refers to the termination status This displays the command for generating the target It is not executed This displays all macro definitions and command descriptions It is not executed If this option is omitted execution is performed without displaying macro definitions and command descriptions This retur
385. ve An unnecessary token is found after preprocessing directive directive The unnecessary token is ignored unexpected non whitespace before preprocessing directive A character other than a blank character space exists before a processing directive unrecognized pragma directive pragma directive ignored pragma directive is not recognized This pragma directive is ignored constant out of range The constant value exceeds the range in which it can be expressed It is assumed that only the lower valid number of digits has been specified hexadecimal digit out of range The range in which a hexadecimal value can be expressed is exceeded The last two characters are valid with this processing system Declaration of name hides parameter Because a symbol name identifical to that of the argument exists the symbol is assumed to be valid and declaration of the argument is hidden This warning message is error message E2211 when the ansi option is specified W2215 W2222 W2231 W2244 W2245 W2268 W2287 F2289 W2291 W2293 W2302 W2306 Undeclared function function is called Function function that is not declared is called Plain int bit field is treated as unsigned int The bit field of plain int is regarded as unsigned int Initialization of non auto pointer using non number initializer is not position independent The code for an initialization directive using an initial value other th
386. with the CPU e If the p option and O option for optimization of the as are specified at the same time p takes precedence and O is ignored e If a code pattern that generates a fault straddles over different sections the function of this option is invalid The type and meaning of num are as follows For the instructions and registers refer to the manual of each CPU 1 Xv850patch 1 p1 Insert a nop instruction immediately after the first Id w in respect to the combination of Id w instruction st b h w sst b h w instruction Id b w sld b w instruction branch instruction Example gt Id w Id w dw gt nop jarl Id w jarl 2 Xv850patch 2 p2 Insert a nop instruction between the load store instruction and branch instruction in respect to the combination of Id w sld w st w sst w instruction branch instruction Example gt Id w Id w jarl gt nop jarl If the pattern of num 1 is processed at the same time the pattern of num 2 is searched and processed first An unnecessary nop instruction needs not to be inserted 206 3 Xv850patch 3 gt p3 Insert the clr1 instruction in respect to the corresponding interrupt control register immediately before the reti instruction Example gt reti gt clr1 5 POICO reti None Xv850patch p Inserts each code to all the types 1 through 3 2 3 Example Here are some examples of using the as e To create assemble list
387. x INPUT FILE crtN o main o func o stremp o 1lib830 r32 libc a main o func o bf ee Do nil TELNE ZANELE 318 To this link map the following items of information are output 1 2 3 4 5 Output section Name of the output section constituting the object file to be created Input section Name of the input section allocated to each output section Address First address of the output section and the input section Size Size of the output section and the input section Input file Name of the object file to which the input section belongs The section created with the Id as well as symtab strtab and shstrtab created by the as included in this compiler package are marked nil If the object file to which the input section belongs is an object file in the archive file the name of the archive file is also displayed in the format object file name archive file name 319 CHAPTER 5 SUPPLEMENT This chapter explains the supplementary information on the Id 5 1 Using Archive File The archive file is created by linking two or more object files with the archiver ar The Id searches the archive file for an unresolved external reference at the point where the archive file has been specified gt and links only the necessary object files The archive file can be also specified in the mapping directive of the link directive If the archive file is also
388. xisting in the specified archive file If a member name has not been specified this option outputs to standard output the member names of all members existing in the specified archive file If amember name has been specified and if the specified member exists in the specified archive file this option extracts that member and creates a file having the same name If a member name has not been specified this option extracts all of the members existing in the specified archive and creates files having the same names The contents of the archive file are not changed 2 2 2 Option list The following table lists options of the ar Specification Format Feature This option does not output message This option outputs this archiver s execution status using the format a d q m r x file name a file name d file name Delete q file name Create new m file name r file name Replace x file name Extract cfile This option handles cfile as a command file refer to page 161 If this option is omitted it is assumed that no command file has been specified 2 3 Examples of Use Here are examples of using the ar e To update a member ar850 ru file a a o If object file a o is updated more recently than the member a o of archive file file a object file a o replaces member a o of archive file file a e To extract a member ar850 xv file a a o Member a o is extracted from archive file file a and object file a o
389. y has run short by num characters compiler limit too many macro definitions num The number of macro definitions exceeds the limit The maximum value of this processing system is num compiler limit too long macro name name num The length of the macro name name is too long The maximum value of this processing system is 1023 redeclared macro parameter name The parameter name of a macro is re defined unexpected non whitespace before preprocessing directive A character other than a blank character space exists before a preprocessing directive undefined control The description of the preprocessing directive following is incorrect compiler limit too many include nestings num The number of times of nesting of the include directive exceeds the limit The maximum value of this processing system is 50 errmsg The error indicated by errmsg has occurred This message is displayed if the error directive is used in the source program compiler limit initialization nests too deep num The nesting of the initializer list is too deep The maximum value of this processing system is 100 compiler limit too many case labels num The number of case labels in the switch statement exceeds the limit The maximum value of this processing system is 1025 cannot recover from earlier errors The processing cannot continue as a result of the error that previously occurred unknown cpu type cannot compile Compil
Download Pdf Manuals
Related Search
Related Contents
DL-32 Multi-sensor Universal Data Logger User Manual relación de bajas 2013 1 panela de arroz e vaporeira (1.5l) 0E-222 TENISPLAST Bleuets nains, pour l`année de taille Herbicide VENTURE L manual de utilização e manutenção manual de utilização e 69-1849S - PRO TH4110D Programmable Thermostat Regina Plus 40T Regina Plus 90T A190146 Kensington BlackBelt 1st Degree Rugged Case for iPad® mini - Black Copyright © All rights reserved.
Failed to retrieve file