Home
M3T-SRA74 V.4.10 User`s Manual
Contents
1. Command Addressing mode Entry format SEB Zero page bit SEB 1 77 SEB bitsym SEC Implied SEC SED Implied SED Implied SET Implied SET SLW Implied SLW STA Zero page STA 22 STA bitsym Zero page X STA zz X Zero page indirect X STA zz X Zero page indirect Y STA zz Y Absolute STA hhll STA bitsym Absolute X STA hhll X Absolute Y STA hhll Y STP Implied STP STX Zero page STX 22 Zero page STX zz Y Absolute STX hhll STY Zero page STY 22 Zero page X STY zz X Absolute STY hhll TAX Implied TAX TAY Implied TAY TST Zero page TST 22 TSX Implied TSX TXA Implied TXA TXS Implied TXS TYA Implied TYA WIT Implied WIT Note 1 When a bit symbol is entered into the operand of the STA command only the address of the bit symbol is valid 1 72 5 Renesas Technology Corp SRA74 APPENDIX C Commands Listed by Addressing Mode C 1 List of commands by addressing mode Listed below are command coding formats by addressing mode The symbols used in the descrip tion are listed in the symbol table in Appendix B 1 1 Implied Commands Coding Format BRK CLC CLD CLI CLT CLV DEX BRK DEY INX INY NOP PHA PHP PLA PLP RTI RTS SEC SED SEI SET SLW STP TAX TAY TSX TXA TXS TYA WIT 2 Immediate Commands Coding Format ADC AND CMP CPX CPY EOR ADC imm LDA LDX LDY ORA SBC 3 Accumulator
2. Command Addressing mode Entry format CPX Immediate CPX imm Zero page CPX 22 Absolute CPX hhll CPY Immediate CPY imm Zero page CPY 27 Absolute CPY hhll DEC Accumulator DEC A Zero page DEC 22 Zero page DEC zz X Absolute DEC hhll Absolute X DEC hhll X DEX Implied DEX DEY Implied DEY DIV Zero page X DIV zz X EOR Immediate EOR imm Zero page EOR 27 Zero page EOR zz X Zero page indirect X EOR 22 Zero page indirect EOR 22 Absolute EOR hhll Absolute X EOR hhll X Absolute Y EOR hhll Y FST Implied FST INC Accumulator INC A Zero page INC 27 Zero page INC zz X Absolute INC hhll Absolute X INC hhll X INX Implied INX INY Implied INY JMP Absolute JMP hhll Zero page indirect JMP zz Absolute indirect JMP hhll 434 NESAS Renesas Technology Corp 1 69 Appendix B List of commands Command Addressing mode Entry format JSR Absolute JSR hhll Special page JSR Zero page indirect JSR 22 LDA Immediate LDA imm Zero page LDA 22 LDA bitsym Zero page X LDA zz X Zero page indirect X LDA zz X Zero page indirect Y LDA zz Y Absolute LDA hhll LDA bitsym Absolute X LDA hhll X Absolute Y LDA hhll Y LDM Zero page LDM stimm zz LDX Immediate LDX imm Zero page LDX 22 Zero page LDX 22 Absolute LDX hhll Absolute Y LDX hh
3. 17 Example of error display 18 5 Renesas Technology Corp List of Tables 4 1 List of command parameters 4 2 List of rror levels u adds cav List Of system errors uuu naiiai aaaeaii aiaiai waa 2 iii 434 NESAS RenesasTechnology Corp CHAPTER 1 The Format of the Manual The LINK74 operation manual contains the following chapters Chapter 2 Outline The basic functions of LINK74 and the files which it generates Chapter 3 Section functions The sections the basic operational units of LINK74 Chapter 4 Operating method How to enter the commands used by LINK74 Appendix A Error messages A list of the error messages used by LINK74 along with clarifications of the content of the messages and appropriate user responses 434 NESAS Renesas Technology Corp Chapter 2 Outline CHAPTER 2 Outline LINK74 links the relocatable files produced by SRA74 with library files to produce machine lan guage data files for the 740 Family 2 1 Functions LINK74 can be used in conjunction with debugger for 740 family The following functions are provided to ensure that the RTT74 and LIB74 functions can be used to the full 1 LINK74 joins together in series all areas from separate relocatable files
4. eee 54 8 4 Example of error display 56 1 iv 5 Renesas Technology Corp List of Tables 4 17 List of operators 29 5 1 List of structured language operators 37 7 1 List of macro operators J 46 8 1 List of command parameters J 51 8 2 Listof error levels ETC n 57 List of system errors IL erm rne ino c da Ev aae aa aai RUE 59 A 2 List of assembly errors 60 A 3 List of warnings au u recon uh onn ki aana ranpa ranana tamaaa iurati Saanane 65 B 1 List of symbols easi u aaa asss a bann Ea ssssawawawawasasasawasasssssssassasasasasss 66 B 2 List of Commands 67 F 1 Symbols used in examples 121 F 2 Register and flag assignment statement generation examples 121 F 3 Memory assignment statement generation examples 123 F 4 Addressing mode assignment statement generation examples 123 F 5 Dual term operation assignment statement generation examples 126 F 6 Flag conditi
5. 3 4 1 LEE 3 4 2 Value for return to operating system 3 5 Environment variables Appendix A Error messages A 1 System errors A 2 Library manager errors 3 i 5 Renesas Technology Corp List of Figures 2 1 2 2 2 3 3 1 3 2 3 3 3 4 3 5 3 6 LST file output example 1 list of modules 4 LST file output example 2 list of global labels and symbols 5 LST file output example 3 list of global labels and symbols for each module 6 Command line input Example 1 deleting a module 12 Command line input Example 2 Adding relocatable files 12 Specifying a command lile 13 Command file layout Example 13 Example of display when LIB74 terminates normally 13 Help screen for command line errors 14 3 ii 5 Renesas Technology Corp List of Tables 3 1 List of command parameters 9 3 2
6. 0 0 STACK RAM CL WORKO WORK1 ram clear fAD INT OK OFF 33 1 X 2 A D convert 2 times 34 1 do 35 1 2200 E 0 JSR DATA f Indicates reference to external label WORKO WORKO AD RESULT WORK1 WORK1 O with c X X while X 0 A D DATA average WORK1 WORK1 1 gt gt 1 WORKO WORKO gt gt 1 with c AD DATA WORKO END 36 1 37 1 38 391 40 1 411 421 431 44 e CO OO OO OO OCH ERROR COUNT 00000 WARNING COUNT 00000 STRUCTURED STATEMENT 00014 LINES INE SOURCE 00044 LINES INE OBJEC 00044 LINES INE SOURCE 00000 LINES INE OBJEC 00000 LINES SIZE Z 00005 0005 BY Indicates section name up to 32 chars SIZE AD CONVERT 00044 002C BY Fig 2 5 Example of a PRN file Second half of source file No I parameter 1 11 434 NESAS Renesas Technology Corp Chapter 2 Outline 740 Family SRA74 V 4 0 USED BOLS TYPE d OPTION USED SYMBOLS TYPE EQUATE Symbol name output up to 32 characters OFF 0000p STACK TIndicates public label USED SYMBOLS TYPE BIT EQUATE fAD INT OK 4 00FEp f Indicates the relevant bit with valu
7. Appendix C Commands listed by addressing mode C 1 List of commands by addressing mode 1 ii 5 Renesas Technology Corp 39 39 41 41 42 43 44 44 45 45 45 46 66 66 66 73 Appendix D The pseudo commands D 1 How to use the pseudo command reference section 77 D 2 Summary of the pseudo commands 77 D 3 List of reserved 99 Appendix E List of macro commands 105 E 1 How to use the macro command reference section 105 E 2 Summary of the macro commands 105 Appendix F List of structured commands 116 F 1 Using the structured command reference section 116 F 2 Summary of the structured commands 116 F 3 Generation example 121 F 3 1 Assignment statement generation example 121 F 3 2 Conditional expression generation 128 FA Syntax maps of structured commands 135 List of Reserved Words 145 1 iii 5 Renesas Technology Corp List of Figures 2 1 Exam
8. 5 Renesas Technology Corp 3 3 Methods of entry 2 If the each Command file input is convenient when there are too many files or too many characters to use command line input The command file name is specified as shown in fig 3 3 when activating LIB74 by entering in front of the file name In fig 3 3 the contents of CMD DAT are executed as the command The contents of the command file are the same as for command line input the LIB74 can be omitted however The lt RET gt is disregarded so long commands can be entered on several lines The example in fig 3 2 can be written as the command file shown in fig 3 4 command has been entered correctly LIB74 starts processing As soon as the processing of LIB74 command terminates a termination message is shown on the screen and processing finishes Fig 3 5 shows an example of the display when LIB74 processing has terminated nor mally A gt LIB74 CMD DAT lt RET gt Fig 5 iB FI 3 3 Specifying a command file 2 FI Fig 3 4 Command file layout Example A LIB74 AVO TEST LIB F SUB 1 SUB_100 lt RET gt 740 Family LIBRARY MANAGER V 1 00 10 Copyright 1989 1998 MITSUBISHI ELECTRIC CORPORATION AND All MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION Rights Reserved test lib Create APPI MOD END FILE s
9. 8 2 2 Command parameters 1 command parameter consists of a minus sign followed by one or two characters 2 Both upper case and lower case characters are remain valid for command parameters 1 50 SRA74 5 Renesas Technology Corp 8 2 Input parameters 3 Each parameter is capable of multiple specification at the same time In such cases each parameter should be separated from the next by a space prior to entry 4 Two consecutive minus signs can be used to disable a command parameter For example L suppresses the generation of PRN file 5 Command parameters specified with the environment variable SRA74 are processed first Table 8 1 describes the contents of the command parameters Table 8 1 List of command parameters Command parameter Description Inhibits the output of messages other than error messages to the VDU This parameter should be used when using SRA74 with batch files for example and only error messages are required to be shown on the screen 8 Makes the calculation result the lower 8 bits of the value after carrying out a operation A Specifies that the program is entered only in assembly language BANK Expands the address area upper limit from FFFFH to 1FFFFH Opera tors BK and BL can be used Section E information is not output to relocatable files or list files C Outputs source line debug data for all lines in the file D Sets a symbol s numerical
10. 3 15 5 Renesas Technology Corp Appendix A Error messages APPENDIX A Error Messages A 1 System errors When a system error is detected during LIB74 operation an error message is displayed on the VDU and processing is suspended Table A 1 lists all the system errors A 2 Library manager errors When a processing error is detected during LIB74 operation an error message is displayed on the VDU and processing is suspended Table A 2 lists all the library manager errors 3 16 SRA74 5 Renesas Technology Corp A 2 Library manager errors Table A 1 List of system errors Error message Description and user action Usage A gt LIB74 adluvxz o The command has been input wrongly filename f lt filename gt Refer to the help screen and input the command again Can t open xxx File not found Check that the file specified with O or F parameter exists in the specified directory Can t create xxx This file cannot be generated Check the specification of the O parameter and input again Out of disk space There is not enough space left on the disk selected for output Create more space on the disk Input file read error xxx Error occurred during file read process gt This error involves the operating system It most fre quently occurs when there is a hardware problem with a disk drive Internal error An internal error has occurred in LIB
11. comma Example ADC ZWORK X 6 Zero page Y Method by which the zero page address is qualified by register Y as the target data The register name Y should be entered after a comma Example LDX ZWORK Y 1 25 5 Renesas Technology Corp Chapter 4 Assembly language 1 26 7 10 11 12 13 14 Zero page indirect Method by which the target data is indicated to be in indirect memory The zero page address which holds the target address is entered into the operand and the 2 byte target address is stored in the memory The operand value should be enclosed by Example JMP ZWORK Zero page indirect X Method by which target data is indicated to be in indirect memory and qualified by register X The zero page address which holds the target address is entered into the operand and the 2 byte target address is stored in the memory The register name X is entered after a comma and the operand value should be enclosed by Example ADC ZWORK X Zero page indirect Y Method by which target data is indicated to be in indirect memory and qualified by register Y The zero page address which holds the target address is entered into the operand and the 2 byte target address is stored in the memory The register name Y is entered after a comma and the operand value should be enclosed by Example ADC ZWORK Y Absolute Method by which a general page a
12. now processing pass 1 now making cross reference SRCFILE1 A74 Out of heap space A Fig 3 3 Error display 4 6 SRA74 434 NESAS RenesasTechnology Corp 3 4 Errors 3 4 2 Value for return to operating system When entering an execution command into an operating system DOS batch file for example there are times when you may wish to change the contents of the processing operation in accordance with the outcome of the execution In CRF74 the execution results are divided into 3 error levels as shown in Table 3 2 and returned to the operating system For an explanation of how to make best use of these error levels please refer to a commercially available MS DOS handbook Table 3 2 List of error levels Error level Description of execution results 0 Normal termination 1 Error due to not being able to find source file specified by pseudo command INCLUDE 2 Error relating to input of CRF74 commands 3 Error relating to the operating system 3 5 Environment variables CRF74 does not use operating system environment variables 4 7 5 Renesas Technology Corp Appendix A Error messages APPENDIX A Error Messages A 1 System errors When a system error is detected during CRF74 operation an error message is displayed on the VDU and processing is suspended Table A 1 lists all the system errors Table A 1 List of system errors Error message Description and user
13. 5 Renesas Technology Corp Chapter 5 Structured language 7 Accumulator value Most structured language operations use the accumulator Therefore note that the value in the accumulator will change after executing the following type of structured language state ment WORK 1 DATA2 LDA DATA1 CLC DATA2 STA WORK IF WORK amp OFH gt 4 LDA WORK AND 40FH CMP 4 BEQ 10 BCC 10 H X 4 X INX ENDIF Dages However transfer to and comparison of registers are generated into efficient assembly lan guage without the use of accumulators X WORK LDX WORK IF X gt WORK 1 CPX WORK BEQ I0 BCC 10 gt Y Y INY ENDIF SLOS Refer to the dual term operation assignment statement generation example in Appendix F 3 1 for details 5 4 Structured operators Table 5 1 lists the operators which may be used with the structured language 1 36 SRA74 5 Renesas Technology Corp 5 4 Structured operators Table 5 1 List of structured language operators Type Operator Description Single term operator Indicates positive number Indicates negative number Takes ones complement Increment Decrement Dual term operator 1 Addition 1 Subtraction i Multiplication 2 Division 902 Division surplus amp Each bit AND Each bit OR A Each bit exclusive OR amp amp 3 Logic AND Logic OR lt lt
14. 5 Renesas Technology Corp List of Figures 2 1 22 3 1 Command line input Example 3 2 Help screen for command line errors 3 3 Error display 4 ii 5 Renesas Technology Corp List of Tables 3 1 List of command parameeters 3 2 List of error levels Ec EC Hore usua o eae Roe Ra Pa en p asas List of system errors nk iade ce curd annainn Rara noo A 2 List of cross reference errors 4 iii 434 NESAS RenesasTechnology Corp CHAPTER 1 The format of the Manual The CRF74 operation manual contains the following chapters Chapter 2 Outline The basic functions of CRF74 and the files which it generates e Chapter 3 Operating method How to enter the commands used by CRF74 Appendix A Error messages A list of the error messages used by CRF74 along with clarifications of the content of the messages and appropriate user responses 4 1 434 NESAS Renesas Technology Corp Chapter 2 Outline CHAPTER 2 Outline CRF74 is a program for creating a cross reference list of labels and symbols in a source file This list is very useful in helping you to understand t
15. 0 lt Structured command becomes comment CLD lt Structured inst converted to assembly language T 0 CLT z s STACK LDX STACK 1 1 1 1 1 1 cates symbol reference TXS CL WORKO WORK1 ram clear LDA 0 dicates macro expansion REPEATI ram WORKO WORK1 ram END STA WORKO STA WORK1 END fAD_INT_OK OFF CLB fAD INT OK cates reference to bit symbol A A D convert 2 times LDX 2 5 OO Oo 0 O Oo Fig 2 8 Example of a PRN file Middle part of source file Uses 1 parameter 5 Renesas Technology Corp 2 2 Generating files JSR ET AD DATA WORKO WORKO WORKO E01 E01 E01 01 AD_RESULT WORKO 1 0 with c RK1 E01 E01 E01 0 RK1 EOIE CA EOIF E000 E021 DOEC CO OO OO OO OO OO OO OO cO OC CH Family SRA74 V 4 00 OC OBJ S NM ios Sale d E STATEMENT 8 64 65 66 67 68 69 1 70 71 1 72 1 73 0 A D DATA average CLC WORK1 WORK1 gt gt 1 LSR WORK1 WORKO WORKO 551 with c ROR WORKO AD DATA WORKO LDA WORKO STA AD DATA COUNT 00000 WARNING COUNT 00000 STRUCTURED 5 EME 00014 LINES LINE 00043 LINES LINE 00073 LINES LINE 00000 LINES INE
16. A macro definition may or may not have arguments attached but where a macro with argu ments is used then the necessary arguments must be transferred by the macro call state ment When a macro call is made and the arguments are generated then they will be transferred in the order in which the dummy arguments have been entered into the macro definition Either assembly language commands structured language commands system macro com mands or pseudo commands can be entered between MACRO and ENDM However macro definition must not be nested for more than 20 levels Providing a macro call follows a macro definition then it may be located anywhere in the program lf however a macro definition appears only after the macro call then this will be registered as an error The arguments which are specified in the operand by the macro call are substituted in order from the left for the corresponding dummy arguments in the macro definition It does not matter if the number of actual arguments and the number of dummy arguments entered at the original definition stage do not agree but if the number of actual arguments exceeds the number of dummy arguments then the surplus is ignored and if the number falls short then the shortfall is treated as null characters a character string with zero length Any number of actual arguments may be specified regardless of the number of dummy arguments used in the macro definition but they must a
17. Error level Description of execution results 0 Normal termination 1 Forced termination caused by C cntl C 2 Error relating to the operating system 3 Error relating to content of source file the which constitutes the object of the operation 4 Error relating to input of CV74 commands 3 5 Environment variables CV74 does not use operating system environment variables SRA74 5 Renesas Technology Corp A 1 List of errors APPENDIX A Error Messages A 1 List of errors Table A 1 List of errors Error message Description and user action H and S are used Both the H and S options were specified at the same time Specify one or the other is specified in the filename The specified file name contains a period Check the file name Can t create xx file The xx file cannot be generated Check directory capacity Can t create temporary file A temporary file could not be generated Specify a directory in the environment variable TMP so as to create a temporary file in a directory other than the current one Can t open xx file The xx file cannot be opened Check the file name Command line is too long There are too many characters in the command line Reinput the command line File format error The input file format is illegal Check the file format Hex files number exceed 1 Multiple target
18. Commands Coding Format ASL DEC INC LSR ROL ROR ASL A 4 Zero page Commands Coding Format ADC AND ASL BIT CMP COM CPX ADC zz CPY DEC EOR INC LDA LDX LDY LSR ORA ROL ROR RRF SBC STA STX STY TST LDM LDM imm zz 1 73 5 Renesas Technology Corp 5 Zero page index X Commands Appendix C Commands listed by addressing mode Coding Format ADC AND ASL CMP DEC DIV EOR INC LDA LDY LSR MUL ORA ROL ROR SBC STA STY 6 Zero page index Y Commands ADC 22 Coding Format LDX STX 7 Zero page indirect Commands LDX zz Y Coding Format JMP JSR 8 Zero page indirect index X zz Commands Coding Format ADC AND CMP EOR LDA ORA ADC zz X SBC STA 9 Zero page indirect index Y Commands Coding Format ADC AND CMP EOR LDA ORA ADC zz Y SBC STA 10 Absolute Commands Coding Format ADC AND ASL BIT CMP CPX CPY ADC DEC EOR INC JMP JSR LDA LDX LDY LSR ORA ROL ROR SBC STA STX STY 11 Absolute index X Commands Coding Format ADC AND ASL CMP DEC EOR INC ADC hhll X LDA LDY LSR ORA ROL ROR SBC STA 1 74 SRA74 5 Renesas Technology Corp C 1 List of commands by addressing mode 12 Absolute index Y Commands Coding Format ADC AND CMP EOR LDA LDX ORA ADC hhll Y SBC STA 13 Absolute indirect Com
19. Q or q at the end Example BYTE 70 Example BYTE 700 Example BYTE 700 e Decimal numbers Should be composed of decimal figures without a further special identification Only integers such as 23 or 256 may be entered Example BYTE 100 e Hexadecimal numbers Should be composed of hexadecimal figures with either at the head or H or h at the end Where the head starts with the alphabetic charac ters A F please insert 0 at the beginning Example BYTE 64 Example BYTE 64H Example BYTE OABH 2 Character constants Characters defined by the ASCII code may be used e Character constants should be enclosed within either single quotes or double quotes Each character corresponds to 7 bit ASCII code most significant bit 0 Example BYTE A To set 4116 3 Symbolic constant There 4 types of symbol which are used to indicate a symbol bit symbol label or the head of the current statement Bit symbols have the value allocated to the bit and the address to which that bit belongs Symbols have an absolute value whereas labels and have either relative or absolute values ks SRA74 5 Renesas Technology Corp 4 3 Operators Example WORD SUB gt Sets the address of the label SUB Example BRA 2 Causes a jump to an address located by adding 2 to the current address 4 Expression
20. A gt LINK74 CMD DAT lt RET gt Fig 4 6 Specifying a command file MAIN SUB WORKRAM 100 PROM C000 DROM r Fig 4 7 Command file layout Example 2 17 5 Renesas Technology Corp Chapter 4 Operation method 4 4 Errors 4 4 1 Types of error The types of errors which occur during the operation of LINK74 have the following causes 1 Errors relating to the operating system These are errors such as insufficient disc or memory capacity which relate to LINK74 s operating system Please refer to the list of error messages in Appendix A and proceed according to the operating system commands 2 Errors relating to the input of LINK74 command lines These are errors relating to the input of the command lines to activate LINK74 Please study the contents of this chapter and then enter the relevant commands again 3 Errors relating to the contents of the relocatable files constituting the object of the linking operation These are errors relating to the relocatable files such as the dual definition of a global label or reference to an external label which has not been defined Please correct the relevant contents of the source file and carry out the assembly operation again where required 4 Error relating to LINK74 functions This error occurs if the SRA74 and LINK74 versions do not match Please ask your supplier if you require a more detailed explanation LINK74 outputs the details of an error
21. FLAG3 FLAG4 Whether to assemble this section depends on the truth table shown below ENDIF if FLAG is true FLAG1 FLAG2 FLAG3 FLAG4 Result TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE may be either 1 86 5 Renesas Technology Corp ENDIF if FLAG is false E if argument SRA74 D 2 Summary of the pseudo commands INCLUDE File read in Format A INCLUDE Afile name Description The contents of the file specified in the operand will be read into the location in which this pseudo command is entered name of the file should always be specified in full This pseudo command can be nested up to 4 levels The nesting level is output to the print file Example INCLUDE TEST INC Reads in the contents of TEST INC LIB Library file name specification Format A LIB A file name file name file name Description Specifies the name of a library file forming the target of a link operation Only files with the attribute LIB may be specified The specification of any other file will result in an error being registered during the link operation This pseudo command cannot be nested directory path and file attribute LIB may not be entered in the file name Example
22. This pseudo command should be entered prior to the line in which reference is made to the label Example SECTION P EXT WORK1 WORK2 SEX SUB START LDA WORK1 JSR SUB SMOD ROM area specification special page Format A SMOD Description Specifies that the area from this command onwards is a special page ROM area This command is equivalent to the insertion of S into the operand of the pseudo command SECTION This specification will remain valid until another area specification command is received Example SMOD EXT AIN SUB ENZAN ENZAN CLT 1 96 SRA74 5 Renesas Technology Corp D 2 Summary of the pseudo commands VER Program version specification Format AVER A character string Description Specifies the version of a relocatable f the parameter V is specified then the LINK74 will check that there is correspondence between the version specifications in each relocatable file It is thereby possible to check the version coordination between different relocatable files For further information concerning the V parameter please refer to the LINK74 operation manual The correspondence between versions is checked by means of a comparison of character strings Care should be taken when entering since a distinction is made between upper case and lower case characters This pseudo command may only be entered once
23. BYTE UB BYTE re BYTE dE BYTE Te ENDM REPEATI macro command Format A label A REPEATI Adummy argument real argument real argument real argument Description 1 114 Assembly is repeated until ENDM is reached in accordance with the number of arguments entered in the operand One argument is withdrawn from the arguments entered in the operand and transferred to the dummy argument each time the operation is repeated The label given to the REPEATI command line becomes the first label of the generated line Assembly language commands structured language commands macro commands and pseudo commands other than INCLUDE may be coded between REPEATC and ENDM However macros must not be nested for more than 20 levels Numerical constants character constants symbolic constants labels and character string constants may be entered as real arguments Other macro commands may not be entered If spaces tabs or commas are included in a real argument then the whole argument must be enclosed within SRA74 5 Renesas Technology Corp E 2 Summary of the macro commands Example Example 1 Source entry example SUB REPEATI INST NOP LDA 1 JSR SUB1 RTS T d Dummy argument Real argument INST ENDM After macro generation SUB NOP LDA 1 JSR SUB1 RTS ENDM Example 2 Source entry example DATA REPEATI VAL 0 1 2 HE
24. LIB LIB1 LIB2 LIB3 1 87 5 Renesas Technology Corp Appendix D The pseudo commands LINE LIST Specification of number of lines per page Default value 54 Format A LINE numerical expression Description Specifies the number of lines 5 255 per page of a list This pseudo command may be used only once in a program Example LINE 60 Sets the number of lines to 60 Initiate list output Preset value 1 88 Format A LIST Description Performs the output of a list to the PRN file This is used to restart the output of a list following suspension of output to the PRN file by means of the pseudo command NLIST Example NLIST Inhibits the output of the list 2 There will no output to the PRN file until LIST LIST Initiates the output of the list Output is to the PRN files which follow this pseudo command SRA74 5 Renesas Technology Corp D 2 Summary of the pseudo commands LISTM Initiation of list output of macro generation section Preset value Format A LISTM Description Outputs the macro command generation section to the PRN file Used to restart list output following suspension of the macro generation section output means of the pseudo command NLIST e In cases where the pseudo command NLIST has been used to inhibit total list output then the LISTM command is invalid Example
25. SWITCH CASE ENDS SWITCH statement Format A label A L SWITCH Aconditional expression A label ACASE constant statement A label ACASE constant statement A label ADEFAULT statement A label AENDS Description The switch statement passes control to another statement which is determined in accor dance with the value of a conditional expression The value of the expression is compared with a case prefix constant attached to the beginning of the statement and where there is a match then control is passed to the statement Where there is no match between the value of the expression and the value specified by the case then control is passed to the state ment which has a default prefix Where there is no default none of the statements is executed and the switch statement is left The default section may be omitted When control has been passed to a matching case statement then all subsequent case statements will be executed in turn If you do not wish to pass on to the next case statement but instead to leave the switch statement then this can be effected by the use of a break statement For further details of conditional expressions and constants please refer to the syntax maps ASSIGNMENT ASSIGNMENT statement Format A label Aleft side A Aright side Description 1 120 Assigns the right side to the left For assignment to memory bit variab
26. if Y lt MEM CPY MEM CPY MEM BEQ Z0 BEQ Z0 BCS hhll BCC Z0 Z0 JMP hhil Z0 1 134 SRA74 5 Renesas Technology Corp F 4 Syntax maps of structured commands F 4 Syntax maps of structured commands Syntax maps are used to illustrate the grammar of the structured commands which can be used by SRA74 The meanings of the most important words are illustrated below Variable Variable is used as a general term covering memory variables memory bit variables register variables register bit variables and flag variables Memory variable This refers to any selected memory or stack location which is referred to in any of the addressing modes of the 740 Family Memory variables should always be enclosed for entry in or ZZ Zero page ZZ X Zero page X ZZ Y Zero page Y HHLL Absolute HHLL X Absolute X HHLL Y Absolute Y 42 Zero page indirect X ZZ Y Zero page indirect Y S Stack Memory bit variable This refers to any selected bit which is referred to in any of the bit addressing modes of the 740 Family Memory bit variables should always be enclosed for entry These variables must always be defined in the following way by the pseudo command EQU prior to reference Example BITSYM EQU 1 1000H Bit symbol definition if BITSYM Bit symbol reference else endif Register variable This refers to the various registers of the 740 Family There is no need
27. 5 BIT MEM Jop BBC BIT MEM L1 L1 1 BIT MEM Jop BBS BIT MEM L1 J L1 1 BRA L1 J L1 Labels generated by LOOP74 are output with a format from lop1 to 10 65535 5 Renesas Technology Corp Also if multiple conditional branch instructions which branch to the same jump destination are written consecutively conversion takes place as follows APUG INS output line 1 Jop Bcnd 1 L1 Bcnd 2 lop1 Bcnd_2 L1 BcndR n 10 2 L1 SE L1 10 2 1 2 represent the below conditional branch instructions BEQ BNE BCS BMI BPL BVC BVS BcndR_n represents the conditional branch instruction which returns to the Bcnd_n branch instruction If multiple conditional branch instructions which branch to the same jump destination are written consecutively only the last instruction written is returned and developed A specific example is given below input line output line BEQ 1 1 11 lop2 BCS 11 lop1 J L1 10 2 7 Errors If an error occurs while LOOP74 is running an error message is displayed on the monitor and LOOP 74 stops An error list is given below Error message Description Remedial action Can t create file filename The file name file cannot be generated Check disk capacity Can t c
28. 6 15 List of system errors 17 A 2 List of library manager errors 18 3 iii 5 Renesas Technology Corp CHAPTER 1 The Format of the Manual The LIB74 operation manual contains the following chapters Chapter 2 Outline The basic functions of LIB74 and the files which it generates Chapter 3 Operating method How to enter the commands used by LIB74 Appendix A Error messages A list of the error messages used by LIB74 along with clarifications of the content of the messages and appropriate user responses 434 NESAS Renesas Technology Corp Chapter 2 Outline CHAPTER 2 Outline LIB74 is a program for managing the structured relocatable files produced by SRA74 in the form of a library Frequently used subroutines can be included in a library to reduce assembly time and promote the reuse of programs 2 1 Functions LIB74 processes the relocatable files created by SRA74 Files created by LIB74 can be accessed by LINK741 The following functions are provided to ensure that their functions can be used to the full 1 LIB74 creates and modifies library files that can be accessed by LINK74 2 Relocatable files can be stored in library files 3 Unrequired relocatable files can be deleted from library files 4 Old relocatable files in a
29. NLISTM Inhibits output of the macro generation section list The macro generation section up to LISTM will not be output LISTM Initiates the output of a macro generation section list 2 macro generation section from this pseudo command onwards will be output NLIST List output inhibition Format A NLIST Description Inhibits output to the PRN file This condition can be reversed by means of the pseudo command LIST Example NLIST Inhibits list output There will be no output to the PRN file until LIST LIST Initiates list output E Output will be made to the PRN file from this pseudo command onwards 1 89 5 Renesas Technology Corp Appendix D The pseudo commands NLISTM Inhibition of macro generation section list output Format A NLISTM Description The macro command generation section will not be output to the PRN file This condition can be reversed by means of the pseudo command LISTM Example NLISTM Inhibits output of the macro generation section list The macro generation section will not be output until LISTM LISTM Initiates the output of the macro generation section list S The macro generation section from this pseudo command onwards will be output OBJ Relocatable file name specification Format A OBJ file name file name file name Description Specifies the name of a relocatable file which forms t
30. Renesas Technology Corporation and Renesas Solutions Corporation assume no responsibility for any damage liability or other loss rising from these inaccuracies or errors Please also pay attention to information published by Renesas Technology Corporation and Renesas Solutions Corporation by various means including the Renesas home page http Awww renesas com When using any or all of the information contained in these materials including product data diagrams charts programs and algorithms please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products Renesas Technology Corporation and Renesas Solutions Corporation assume no responsibility for any damage liability or other loss resulting from the information contained herein Renesas Technology semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake Please contact Renesas Technology Corporation Renesas Solutions Corporation or an authorized Renesas Technology product distributor when considering the use of a product contained herein for any specific purposes such as apparatus or systems for transportation vehicular medical aerospace nuclear or undersea repeater use The prior written approval of Renesas Technology Corporation and Renesas Solutions Corporation is necessary to reprint or reproduce in who
31. Zero page AND zz X Zero page indirect X AND zz X Zero page indirect Y AND zz Y Absolute AND hhll Absolute X AND hhll X Absolute Y AND hhll Y ASL Accumulator ASL A Zero page ASL 22 Zero page ASL zz X Absolute ASL hhll Absolute X ASL hhll X BBC Accumulator bit relative BBC i A hhll BBC bitsym A hhll Zero page bit relative BBC i zz hhll BBC bitsym hhll BBS Accumulator bit relative BBS i A hhll BBS bitsym A hhll Zero page bit relative BBS i zz hhll BBS bitsym hhll 1 67 434 NESAS Renesas Technology Corp Appendix B List of commands 1 68 Command Addressing mode Entry format BCC Relative BCC hhll BCS Relative BCS hhll BEQ Relative BEQ hhll BIT Zero page BIT 27 Absolute BIT hhll BMI Relative BMI hhll BNE Relative BNE hhll BPL Relative BPL hhll BRA Relative BRA hhll BRK Implied BRK BVC Relative BVC hhll BVS Relative BVS hhll CLB Accumulator bit CLB LA CLB bitsym A CLB Zero page bit CLB i ZZ CLB bitsym CLC Implied CLC CLD Implied CLD CLI Implied CLI CLT Implied CLT CLV Implied CLV CMP Immediate CMP imm Zero page CMP 27 Zero page CMP zz X Zero page indirect X CMP zz X Zero page indirect Y CMP zz Y Absolute CMP hhll Absolute X CMP hhll X Absolute Y CMP hhll Y COM Zero page COM 22 5 Renesas Technology Corp SRA74 B 2 List of commands
32. corresponding to the newest relocatable file is updated Notes 1 The numbers indicate the following details 1 Essential parameter Always enter the name of the library file to be edited 2 When one of the A R and X parameters is specified to append replace or extract a relocatable file the name of the relocatable file must be specified To deleting a module the name of the module must be specified 3 One of these five parameters must be specified 4 Specify as required 2 No distinction is made between upper case and lower case letters for command parameters Either A or a is acceptable 3 9 434 NESAS Renesas Technology Corp Chapter 3 Operation method 3 10 3 2 4 Details of command parameters The individual command parameters are described in detail below 1 O Specifies the library file to be edited The library file name can be specified with a directory path name Example A gt LIB74 LO B USR TEST lt RET gt If the directory path specification is omitted the system first searches in the directory specified by the environmental variable LIB74 then in the current directory If the envi ronmental variable is set as shown in the example shown below a file in the USR LIB directory on drive B will be processed Example A gt SET LIB74 B USR LIB If the directory path specification is omitted and no environmental variable has been set a file in the current directory on the current drive
33. D65535 F0 F65535 10 165535 S0 565535 5 The following labels starting with the special character double period should not be used since they are reserved by SRA74 Also avoid labels beginning with because they are reserved for SRA74 function enhancement 0 65535 6 Labels starting with the special character double question mark are treated local labels valid only within that section It is thus possible to use the same label name again ina different section In case of reference only labels within that section will be referred to SRA74 treats anything defined by the pseudo command EQU or parameter D as a symbol or bit symbol and anything defined in any other way as a label 1 23 5 Renesas Technology Corp Chapter 3 Entering the source program 1 24 Example SECTION PROG1 MAIN NOP BRA MAIN This will result in a jump to MAIN within the section named PROGI SECTION PROG2 MAIN NOP BRA MAIN This will result in a jump to MAIN within the section named PROG2 7 The PUB declaration can be omitted if a 7 is inserted immediately before a symbol bit symbol or label Example SYMBOL EQU 10 SECTION PROG2 LABEL NOP When entering a label a colon can be inserted immediately prior to the name We recommend that a should be inserted before entry in order to make it easy to distinguish
34. Operating method How to enter the commands used by CV74 Appendix A Error messages A list of the error messages used by CV74 along with clarifications of the content of the messages and appropriate user responses 434 NESAS Renesas Technology Corp Chapter 2 Outline CHAPTER 2 Outline CV74 converts HEX files and symbol files generated with the assembler system SRA74 V 3 00 and later for the M37280 into a data format usable with a debugger Use it together with a debugger to debug programs with address area data exceeding the 64 Kbytes of the M37280 Before using CV74 generate a HEX file and symbol file with LINK74 2 1 Functions 5 2 CV74 can convert HEX files and symbol files generated with the assembler system SRA74 V 3 00 and later for the M37280 into a data format usable with a debugger 1 HEX files are divided into those whose address area data exceeds 64 Kbytes and that which is 64 Kbytes or less 2 Symbol files are converted into a usable format for debuggers Note Proper debugging is not possible if the HEX files and symbol files are used before conversion with 74 SRA74 5 Renesas Technology Corp 2 2 Generating files 2 2 Generating files CV74 generates 3 file types as outlined below 1 HEX files storing address area data of 64 Kbytes or less files which can be debugged with a debugger Files storing address area data of 64 Kbytes or less sampled from HE
35. SRC 1 ENDM Examplee 4 Recursive macro call Macro defnition MAC MACRO First definition DATA BLKB 1 MAC MACRO VALUE Second definition LDM VALUE DATA ENDM ENDM Call example MAC Area reservation and new macro definition MAC 10H Newly defined macro call 1 111 434 NESAS Renesas Technology Corp Appendix E List of macro commands ENDM REPEAT macro command Format A label A REPEAT Anumber of times Description given 740 Family command is repeatedly assembled between REPEAT and ENDM accordance with the number of times specified by the operand label given to the REPEAT command line becomes the first label of the generated line e Assembly language commands structured language commands macro commands pseudo commands other than INCLUDE may be coded between REPEAT and ENDM However macros must not be nested for more than 20 levels e Numeric and symbolic constants labels be entered in the operand but labels with relocatable values may not Example Source entry example 5 REPEAT 5 END After macro generation 5 REPEAT 5 END 5 1 112 SRA74 5 Renesas Technology Corp E 2 Summary of the macro commands ENDM REPEATC macro command Format A label
36. an l file First half of source file 434 NESAS Renesas Technology Corp Chapter 2 Outline JSR C 0 CLC GET_AD_DA WORKO LDA WOR CLC ADC AD_RESULT STA WORKO WORK1 0 with c LDA WORK1 ADC 0 STA WORK1 DEX A D DATA average WORK1 WORK1 gt gt 1 LSR WORK1 WORKO WORKO gt gt 1 with c ROR WORKO AD_DATA WORKO LDA STA WORKO AD_DATA Fig 2 3 Example of an I file Second half of source file 434 NESAS Renesas Technology Corp SRA74 2 2 Generating files 2 2 2 Configuration of PRN file Figs 2 4 2 11 show examples of output PRN files The PRN file contains the following data 1 Contents of source file plus data pertaining to corresponding address and generated data first half of Figs 2 4 2 5 and 2 7 2 9 Lines referring to external labels show E beside the source Lines referring to public labels show P beside the source Lines referring to local labels show L beside the source Lines referring to symbols show S beside the source Lines referring to bit symbols show B beside the source 2 Result of assembly operation Second half of Fig 2 5 and Fig 2 9 Shows the number of errors number of warnings total number of lines number of comment lines and memory capacity of each section 3 List of symbols First half of Fig 2 6 and whole of Fig 2 10 The
37. argument Example Macro definition ADDI MACRO MEM IMM LDA MEM CLC ADC STA MEM ENDM Call example ADDI RAM X 5 Macro generation LDA RAM X CLC ADC 5 STA RAM X 1 49 5 Renesas Technology Corp Chapter 8 Operation method CHAPTER 8 Operation Method 8 1 Activation method Before using SRA74 the following data input parameters must be entered 1 Source file name required item 2 Command parameters With SRA74 these data can specified from the operating system command line or defined with the environment variable SRA74 Section 8 2 describes the input parameters section 8 3 describes how to enter the command with examples and section 8 5 describes how to define the environment variable SRA74 8 2 Input parameters 8 2 1 Source file name 1 Specifies the name of the source file which forms the object of the assembly operation Only one source file may be specified 2 When the file attribute A74 is omitted then the attribute A74 is selected as the default value 3 By specifying the full name of a file files with attributes other than A74 eg ASM may also be assembled 4 The directory path can also be specified within the file name If only the file name is specified then the processing operation will be carried out on a file contained within the current directory in the current drive Example A gt SRA74 C WORK TEST lt RET gt
38. as the result of linking To avoid confusion with address attributes sections with ROM attributes are called ROM type 2 RAM attribute RAM attribute sections do not generate HEX files as the result of linking Sections including the area securing pseudo command BLKB in the assembly language source program are RAM attribute sections To avoid confusion with address attributes sections with RAM attributes are called RAM type Sections with the same name must all have the same physical attribute SRA74 5 Renesas Technology Corp 3 2 Section attributes 3 2 3 Reserved sections LINK74 treats sections Z S P and R as reserved sections These reserved sections are described below 1 Zsection The Z section is the RAM attribute section located in the 740 Family zero page from address 0016 to If a section name is declared as Z or z by the SRA74 pseudo command SECTION or if the pseudo command ZMOD is declared the section becomes the Z section If the Z section is a relative attribute section the start address can be specified by LINK74 command input If the start address specification command is omitted 0046 is selected as the start address 2 Ssection The S section is the ROM attribute section located in the 740 Family special page from address FF0046 to FFFF46 If a section name is declared as 5 or s by the SRA74 pseudo command SECTION or if the pseudo command SM
39. at the same time as the H option Note To debug with a debugger download the HEX and symbol files generated with CV74 5 4 SRA74 5 Renesas Technology Corp 3 3 Methods of entry 3 3 Methods of entry With command line input the whole command is entered on the operating system command line to activate CV74 Figure 3 1 gives an example wherein a HEX file master hex and symbol file master sym gener ated with LINK74 are converted into a HEX file change hex and symbol file change sym of a format usable with a debugger A gt CV74 master Ochange RET HEX SYM file converter for 7200 Series V 1 00 00 Copyright 1998 MITSUBISHI ELECTRIC CORPORATION AND MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION All Rights Reserved HEX file convert now master hex gt change hex SYM file convert now master sym gt change sym Fig 3 1 Help screen for command line errors 3 4 Errors 3 4 1 Types of error The types of errors which occur during the operation of CV74 have the following causes 1 Errors relating to the operating system These are errors such as insufficient disc or memory capacity which relate to CV74 s operat ing system Please refer to the list of error messages in Appendix A and proceed according to the operating system commands 2 Errors relating to the input of CV74 command lines These are errors relating to the inpu
40. bit symbol External reference specification symbol label PUB Public specification bit symbol label SECTION ROM and Ram area specification SECTION P PMOD ROM area specification general page SECTION R RMOD RAM area specification general page SECTION S SMOD ROM area specification special page SECTION Z ZMOD OBJ LIB a RAM area specification zero page Link file name specification VER Version specification 4 List control Carries out controls related to PRN file output This group contains the 7 following pseudo commands UNE List format numbers of columns and lines specification LIST NLIST List output inhibit specification LISTM NLISTM Macro generation section list output inhibit specification PAGE Page feed and title specification 5 Debug support Carries out the controls relating to the source line debugger This group consists of the 2 following pseudo commands FUN ENDFUNC Function specification 6 Reserved pseudo commands These are pseudo commands which have been reserved for future expansion These pseudo commands have no effect on the assembly processing operations This group consists of the 9 following pseudo commands PROGNAME Program name declaration ENDIO RAM ENDRAM Area name declarations PROCMAIN PROCSUB PROCINT Module name declarations ENDPROC Module termination declaration The following pages describe the functions of the p
41. concerning this line please refer to Chapter 7 and Appendix E A Label A MACRO A Operand A Comment lt RET gt A Label A Macro command Operand A Comment RET 1 Macro name section Name for accessing the macro definition 2 Label section Enter the label name to enable reference to the line from another location 3 Macro command section Enter a 740 Family macro command The macro command makes no distinction between upper case and lower case alphabetic characters Either REPEATI repeati or Repeatl would therefore all be equally valid SRA74 recognizes the op code as a reserved word so that when a label is not entered entry can be made from the head of the line 4 Operand section Enter the macro command s operand When the operand contains more than one item of data then the items should be separated from each other by a comma A space or tab code can be entered on either side of a comma 5 Comment section This section is not subject to processing by SRA74 and may therefore be utilized in whatever way the user wishes 3 2 5 Comment line The first character on a comment line with the exception of A should always be a semi colon The configuration of a comment line is shown below A Comment RET Note If the first character on a comment line is anything other than then SRA74 will not recognize the line as a comment and will include it in the assembly operation Care must
42. div ansl division div ansh division key buffl key Dutt key scan key buff3 _key_buff4 key_scan mul ansl multiply mul ansh multiply Fig 2 2 LST file output example 2 list of global labels and symbols 3 5 434 NESAS Renesas Technology Corp Chapter 2 Outline 3 List of global labels and symbols for each module Two tables are output a PUBLIC symbol table and an EXTERN symbol table Both show the module names followed by the global labels and global symbols for each module LIB74 librarian V 1 00 10 date 1998 Dec 10 15 30 page 4 PUBLIC symbol table Module name key_scan symbol count 0006 _key_flgl b _key_flg2 b _key_scan _two Module name multiply symbol count 0002 multil multiply Module name division symbol count 0002 dividel division LIB74 librarian V 1 00 10 date 1998 Dec 10 15 30 page 5 EXTERN symbol table odule name key_scan symbol count 0006 _key_buff1l _key_buff2 _key_buff3 _key_buff4 _linecnty linecntx Module name multiply symbol count 0002 mul ansl mul ansh Module name division symbol count 0002 div ansl div ansh Fig 2 3 LST file output example 3 list of global labels and symbols for each module 3 6 SRA74 5 Renesas Technology Corp CHAPTER 3 Operation Method 3 1 Activation method Before using LIB74 the following data must be entered 1 Library file name required item 2 R
43. during a program Example VER V 1 0 Specifies version V 1 0 WORD Word data specification Format A label A WORD A numerical expression Description Sets values using numerical expressions unit word f more than one item of data is set then each item should be separated by a A maximum of 16 items may be specified on a single line The data is set from the low order byte Global labels may be entered into the operand Example label WORD OEO00H Sets OOH and EOH WORD symbol Sets the value of a symbol from the low order byte 1 97 434 NESAS Renesas Technology Corp Appendix D The pseudo commands ZBEXT External reference specification Zero page bit symbol Format A ZBEXT Abit symbol bit symbol bit symbol Description Specifies that the bit symbol specified in the operand may be subject to external reference Abit symbol specified by this pseudo command is understood to be located on a zero page This pseudo command should be entered before the line which refers to the label Example ZBEXT BITO BIT1 BIT2 ZEXT External reference specification Zero page Format A ZEXT Alabel or symbol label or symbol label or symbol Description Specifies that the label specified in the operand may be the subject of external reference the zero page addressing mode If you wish to carry out the assembly operation in the absolute addressing
44. expression may be used as operand When the operand is a numeric expression assembles statement 1 if the result is true not O or statement 2 if the result is false 0 When the operand is a string expression assembles statement 1 if the string is true string data or statement 2 if the string is false no string data This command may be nested up to 20 levels Depending on the available host system memory Multiple lines may be specified for statements 1 and 2 Label with relocatable value may not be specified in the operand field The operand may contain the following logical operators Less than gt Greater than Equal l Not equal lt Less than or equal gt Greater than or equal If an undefined symbol is used in a numeric expression it is treated as a symbol with value 0 If an undefined symbol is used in a string expression it is treated as a character string Up to six conditional expressions can be combined as operand using logical operators amp amp However the expressions have no priority and are evaluated from left to right 1 85 5 Renesas Technology Corp Appendix D The pseudo commands Example 1 IF FLAG Assembles lines through ELSE ELSE Assembles lines through ENDIF 2 ADD MACRO OP1 0P2 0P3 IF OBS Assemble through E OP3 exists ADC OP1 0P2 0P3 ELSE ADC OP1 0P2 ENDIF 3 SUE FLAG1 amp amp FLAG2
45. for enclosure in or for entry They should be entered as they SRA74 uses the following names as reserved words for the registers Since no distinction is made between upper and lower case characters either A or a is equally valid A Accumulator X Index register X Y Index register Y S Stack pointer P Program counter e Register bit variable This refers to any selected accumulator bit referred to in the 740 Family accumulator bit addressing mode SRA74 uses the following names as reserved words for the register bits Since no distinction is made between upper and lower case characters either BIT 0 or bit aO is equally valid 1 135 5 Renesas Technology Corp Appendix F List of structured commands 1 136 BIT_AO Accumulator bit 0 1 Accumulator bit 1 BIT_A2 Accumulator bit 2 BIT Accumulator bit 3 BIT_A4 Accumulator bit 4 BIT_A5 Accumulator bit 5 BIT_A6 Accumulator bit 6 BIT_A7 Accumulator bit 7 Flag variable This refers to the flags in the 740 Family status registers SRA74 uses the following names as reserved words for the flags Since no distinction is made between upper and lower case characters either C c is equally valid Carry flag Z Zero flag Interrupt inhibit flag D Decimal mode flag T X qualified operation mode flag V Overflow flag N Negative flag WITH_C This refers to the specification of an operation with carry This is prepared as a reserved word in SRA74 Since no
46. gt ifilename opath i not include specified files use ifilename select drive and directory for output use otmp Fig 3 2 Help screen for command line errors 4 5 5 Renesas Technology Corp Chapter 3 Operation method 3 4 Errors 3 4 1 Types of error The types of errors which occur during the operation of CRF74 have the following causes 1 Errors relating to the operating system These are errors such as insufficient disc or memory capacity which relate to CRF74 s operating system Please refer to the list of error messages in Appendix A and proceed according to the operating system commands 2 Errors relating to the input of CRF74 command lines These are errors relating to the input of the command lines to activate CRF74 Please study the contents of this chapter and then re enter the relevant commands 3 Errors relating to the contents of the source files being processed This error occurs when a source file specified by the pseudo command INCLUDE cannot be found When CRF74 detects an error a message is displayed in the format shown in Fig 3 3 Refer to the list of error messages in Appendix A and take the appropriate action gt 74 SRCFILE1 lt RET gt 740 Family CROSS REFERENCE V 1 00 10 Copyright 1989 1998 UBISHI ELECTRIC CORPORATION AND MITSUBISHI ELEC EMICONDUCTOR SYSTEMS CORPORATION All Rights Reserved
47. hhii BEQ Z0 JMP hhli 20 if A MEM CMP MEM CMP MEM BEQ hhli BNE 20 JMP hhli 20 if A gt MEM BEQ hhli BEQ 20 A BCC hhll BCS 21 register Z0 JMP hhli 21 if A gt MEM CMP MEM CMP MEM hhll BCS 20 JMP hhli 20 if lt MEM BCS hhll 20 JMP hhli 20 if A lt MEM CMP MEM CMP MEM BEQ Z0 BEQ 20 BCS hhll BCC Z0 Z0 JMP hhli 20 if X MEM BNE hhll BEQ Z0 JMP hhli 20 X if MEM CPX MEM CPX MEM register BEQ BNE Z0 JMP hhli 20 if X BEQ hhii BEQ 20 BCC hhll BCS 21 20 JMP hhli 21 1 133 5 Renesas Technology Corp Appendix F List of structured commands Type Structured command Assembly command Long branch if X gt MEM CPX MEM CPX MEM BCS Z0 JMP hhli Z0 X if X MEM CPX MEM CPX MEM regisrer BCS hhll BCC Z0 JMP hhli Z0 if X lt MEM CPX MEM CPX MEM BEQ Z0 BEQ Z0 BCS hhll BCC Z0 Z0 JMP hhil Z0 if Y MEM CPY MEM CPY MEM BNE hhli BEQ 20 JMP hhli Z0 if Y I MEM CPY MEM CPY MEM BEQ hhli BNE 20 JMP hhli Z0 if Y 2 MEM CPY MEM CPY MEM BEQ hhli BEQ Z0 BCC hhll BCS 21 Y Z0 register JMP hhli 21 if Y gt MEM CPY MEM CPY MEM hhll BCS Z0 JMP hhli Z0 if Y CPY MEM CPY MEM BCS hhll BCC Z0 JMP hhli Z0
48. lt RET gt Libraries gt gt UTIL1 UTIL2 lt RET gt Section information gt gt WORKRAM 100 000 DROM lt R Command parameter gt gt ONWORK M S RET Fig 4 2 Display during interactive input 2 15 5 Renesas Technology Corp Chapter 4 Operation method 4 3 2 Command line input Command line input has the following features 1 A gt LINK74 MAIN SUB UTIL1 UTIL2 WORKRAM 100 PROM C000 DROM ONWORK S lt R With command line input the whole command is entered on the operating system command line MS DOS restricts the length of a command to 127 characters so command line input should be used when the number of relocatable files or sections is small Command line input may also be used inside batch files and make files The four different types of data in the input parameters should be separated by commas Fig 4 3 shows the same command as fig 4 2 but this time entered on the command line Even if the library name and subsequent parameters are not required the commas must still be entered For instance fig 4 4 shows the command line input for the command in fig 4 3 if the library is not required In the special case where command parameters are not required two commas are required to show clearly that there are no command parameters The example from fig 4 4 is shown with the command parameters omitted in fig 4 5 If the command parameters entered are insuffici
49. must be made Set the stack page SPPAGE label definition The setting 0 secures page 0 and the setting 1 secures page 1 Take care since this procedure simply provides the required indication to the assembler and it does not mean that the stack is now set Example SPPAGE EQU 1 e Secure 3 bytes in page 0 in the RAM as the operation work area syswk The operation result will be set in the case of a multiplication from low order to high order in syswk and syswk 1 The user himself should carry out the reference if he wishes to refer to the high order of the operation result Example Syswk blkb Care should be taken when using the operation work area syswk for an interrupt process ing routine In such cases there are a number of other operations which will need to be carried out such as the modification of the related library source SRA74 A74 by the user or the saving of the operation work area to the stack 3 Upto six structured commands if for while can be coded using dual term operators amp amp and These logical operators are have no priority and are generated from left to right as follows A1 BIT A2 1 amp amp BIT A3 4 BBS 1 10 2 11 BBS 10 4 11 10 X X INX ENDIF 1 38 SRA74 5 Renesas Technology Corp CHAPTER 6 Pseudo Commands 6 1 Functi
50. of command parameters Command parameter Description A Allows overlapping of absolute attribute sections with the same name Useful when sharing global memory area BANK Expands the address area upper limit from FFFFH to 1FFFFH F Specifies the output file name The specification format is as follows Fsample M Outputs a MAP file section data only MS Outputs a MAP file with global labels global bit symbols and a global symbol list N Causes references to the R74 and LIB files specified by means of pseudo commands OBJ and LIB in the source file to be disregarded O Specifies the directory for the output file The specification format is as follows OC USR WORK This specifies the output directory as directory USR WORK on drive C S Outputs a SYM file V Checks that the versions of different relocatable files are consistent In order for this check to be performed the version must be specified in the assembly language source file using the pseudo command VER 2 13 5 Renesas Technology Corp Chapter 4 Operation method 4 3 Methods of entry 2 14 4 3 1 Interactive input Interactive input has the following features 1 The relocatable file library file section control commands and command parameters are entered interactively in this sequence 2 This method of entry is convenient when there are only a few relocatable files or sections or when using trial and e
51. of such operations 1 The pseudo command SECTION enables you to allocate the name of your choice section name to each separate area When linking section names allocated in this way can be used to specify an address 2 The number of sections which can be defined within any given file is unlimited thus enabling the setup to be matched to the user system s various ROM RAM areas 3 The pseudo commands LIB and OBJ can be used to specify the link target file name in the source program It will therefore be unnecessary to specify the link target file name during linking 4 Declaration of the version using the pseudo command VER enables the version in the relocatable files to be confirmed during linking Other special features of SRA74 functions are outlined below 1 It is possible to assemble a source file containing a mixture of assembly language and structured language For assembly the structured language commands are converted into assembly language commands Linkage editor for use with 740 Family Library for use with 740 Family 5 Renesas Technology Corp Chapter 2 Outline 2 Files can be generated where the structured language has been converted into assembly language Such files can be optimized by the user 3 A tag files can be generated to store error details Assembly errors can be efficiently recti fied 4 The program can be used as an absolute assembler since both ROM and RAM area
52. omitted the sections are arranged in the order they are encountered in the relocatable file read in Specify section data for relative attribute files Absolute attribute files are located at fixed addresses specified by the pseudo command ORG regardless of whether or not a section is specified Section locations should be specified in order starting with the lowest address Separate each of the section names with spaces SRA74 5 Renesas Technology Corp 4 2 Input parameters 4 The start address for each section is specified by following the section name with equals sign then by the address Specify the address in hexadecimal The initial O and final H are not required 5 Section names can be specified with either upper case or lower case characters 6 If the start address for a relative attribute file is omitted the start address becomes 000016 Reserved section S starts from FF0046 7 Overlapping section address results in error However if the command parameter A is specified absolute addresses may overlap This enables absolute address labels such as SFR area to be included in several program files with the pseudo command INCLUDE without defining it as external reference 4 2 4 Command parameters Command parameters control the output file from linking presence or absence of a version check and similar items Table 4 1 gives details of the command parameters Table 4 1 List
53. onto the VDU screen in the format shown in Fig 4 8 Please study the list of errors in error number order in Appendix A and take action accordingly A gt LINK74 MAIN SUB WORKRAM 100 000 DROM MELPS 740 LINKER V 1 00 00C Copyright 1989 1990 MITSUBISHI ELECTRIC CORPORATION AND MITSUBISHI ELECTRIC SEMICONDUCTOR SOFTWARE CORPORATION All Rights Reserved now processing pass 1 processing MAIN R74 ERROR NO 2 Out of heap space A Fig 4 8 Example of error display 2 18 SRA74 5 Renesas Technology Corp 4 5 Enfironment variables 4 4 2 Value for return to operating system When entering an execution command into an operating system batch file for example there are times when you may wish to change the contents of the processing operation in accordance with the outcome of the execution In LINK74 the execution results are divided into 5 error levels as shown in Table 4 2 and returned to the operating system Table 4 2 List of error levels Error level Description of execution results 0 Normal termination 1 Error relating to content of relocatable file which constitutes the object of linking 2 Error relating to input of LINK74 commands 3 Error relating to the operating system 4 Error relating to LINK74 functions 4 5 Environment variables LIB74 LINK74 refers to the environment variables in LINK74 at the point when it reads in t
54. operation 2 Error relating to input of SRA74 commands 3 Error relating to the operating system 4 Forced termination caused by C cntl C 1 57 5 Renesas Technology Corp Chapter 8 Operation method 8 5 Environment variables 1 58 SRA74 makes use of the following environment variables TMP Specifies the name of the directory for creation of the temporary files generated during the assembly operation In cases where this environment variable has not been set the tempo rary files will be generated in the same directory as the source file An example of the setting of an environment variable is shown below Example set TMP A TMP INC Specifies the name of the directory holding the files to be included during the assembly operation In cases where this environment variable is not specified files to be read in by means of the pseudo command INCLUDE are retrieved from the current directory An example of the setting of this environment variable is shown below Example set INC A INC74 SRA74 This environment variable can be used to specify the command name and command param eters normally entered from the command line An example of this command variable is shown below Example SET SRA74 L I This environment variable can be used to define frequently used command paraemters thus eliminating the need to enter them from the command line each time The command param eter defined with this environm
55. sented by the operand as arguments REPEAT ENDM Repeats the processing operation a specific number of times 2 User macro commands MACRO ENDM Defines the macro commands EXITM Forces the termination of macro generation e LOCAL Changes the labels used in the macro definitions into intra macro local labels For further details please refer to Appendix E 1 45 5 Renesas Technology Corp Chapter 7 Macro commands Notes 1 User macro commands must be defined prior to use Macro commands should normally therefore be defined at the beginning of a program or alternatively a macro definition file should be inserted at the head by means of the pseudo command INCLUDE User macro definitions may be nested up to 20 levels however this depends on the available host machine memory If the macro definition file is treated as a separate file macro library then the macro can be used simply by including it in the beginning of a program and it ceases to be necessary to enter the macro definition into each program Macro generated sections are indicated by a at the side of the source in the print file LOCAL labels are assembled in order by allocation of the label n where n is a decimal number between 0 65535 Care should be taken by the user since he may not use the label n When a pair of square brachets or curry braces indicating memory reference in structured d
56. symbols used in the program are divided into the following five types A print file containing a symbol list can be generated by specifying the command parameter LS e USED d OPTION Indicates symbol defined by command parameter D from the command line and re ferred to in the program e USED EQUATE Indicates symbol defined by pseudo command EQU and referred to in the program USED BIT EQUATE Indicates bit symbol defined by pseudo command EQU and referred to in the program e UNUSED d or EQUATE Indicates symbol defined in the above manner but not used in the program e UNUSED EQUATE Indicates bit symbol defined by pseudo command EQU but not referred to in the pro gram 4 Indicates labels defined in other files External labels and public labels are together referred to as global labels 5 Labels defined in this file which can be referred to from other files 5 Labels defined in this file which can be referred to only from within this file 7 Indicates symbols defined by the D parameter and pseudo command EQU 8 Indicates bit symbols defined by pseudo command EQU 5 Renesas Technology Corp Chapter 2 Outline 4 List of labels Second half of Fig 2 6 and whole of Fig 2 11 Lists the labels used in the program with their values divided into the following 3 groups USED USER DEFINED Indicates labels at section level which are defined and referred to in the progr
57. therefore be taken since this will result in a variety of problems such as assembly error or even the generation of false codes 1 22 SRA74 5 Renesas Technology Corp 3 3 Section entry method 3 3 Section entry method This section deals only with those sections where the entry format is the same for each command line For further details of those sections requiring more than one entry format please refer to Chapters 4 5 6 and 7 3 3 1 Symbol Bit symbol Label sections These sections require the same entry format for each command line SRA74 distinguishes symbols bit symbols and labels from each other and processes them accordingly The rules of entry are given below 1 The name can be entered using either alphanumeric characters or the special characters underline period and question mark The first character must however be either an alphabetic or special character The maximum number of permissible characters includ ing is 255 2 A distinction is made between upper and lower case characters BIG and Big would there fore be discriminated as different names 3 Reserved words may not be used as names SRA74 processes all register names flag names op codes structured commands pseudo commands and macro commands as re served words 4 The following labels starting with the special character period should not be used as they are reserved by SRA74 D0
58. this file is described in the next section 3 Relocatable file File generated on specification of command parameter X File regenerated from a relocatable file stored in a library file A regenerated relocatable file is identical to the relocatable file created by SRA74 before it was stored in the library file The file attribute is R74 4 Backup file Note Backup files are generated regardless of command parameter specifications unless LIB74 terminates abnormally Whenever a library file is modified the library file before modification is retained as a backup The file attribute is BAK Library files relocatable files and backup files are in binary format so they should not be output to the screen or printer 3 3 5 Renesas Technology Corp Chapter 2 Outline 2 4 Configuration of the LST file Fig 2 1 fig 2 2 and fig 2 3 show examples of an output LST file The LST file contains the following data 1 List of modules The following information stored in the library file is output Module Names of modules stored in the library file The output sequence is the same sequence that the files were stored in the library file Offset The number of bytes from the start of the module to start of the module hexa decimal Module size Module memory capacity hexadecimal LIB74 librarian V 1 00 10 date 1998 10 15 30 page 1 Library file name CALC8 LIB Relocatable fo
59. to do V Outputs LOOP 74 version and ends processing and 100 The default is 100 COUNTn Ends conversion after reaching a specified number n decimal number of conversion cycles Specify n between 1 been performed to the converted line Attaches a comment indicating LOOP 74 conversion has Capital and small case letters are distinguished in the above options therefore commands must be specified exactly as indicated above in capital letters SRA74 command options These command options are specified when LOOP 74 starts up SRA74 All command options which LOOP74 does not support itself are interpreted to be SRA74 command options and handed over to SRA74 3 2 Startup LOOP74 starts up with the below line A gt LOOP74 SAMPLE A74 COMMENT S C L RET The above line specifies SAMPLE A74 as the assembler source file to convert specifies that LOOP74 shall attach a comment to the converted line and specifies S C and L as command options to be handed over to SRA74 The same processing is achieved with the following line A gt LOOP74 L SAMPLE A74 5 COMMENT C lt RET gt 5 Renesas Technology Corp In other words there is not set sequence for specifying command parameters with LOOP 74 Note LOOP 74 automatically generates tag files therefore it is not necessary to write the E command option of SRA74 any case problems are not created if the command opti
60. write all branch instructions with the shortest branch instructions and use loop74 you will be able to generate programs written with optimized branch instructions 2 Generated files When the ASM command parameter is specified LOOP 74 outputs conversion results to the xxx i file generated by SRA74 The xxx i file is output to the same directory as the input file When the ASM command parameter is not specified LOOP 74 outputs conversion results to the structured source file specified by LOOP 74 Note Source level debugging using a debugger is not possible with files converted with ASM command 3 Startup 3 1 Input parameters Torun LOOP 74 it is necessary to input the below information input parameters Source file name This name specifies the source file to be converted Only one file can be specified nput the extension with the file name The only applicable extension is A74 The directory path can be specified in the file name When only the file name is specified the file in the current directory of the current drive is processed 5 Renesas Technology Corp LOOP74 command options Option Description monitor Not applied to error messages Prevents the state of execution from being output to the commands to the assembly commands source level debugging ASM Converts branch instructions developed from structured When using this option it becomes not possible
61. 00014 LINES SIZE 00005 0005 BYTE SIZE ERT 00044 002C BYTE Fig 2 9 Example of a PRN file Final part of source file Uses I parameter 1 15 5 Renesas Technology Corp Chapter 2 Outline 740 Family 5 USED USED BOLS BOLS 0000p SYMBOLS RA74 V 4 d OPTION EQUATE STACK TYPE fAD_INT_OK 4 00FEp UNUSI ON UNUSI ED SYMBOLS 0001p ED SYMBOLS TYPE BIT EQUATE TYPE Fig 2 10 Example of a PRN file Symbol list Uses I parameter 1 16 SRA74 5 Renesas Technology Corp 2 2 Generating files USE ERNAL AD DATA 0000e ECTION Z D DATA 0003p AD RESULT 0002p WORKO 0000p WORK1 0001p SECTION AD_CONVERT AD_CONVERT EOOF ELS SECTION AD_CONVERT START 000 Fig 2 11 Example of a PRN file Label list Uses parameter 1 17 5 Renesas Technology Corp Chapter 2 Outline 1 18 2 2 3 Configuration of TAG file Fig 2 12 gives an example of TAG file output A TAG file contains the following d
62. 2 BNE hhli BEQ 20 JMP hhli 20 while MEM gt 2 LDA MEM LDA MEM CMP 2 CMP 2 BEQ 20 BEQ 20 BCS hhll BCC 20 DO Z0 JMP hhli statement 20 while gt 2 LDA MEM LDA MEM CMP 2 CMP 2 BCS hhli BCC 20 JMP hhli 20 while MEM lt 2 LDA MEM LDA MEM CMP 2 CMP 2 hhli BCS 20 JMP hhli 20 while lt 2 LDA MEM LDA MEM CMP 2 CMP 2 BEQ hhll BEQ 20 hhli BCS 21 20 JMP hhli 21 1 131 5 Renesas Technology Corp Appendix F List of structured commands Type Structured command Assembly command Long branch for MEM LDA MEM LDA MEM CMP 2 CMP 2 BNE hhll2 BEQ Z0 JMP 2 20 for MEM 2 LDA LDA MEM CMP 2 CMP 2 BEQ hhll2 BNE Z0 JMP hhll2 20 for gt 2 LDA MEM LDA MEM CMP 2 CMP 2 BEQ hhll2 BEQ Z0 hhll2 BCS Z1 20 FOR JMP hhil2 statement 21 for MEM gt 2 LDA MEM LDA MEM CMP 2 CMP 2 hhll2 BCS 20 JMP hhil2 20 for lt 2 LDA MEM LDA MEM CMP 2 CMP 2 BCS hhll2 BCC 20 JMP hhll2 20 for MEM lt 2 LDA MEM LDA MEM CMP 2 CMP 2 BEQ 20 BEQ 20 BCS hhll2 BCC Z1 Z0 Z0 JMP hhll2 21 1 132 5 Renesas Technology Corp SRA74 F 3 Generation example Table F 8 Register conditional expression generation example Type Structured command Assembly command Long branch if A MEM CMP MEM CMP MEM BNE
63. 4 Example FUNC SUB SUB LDA 1 RTS ENDFUNC SUB Specifies the end of the function 1 81 434 NESAS Renesas Technology Corp Appendix D The pseudo commands EQU or else Synonymous definition Format 1 symbol EQU or numerical expression Format 2 bit symbol EQU or 2 numerical expression numerical expression Description Allocates a numerical value to the left hand symbol Format 1 is used to allocate a 16 bit integer value to the symbol Format 2 is used to allocate 0 7 bit values and a 16 bit integer value address to the symbol Any labels or symbols used in the numerical expression should be defined prior to the line in question Labels with relocatable values may not be entered into the operand Symbols may be redefined fthe command parameter is specified a warning is issued when a symbol is redefined Example symbol EQU 1 1 is assigned to symbol m EQU 2 7 2 is assigned to symbol Em EQU 3 3 is assigned to symbol EQU 1 23H bit 1 at 23H is assigned to bitsym 1 82 SRA74 5 Renesas Technology Corp D 2 Summary of the pseudo commands ERROR Assembly error directive Format A ERROR A characher string Description Used in combination with the conditional assembly command f something is specified which cannot exist as a condition then the character string entered in the ope
64. 4 2 Input parameters 2 12 4 2 1 Relocatable file name 1 Always enter the name of the relocatable file The relocatable file must have the file attribute R74 but the attribute part of the filename may be omitted when the command is input The directory path can also be specified within the file name If only the file name is specified then the processing operation will be carried out on a file contained within the current directory in the current drive The name for the output file is taken from the name of the first relocatable file specified If an output file name is specified using the command parameter F this takes precedence The directory where the output file is output is taken from the directory for the first relocatable file specified If a directory is specified using the command parameter O this takes prece dence 4 2 2 Library file name 1 The name of the library file may be omitted The library file must have the file attribute LIB but the attribute part of the filename may be omitted when the command is input The directory path can also be specified within the file name If only the file name is specified then the processing operation will be carried out on a file contained within the current directory The library file is only accessed when there are global labels or global symbols which cannot be resolved within the relocatable file 4 2 3 Section control 1 Section data may be omitted If
65. 5 l switch case ends statement The switch statement switches control to some another statement in accordance with the value of a conditional expression switch ME LDA MEM case 1 1 outputl BNE CASE2 break 5 JSR 1 case 2 G BRA ENDS output2 y CASE2 break 2 case 3 BNE CASE3 output3 JSR OUTPUT2 break ENDS default CASES jsr output4 3 ends H BNE DEFAULT H JSR OUTPUT3 d BRA ENDS DEFAULT JSR OUTPUT4 ENDS 1 32 SRA74 5 Renesas Technology Corp 5 3 Notes concerning entry procedures 6 l break statement The break statement terminates the execution of a given for do or switch statement and passes control to the subsequent statement for 1 7 FOR if MEM2 1 LDA break BEQ NEX endif i LDA MEM2 jsr output ENDIF next BRA NEX ENDIF JSR OUTPUT BRA FOR NEXT 7 l continue statement The continue statement inserts a dummy statement to which it passes control after the final statement of the minimum for or do statement which contains it for 1 i FOR if MEM2 1 LDA continue BEQ EXT endif x LDA EM2 jsr output BEQ ENDIF next 2 BRA FOR ENDIF JSR OUTPUT BRA FOR
66. 74 gt Please notify your supplier File seek error xxx Seek failure gt This error involves the operating system It most fre quently occurs when there is a hardware problem with a disk drive Note 1 LIB74 creates intermediate files when it is running Disk space equivalent to approximately two or three times the size of the library file is required 3 17 5 Renesas Technology Corp Appendix A Error messages Table A 2 List of library manager errors 3 18 Error message Description and user action xxx is multiple defined in xxx others in xxx Public label or public symbol is defined more than once Use aLST file to check the public labels and symbols in the library file xxx module is not in the library The module specified cannot be found Use aLST file to check the modules in the library file Invalid module or library The module in the library file is in a different format from the relocatable file The library file to be edited and the relocatable file must be created with the same version of SRA74 Xxx command file not found The command file specified cannot be found Check the command file specification Out of heap space The memory space required for the operation of the library manager is insufficient Reduce the number of global labels Too many object modules There are too many modules in the library file Split up the library file int
67. 74 to the R74 file This causes only user defined local labels to be output when the S option is specified L Generates a PRN file A PRN file will not be generated without this specification LS Generates a PRN file with symbol list M Outputs the result of macro generation to the PRN file Without this specification the result of the macro generation will not be output into the list Specifies the output destination path for the generated file Both the directory and the drive name can be specified in the path In the absence of such specification output will use the same path as the source file The specification format is as follows O path name Example A gt SRA74 SRCFILE OB USR lt RET gt S Outputs local bit symbols symbols and labels to the R74 file U Ignores the label entry colon Without such specification and cases where the label was entered by the program then the absence of the will be treated as an error X Activates the cross referencer after the assembly operation has been completed3 Example A gt SRA74 SRCFILE X RET Notes 1 When this specification is made then SRA74 will not create temporary files during the assem bly operation The duration of the assembly operation will therefore be reduced This command parameter should also be specified when an file is input as the source file If there is no CRF74 in the current directo
68. A REPEATC Adummy argument real argument Description Characters are repeatedly assembled by the operand in accordance with the number of times they are given by the real argument until ENDM is reached One character is withdrawn from the real argument and transferred to the dummy argument each time the operation is repeated The label given to the REPEATC command line becomes the first label of the generated line Assembly language commands structured language commands macro commands and pseudo commands other than INCLUDE may be coded between REPEATC and ENDM However macros must not be nested for more than 20 levels If special characters such as a space tab or comma are included in a character string then the whole string must be specified within In such cases the whole of the character string is used with the exception of the Example Example 1 Source entry example DATA REPEATC VAL ABCDE J Dummy argument Real argument BY TE VAL END After macro generation DATA BYTE BYTE B BYTE Pot BYTE 37 BYTE 1 113 5 Renesas Technology Corp Appendix E List of macro commands Example 2 Source entry example DATA REPEATC VAL ABC i Wn Dummy argument Real argument BYTE VAL END After macro generation DATA BYTE
69. LLO 7 Dummy argument Real argument BYTE VAL END After macro generation DATA HELLO 1 115 434 NESAS Renesas Technology Corp Appendix F List of structured commands APPENDIX F List of Structured Commands F 1 Using the structured command reference section All the structured commands which can be used in SRA74 are described in alphbetical order Points which should be noted with regard to the notation style in this section are outlined below 1 are used to indicate the use of a space or tab code The A represents a required section whereas the A section may be omitted if necessary 2 The items in brackets may be omitted 3 When entering a label a colon is not absolutely necessary but if it is omitted then a space or tab code must be inserted between the label and a structured command As a general rule you are recommended to use a at all times F 2 Summary of the structured commands ie 5 Renesas Technology Corp F 2 Summary of the structured commands BREAK BREAK statement Format A label A L BREAK Description A break statement suspends the execution of the corresponding for do or switch statement and passes control to the next statement to be executed break statement may only be used within a for do or switch statement CONTINUE CONTINUE state
70. Left shift gt gt Right shift Comparative operator Smaller Larger Equivalent Iz Non equivalent lt Smaller or equivalent gt Larger or equivalent Notes 1 All operations are carried out as 8 bit unsigned numbers When the results of operations only are compared for size for example then the overflow and borrow may be used In the following example if the work contents are assumed to be FF16 then the result of the operation will be 0116 and the condition will be fulfilled Example if work 2 gt 10 else endif When using or in a dual term operator the related subroutine library SRA74 A74 should be linked after assembly as follows a Assemble SRA74 A74 and generate the relocatable file SRA74 R74 b Define the labels corresponding to the operators as external reference The labels corresponding to the operators in the following table must be defined as external label because SRA74 generates machine codes to call the subroutine in SRA74 R74 from operators and 96 1 37 5 Renesas Technology Corp Chapter 5 Structured language Operator Label mult_8 Multiply routine div 8 Divide routine 96 mod 8 Modulo routine Coding example ext mult 8 8 c Link the user program with SRA74 R74 This can be used on system using one page beyond address 010016 for stack area but in this case the following definition and work area reservation
71. Macro command line This line contains a 740 Family macro command Comment line This line is not processed by SRA74 and is therefore free for use as the user requires 1 19 434 NESAS Renesas Technology Corp Chapter 3 Entering the source program 3 2 Configuration of a line 1 20 This section explains the configuration of each of the lines An explanation and rules concerning the use of symbols for notation is also included 1 A indicates a space or tab code The A part is required but the A part may be left out 2 When entering a label a colon is not an absolute requirement but if it is left out then a space or tab code must be inserted between each command During assembly the U parameter must be specified You are therefore recommended to use the as a matter of course 3 2 1 The assembly language command line The configuration of the assembly language command line is shown below For further details concerning this line please refer to Chapter 4 Appendices B and C Label A Op code Operand A Comment HEI 1 Label section Enter the label to enable reference to the line from another location 2 Operation code section Enter the 740 Family assembly language mnemonic Hereafter referred to as the op code The op code makes no distinction between upper case and lower case alphabetic characters NOP nop or Nop would therefore all be valid SRA74 recognizes the op code as a reserved word s
72. NDIO reserved pseudo command ENDM macro command ENDPROC reserved pseudo command ENDRAM reserved pseudo command EQU pseudo command ERROR pseudo command EXITM macro command EXT pseudo command F0 F65535 label FUNC pseudo command 10 165535 label IF pseudo command INCLUDE pseudo command reserved pseudo command LIB pseudo command LINE pseudo command LIST pseudo command LISTM pseudo command LOCAL macro command MACRO macro command NLIST pseudo command NLISTM pseudo command OBJ pseudo command ORG pseudo command PAGE pseudo command PMOD pseudo command PROCINT reserved pseudo command PROCMAIN reserved pseudo command List of Reserved Words PROCSUB reserved pseudo command PROGNAME reserved pseudo command pseudo command reserved pseudo command macro command macro command macro command RMOD pseudo command S0 S65535 label SECTION pseudo command SEXT pseudo command SMOD pseudo command VER pseudo command WORD pseudo command ZBEXT pseudo command ZEXT pseudo command ZMOD pseudo command 0 65535 label A A accumulator ADC mnemonic AND mnemonic ASL mnemonic BBC mnemonic BBS mnemonic BCC mnemonic BCS mnemonic BEQ mnemonic BIT mnemonic 0 symbol 1 symbol 2 symbol symbol 4 symbol BIT 5 symbol 6 symbol A7 symbol mnem
73. NEXT 5 3 Notes concerning entry procedures The following pages contain explanations of some of the points which should be borne in mind when carrying out programming using structured language 1 Memory areas to be referred to via any one of the 740 Family addressing modes should be enclosed within II or when entering them in the conditional expression section of an assignment statement or any of the control statements the if statement for example Refer to the assignment statement generation example in Appendix F 3 1 for details 2 Selected bits which may be referred to by bit symbols should be enclosed within or when entering them in the conditional expression section of an assignment statement or any of the control statements for example if The reserved words shown below must how ever be used when referring to a selected accumulator bit In this case there is no need to use the or enclosure procedure Since no distinction is made between upper and lower case characters either BIT 0 or bit a0 would be equally valid 1 33 434 NESAS Renesas Technology Corp Chapter 5 Structured language BIT_AO Accumulator bit 0 BIT_A1 Accumulator bit 1 BIT_A2 Accumulator bit 2 Accumulator bit 3 BIT_A4 Accumulator bit 4 BIT_A5 Accumulator bit 5 BIT_A6 Accumulator bit 6 7 Accumulator bit 7 Refer to the register and flag assignment statement generation example i
74. NK74 gt Please notify your supplier SRA74 5 Renesas Technology Corp Error number Error message Description and user action 7 xxx relocatable format is mismatch The R74 relocatable file format versions do not match gt This error occurs when there is a mismatch be tween the assembler or library and the linker being used The R74 file and LIB file processed must be created by SRA74 and LIB74 having the same ver sion number as LINK74 Program version is different Mismatch with the program version declared by pseudo command VER Either make the version specified in the relocat able file by pseudo command VER match or use the V parameter to cancel the parameter specifica tion Unresolved label xxx in xxx A symbol or label declared for external reference in the section is not defined Link a program with the label or symbol declared as public 10 xxx is multiple defined in xxx others in xxx Label or symbol is defined more than once Modify the label or symbol name 11 Location overlap SECTION xxx ADDRESS xxx in xxx The section address space overlaps Check the section address location and ensure that an address overlap does not occur For abso lute attribute sections modify the pseudo command ORG in the source file 12 SECTION xxx is an absolute A start address is specified for an absolute attribute se
75. OD is declared the section becomes the S section If the S section is a relative attribute section the start address can be specified by LINK74 command input If the start address specification command is omitted FF0046 is selected as the start address 3 section The P section is a ROM attribute section with program or fixed data It can be located anywhere within the program area from address 0016 to FFFF46 If a section name is declared as P or p by the SRA74 pseudo command SECTION or if the pseudo command PMOD is declared the section becomes the P section If the P section is a relative attribute section 0016 is selected as the start address if the start address specification command is omitted 4 R section The R section is a RAM attribute section It can be located anywhere within the program area from address 0046 to FFFF4g If a section name is declared as R or r by the SRA74 pseudo command SECTION or if the pseudo command RMOD is declared the section becomes the R section If the R section is a relative attribute section 0016 is selected as the start address if the start address specification command is omitted 434 NESAS Renesas Technology Corp Chapter 3 Section functions 5 E section Defined symbols in section E and source line debug information in the section are not output to relocatable files When section E small case letters accepted is declared using the SECTION p
76. SEB 0 C20 CLC C 21 SEC Flags D 0 CLD D 1 SED 1 0 CLI EN T 0 CLT T 1 SET V 0 CLV 1 121 434 NESAS RenesasTechnology Corp Appendix F List of structured commands Type Structured command Assembly command A imm LDA imm X imm LDX imm Y imm LDY imm Data X A TAX A X TXA transfer Y A TAY A Y TYA commands 5 TSX 5 X TXS S A PHA S P PHP A S PLA P S PLP A A imm WITH_C ADC imm A A imm WITH_C SBC imm A A INC A A DECA X X INX Arithmetic DEX INY commands Y Y DEY A A amp imm AND imm A imm ORA imm A A imm EOR imm A imm ASLA A A gt gt imm LSRA A A lt lt imm WITH_C ROL A A gt gt imm WITH C ROR A 1 122 5 Renesas Technology Corp SRA74 F 3 Generation example B Memory assignment statement generation examples Table F 3 Memory assignment statement generation examples Type Structured command Assembly command 72 LDA 27 Data X 22 LDX 22 Y zz LDY 27 transfer zz imm LDM imm zz zz A STA 27 commands zz X STX 22 zz Y STY 27 A A zz WITH_C ADC 27 A A zz WITH_C SBC 27 zz zz INC ZZ zz zz DEC 27 Arithmetic A A amp zz AND 22 221 ORA 27 5 A A zz EOR 27 zz zz l
77. STA 27 zz zz 4 LDA ZZ JSR mod 8 BYTE 4 STA 22 zz zz amp 4 LDA ZZ Logical AND 4 STA 22 operation 22 22 4 LDA 22 ORA 4 commands STA 22 221 221 4 LDA 22 EOR 4 STA 22 Refer to Note 2 in section 5 4 for mult_8 div 8 and mod 8 1 127 434 NESAS Renesas Technology Corp Appendix F List of structured commands F 3 2 Conditional expression generation examples The conditional expression generation examples for IF DO and FOR statements are shown below The labels corespond to the following generation example if else endif if MEM 2 LDA MEM JSR out 2 endif BNE hhll d JSR out e BALL do while do hBhlls JSR out n JSR out while MEM 2 LDA MEM CMP 2 BEQ hhll for next for MEM 2 D z JSR out LDA MEM next 2 2 112 G JSR out 111 hhli2 1 128 SRA74 5 Renesas Technology Corp F 3 Generation example Table F 6 Flag conditional expression generation example Structured command Assembly command Long branch FLAG BBC FLAG hhll BBS FLAG Z0 e while FLAG JMP hhli for FLAG 20 eif FLAG BBS FLAG hhil BBC FLAG 20 e while FLAG 1 JMP hhli for FLAG 20 eif BCC hhll BCS Z0 while C 220 JMP hhii efor Z0 eif C BCS hhll BCC Z0 while C 221 JMP hhii efo
78. To our customers Old Company Name in Catalogs and Other Documents On April 1 2010 NEC Electronics Corporation merged with Renesas Technology Corporation and Renesas Electronics Corporation took over all the business of both companies Therefore although the old company name remains in this document it is a valid Renesas Electronics document We appreciate your understanding Renesas Electronics website http www renesas com April 1 2010 Renesas Electronics Corporation Issued by Renesas Electronics Corporation http www renesas com Send any inquiries to http www renesas com inquiry 2 NE S AS 8 10 11 12 Notice All information included in this document is current as of the date this document is issued Such information however is subject to change without any prior notice Before purchasing or using any Renesas Electronics products listed herein please confirm the latest product information with a Renesas Electronics sales office Also please pay regular and careful attention to additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise is g
79. X files generated by LINK74 extension is HES 2 HEX files storing address area data over 64 Kbytes Files storing address area data over 64 Kbytes sampled from HEX files generated by LINK74 extension is HXH 3 Symbol files debuggable with a debugger The extension is SYM 5 3 434 NESAS Renesas Technology Corp Chapter 3 Operation method CHAPTER 3 Operation Method 3 1 Activation method To start up CV74 it is necessary to input the following information input parameters 1 Name of file to convert 2 Command parameters 3 2 Input parameters 3 2 1 Name of file to convert 1 sure to input the name of the file to convert 2 Prepare the target HEX files and symbol files in the same directory 3 Itis not possible to specify multiple file names 4 File names cannot be specified with period The same goes for relative directories 3 2 2 Command parameters The command parameters specify the output file name or file to convert They are described in Table 3 1 Both HEX and symbol files are converted as long as either H or S is not specified Table 3 1 List of command parameters Command parameter Description O Specifies the name of the output file Be sure to input this option H Converts only HEX files This command parameter cannot be specified at the same time as the S option S Converts only symbol files This command parameter cannot be specified
80. a Example RAM work BLKB T workl BLKB n ENDRAM 1 104 SRA74 5 Renesas Technology Corp APPENDIX E List of Macro Commands E 1 How to use the macro command reference section All the macro commands which can be used in SRA74 are described in alphbetical order Points which should be noted with regard to the notation style in this section are outlined below 1 The use of square brackets indicates that the section may be omitted as required 2 A are used to indicate the use of a space or a tab code The A represents a required section whereas the A section may be omitted if necessary 3 nthe following descriptions the space between a label and a macro command is indicated by a A When entering a label a colon is not absolutely necessary but if it is omitted then a space or tab code must be inserted between the label and a macro command E 2 Summary of the macro commands 1 105 434 NESAS Renesas Technology Corp Appendix E List of macro commands ENDM ENDM macro command Format A ENDM Description This command indicates the end of all macro definitions Example Macro definition ADD MACRO VAL CLC ADC VAL ENDM Call example ADC 10 Macro generation CLC ADC 10 ENDM 1 106 SRA74 5 Renesas Technology Corp E 2 Summary of the macro commands macro command Format A EXITM Description Thi
81. acter string retrieval programs on general sale in order for example to confirm the contents of the source file If the pseudo command PROCMAIN is entered into the source file as shown below then retrieval of the main program can be carried out by using a character string retrieval program to retrieve Example PROCMAIN KEY SCAN Key scan program section entry 1 44 SRA74 5 Renesas Technology Corp CHAPTER 7 Macro Commands 7 1 Functions of macro commands The definition of the 740 Family programs which use assembly language and structured language in terms of macro commands enables the user to enter the assigned names macro names into the source program operand sections in just the same way as he enters op codes or structured commands It is possible therefore by preparing a variety of macro definitions to use the MELPS 740 as a new extended CPU for use when programming In this way the macro command functions provide the user with a way of fine tuning his own programming environment 7 2 Types of macro command Macro commands are divided into 2 broad areas those which come with SRA74 and those which are defined by the user himself 1 System macro commands REPEATI ENDM Repeats the processing operation in accordance with the number of arguments con tained in the operand REPEATC ENDM Repeats the processing operation in accordance with the number of characters pre
82. action Usage crf74 filename ifilename opath The command has been input wrongly Refer to the help screen and input the command again Can t open xxx File not found Check the source file name and input the command again Can t create xxx This file cannot be generated Create more space on the disk Out of disk space There is not enough space left on the disk for output Create more space on the disk Out of heap space Note There is not enough available memory for the cross refer encer to work properly Reduce the number of symbols or labels 1 The total number of symbols and labels which can be handled by CRF74 depends on the available memory capacity 4 8 SRA74 5 Renesas Technology Corp A 2 Cross reference errors A 2 Cross reference errors If an error is detected during cross reference creation an error message is displayed on the VDU but processing still continues Table A 2 lists all the cross reference errors Table A 2 List of cross reference errors Error message Description and user action Can t open include file xxx The source file specified by pseudo command INCLUDE cannot be found Check the contents of the directory 4 9 5 Renesas Technology Corp PAIR 5 M37280 CONVERTER FOR THE 740 FAMILY CV74 OPERATION MANUAL REN ESAS as Technology Corp Table of Content
83. ady stored in the library If two identical module names are specified at the same time the multiple definition of labels and symbols is regarded as an error and processing stops Updates a module in the library file Used together with U only modules in the relocatable file with the latest update date are updated Deletes a specified module from the library file Outputs a list LST file of the modules stored in a library file When a file is specified with the F parameter information concerning the specified relocatable file is output to the LST file When no file is specified with the F parameter information concerning all modules in the library is output to the LST file file attribute is LST Extracts a specified module from the library file creating a relocatable file identical to the relocatable file before storage in the library date of extraction becomes the update date for the relocatable file extracted relocatable file can be processed by LINK74 extracted relocatable file is created in the current directory When no relocatable file is specified with the F parameter all modules in the library file are extracted The contents of the library file are not modified file attribute is R74 8 V Displays details of files on the screen to show how they are being processed 3 11 434 NESAS Renesas Technology Corp Chap
84. age command line 3 2 2 Structured language command line 3 2 8 Pseudo command line sss 3 2 4 Macro command line 10000 3 2 5 Gomtmentlinge ceed aed ei eee rrt eeu eae ed da 3 3 Section entry method sss 3 3 1 Symbol Bit symbol Label sections 3 3 2 Gomiment Secti ri 20400 t ent nara Chapter 4 Assembly language 4 1 Addressing mode 4 2 Operand data format 4 3 M M Chapter 5 Structured language 5 1 Function of the structured command 5 2 Types of statement 5 3 Notes concerning entry procedures 5 4 Structured operators 1 i 5 Renesas Technology Corp Chapter 6 Pseudo commands 6 1 Functions of pseudo commandqs 6 2 Assembly controls 6 3 Address CODIFOL usu iones doo RH RR PER Ch CK e EE cpu nU 6 4 Link control uu u uu uuu u
85. am e USED SYSTEM DEFINED Indicates labels at section level which are defined by SRA74 and referred to in the program Output only when command parameter I is specified e UNUSED USER DEFINED Indicates labels at section level which are defined but which are not referred to in the program 5 When the column number specified by pseudo command COL exceeds 132 characters then the time of assembly is shown in the list header section in the following manner Sat Jan 16 15 06 42 1993 Family SRA74 V 4 00 00 LOC OBJ S NM 0 INCLUDE Section 2 T Indicates include nest SECTIO ORG WORKO 1 WORKI1 AD RESULT 0001 1 AD DATA Tindicates size of reserved area 1 ORG OOFE 0001 1 ICON BL lIndicates reference to public label 4 00FE P 1 fAD INT OK EQ Tindicates bit number 1 INCLUDE OOBF STACK EQ 0000 EQ 0001 ON EQ Fig 2 4 Example of a PRN file First half of source file I parameter 0 5 Renesas Technology Corp 2 2 Generating files 740 Family SRA74 V 4 00 00 SEQ LOC OBJ NM 15 16 17 18 19 20 2l 22 23 24 25 26 271 28 1 29 1 30 1 3T 1 32 1 AD CONVER 5 000 AD DA sub routine START JUDE MACRO A74 RAMS A 0 EPEATI ram RAMS A ram D D
86. an endless loop For further details concerning conditional expressions please refer to the syntax maps 1 118 SRA74 5 Renesas Technology Corp F 2 Summary of the structured commands IF ELSE ENDIF IF statement Format A label A L IF conditional expression statement A L ELSE statement A label AENDIF Description The if statement is a command which switches the control stream in one of two different directions where the selected direction for branching is determined in accordance with a conditional expression The branch decision itself is based on whether the result of applying the condition is zero false or not true If the condition holds true then control is passed to the subsequent command but if it is found to be false then control is passed to the command immediately following else where there is an else and to the command following endif if there is no else The else section can be omitted There is no limit to the number of times the if statement can be nested Where the if statement is nested in a complex manner then the relationship between if and else is determined such that the if and else pair which is closest together forms a sequential pair For further details concerning conditional expressions please refer to the syntax maps 1 119 434 NESAS Renesas Technology Corp Appendix F List of structured commands
87. ata e Indicates name of file where error or warning has occurred line number within the file consecutive line number error number and error message The TAG file should be printed out for use as a reference when correcting editor errors A74 115 Error 18 Relative jump is out of range A74 127 LINE Error 22 Value is out of range data 74 593 4 F Error 23 format error Fig 2 12 Example of a TAG file SRA74 5 Renesas Technology Corp CHAPTER 3 Entering the Source Program 3 1 Configuration of the source program The configuration of the source program takes the line as its basic unit The rules for line entry are outlined below 1 Each line is complete in itself More than 1 line cannot therefore be used to enter a single command Each line contains a maximum of 256 characters including the line feed code SRA74 ignores areas which exceed the 256 character limit Lines are divided into the following 5 groups in accordance with their content Assembly language command line This line contains a 740 Family assembly language command It also generates the corresponding machine language data Structured language command line This line contains a 740 Family structured language command It also generates the corresponding machine language data Pseudo command line This line contains a 740 Family pseudo command
88. ations It can be used for interrupt vectors and other areas with fixed addresses 1 41 5 Renesas Technology Corp Chapter 6 Pseudo commands 3 Securing an area BLKB The amount of memory area specified in the operand is secured as RAM area 4 Data setting BYTE WORD The data specified in the operand is generated in the ROM area 6 4 Link control 1 Global label specification BEXT ZBEXT Specifies a bit symbol name for external reference Any bit symbol name which is specified here must not have public specification in another file EXT SEXT ZEXT Specifies a label or symbol name for external reference Any label which is specified here must not have public specification in another file PUB Labels symbols or bit symbols which are defined in this file may be referred to from any other file 2 Area specification SECTION This pseudo command specifies that the area from this line onwards shall have the name specified by the operand The area attribute will be determined automatically by SRA74 in accordance with the subsequent command This specification remains valid until a further area specification command is received SECTION P or PMOD Specifies that the area from this line onwards is a general page ROM area This specification remains valid until a further area specification command is received SECTION R or RMOD Specifies that the area from this line onwards is a general page RAM area Thi
89. attribute is R74 2 Assembly language file Hereafter referred to as the file file which contains the expanded source file macros and structured commands con verted to mnemonics 3 The name tag derives from the use of the word tag to label the location of an error or warning 1 4 SRA74 5 Renesas Technology Corp 2 2 Generating files File generated in the same directory as R74 files on specification of command parameter P No file is generated however if command parameter A is specified at the same time If the command parameter is not specified this file is output as temporary file for assembly to the same directory as the TMP file and deleted automatically at the end of assembly This is used as the input file source file for SRA74 pass 2 processing operations The macro definition area macro calling area and structured commands are all output as comment lines In the source file a file read in by means of the pseudo command INCLUDE is also output with a file name having the attribute In n 2 0 99 The file should be used to optimize the source file at the assembly language level The file attribute is l 3 Print file Hereafter referred to as the PRN file This file shows the source file to be processed along with its location address and generation data The PRN file is generated on specification of command parameter L Output is in the specified directory wh
90. between a label and a symbol and to enable label access to be carried out effectively by the editor Take care however since it is an error to insert a when entering a symbol or bit symbol 3 3 2 Comment section The user is free to enter whatever data he wishes here The entry format is as follows 1 semi colon must be inserted at the head of the comment before entry 2 Any kind of character can be entered in the comment section SRA74 5 Renesas Technology Corp CHAPTER 4 Assembly Language 4 1 Addressing mode The addressing mode is the basic means mode by which a command specifies the data which it processes The 740 Family has 19 addressing modes each with its own specific operand format The addressing modes with related operand entry are outlined below 1 Implied This is an op code command only There is no operand specification Example BRK 2 Accumulator Method by which the contents of the accumulator are specified as the target data Example ASL A 3 Immediate Method by which the operand is specified directly as the target data The value entered in the operand should be preceded by Example ADC IMMDATA 4 Zero page Method by which the zero page area 0016 FF46 is specified as the target data Example ADC ZWORK 5 Zero page X Method by which the zero page address is qualified by register X as the target data The register name X should be entered after
91. ble assignment statement Stack frame variable assignment statement S EE Register variable A Register variable P 1 138 SRA74 5 Renesas Technology Corp F 4 Syntax maps of structured commands if statement else Statement for statement for m Condition Statement do statement switch statement ends Statement break statement continue statement continue 1 139 434 NESAS Renesas Technology Corp Appendix F List of structured commands Expression 1 Condition expression pee jo qe Iesse can be concatenated up to six times Expression 2 Memory bit variable Register bit variable 1 Flag variable C 0 1 Flag variable N Flag variable V Flag variable Z Expression 3 Memory variable 1 140 SRA74 5 Renesas Technology Corp F 4 Syntax maps of structured commands Expression 3 Memory variable Register variable E Register variable 1 Hm IN E Register variable E Memory variable Register variable Constant Memory variable 1 141 434 NE SAS Renesas Technology Corp Appendi
92. but Renesas Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein Renesas Electronics products are classified according to the following three quality grades Standard High Quality and Specific The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application categorized as Specific without the prior written consent of Renesas Electronics Further you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of Renesas Electronics Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as Specific or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets or data books etc Standard Computers off
93. cro generation section list output inhibit specification NLISTM Controls the output of lists of macro generation sections to the PRN file 1 43 434 NESAS Renesas Technology Corp Chapter 6 Pseudo commands 6 6 Debug support SRA74 generates a source level debug data when the command parameter C is specified However it is also possible to generate source line debug data only for statements enclosed between the FUNC and ENDFUNC statements Memory usage on the host machine can be reduced by limiting the generation of debug data to the necessary statements The command parameter C can still be used for source file containing the FUNC pseudo command to generate the source line debug data for the entire file 1 Function start specification FUNC Specifies the start of the function 2 Function end specification ENDFUNC Specifies the end of the function Note 1 When specifying C for assembly with SRA74 the FUNC and ENDFUNC pseudo command lines cannot be checked Accordingly errors related to these pseudo command lines cannot be detected 6 7 Reserved pseudo commands Reserved pseudo commands are pseudo commands which are being reserved to enable the later expansion of SRA74 These pseudo commands can be entered in the source file without resulting in error They do not affect the outcome of the assembly operation in any way Generally speaking they can be used in combination with any of the char
94. ction using a section control command Either stop specifying the address with the com mand input or change the section to a relative at tribute section 2 21 5 Renesas Technology Corp Appendix A Error messages Error number Error message Description and user action 14 Can t find SECTION xxx The section cannot be found Specify the section information correctly Take care with upper and lower case letters section names make a distinction between upper and lower case 15 Can t create xxx This file cannot be generated Check the specification of the O parameter and input again 16 File seek error xxx Seek failure gt This error involves the operating system It most frequently occurs when there is a hardware problem with a disk drive 17 Expression value is out of range The value resulting from calculation of an expression SECTION xxx ADDRESS xxx is out of range The section name absolute OFFSET xxx address and offset from the start of the section are given to indicate the location of the error Modify the program to ensure that the expression value does not go out of range 18 Out of disk space There is not enough space left on the disk selected for output Create more space on the disk 19 Relative jump is out of range The jump destination address of the relative jump 2 22 SECTION xxx ADDRESS xxx OFFSET xxx command cannot be accessed Modi
95. distinction is made between upper and lower case characters either WITH_C or with_c is equally valid Example work work lt lt 2 with c The contents of work including the carry is shifted 2 places to the left EVER This refers to the specification of an endless loop This is prepared as a reserved word in SRA74 Since no distinction is made between upper and lower case characters either EVER or ever is equally valid Example for ever Specifies an endless loop next Constant This is a general term referring to numerical constants character constants symbolic con stants or combinations of these with operators SRA74 5 Renesas Technology Corp F 4 Syntax maps of structured commands Assignment statement Memory variable assignment statement Register variable assignment statement R R R egister variable X H egister variable Y Register variable S Register variable X Register variable A Register variable P EN Register variable X Gem Register variable S CC Memory bit variable assignment statement Memory bit variable H SE Memory bit variable that is the same as left term 1 137 5 Renesas Technology Corp Appendix F List of structured commands Register bit variable assignment statement Register bit variable A H 11 J H Memory bit variable that is the same as left term Flag varia
96. e switch statement range Check the program 39 ends not associated with switch There is no switch to correspond with ends Check the program 40 1 64 continue not inside for or do continue has been entered into an improper location Check the program SRA74 5 Renesas Technology Corp A 3 List of warnings A 3 List of warnings When a warning is detected a warning message is output to the VDU and the PRN file Table A 3 lists all the warning messages along with a description of their contents Warning number Table A 3 List of warnings Warning message Description and user action 1 Phase warning 1 The address specified by pseudo command ORG precedes an address prior to that one Example ORG 0 000 MAIN LDA WORK ORG 0COO00H 2 The command is referring to a label or symbol which is defined after this line LDA Example WK X WK EQU 80H Define the label or symbol prior to the line which refers to it 2 END statement in include file The pseudo command END has been entered into the include file Enter END into the source file 3 statement has no effect The statement has no meaning as a statement Check the program 4 not case values for switch The switch statement does not contain any case statement values Check the program 5 statement not preceded by case or The statemen
97. e from 1 7 UNUSED SYMBOLS d or EQUATE ON 0001p BOLS USED ELS EXTERNAL f Indicates external reference GET_AD_DATA 0000e Tindicates external label SECTION 7 Tindicates section name up to 122 characters AD_DATA 0003p AD_RESULT 0002p WORKO 0000 WORK1 0001p SECTION AD CONVERT UNUS EXTERNAL SECTION AD CONVERT START 000 Fig 2 6 Example of a PRN file Symbol and label list No I parameter 5 Renesas Technology Corp 2 2 Generating files Family SRA74 V 4 00 00 LOC OBJ NM E i M c UOS 0 UDE Section 7 WORKO WORK1 AD_RESULT AD_DATA ORG ICON fAD INT OK INCLUDE STACK OFF ON Fig 2 7 Example of a PRN file First part of source file Uses I parameter 1 13 434 NESAS Renesas Technology Corp Chapter 2 Outline 740 Family SRA74 V 4 00 00 SEQ LOC OBJ S NM PAGE EC AD CONVER RG 5 000 EX GET AD DA sub routine UB START CLUDE MACRO A74 ACRO RAMS 0 EPEATI ram RAMS ram mo Oo D D Ei EJ Hw O
98. earlier Example 2223h OFFFFh 2 Results for V 2 00 10 and earlier 1111H Results for V 4 00 00 and later 9111H The SIZEOF value is determined at the time of the link operation without regard to the reference section or whether it is relocatable or absolute The SIZEOF operator can only be used with a section name When using the SIZEOF operator a space must be left between the operator and the section name Example WORD SIZEOF DATA For the operands of operators BK and BL specify labels whose values are defined in assembly execution The extra area value is obtained by adding 1000H to the low order 12 bits of the operand label Operations are carried out from left to right operators have no order of priority Example 2 6 2 The result is 4 Bit symbol operations and operations between labels which refer by means of ZEXT and SEXT are not possible SRA74 5 Renesas Technology Corp CHAPTER 5 Structured Language 5 1 Function of the structured command The readability of a program is severly affected by the frequent use of branch instructions and labels The structured language allows coding of conditional branch structures and repeat struc tures without the use of labels thus improving program readability In addition instructions that directly operate on registers and flags are available to enable generation of efficient codes 5 2 Types of statement The structured language statements ca
99. echnology Corp 24 NE SAS C me d lt D C M3T SRA74 V 4 10 User s Manual Relocatable Assembler for 740 Family Renesas Electronics Rev 1 00 2003 08 www renesas co Microsoft MS DOS Windows and Windows NT are registered trademarks of Microsoft Corporation in the U S and other countries Sun Java and all Java based trademarks and logos are trademarks or registered trademarks of Sun Microsystems Inc in the U S or other countries and are used under license Linux is a trademark of Linus Torvalds Turbolinux and its logo are trademarks of Turbolinux Inc IBM and AT are registered trademarks of International Business Machines Corporation Intel and Pentium are registered trademarks of Intel Corporation Adobe Acrobat and Acrobat Reader are trademarks of Adobe Systems Incorporated All other brand and product names are trademarks registered trademarks or service marks of their respective holders Keep safety first in your circuit designs Renesas Technology Corporation and Renesas Solutions Corporation put the maximum effort into making semiconductor products better and more reliable but there is always the possibility that trouble may occur with them Trouble with semiconductors may lead to personal injury fire or property damage Remember to give due consideration to safety when making your circuit designs with appropriate measures such as i placement of substitut
100. elocatable file name 3 Command parameters In LIB74 this data can be input in any of two different ways according to the operating environ ment 1 Command line input 2 Command file input These different input methods are used for the same parameters The following sections contain explanations of the input parameters and outline with the help of examples the different methods of entering the parameters 434 NE SAS Renesas Technology Corp 3 7 Chapter 3 Operation method 3 2 Input parameters 3 2 1 Library file name 1 Always enter the name of the library file The name for a library file to be edited should be entered after command parameter O and separated from the command parameter by a space or tab character The directory path can also be specified within the file name If only the file name is specified then the system will search for the library file in the directory specified by the environmental variable LIB74 If the environmental variable has not been set processing will be carried out on a file contained within the current directory The file attribute LIB may be omitted 3 2 2 Relocatable file name 1 Several relocatable files may be specified separated by space or tab characters The names of the relocatable files to be processed should be entered after command param eter F and separated from the command parameter by a space or tab character The directory path can also be s
101. emory capacity which relate to SRA74 s operating system Please refer to the list of error messages in Appendix A and proceed according to the operating system commands 2 Errors relating to the input of SRA74 command lines These are errors relating to the input of the command lines to activate SRA74 Please study the contents of this chapter and then reinput the relevant commands 3 Errors relating to the contents of the source file constituting the object of the assembly operation These are errors relating to the source file such as the dual definition of a label or reference to a symbol which has not been defined Please correct the relevant contents of the source file and carry out the assembly operation again When an assembly error is detected the R74 file will not be generated Whenever an error or warning is detected SRA74 outputs the contents file name line number in file consecutive line number error number and error message of the error onto the VDU screen and the print file in the format shown in Fig 8 4 Please study the list of errors in error number order in Appendix A and take action accordingly 1 55 5 Renesas Technology Corp Chapter 8 Operation method A gt SRA74 TEST lt RET gt 740 Family SRA74 V 4 00 00 Copyright 1989 1998 MITSUBISHI ELECTRIC CORPORATION AND MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION All Rights Reserved processing pa
102. ent the system automatically switches to interactive input mode Fig 4 3 Command line input Example 1 A gt LINK74 MAIN SUB WORKRAM 100 PROM C000 DROM O WORK M S lt R Fig 4 4 Command line input Example 2 No library file A gt LINK74 MAIN SUB WORKRAM 100 PROM C000 DROM lt RET gt Fig 4 5 Command line input Example 3 No command parameters 2 16 SRA74 434 NESAS RenesasTechnology Corp 4 3 Method s of entry 4 3 3 Command file input Command file input has the following features 1 With command file input a command file is created in advance and specified when LINK74 is activated Command file input is convenient when there are too many characters to use command line input The command file name is specified as shown in fig 4 6 when activating LINK74 by entering in front of the file name In fig 4 6 the contents of CMD DAT are executed as the command The contents of the command file are the same as for command line input the LINK74 can be omitted however The lt RET gt is disregarded so long commands can be entered on several lines The example in fig 4 5 can be written as the command file shown in fig 4 7 If the command parameters entered are insufficient the system automatically switches to interactive input mode For example if the last two commas are omitted from fig 4 7 LINK74 outputs an interactive input display to request the command parameters
103. ent varialbe can be disabled from the command line if it is unnecessary The specifications made with the environment variable SRA74 are processed before those on the command line For example the following specifications PC SET SRA74 L I SRA74 FILE L S are equivalent to the following specification from the command line SRA74 L I FILE L In other words the command parameter L is disabled with the specification from the command line and no PRN file is generated SRA74 5 Renesas Technology Corp APPENDIX A Error Messages A 1 System errors When a system error is detected during the assembly operation an error message is displayed on the VDU and assembly is suspended Table 1 lists all the system errors Table A 1 List of system errors Error Message Description and User Action Usage sra74 filename options The command has been input wrongly Refer to the help page and input the command again Can t open xxx File not found Check the source file name and input again Can t create xxx This file cannot be generated Check the specification of the O parameter and input again Out of disk space There is not enough space left on the disk selected for output Create more space on the disk Out of heap space The memory space required for the operation of the assembler is insufficient Reduce the number of symbols or label
104. er Error Message Description and User Action 11 No END statement There is no END statement in the source file Enter an END statement at the end of the program 12 No symbol definition The symbol has not been entered Example EQU 60 Enter the symbol 13 No at the top of comment There is no at the head of the comment section Example LDA CNT counter set Add a at the head of the comment section 14 Not in conditional block ELSE or ENDIF has been entered regardless of the absence of a corresponding IF statement This error will also occur when the corresponding IF statement is in error Example IF DATA1 ENDIF ELSE ENDIF Check the IF statement 15 Operand is expected The operand required by the command is insuffi cient Example BYTE Check the entry of the operand 16 Questionable syntax The mnemonic is spelled incorrectly Example ADD DATA Check the spelling of the mnemonic 17 1 62 Reference to multi defined label or symbol Reference has been made to a label or symbol which has been defined more than once Example MAIN NOP MAIN NOP BRA MAIN Check the name of the label or symbol SRA74 5 Renesas Technology Corp A 2 List of assembly errors Error number Error Message Description and User Action 18 Relative jump is out of ra
105. ere the command parameter O has been simul taneously specified and in the current directory where O has not been specified When command parameter 4 is simultaneously specified the structured command is converted to a mnemonic and output underneath the source line The PRN file should be used for operations such as print and debug The file attribute is PRN 4 The tag file Hereafter referred to as the TAG file This file is used to store the error and warning messages generated in the course of an assembly operation The TAG file is output on specification of command parameter E The TAG file should be used for reference when correcting editor errors The file attribute is TAG 5 The temporary file Hereafter referred to as the TMP file Note This is a temporary file for use during assembly operations Output is in the set directory where the environment variable TMP has been set and in the current directory where TMP has not been set This file is automatically deleted when the assembly operation has been completed The file attribute is n n 1 5 The R74 file has a binary format and there should therefore be no output to the printer and VDU 434 NESAS Renesas Technology Corp Chapter 2 Outline 2 2 1 Configuration of the file Fig 2 1 gives an illustration of a source file and Figs 2 2 2 3 give examples of files generated during its assembly The file is made up from the fol
106. erefore be utilized in whatever way the user wishes 3 2 3 Pseudo command line The configuration of the pseudo command line is shown below For further details concerning this line please refer to Chapter 6 and Appendix D A Symbol Bit symbol A EQU A Operand A Comment RET A Label A Pseudo command Operand A Comment RET Symbol Bit symbol section Enter a symbol or bit symbol with a value given by the pseudo command EQU Label section Enter the label to enable reference to the line from another location Pseudo command section Enter a 740 Family pseudo command The pseudo command makes no distinction between upper case and lower case alphabetic characters Either END end or End would therefore be equally valid SRA74 recognizes the pseudo command as a reserved word so that when a label is not entered entry can be made from the head of the line Operand section Enter the pseudo command s target When the operand contains more than one item of data then the items should be separated from each other by a comma A space tab code can be entered on either side of a comma Comment section This section is not subject to processing by SRA74 and may therefore be utilized in whatever way the user wishes 1 21 5 Renesas Technology Corp Chapter 3 Entering the source program 3 2 4 Macro command line The configuration of the macro command line is shown below For further details
107. escription are used for the macro argument in each macro call enclose or in double quotation marks Example mac macro 1 para2 paral para2 endm mac work 10h 7 3 Macro operators 1 46 Table 7 1 lists the operators which can be used with macro commands Table 7 1 List of macro operators Operator Description V Causes recognition as argument of the character following the which is placed in front of a special character which cannot be used as a macro argument format character 212 Defines the comment which is not generated a macro definition format comment 9 Used when calling a macro where there is for example space tab or reserved word included in the argument format character string Used when there is concatenation of character strings either before or after the argument format 1 argument character string 2 character string argument SRA74 5 Renesas Technology Corp 7 3 Macro operators Notes 1 By acting as escape characters they negate the special meanings of the following charac ters Example Macro definition DATA MACRO VAL BYTE VAL END Call example DATA HELLO Macro generation BYTE HELLO END 2 When outputting the result of a macro generation to the print file comments preceded by a single semi colon wi
108. far as possible the same sequence has been followed in the description for each of the programs For instance environmental variables are covered at the end of the chapter on operating method for each program Part 1 SRA74 operation manual Describes how to use the SRA74 structured relocatable macro assembler and how to enter SRA74 source programs 2 LINK74 operation manual Describes how to use the LINK74 linker and the part functions Part 3 LIB74 operation manual Describes how to use the LIB74 library Part 4 CRF74 operation manual Describes how to use the CRF74 cross referencer Part 5 CV74 operation manual Describes how to use the CV74 M37280 converter 434 N ESAS RenesasTechnology Corp PAIR 1 RELOCATABLE ASSEMBLER FOR THE 740 FAMILY SRA74 OPERATION MANUAL RENESAS as Technology Corp Table of Contents Chapter 1 The format of the manual Chapter 2 Outline 2 1 Funcltions 2 2 Generating ON 2 2 1 Configuration of the I file 2 2 2 Configuration of the PRN file 2 2 8 Configuration of the TAG file Chapter 3 Entering the source program 3 1 Configuration of the source program 3 2 Configuration of a line cessus 3 2 1 assembly langu
109. files have been specified Specify only 1 target file Invalid option xx is used Invalid command option xx was used The specified option does not exist Reinput the com mand No input files specified An input file was not specified Specify an input file No output files specified An output file was not specified Specify an output file Not enough memory There is not enough memory Divide up the file and reexecute the command or in crease memory Option xx is multiple defined Command option xx is defined twice Reinput the command Option xx is not appropriate The xx command option is not properly written Respecify the command option 434 NESAS Renesas Technology Corp Appendix A Error messages A 2 List of warning Table A 2 List of warning Error message 7 Descripionanduseraction Output data to the xx file doesn t exitst The xx file cannot be generated because the speci fied data area is empty Check the contents of the input file 5 8 SRA74 5 Renesas Technology Corp kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Branch Instruction Optimization Tool LOOP74 Operation Guide kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 1 Function This program converts branch instructions that generate errors because the addresses are out of range into enabled branch instructions If you will
110. fy the program so that the jump destination label is within range The section name absolute address and offset from the start of the section are given to indicate the location of the error SRA74 5 Renesas Technology Corp Error number Error message Description and user action 22 Out of maximum program size The program area exceeds the 64KB FFFF16 maxi mum area Reduce the size of the program 23 Section type mismatch in Section with ROM type and RAM type mixed SECTION xxx Ensure that ROM and RAM type are not mixed in the same section 25 Expression is out of ZERO page The result of the formula processed for zero page SECTION xxx ADDRESS xxx addressing exceeds the range from 0016 to FF16 OFFSET xxx Modify to ensure that the result is within the zero page range 26 Expression is out of SPECIAL The result of the formula processed for special page SECTION xxx ADDRESS xxx addressing is outside the range from FF0016 to OFFSET xxx FFFF16 Modify to ensure that the result is within the spe cial page range 27 label xxx type is mismatch The type label or bit symbol of an externally refer enced label differs from the declaration Correctly declare the pseudo command for exter nal reference 28 Section xxx information is The section start address specified by command out of range input is out of range Specify the start address correctly 29 B
111. g Format A label A BYTE numerical expression Description Sets 1 byte of constant data f more than 1 byte of data is to be set then each item of data must be separated by a Up to 255 items of data may be specified Global labels may be entered into the operand Example E labell BY 10 Sets OAH labe12 BYTE A B Sets 41H and 42H 1 79 5 Renesas Technology Corp Appendix D The pseudo commands COL Column number setting Default setting 512 Format A COL numerical expression Description Sets the number of columns from 80 to 512 on one line of a list setting of 79 columns or less will be registered as 80 and a setting of 513 or more will be registered as 512 This pseudo command can be used only once during a program Example COL 80 Sets the number of columns to 80 END Program termination directive Format A END Description Specifies the end of the source program Lines following this pseudo command will not form part of the assembly operation Example END Directs the termination of the program 1 80 SRA74 5 Renesas Technology Corp D 2 Summary of the pseudo commands ENDFUNC Function termination specification Format A ENDFUNC Alabel Description Specifies the end of the function subroutine use of this command enables a source line debug in the SDB7
112. he interrelationships between different parts of a source file when you are modifying a program 2 1 Functions CRF74 is used in conjunction with SRA74 The following functions are provided to make the process of understanding a source file more efficient 1 Line numbers are displayed for commands accessing labels 2 File read can be executed by means of the pseudo command INCLUDE 3 Headers can be output using the pseudo command PAGE 2 2 Generating files CRF74 generates a cross reference lists CRF files A label and symbol cross reference list is displayed Format is fixed Each page has 57 lines of 80 characters each This file should be output to the printer and used in case of debugging or editing The file attribute is CRF relocatable assembler for use with the 740 Family 4 2 SRA74 5 Renesas Technology Corp 2 3 Configuration of the CRF file 2 3 Configuration of the CRF file Fig 2 1 shows an example of an output CRF file The CRF file contains the following data 1 Labels and symbols together with the line numbers where they are defined and accessed The definition line is marked with and any access lines involving subroutine calls are marked with amp 2 The first 32 characters of label and symbol names are shown The page format is deter mined by the longest name in the CRF file 3 The list header shows any title specified using the pseudo command PAGE O
113. he library file If the directory path for the library file is specified by setting the environment variable LIB74 the directory path does not need to be specified when the command is entered Details are given in ordinary OS manuals 2 19 5 Renesas Technology Corp Appendix A Error messages APPENDIX A Error Messages Error number Table A 1 List of system errors Error message Description and user action 0 Xxx file not found The file specified in the input cannot be found This error message can also appear for files specified by the pseudo commands OB or LIB gt Enter the correct filename Invalid command input The command input has more than four parameters or the total number of characters used for the pa rameters is 2048 or more Input the command again within the limits im posed by these restrictions Out of heap space The memory space required for the operation of the linker is insufficient gt Reduce the number of public symbols Invalid section information Section information is incorrect Input the command again in the format Section name address Invalid parameter input xxx Command parameter specification is incorrect gt Input the command again correctly Non relocatable file name No relocatable file name has been input gt Input the file name 2 20 Internal error An internal error has occurred in LI
114. he target of a link operation Only files with the attribute R74 may be specified The specification of any other file will result in the registration of an error during the link operation This pseudo command may not be nested directory path and file attribute R74 may not be entered in the file name Example OBJ OBJ1 OBJ2 OBJ3 1 90 SRA74 5 Renesas Technology Corp D 2 Summary of the pseudo commands ORG or else Address directive Preset value 0000H Format A ORG or numerical expression Description Directs the initiation address from this line onwards Inthe absence of any specification the initiation address will be OOOOH The section in which this pseudo command is entered will become an absolute attribute Any section not containing this pseudo command will become a relative attribute Any labels or symbols used in the numerical expression should be defined prior to the line in question Labels with relocatable values may not be entered into the operand Example ORG OCOOOH Sets the location to OEOOOH Sets the location to EOOOH PAGE List page feed and title setting Format A PAGE title Description A list page feed is carried out immediately prior to this command and the title specified in the operand is output to the header section of the list The title should be enclosed within single qu
115. hll X lt lt imm WITH C ROL hhll X 22 zz X gt gt imm WITH C ROR zz X 2 gt gt imm WITH C ROR hhll X hhll X gt gt imm WITH C ROR hhll X 1 125 5 Appendix F List of structured commands Commands with no corresponding structured language command MUL DIV COM BIT TST RRF JSR RTI RTS NOP FST SLW WIT STP BRA JMP D Dual term operation assignment statement generation examples Table F 5 Dual term operation assignment statement generation examples Assembly command Type Structured command Rotate shift commands zz zz lt lt 2 ASL ASL ZZ 27 zz 22 2 WITH C ROL ROL ZZ ZZ zz 2zz gt gt 2 LSR LSR ZZ ZZ zz 22 gt gt 2 _ ROR ROR ZZ 27 Add subtract commands 1 126 zz 2z 4 LDA CLC ADC STA ZZ 4 ZZ zz 22 4 WITH C LDA ADC STA ZZ 4 ZZ zz 2z zz LDA CLC ADC STA ZZ ZZ ZZ zz z2z 4 LDA SEC SBC STA 22 4 ZZ zz zz 4WITH_C LDA SBC STA 5 Renesas Technology Corp ZZ 4 ZZ SRA74 F 3 Generation example Type Structured command Assembly command Subtract zz zz zz LDA 27 SEC commands SBC 22 5 22 221 221 4 LDA 27 JSR mult 8 BYTE 4 Multiply STA 22 22 221 4 LDA ZZ divide JSR div 8 BYTE 4 commands
116. ice equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems medical equipment or systems for life support e g artificial life support devices or systems surgical implantations or healthcare intervention e g excision etc and any other applications or purposes that pose a direct threat to human life You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions unde
117. ify the drive name for the output file Table 3 1 gives details of the command parameters 4 4 SRA74 5 Renesas Technology Corp 3 3 Methods of entry Table 3 1 List of command parameters Command parameter Description O Specifies the drive name and directory path for the CRF file to be output They should be specified in the following format Example A gt CRF74 SRCFILE lt RET gt The Y symbol and V symbol are interchangeable This is because the use of one or other of these signs depends on which operating system is being used Since the codes are the same either sign can be used The CRF file is output to the TMP directory on drive C Disregard the pseudo command INCLUDE 3 3 Methods of entry 3 3 1 Command line input Command line input has the following features With command line input the whole command is entered on the operating system command line to activate CRF74 gt 74 SRCFILE1 SRCFILE2 SRCFILE3 lt RET gt Fig 3 1 Command line input Example If an error is detected in the command line a help screen like the one shown in fig 3 2 is displayed and processing stops A gt CRF74 lt RET gt 740 Family CROSS REFERENCE V 1 00 10 Copyright 1989 1998 MITSUBISHI ELECTRIC CORPORATION AND MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION All Rights Reserved Usage crf74 lt filename
118. ile MAIN R74 RAM area Section name WORKRAM Program area Section name PROM Fixed data area Section name DROM Fig 3 1 Relocatable file structure 2 6 Relocatable file SUB R74 RAM area Section name WORKRAM Program area Section name PROM Fixed data area Section name DROM SRA74 5 Renesas Technology Corp 3 1 The role of sections To arrange these relocatable files in the sort of memory space shown in fig 3 2 the sections to be linked should be given the same name using the assembler pseudo command SECTION Doing this ensures that the sections are assigned to continuous areas when linked LINK74 allows the start address for each section to be specified at the time of linking Section control command WORKRAM 100 PROM C000 DROM Output file hex file name Address MAIN HEX 010016 Section name WORKRAM WORKRAM for MAIN R74 WORKRAM for SUB R74 020016 Unused area C00016 Section name PROM PROM for MAIN R74 PROM for SUB R74 Section name DROM DROM for MAIN R74 DROM for SUB R74 Fig 3 2 System memory map As can be seen LINK74 can be used to create machine language data corresponding to the final address in the customer s system 2 7 5 Renesas Technology Corp Chapter 3 Section functions 3 2 Section attributes Each section contains two different types of information information about address assignment relocatable or fixed and information abou
119. is being made to a section name which has not been defined Example LDA SIZEOF UNDEF Check the relevant section 27 Section type mismatch command or data set pseudo command etc has been mixed up with an area secure command BLKB etc Example LDA WORK BLKB 1 Separate the sections 28 Constant value is required Relative attribute label or external reference symbol cannot be used Use an absolute value 30 else not associated with if There is no to correspond with else Check the program 31 endif not associated with if There is no to correspond with endif Check the program 32 next not associated with for There is no for to correspond with next Check the program 33 while not associated with do There is no do to correspond with while Check the program 34 break not inside for do or switch break has been used in an improper location Check the program 35 case not inside switch case has been entered outside the switch range Check the program 36 duplicate case value The case value has been used more than once Check the program 37 more than one default There is more than one default in the same switch statement Check the program 38 default not inside switch default has been entered outside th
120. it value is out of range The result of calculating a bit value is outside the SECTION xxx ADDRESS xxx range from 0 to 7 OFFSET xxx Modify to ensure that the result is within the range 30 Extend area requires command The expansion area is not defined option BANK Link it by specifying the BANK command option 2 23 5 Renesas Technology Corp PARI 3 LIBRARIAN FOR THE 740 FAMILY LIB74 OPERATION MANUAL REN ESAS as Technology Corp Table of Contents Chapter 1 The format of the manual Chapter 2 Outline 21 FUNGUS coco niodo nd value cuir dc 2 2 rici m 2 3 Generating Iles u 2 4 Configuration of the LST file Chapter 3 Operation method 3 1 Activation method 3 2 Input parameters 3 2 1 Library file name L L S sS Su mnn 3 2 2 Relocatable file name u uuu 3 2 3 Command 3 2 4 Details of command parameters 3 3 Methods of entry 3 3 4 Command line input 3 3 2 Command file input zr
121. ive auxiliary circuits ii use of nonflammable material or iii prevention against any malfunction or mishap Notes regarding these materials These materials are intended as a reference to assist our customers in the selection of the Renesas Technology product best suited to the customer s application they do not convey any license under any intellectual property rights or any other rights belonging to Renesas Technology Corporation Renesas Solutions Corporation or a third party Renesas Technology Corporation and Renesas Solutions Corporation assume no responsibility for any damage or infringement of any third party s rights originating in the use of any product data diagrams charts programs algorithms or circuit application examples contained in these materials All information contained in these materials including product data diagrams charts programs and algorithms represents information on products at the time of publication of these materials and are subject to change by Renesas Technology Corporation and Renesas Solutions Corporation without notice due to product improvements or other reasons It is therefore recommended that customers contact Renesas Technology Corporation Renesas Solutions Corporation or an authorized Renesas Technology product distributor for the latest product information before purchasing a product listed herein The information described here may contain technical inaccuracies or typographical errors
122. jump will be made to an address located relative to the head address of the main command at a distance measured in terms of the content of the final operand The relative value itself cannot be entered into the final operand If the label or target address is entered then SRA74 will calculate the relative value Example BBC 3 A NEXT Specifies bit 3 of the accumulator Example BITSYMBOL A NEXT The entry formats for each command in each addressing mode are given for reference in Appendix C 1 27 5 Renesas Technology Corp Chapter 4 Assembly language 4 2 Operand data format 1 28 The 4 types of data format shown below may be entered into the operand 1 Numerical constant Positive and negative values are shown by inserting the operators or before the numerical constant Where neither operator is inserted then the value will be processed as if positive A space or tab cannot be inserted between the sign which indicates the type of number and the number itself Example BYTE 64 gt This is an error Either binary octal decimal or hexadecimal numbers may be used as numerical con stants Binary numbers Should be composed of binary figures with either at the head or a B or b at the end Example BYTE 100110 Example BYTE 100110B e Octal numbers Should be composed of octal figures with either a at the head or
123. l Y WITH C SBC hhll Y commands A A zzX WITH C SBC zz X A A zz Y WITH C SBC zz Y zz X zz X INC zz X hhli INC hhli hhll X hhll X INC hhll X 22 zz X DEC zz X hhli hhli DEC hhil Y hhll Y DEC hhll X 1 124 SRA74 5 Renesas Technology Corp Renesas Technology Corp F 3 Generation example Type Structured command Assembly command 22 22 A A amp hhll AND hhli A A amp hhll X AND hhll X Logical A AG amp hhll Y AND hhll Y A A amp zzX AND 22 operation A A amp zz Y AND zz Y zz X ORA 22 commands A A hhll A A hhll X ORA hhll X A A hnhll Y ORA hhll Y 22 ORA 22 22 ORA 2z Y A AA zz X EOR zz X Logical A AA hhll EOR hhli A A A hhll X EOR hhll X operation A AA hhll Y EOR hhll Y A A zzX EOR zzX commands 22 EOR zz 22 22 lt lt imm ASL 22 2 hhll lt lt imm ASL hhll Rotate hhll X hhll X lt lt imm ASL hhll X 22 zz X gt gt imm LSR zz X shift hhll hhll gt gt imm LSR hhll hhll X hhll X gt gt imm LSR hhll X 22 zz X imm WITH C ROL zz X commands hhli hhil lt lt imm WITH ROL hhll hhll X 2 h
124. le or in part these materials f these products or technologies are subject to the Japanese export control restrictions they must be exported under a license from the Japanese government and cannot be imported into a country other than the approved destination Any diversion or reexport contrary to the export control laws and regulations of Japan and or the country of destination is prohibited Please contact Renesas Technology Corporation or Renesas Solutions Corporation for further details on these materials or the products contained therein For inquiries about the contents of this document or product fill in the text file the installer generates in the following directory and email to your local distributor SUPPORT Product name SUPPORT TXT Renesas Tools Homepage __http www renesas com en tools Introduction SRA74 is a structured relocatable macro assembler for the 740 Family SRA74 can produce 740 Family machine language files and debug data files from source programs containing 740 Family structured language assembly language or a mixture of the two This manual describes the functions and use of the four programs included in the SRA74 package 1 SRA74 structured relocatable macro assembler 2 LINK74 linkage editor 3 LIB74 library 4 CRF 74 cross referencer 5 CV74 M37280 converter The format of the manual This manual consists of four separate parts Each part covers one of the programs in the SRA74 package As
125. les register bit variables or flag variables only numerical or symbolic constants with values of 0 or 1 can be used For further details concerning left and right sides please refer to the syntax maps SRA74 5 Renesas Technology Corp F 3 Generation example F 3 Generation example The assembly language statements generated from structured language commands are described with examples F 3 1 Assignment statement generation example The relationship between assembly language and structured language commands other than condi tional branch commands are shown below Conditional branch commands are described in F 3 2 The following table describes the symbols used in the assignment statement generation example Table F 1 Symbols used in examples Symbol Description Symbol Description A Accumulator X Index register X Y Index register Y S Stack pointer P Processor status register C Carry flag Z Zero flag Interrupt disable flag D Decimal mode flag T X modifier operation mode flag V Overflow flag N Negative flag imm Immediate data 22 Zero page address hhll General page address Immediate mode MEM Memory FLAG Memory bit A Register and flag assignment statement generation examples Table F 2 Register and flag assignment statement generation examples Type Structured command Assembly command Bit 0 0 CLB AO Operation BIT_AO 1
126. library file can be updated to create new relocatable files 5 Relocatable files stored in a library file can be extracted 6 Information of relocatable files in a library file can be displayed 2 2 Advantages 1 Linking can be made faster Storing relocatable files in a library enables the fast access to the information required in linking and accelerates the LINK74 linking operation 2 When relocatable files in a library file are updated the update dates can be compared making it possible to cut down processing work by only processing new versions of relocat able files When the U command parameter is specified 1 A linkage editor for use with the 740 Family 3 2 SRA74 5 Renesas Technology Corp 2 3 Generating files 2 3 Generating files LIB74 generates 4 file types as outlined below 1 Library file File containing edited relocatable files with an index to labels and symbols In the library file relocatable files are handled as individual modules Here the relocat able files in a library file are referred to as modules A module name is the same as the relocatable file name including the file attribute The file attribute of a library file is LIB 2 Program list file Hereafter referred to as the LST file File generated on specification of command parameter L Contains an index with relocatable file names global labels and symbols The file attribute is LST The structure of
127. ll Y LDY Immediate LDY imm Zero page LDY 22 Zero page X LDY zz X Absolute LDY hhll Absolute X LDY hhll X LSR Accumulator LSR A Zero page LSR 27 Zero page LSR zz X Absolute LSR hhll Absolute X LSR hhll X MUL Zero page X MUL zz X NOP Implied NOP Note 1 When a bit symbol is entered into the operand of an LDA command only the address of the bit symbol is valid 1 70 SRA74 5 Renesas Technology Corp B 2 List of commands Command Addressing mode Entry format ORA Immediate ORA imm Zero page ORA 27 Zero page ORA zz X Zero page indirect X ORA 22 Zero page indirect ORA 22 Absolute ORA hhll Absolute X ORA hhll X Absolute Y ORA hhll Y PHA Implied PHA PHP Implied PHP PLA Implied PLA PLP Implied PLP ROL Accumulator ROL A Zero page ROL 22 Zero page ROL zz X Absolute ROL hhll Absolute X ROL hhll X ROR Accumulator ROR A Zero page ROR 22 Zero page ROR zz X Absolute ROR hhll Absolute X ROR hhll X RRF Zero page RRF ZZ RTI Implied RTI RTS Implied RTS SBC Immediate SBC imm Zero page SBC 27 Zero page SBC zz X Zero page indirect X SBC zz X Zero page indirect Y SBC zz Y Absolute SBC hhll Absolute X SBC hhll X Absolute Y SBC hhll Y SEB Accumulator bit SEB LA GER bitsym A 1 71 5 Renesas Technology Corp Appendix B List of commands
128. ll be fitted within the compass of a single line Since arguments are divided by a it is necessary when using a comma or a space as an argument to enclose it within However commas inside parentheses treated as argument separators Amacro generated area is marked in the PRN file by a Multiple macro definitions may be made using the same macro name When such macro is called the most recent definition is used 1 109 434 NESAS Renesas Technology Corp Appendix E List of macro commands 1 110 Example Example 1 Macro definition without operand Macro definition ADDa DA DX LC DC TA ENDM Call example ADDa Macro generation DA DX LC DC TA ENDM ABC DEF TABLE X GHI ABC DEF TABLE X GHI Example 2 Macro definition with operand Macro definition ADDb DA DX LC DC TA ENDM Call example A Macro generation DDb DA DX LC DC TA ENDM V1 IMM V2 Dummy arguments 1 2 V1 IMM TABLE X V2 WORK1 10 WORK2 WORK1 10 TABLE X WORK2 5 Renesas Technology Corp SRA74 E 2 Summary of the macro commands Example 3 Macro nesting Macro definition ADD MACRO SRC CLC ADC SRC ENDM Call example ADDW MACRO SRC ADD SRC Macro call within a macro ADC
129. ll be output on the occasion of each macro generation whereas those preceded by a double semi colon will not Example Macro definition LOOP MACRO LOCAL LOOP1 LDA 20 comment LOOP1 DEC A comment BNE LOOP1 comment ENDM Call example LOOP Macro generation LDA 120 comment sues DEC A BNE vai ENDM 1 47 434 NESAS Renesas Technology Corp Chapter 7 Macro commands 3 When the argument supplied by the operand contains for example a space tab comma or reserved word then everything should be enclosed within double quotes Example Source entry SUB REPEATI INST NOP LDA 41 JSR SUB1 RTS INST ENDM Macro generation SUB NOP LDA 1 JSR SUB1 RTS ENDM 4 Used when there is character string concatenation either before or after an argument and the name given by the argument is changed There must be no space or tab inserted between the and the character string Example Source entry ADDWI MACRO MEM IMM CLC LDA MEMS_2 gt IMM STA MEM 1 LDA lt IMM ADC MEMS_2 1 STA MEMS_1 1 ENDM Call example ADDWI RAM 1000H Macro generation CLC LDA RAM 2 ADC gt 1000H STA RAM 1 LDA lt 1000H ADC RAM 241 STA 1 1 1 48 SRA74 5 Renesas Technology Corp 7 3 Macro operators 5 The strings enclosed in parentheses are treated as single
130. logy Corp Chapter 1 The format of the manual Appendix E Macro instructions A list of the contents of each macro instruction used with SRA74 e Appendix F Structured commands A list of the contents of each of the structured commands used with SRA74 e Reserved words List of reserved words used with SRA74 Note Parts of the programming examples contained in this manual use the sign in place of Y to refer to the special page addressing mode This is because the use of one or other of these signs depends on which operating system is being used Nevertheless since the codes are the same either sign can be used 1 2 SRA74 5 Renesas Technology Corp CHAPTER 2 Outline SRA74 is the structured relocatable macro assembler for the 740 Family The assembly language and the structured language are used to convert the source program to be called the source file from now on into relocatable files which can be processed by means of LINK74 and LIB742 From now on this operation will be referred to as assembly LINK74 can be used to convert the relocatable files into machine language 2 1 Functions The development of large scale software has made necessary the parallel development of func tions which permit the sharing of programs for for example the exchange of data between groups of engineers or the reuse of existing software SRA74 is provided with the following functions to permit the efficient handling
131. lowing data The parts entered using structured language commands are converted to assembly language commands which are shown beneath the structured language commands The structured language and macro commands are all output as comment lines The file can thus be treated as the source file and the assembly operation carried out by means of SRA74 ERO H Section 2 D CONVERT E000 GET_AD_DA routine START MACRO A74 START D 0 T 0 STACK RAM CL WORKO WORK1 ram clear fAD INT OK OFF K 2 A D convert 2 times do JSR ET_AD_DATA WORKO WORKO AD RESULT WORK1 WORK1 0 with c X X while X A D DATA average WORK1 WORKO AD_DATA END WORK1 gt gt 1 gt gt 1 with c WORKO Fig 2 1 Example of a source file 1 6 SRA74 5 Renesas Technology Corp 2 2 Generating files ERO IO00 Section z The INCLUDE command line has name changed to the I file generated by SRA74 AD CONVER 5 000 AD DA sub routine START MACRO IO1 0 lt Structured commands output as comments and converted to assembly language CLD 0 CLT STACK STACK TXS CL WORKO WORK1 ram clear 0 EATI ram WORKO Macro commands output as comments and converted into assembly language OFF CAD INT OK A D convert 2 times 2 Fig 2 2 Example of
132. ly file consisting only of Z section and R section all labels are treated as global Therefore PUB specification for these labels may be omitted This pseudo command should be entered prior to the line in which the label or symbol is defined Example RMOD PUB WORK1 WORK2 WORK3 WORK1 BLKB 1 WORK2 BLKB 1 BLKB 1 WORK3 1 93 434 NESAS Renesas Technology Corp Appendix D The pseudo commands RMOD RAM area specification General page Format A RMOD Description Specifies that the area from this command onwards is a general page RAM area This command is equivalent to the insertion of R into the operand of the pseudo command SECTION This specification will remain valid until another area specification command is received e Ina RAM area only file consisting only of Z section and R section all labels are treated as global Therefore PUB specification for these labels may be omitted Example RMOD WORK1 BLKB 1 WORK2 BLKB 1 WORK3 BLKB 1 1 94 SRA74 5 Renesas Technology Corp D 2 Summary of the pseudo commands SECTION Area specification Format A SECTION section name Description Specifies that the area from this line onwards will be the area with the name specified in the operand When reserved section names P R 5 Z have been entered in the operand SRA74 will recognize each as its own area attribute from this pseudo command onwards and proce
133. mands Coding Format JMP hhll 14 Special page Commands Coding Format JSR JSR WMhhll 15 Zero page bit Commands Coding Format CLB SEB 1 22 bitsym 16 Accumulator bit Commands CLB SEB CLB iA CLB bitsym A 17 Relative Commands Coding Format BCC BCS BEQ BMI BNE BPL BRA BCC BVC BVS 18 Zero page bit relative Commands Coding Format BCC BBS BBC i zz hhll BBC bitsym hhll 1 75 434 NESAS Renesas Technology Corp Appendix C Commands listed by addressing mode 19 Accumulator bit relative Commands Coding Format BBC BBS BBC i A hhll BBC bitsym hhll 1 76 SRA74 5 Renesas Technology Corp APPENDIX D The Pseudo Commands D 1 How to use the pseudo command reference section All the pseudo commands which can be used in SRA74 are described in alphbetical order Points which should be noted with regard to the notation style in this section are outlined below 1 The use of square brackets indicates that the section may be omitted as required 2 A are used to indicate the use of a space or a tab code The A represents a required section whereas the A section may be omitted if necessary 3 In the following descriptions the space between a label and a pseudo command is indicated by a A When entering a label a colon is not absolutely necessary but if it is omitted then a space or tab code mus
134. me 4 2 3 Section contra 4 2 4 Command 4 3 Methods of entry J 4 3 1 Interactive 4 3 2 Command line input 4 3 8 Command file input a E A E Rs E MR 444 Types Te EE 4 4 2 Value for return to operating system 4 5 Environment variables Appendix A Error messages 2 5 Renesas Technology Corp 20 List of Figures 2 1 3 1 3 2 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 2 ii Example of a MAP file output J J 5 Relocatable file structure J J 6 System memory Map ME 7 LINK74 initial display 14 Display during interactive input 15 Command line input Example 1 16 Command line input Example 2 No library file 16 Command line input Example No command parameters 16 Specifying a command lile 17 Command file layout Example
135. ment Format A label A L CONTINUE Description The continue statement uses a dummy statement to replace the final statement of the smallest repeat statement for or do which contains it and passes control to that dummy statement t may only be used within a for or do statement 1 117 434 NESAS Renesas Technology Corp Appendix F List of structured commands DO WHILE DO statement Format A label A L DO lt statement gt A label AWHILE conditional expression Description do statement continues to be executed so long as the conditional expression is fulfilled so long as it remains true The decision to repeat is made only after execution of the statement For this reason the do statement is most useful when you wish to repeat an operation once more before terminating the repetition f ever is inserted into a conditional expression it will form an endless loop Forfurther details concerning conditional expressions please refer to the syntax maps FOR NEXT FOR statement Format A label A L FOR conditional expression lt statement gt A label ANEXT Description The for statement is a command used for the control of the repetition of an operation which it will continue to repeat for so long as the specified conditional expression holds true f ever is inserted into a conditional expression it will form
136. mode or in the special page addressing mode then the specification should be modified to EXT or SEXT respectively This pseudo command should be entered prior to the line in which reference is made to the label Example SECTION 7 ZEX WORK1 WORK2 SEX SUB START LDA WORK1 JSR SUB 1 98 SRA74 5 Renesas Technology Corp D 3 List of reserved pseudo commands ZMOD RAM area specification Zero page Format A ZMOD Description Specifies that the area from this command onwards is a zero page RAM area This command is equivalent to the insertion of Z into the operand of the pseudo command SECTION This specification will remain valid until another area specification command is received Ina RAM area only file consisting only of Z section and R section all labels are treated as global Therefore PUB specification for these labels may be omitted Example ZMOD WORK1 BLKB 1 WORK2 BLKB 1 WORK3 BLKB 1 0 3 List of reserved pseudo commands The pseudo commands listed below have been reserved to facilitate expansion in the future Even if these pseudo commands are entered there will be no effect on the assembly operation 1 99 5 Renesas Technology Corp Appendix D The pseudo commands ENDIO Format A ENDIO Description I O area termination directive Reserved Directs the termination of an I O area All labels and symbols en
137. n Appendix F 3 1 A for details 3 All the 740 Family registers should be entered without specific enclosure in the conditional expression section of an assignment statement or any of the control statements for example if This is because SRA74 uses the following types of names as reserved words Since no distinction is made between upper and lower case characters either A or a would be equally valid A Accumulator X Index register X Y Index register Y S Stack pointer P Processor status register Refer to the register and flag assignment statement generation example in Appendix F 3 1 A for details 4 The 740 Family status register flags should be entered without specific enclosure into the conditional expression section of an assignment statement or any control statement for example if This is because SRA74 uses the following types of names as reserved words Since no distinction is made between upper and lower case characters either C or c would be equally valid C Carry flag Z Zero flag Interrupt inhibit flag D Decimal mode flag T X qualified operation mode flag V Overflow flag N Negative flag Refer to the register and flag assignment statement generation example in Appendix F 3 1 A and flag condition generation expansion example in Appendis F 3 2 for details 5 SRATA processes using for example LDA commands to generate the codes the following types of entry front reference as labels If therefore BITSYM i
138. n be classified into seven types as shown below When the character is prefixed to each instruction a long branch using the instruction is generated The following examples show the coding example on the left with equivalent assembler program on the right Refer to Appendix F for the details of each statement 1 Assignment statement Assigns the right to the left MEM 10 LDM 10 MEM MEM 1 LDA MEM1 STA MEM 2 lif endif statement The if statement is an instruction to change the control stream into two directions with the branch direction being determined by means of a conditional expression if MEM LDA EM WORK 1 BEQ ELSE else LDM 1 WORK WORK 2 BRA ENDIF endif s LSE LDM 2 WORK ENDIF 1 31 5 Renesas Technology Corp Chapter 5 Structured language 3 l for next statement The for statement is an instruction for the control of repetition whereby a statement is executed repeatedly for as long as the specified conditional expression holds true for MEM 1 t FOR jsr output G LDA MEM next d BEQ NEXT JSR OUTPUT BRA FOR NEXT 4 while statement The do statement is executed repeatedly for as long as a specified conditional expression holds true do DO jsr output H JSR OUTPUT while MEM LDA MEM H BNE DO
139. nd PUB 5 Indicates bit symbols declared by the pseudo command PUB SRA74 5 Renesas Technology Corp 2 3 Cofiguration of the MAP file 740 Family LINKER V 4 00 00 MAP FILE Thu Dec 10 18 30 58 1992 SECTION FILENAME TYPE START LENGTH WORKRAM MAIN R74 RAM 0000 0080 SUB R74 EL 0800 0100 UTIL LIB EL 0180 0008 CALC R74 MAIN R74 EL C000 1080 SUB R74 EL D800 1500 UTIL LIB EL EDOO 0820 CALC R74 MAIN R74 EL F520 0023 SUB R74 EL F544 0030 GLOBAL LABEL INFORMATION ADCNT 0030 COUNT DATA1 00A6 MAIN GLOBAL SYMBOL INFORMATION GLOBAL BIT SYMBOL INFORMATION Fig 2 1 Example of a MAP file output 434 NESAS Renesas Technology Corp Chapter 3 Section functions CHAPTER 3 Section Functions 3 1 The role of sections Programs written in assembly language are generally structured with a RAM area program area and fixed data area A relocatable file is generated when an SRA74 source program is assembled and a relocatable file contains at least one of these areas Each area is called a section Some examples are given below to show the contents of sections and the way that they are used Two of the most straightforward examples are the relocatable files MAIN R74 and SUB R74 As can be seen from fig 3 1 each of these relocatable files consists of a RAM area program area and fixed data area Relocatable f
140. nge The jump destination address of the relative jump command is outside the permissible boundaries Either remap the program or modify the com mand 19 Label or symbol is reserved word A name which is identical to a reserved word has been used in the label or symbol Example A EQU 1FFH Modify the name of the label or symbol 20 Reference to undefined label or symbol Reference is being made to a label or symbol which has not been defined Check the label or symbol 21 Value error The data entry format is incorrect Example ADC Check the data entry format 22 Value is out of range The data boundaries are outside the permissible range Example ADC 100H Check the operand entry format 23 format error The number of left brackets and right brackets does not match Example ADC WORK Check the operand entry format 24 Relocatable error The pseudo command ORG has been entered into a relocatable section Example SECTION PROG LDA WORK ORG 1000H Separate the sections 25 No SECTION statement The pseudo command SECTION has not been entered Enter the pseudo command SECTION prior to program entry 1 63 434 NESAS Renesas Technology Corp Appendix A Error messages Error number Error Message Description and User Action 26 Reference to undefined section Reference
141. nic TXA mnemonic TXS mnemonic TYA mnemonic V V overflow flag W WHILE structured command WIT mnemonic WITH C structured command X X index register X Y Y index register Y Z Z zero flag 434 NE SAS Renesas Technology Corp List of Reserved Words 1 147 PARU 2 LINKAGE EDITOR FOR THE 740 FAMILY LINK74 OPERATION MANUAL REN ESAS as Technology Corp Table of Contents Chapter 1 The format of the manual Chapter 2 Outline 2 1 amp REY 2 2 Generating files lll 2 3 Configuration of the MAP file Chapter 3 Section functions 3 1 The role of sections J J J 3 2 3 2 4 Address attributes 3 2 2 Physical attribute 40 3 2 9 Reserved Sectioris n t e HR e PAIR CURE 3 3 Basic function of sections Chapter 4 Operation method 4 1 Activation 4 2 Input parameters J J J J 4 2 1 X Relocatable file name 4 2 2 Library file na
142. nly the first 30 characters are used Any further characters are disregarded 4 CRF74 performs no evaluation of values of labels and symbols the source program This means that it cannot make evaluations of condition assembler 740 Family CROSS REFERENCE V 1 00 10 0 3926 8549 9079 9100 3884 5668 93966 9587 9588 9590 1201 1213 1235 1241 4994 5013 5016 5015 300 1025 91544 8302 91454 81574 pp peg Fig 2 1 CRF file output 4 3 5 Renesas Technology Corp Chapter 3 Operation method CHAPTER 3 Operation Method 3 1 Activation method Before using CRF74 the following data input parameters must be entered 1 Source file name required item 2 Command parameters 3 2 Input parameters 3 2 1 Source file name 1 Always enter the name of the library file 2 If the A74 attribute part of the filename is omitted the attribute A74 will be selected as the default 3 If the full filename is specified files with attributes other than A74 may be processed Ex ample ASM 4 The drive name can also be specified within the file name If only the file name is specified then the system will search for the library file on the current drive 5 Upto 16 source file names can be specified 3 2 2 Command parameters Command parameters are used to specify whether or not to search for the pseudo command INCLUDE in the source file and to spec
143. o that when a label is not entered entry can be made from the head of the line 3 Operand section Enter the op code s target When the operand contains more than one item of data then the items should be separated from each other by a comma A space or tab code can be entered on either side of a comma 4 Comment section This section is not subject to processing by SRA74 and may therefore be utilized in whatever way the user wishes 3 2 2 Structured language command line The configuration of a structured language command hereafter referred to as structured command line is as shown below For further details concerning this line please refer to Chapter 5 and Appendix F A Label A Structured command A Conditional expression A Comment RET SRA74 5 Renesas Technology Corp 3 2 Configuration of a line 1 Label section Enter a label to enable reference to be made to the line from another location Structured command section Enter a 740 Family structured command Structured commands make no distinction between upper and lower case alphabetic characters Either IF if or If would therefore be equally valid SRA74 recognizes the op code as a reserved word so that when a label is not entered entry can be made from the head of the line Conditional expression section Enter the 740 Family structured commande target Comment section This section is not subject to processing by SRA74 and may th
144. o two or more files Each library file can hold up to 500 modules CPU number error The specified library file or relocatable file has not been created by SRA74 Check the library file or relocatable file specification SRA74 5 Renesas Technology Corp PARUT 4 CROSS REFERENCER FOR THE 740 FAMILY CRF74 OPERATION MANUAL REN ESAS as Technology Corp Table of Contents Chapter 1 The format of the manual Chapter 2 Outline KS WH Ee el 2 2 Generating OU 2 3 Configuration of the file Chapter 3 Operation method 3 1 Activation 3 2 Input palamielbetsS 3 27 lt 3 2 2 Command parameters nnn enn 3 3 Methods oT Ghlby EE 3 3 1 Command line input SW Wl el 3 44 Tvpeeotermor su NEEN ENEE NEEN ne Lei CER NEE eee 3 4 2 Value for return to operating system 3 5 Environment variables Appendix A Error messages Syst m M A 2 Cross reference errors 4 i
145. ocatable file name append command replace command delete command extract command listout command update check option verbose option Fig 3 6 Help screen for command line errors LIB74 outputs the details of an error onto the VDU screen Please study the list of errors in error number order in Appendix A and take action accordingly 3 14 SRA74 5 Renesas Technology Corp 3 5 Environment variables 3 4 2 Value for return to operating system When entering an execution command into an Operating system batch file for example there are times when you may wish to change the contents of the processing operation in accordance with the outcome of the execution In LIB74 the execution results are divided into 4 error levels as shown in Table 3 2 and returned to the operating system Table 3 2 List of error levels Error level Description of execution results 0 Normal termination 1 Error relating to the library file or relocatable file to be processed 2 Error relating to input of LIB74 commands 3 Error relating to the operating system 3 5 Environment variables LIB74 always processes the library file in the current directory first If there is no library file in the current directory and a directory path is specified with the environment variable LIB74 then the library file in the directory specified with the environment variable is processed Example A gt SET LIB74 B USR LIB lt RET gt
146. on is written 4 Input source file format LOOP74 processes source files of the same format as the input source files of SRA74 Hence source files which cannot be processed by SRA74 cannot be processed by LOOP74 either LOOP 74 also has the following restrictions LOOP7A does not support labels with EXT declarators etc 74 does not support sources without a in the label 74 does not support elements unprocessible by SRA74 such as the FALSE condition of if pseudo commands A warning is generated if the below relative addresses are written in the branch instruction operand LOOP74 determines an address is relative if is written in the branch instruction operand Example BRA 5 BRA abel 5 Output file format LOOP74 outputs the branch instruction lines to be converted the below format Normally LOOP74 deletes the instruction line prior to conversion but the original instruction line can be kept as a comment by specifying the COMMENT command option Whenthe COMMENT command parameter is not specified Default Line to convert 1 BEQ L1 LOOP74A conversion results BNE lopl Thisistheline which loop74 generated JMP L1 This istheline which loop74 generated 1 1 5 Renesas Technology Corp Line to convert 2 BEQ L1 gotoL 1 74 conversion results BNE lopl This is the line which loop74 generated JMP L1 gotoL 1 1 1 With the above line f
147. onal expression generation example 129 F 7 Memory conditional expression generation example 130 F 8 Register conditional expression generation example 133 1 v 5 5 Renesas Technology Corp CHAPTER 1 The Format of the Manual The SRA74 operation manual contains consists of the following chapters Chapter 2 Outline The basic functions of SRA74 and the files which it generates e Chapter 3 Method of entering the source program How to enter the source program used by SRA74 Chapter 4 Assembly language The 740 Family assembly language used with SRA74 Chapter 5 Structured entry language The structured language used with SRA74 Chapter 6 Pseudo commands Pseudo commands used with SRA74 Chapter 7 Macro instructions Macro instructions used with SRA74 Chapter 8 Operating method Method of operating SRA74 e Appendix Error messages A list of the error messages used by SRA74 along with clarifications of the content of the messages and appropriate user responses Appendix B Commands All the commands in the 740 Family assembly language which can be used with SRA74 e Appendix The commands listed by addressing mode The 740 Family assembly language commands listed for each addressing mode Appendix Pseudo commands A list of the contents of each pseudo command used with SRA74 434 NESAS Renesas Techno
148. onic BNE mnemonic BPL mnemonic BRA mnemonic BREAK structured command BRK mnemonic 1 145 434 NE SAS Renesas Technology Corp List of Reserved Words BVC mnemonic BVS mnemonic C C carry flag CASE structured command CLB mnemonic CLC mnemonic CLD mnemonic CLI mnemonic CLT mnemonic CLV mnemonic CMP mnemonic COM mnemonic CONTINUE structured command CPX mnemonic CPY mnemonic D D decimal mode flag DEC mnemonic DEX mnemonic DEY mnemonic DIV mnemonic DO structured command E ELSE structured command ENDIF structured command ENDS structured command EOR mnemonic EVER structured command F FOR structured command FST mnemonic interrupt diable flag IF structured command INC mnemonic INX mnemonic INY mnemonic 1 146 JMP mnemonic JSR mnemonic LDA mnemonic LDM mnemonic LDX mnemonic LDY mnemonic LSR mnemonic MUL mnemonic N N negative flag NEXT structured command NOP mnemonic O ORA mnemonic P program counter PHA mnemonic PHP mnemonic PLA mnemonic PLP mnemonic R ROL mnemonic ROR mnemonic RRF mnemonic RTI mnemonic RTS mnemonic 5 S stack pointer SBC mnemonic SEB mnemonic SEC mnemonic SED mnemonic SEI mnemonic SET mnemonic 5 Renesas Technology Corp SRA74 STA mnemonic STP mnemonic STX mnemonic STY mnemonic SWITCH structured command T T X modifier flag TAX mnemonic TAY mnemonic TST mnemonic TSX mnemo
149. ons of pseudo commands A pseudo command makes a specification to SRA74 such that it will generate the machine lan guage data which is the objective of the command SRA74 uses 48 different pseudo commands but these can be classified in terms of 6 main groups in accordance with their functions 1 Assembly control pseudo commands themselves do not generate data but control the assembly pro cessing stream They do not affect address updating This group consists of the following seven pseudo commands ASSERT Assemble assertion declaration END Program termination declaration ERROR Assembly error declaration AF ELSE ENDIF Conditional assembly INCLUDE Read file in 2 Address control Data set pseudo commands which generate constant data They carry out address updates This group consists of the following seven pseudo commands EQU Synonymous definitions Address specification BLKB Secures RAM area BYTE WORD Set data 1 The pseudo command names are referred to as declarative where they make a specification with regard to SRA74 and specific where they have an effect on an output file 1 39 434 NESAS RenesasTechnology Corp 3 Link control Chapter 6 Pseudo commands Carries out the controls associated with link processing operations This group consists of the 18 following pseudo commands BEXT ZBEXT EXT SEXT ZEXT External reference specification
150. ormat a comment indicating that LOOP 74 generated the line is attached to the branch instruction line that was converted If a comment is written in the target line LOOP 74 outputs the comment written for the line of the last branch instruction output When the COMMENT command parameter is specified Line to convert 1 L1 LOOP 74 conversion results BEQ Ll lopl Thisistheline which loop74 generated L1 This is the line which loop74 generated 1 1 Line to convert 2 Ll goto L1 LOOP 74 conversion results BEQ L1 gotoL 1 BNE lopl Thisistheline which loop74 generated JMP L1 Thisistheline which loop74 generated lop1 With the above line format the converted line is output as a comment because the COMMENT command option was specified If a comment is written in the target line LOOP74A does not output the comment written for the line of the last branch instruction output 434 N ESAS RenesasTechnology Corp 6 Conversion rules LOOP 74 converts branch instructions according to the below rules input line output line BNE lop1 BEQ L1 J L1 1 1 1 1 BNE L1 JMP L1 1 5 lop1 BCC L1 J MP L1 1 1 BCC lop1 BCS L1 J MP L1 1 BPL 1 1 BMI L1 J MP L1 1 1 1 L1 J MP L1 1 1 BVS lop1 BVC L1 J MP L1 1 lop1 BVS L1 J MP L1 1
151. otes or double quotes for entry The maximum number of characters permitted in title is 20 if column specification is 80 45 if column specification is from 105 to 512 or 60 subtracted from the number of columns if column specification is 81 to 104 If title is not specified only skip to new page is performed Example PAGE PROG1 will be output to the header section of the PRN file 1 91 434 NESAS Renesas Technology Corp Appendix D The pseudo commands PMOD ROM area specification General page Format A PMOD Description Specifies that the area from this command onwards is a general page ROM area This command is equivalent to the insertion of P into the operand of the pseudo command SECTION This specification will remain valid until another area specification command is received n the absence of an area specification command at the head of a file then PMOD will be selected as the standard value Area specification commands may therefore be omitted in respect of the first ROM area of a file Example PMOD EXT AIN SUB ENZAN ENZAN CLT 1 92 SRA74 5 Renesas Technology Corp D 2 Summary of the pseudo commands PUB Public specification Format A PUB Abit symbol or symbol or label Description Enables the bit symbol symbol or label specified in the operand to be referred from any other source file Ina area on
152. pecified within the file name If only the file name is specified then the processing operation will be carried out on a file contained within the current directory on the current drive The R74 attribute part of the filename may be omitted when the command is input 3 2 3 Command parameters Command parameters control output file specification specification of details of library file opera tion and similar items Table 3 1 gives details of the command parameters SRA74 5 Renesas Technology Corp 3 2 Input parameter Table 3 1 List of command parameters Number Command parameter Description 1 O Output Specifies the library file to be edited 2 F Files Specifies a relocatable file to be added to the library file updated or extracted or specifies a module to be deleted from the library file 3 A Append Adds a relocatable file to the library file R Replace Updates a module in the relocatable file D Delete Deletes a specified module from the library file L List Outputs a list of the modules stored in a library file X Extract Extracts a specified module from the library file A relocatable file that can be processed by LINK74 is created in the current directory from the extracted module 4 V Verbose Displays the names of individual files on the screen as they are being processed U Update When updating modules in the library file only the module
153. ple of a source 6 2 2 Example of an file First half of source file 7 2 3 Example of an file Second half of source file 8 2 4 Example of a PRN file First half of source file No I parameter 10 2 5 Example of a PRN file Second half of source file No parameter 11 2 6 Example of a PRN file Symbol and label list No I parameter 12 2 7 Example of a PRN file First part of source file Uses I parameter 13 2 8 Example of a PRN file Middle part of source file Uses I parameter 14 2 9 Example of a PRN file Final part of source file Uses I parameter 15 2 10 Example of a PRN file Symbol list Uses parameter 16 2 11 Example of a PRN file Label list Uses parameter sss 17 2 12 Example of a TAG rere aote ni na haria ax sien nao 18 8 1 Example of the input of activation commands 53 8 2 Help page for command error J 53 8 3 VDU display on normal termination
154. pt program e SRAT74 will process any label entered in the operand as the label for this line Example PROCINT INT ENDPROC PROCMAIN Main program start directive Reserved Format 1 102 A PROCMAIN label Description Directs the start of the main program The area between PROCMAIN and ENDPROC is deemed to be the main program SRAT74 will process any label entered in the operand as the label for this line Example PROCMAIN MAIN ENDPROC SRA74 5 Renesas Technology Corp D 3 List of reserved pseudo commands PROCSUB Subprogram start directive Reserved Format A PROCSUB label Description Directs the start of a subprogram The area between PROCSUB and ENDPROC is deemed to be a subprogram e SRAT74 will process any label entered in the operand as the label for this line Example PROCSUB SUB S Goes PROGNAME Program name directive Reserved Format A PROGNAME program Description Directs the naming of a program contents of the operand will be deemed to be the title of the program Example PROGNAME printer control program 1 103 434 NESAS Renesas Technology Corp Appendix D The pseudo commands RAM RAM area start directive Reserved Format A RAM Description Directs the start of the RAM area Any labels and symbols entered between RAM and ENDRAM are deemed to be part of the RAM are
155. r Z0 eif Z BNE hhll BEQ Z0 e while 2 JMP hhli efor Z Z0 eif Z BEQ hhll BNE 70 e while Z JMP hhii efor Z Z0 eif N BPL hhll BMI 70 e while N JMP hhii efor N Z0 eif N 0 BMI hhll BPL ZO e while N JMP hhii efor N Z0 if V 1 BVC hhll BVS 70 e while V JMP hhli efor Z0 eif Ves BVS hhll DVC 70 e while V JMP hhli efor Z0 1 129 434 NESAS Renesas Technology Corp Appendix F List of structured commands Table F 7 Memory conditional expression generation example Type Structured command Assembly command Long branch if MEM LDA MEM LDA MEM CMP 2 CMP 2 BNE hhli BEQ 20 JMP hhli 20 if MEM 2 LDA MEM LDA MEM CMP 2 CMP 2 BEQ hhli BNE 20 JMP hhli 20 if MEM gt 2 LDA LDA MEM CMP 2 CMP 2 BEQ hhli BEQ 20 BCC hhll BCS Z1 Z0 IF JMP statement 21 if MEM gt 2 LDA MEM LDA MEM CMP 2 CMP 2 BCC hhll BCS 20 JMP 20 if MEM lt 2 LDA MEM LDA MEM CMP 2 CMP 2 BCS hhll BCC 20 JMP 20 if MEM lt 2 LDA MEM LDA MEM CMP 2 CMP 2 BEQ 20 BEQ Z0 BCS hhll 20 Z0 JMP hhli 20 1 130 5 Renesas Technology Corp SRA74 F 3 Generation example Type Structured command Assembly command Long branch while MEM LDA MEM LDA MEM CMP 2 CMP 2 BEQ hhll BNE 20 JMP hhli 20 while MEM 2 LDA MEM LDA MEM CMP 2 CMP
156. r certain use conditions Further Renesas Electronics products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or system manufactured by you Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Elec
157. rand is displayed on the VDU and the assembly operation is terminated Example IF MODE E LS F ERROR undefined assemble mode ENDIF EXT External reference specification General page Format A EXT Alabel or symbol label or symbol label or symbol Description Specifies that the label specified in the operand may make external reference in the absolute addressing mode If you wish to carry out the assembly operation in the zero page address ing mode or in the special page addressing mode then the specification should be modified to ZEXT or SEXT respectively This pseudo command should be entered prior to the line in which reference is made to the label Example EXT WORK1 WORK2 WORK3 1 83 5 Renesas Technology Corp Appendix D The pseudo commands FUNC Function start specification Format A FUNC Alabel Description Specifies the start of the function subroutine The use of this command enables a source line debugging label used with the pseudo command cannot be used on another FUNC Example FUNC SUB Specifies the start of the function SUB LDA 1 RTS ENDFUNC SUB 1 84 SRA74 5 Renesas Technology Corp D 2 Summary of the pseudo commands IF ELSE ENDIF Conditional assembly Format A IF expression statement 1 gt A ELSE statement 2 gt A ENDIF Description Numeric or string
158. rand then the value of that bit symbol only will be referred to Example CLB 1 A Specifies bit 1 of the accumulator Example CLB BITSYMBOL A Relative Causes a jump to an address located relative to the head of the main command at a position measured in terms of the content of the operand The relative value itself cannot be entered into the operand If a label or target address is entered into the operand SRA74 will calculate the relative value Example BRA 12 Example BRA NEXT Zero page bit relative Specifies a zero page area 0016 FF46 specific bit as the target data It is a method whereby if a bit symbol is entered into the first operand then the bit value and address of that bit symbol will be referred to and in accordance with the status of that bit a jump will be made to an address located relative to the head address of the main command at a distance measured in terms of the content of the final operand The relative value itself cannot be entered into the final operand If the label or target address is entered then SRA74 will calculate the relative value Example BBC 2 ZWORK NEXT Specifies bit 2 of ZWORK Example BITSYMBOL NEXT Accumulator bit relative Specifies a specific accumulator bit as the target data It is a method whereby if a bit symbol is entered into the first operand then only the bit value of that bit symbol will be referred to and in accordance with the status of that bit a
159. ranted hereby under any patents copyrights or other intellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information When exporting the products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations Renesas Electronics has used reasonable care in preparing the information included in this document
160. rea 010046 FFFF 6 is specified as the target data Example ADC WORK Absolute X Method by which a general page address is qualified by register X as the target data The register name X should be entered after a comma Example ADC WORK X Absolute Y Method by which a general page address is qualified by register Y as the target data The register name Y should be entered after a comma Example ADC WORK Y Absolute indirect Method by which target data is indicated to be in indirect memory The general page address which holds the target address is entered into the operand and the 2 byte target address is stored in the memory The operand value should be enclosed by Example JMP WORK Special page Method by which a special page area FF0016 FFFF46 is specified as the target data The operand value should be indicated by Y or V Example JSR NWORK SRA74 5 Renesas Technology Corp 4 1 Addressing mode 15 16 17 18 19 Zero page bit Method by which a special page area 0046 FF46 specific bit is specified as the target data When a bit symbol in entered into the operand the value and address of that bit symbol will be referred to Example CLB 0 ZWORK Specifies bit 0 of ZWORK Example CLB BITSYMBOL Accumulator bit Method by which a specific accumulator bit is specified as the target data If the bit symbol is entered into the first ope
161. reate Temporary file A temporary file cannot be generated Check if writing is disabled for the directory Can t open file filename The file name file cannot be opened 434 NESAS RenesasTechnology Corp Check the specified file name Cant translate The address of even the biggest branch instruction cannot be received Check the content of the source program Command line is too long There are too many characters in the command line LOOP74 can take command lines up to a maximum 255 bytes Reduce the number of characters Error occurred in executing sra74 An error occurred while running SRA74 Reexecute SRA74 Illegal source file LOOP74 cannot analyze the source file format Specify a source file of the correct format Illegal TAG file LOOP 74 cannot analyze the tag file format Specify a tag file of the correct format Noinput files specified An input file was not specified Specify an input file Not enough memory There is not enough memory Divide up the input file or increase memory Option xx is not appropriate The xx command option is not properly written Respedify the command option Source files number exceed 1 Multiple source files have been specified Spedify only 1 source file Too many branch error There are too many branch instructions to convert Divide up the source file and reduce the number of branch ins
162. rmat VER A Last update time 1998 Dec 10 15 30 Number of modules 3 Number of global symbols 10 Module_name key_scan Offset 00000000H Module size 00000100H multiply Offset 00000180H Module size 00000080H division Offset 00000200H Module size 000000A5H Fig 2 1 LST file output example 1 list of modules 2 Global label and symbol list alphabetic order Two separate tables are output e PUBLIC symbol table Symbol_name Indicates public labels public symbols and public bit symbols Public symbols declared with the pseudo command EQU are marked with e Public bit symbols are marked with b Module_name Indicates the modules containing the public labels public symbols and public bit symbols 3 4 SRA74 5 Renesas Technology Corp 2 4 Configuration of the LST file EXTERN symbol table Symbol_name Indicates external labels and external symbols Module_name Indicates the modules containing external reference specifications LIB74 librarian V 1 00 10 date 1998 Dec 10 15 30 page 2 PUBLIC symbol table symbol count 0010 Symbol_name Module_name Symbol_name Module_name _dividel division _division division _key_flgl b key scan key flg2 b key scan key scan r ES key scan multiply multiply key scan LIB74 librarian V 1 00 10 date 1998 Dec 10 15 30 page 3 EXTERN symbol table symbol count 0010 Symbol name Module name Symbol name Module name
163. rror to determine the best address 3 If essential commands not present during command line input or command file input the system automatically switches to interactive input Interactive input is activated by entering LINK74 lt RET gt at the operating system prompt When activated LINK74 outputs a display like the one below A gt LINK74 lt RET gt 740 Family LINKER V 4 00 00 Copyright 1989 1998 MITSUBISHI ELECTRIC CORPORATION AND MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION All Rights Reserved Relocatable files R74 gt gt Fig 4 1 LINK74 initial display The last line in fig 4 1 indicates that LINK74 is waiting for a relocatable file to be entered Enter the relocatable file to be linked after gt gt With interactive input then LINK74 waits for the library file section controls and command parameters to be entered in the same way Enter all these as shown in fig 4 2 To enter more than one file separate individual file names with spaces The same applies for the library file name input section control and command parameters SRA74 5 Renesas Technology Corp 4 3 Method s of entry A gt LINK74 lt RET gt 740 Family LINKER V 4 00 00 Copyright 1989 1998 MITSUBISHI ELECTRIC CORPORATION AND MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION All Rights Reserved Relocatable files R74 gt gt MAIN SUB
164. ry or in the command path then this will register as a system error SRA74 5 Renesas Technology Corp 8 3 Method of entry 8 3 Method of entry SRA74 is activated by the input of command lines at the operating system prompt Fig 8 1 shows an example of the input of activation command lines If a mistake is detected during the input of the command lines then a help page is displayed as shown in Fig 8 2 and the assembly operation is halted If on the other hand the command lines have been input correctly then the assembly operation will be initiated On completion of the assembly operation the number of errors the number of warnings the total number of lines the number of comment lines and the section level memory capacity will all be displayed on the screen An example of the appearance of the VDU screen following the successful completion of an assembly operation is shown in Fig 8 3 A gt SRA74 FILE RE i Name of source file Command parameter to be assembled Fig 8 1 Example of the input of activation commands A gt SRA74 lt RET gt 740 Family SRA74 V 4 00 00 Copyright 1989 1998 MITSUBISHI ELECTRIC CORPORATION AND MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION All Rights Reserved Usage sra74 filename options all message suppressed assmble assembly language source file source line data output to R74 file define s
165. s Can t find crf74 exe The CRF74 cannot be found Copy the CRF74 into the current directory or else into a directory in the command path of the operating system Can t find command com for execute xxx The COMMAND COM file which is required to activate the editor specified by the E option cannot be found Check the specification of the operating system command path 1 59 5 Renesas Technology Corp Appendix A Error messages Notes 1 The total number of symbols and labels handled by SRA74 is dependent on the memory capacity of the SRA74 operating system A 2 List of assembly errors When an assembly error is detected an error message is output to both the VDU and the PRN file Table A 2 contains a list of assembly errors with descriptions of their contents Table A 2 List of assembly errors Error number Error Message Description and User Action 1 Already had same statement A pseudo command which should only be used once in the source file has been used more than once Example LINE 60 LINE 80 Reduce the number of times the declaration is used to one 2 Reference to forward label or symbol A pseudo command refers to a forward label or symbol Example ORG TOP TOP Carry out the definition of the label or symbol prior to the reference 3 Division by 0 A numerical expression contains a division by O Check the entry of the numerical e
166. s Expressions are composed of a mixture of numerical constants character constants symbolic constants and operators A space or tab may be inserted as required between any operator and the related item Example TBL 1 Expressions are processed from left to right Operators do not have priority Example 2 3 The result is 6 Example 2 6 2 The result is 4 4 3 Operators Table 4 1 lists all the operators which can be used for operand data entry Table 4 1 List of operators Type Operator Description Single term operator Indicates positive number Indicates negative number Takes ones complement lt Extracts 8 high order bits of label or symbol gt Extracts 8 low order bits of label or symbol SIZEOF2 Finds size of section BK3 Obtains the bank value of label BL3 Obtains the extra area value 4 of label Dual term operator Addition Subtraction H Multiplication Division amp AND of each bit OR of each bit 1 29 5 Renesas Technology Corp Chapter 4 Assembly language 1 30 Notes 1 With SRA74 V 4 00 00 and later format checks are processed as integers attached with a 32 bit code However results are handled as such only in the following two cases Operands of the ORG command Labels when the BANK option is specified With the following written format operation results can differ from that obtained with V 2 00 10 and
167. s CHAPTER 1 The format of the Manual CHAPTER 2 Outline 2 1 Functions c 2 2 Generating UE CHAPTER 3 Operation Method 3 1 rV da a 3 2 Input parameters 3 2 1 Name of file to convert 3 2 2 Command Men 3 3 Methods of entry M D ESTE ONS sisted Su andina dob sadips acciaio pop a va RU Quya hasa 3 4 1 Types e E TEE 3 4 2 Value for return to operating system 3 5 Environment variables J J J APPENDIX A Error Messages MET RUE te c PZ Listof warning WE 5 i 434 NEC SAS Renesas Technology Corp List of figures Fig 3 1 Help screen for command line errors Fig 3 2 oti mr 5 ii lt N CS SAS RenesasTechnology Corp List of Tables Table 3 1 List of command parameters Table 3 2 List of error levels Table A 1 List Of te Table A 2 List of warning 5 iii 5 Renesas Technology Corp CHAPTER 1 The format of the Manual The CV74 operation manual contains the following chapters Chapter 2 Outline The basic functions of CV74 and the files which it generates Chapter 3
168. s specification remains valid until a further area specification command is received SECTION S or SMOD Specifies that the area from this line onwards is a special page ROM area This specification remains valid until a further area specification command is received 1 42 SRA74 5 Renesas Technology Corp 6 5 List controlChapter SECTION Z or ZMOD Specifies that the area from this line onwards is a zero page RAM area This specifica tion remains valid until a further area specification command is received 3 Link file name specification OBJ LIB Specifies the names of the link target R74 files and library files Mnemonic command input of files named here is enabled during link operations to facilitate LINK74 linker automatic reference 4 Version specification VER Specifies the R74 file version If the LINK74 V command parameter is specified then the correspondence between R74 files can be verified 6 5 List control 1 Page feed and title specification PAGE Specifies the page feed and title for a list 2 List format specification COL LINE Specifies the number of columns and lines in a list These pseudo commands may only be entered once into the source file 3 List output inhibit specification LIST NLIST Controls list output to the print file These pseudo commands should be used at times when only parts of lists are required such as during the debugging of part of a program 4 Ma
169. s an example of an output MAP file The MAP file contains the following data Information in section units pertaining to how much data has been linked and from which relocatable files The following types of information are output ATR Indicates relative or absolute attribute REL indicates relative and ABS indicates absolute e Indicates whether RAM area or ROM area START Indicates the start address LENGTH Indicates the size of the area in bytes Ifa library file is linked both the name of the library file and the name of the relocatable file are indicated The name of the relocatable file is indicated within brackets Global label list Indicates global labels in the program together with their absolute addresses This is only output when the command parameter MS has been specified Global symbol list Indicates global symbols in the program together with their absolute addresses This is only output when the command parameter MS has been specified Global bit symbol list Indicates global bit symbols in the program together with their bit values and absolute addresses This is only output when the command parameter MS has been specified 2 n the assembly language source code start addresses specified by the pseudo command ORG or become absolute attributes 3 Indicates labels declared by the pseudo command PUB Indicates symbols declared by the pseudo comma
170. s can be introduced into a single file Linking must however be used 5 The programming environment can be defined clearly using the macro function commands 6 The editor and cross referencer can be activated by specifying the command parameters during assembly 7 Source line debugging data can be output by specification of the command parameters during assembly 2 2 Generating files SRA74 generates the following five files Unless specified with a command parameter these files are placed in the same directory as the source file 1 Relocatable file Hereafter referred to as the R74 file mile containing machine language data with the data for relocation Generates file regardless of contents of command parameters It will not however generate a file in cases where SRA74 has undergone an abnormal termination due for example to an assembly error Output is in the specified directory where the command parameter O has been speci fied and in the current directory where O has not been specified Symbol data for symbolic debugging is included However with conventional values local symbol data is not output Local symbol data is output to an R74 file on specification of command parameter 5 e Source line debug data is output to an R74 file on specification of command parameter C or pseudo instruction FUNC Use of LINK74 generates an Intel HEX format machine language file The file
171. s command suspends macro generation and transfers control to the nearest ENDM Example Macro definition DATA1 MACRO VAL LABEL BYTE VAL EXITM ENDIF WORD VAL ENDM Call example LABEL EQU 1 DATA1 10 Macro generation IE LABEL BYTE 10 EXITM ENDIF END 1 107 434 NESAS Renesas Technology Corp Appendix E List of macro commands LOCAL LOCAL macro command Format A LOCAL Alabel label label Description This command makes label which is defined among the macro definitions into an intra macro local label Labels which are made LOCAL are assembled in order by allocating them the label n where n is a decimal number between 0 65535 Care should be taken by the user since use of the n label is not permitted Example Macro definition LOOP MACRO LOCAL 1 LDA 20 LOOP1 DEC A BNE 1 ENDM Call example LOOP Macro generation LDA 20 205 DEC A BNE G ENDM 1 108 SRA74 5 Renesas Technology Corp E 2 Summary of the macro commands MACRO ENDM MACRO macro command Format A label A MACRO argument1 argument2 argumentn Description A macro definition starts from the line entered as MACRO and ends on the line in which ENDM is entered label allotted to the MACRO command line becomes the name of this macro definition
172. s only defined afterwards as a bit symbol then the generation code will not match and SRA74 will register an error The program should be rewritten such that when entering a bit symbol BITSYM reference should be made to it only after it has been defined Example if BITSYM LDA BITSYM Generation code BEQ IO Generation code endif BITSYM equ 1 80h Definition of bit symbol For further details please refer to the syntax map in Appendix F 1 34 SRA74 5 Renesas Technology Corp 5 3 Notes concerning entry procedures 6 Coding to reduce generated code size For IF and FOR statements gt is more efficient than gt and lt is more efficient than lt For DO statement lt is more efficient than gt and lt is more efficient than lt Refer to the memory conditional expression generation example in Appendix F3 2 for details DO statement is more efficient than FOR statement if the operation is to be performed more than once For SWITCH statement it is more efficient to use the lbreak statement where necessary than to use the Iswitch statement LSWITCH statement Assembly language LBREAK statement Assembly language lswitch MEM 1 P 1 switch MEM CMP 1 case 1 EQ 20 case 1 BNE NOP ER NOP NOP break 2 3 lbreak JMP 2 2 252 52 2 50 16 16 NOP break break default default NOP E d NOP ends ends 1 35
173. seudo commands group by group 1 40 SRA74 5 Renesas Technology Corp 6 2 Assembly controls 6 2 Assembly controls 1 Assebly assertion declaration ASSERT Displays the character string specified as operand on the screen during assembly 2 Assembly termination declaration END Declares the termination of the source program SRA 74 will not process any data on subsequent lines 3 Assembly error declaration ERROR This pseudo command causes the character string in the operand to be displayed on the VDU and the assembly operation to be terminated 4 Conditional assembly AF ELSE ENDIF Specifies the assembly location in accordance with the contents of the symbol value These pseudo commands can be used for various operations such as the handling of programs with varying specifications by means of a single source program or the control of test routine assembly 5 Read file in INCLUDE The contents of another file are read in to the location in which this command is entered It can be used for splitting up and editing large source programs 6 3 Address control 1 Synonymous definition EQU or Ascribes an absolute value to a symbol It also defines the values of bits from 0 7 and 000016 FFFF16 values 2 Address declaration ORG or Declares the addressing of the following lines The section in which this pseudo com mand is entered becomes an absolute attribute and cannot be addressed during link oper
174. seudo command of SRA74 that section becomes section E Always specify the section address in advance with the ORG pseudo command And always specify the BANK option to assemble programs when running SRA74 Unless these command options are specified warning is output for the defined lines in section E 3 3 Basic function of sections 1 During linking sections with the same names are given locations next to each other Other sections cannot be located between sections with the same name 2 The sequence of sections with the same name is determined by the sequence in which the relocatable file names are specified in the link command 2 10 SRA74 5 Renesas Technology Corp 4 1 Activation method CHAPTER 4 Operation Method 4 1 Activation method Before using LINK74 the following data input parameters must be entered 1 Relocatable file name required item 2 Library file name 3 Section control data 4 Command parameters In LINK74 this data can be input in any of three different ways according to the operating environ ment 1 Interactive input 2 Command line input 3 Command file input These different input methods are used for the same parameters Section 4 2 below contains explanations of the input parameters and Section 4 3 outlines with the help of examples the different methods of entering the parameters 2 11 434 NE SAS Renesas Technology Corp Chapter 4 Operation method
175. ss them accordingly but where another optional section name has been entered then the area attribute will be determined in accordance with a later command In such cases however the areas will only be recognized as general page ROM or RAM areas This specification will remain valid until another area specification command is received no problem to have more than one section with the same name in file In the absence of an area specification command at the head of a SECTION P will be selected as the standard value Area specification commands may therefore be omitted in respect of the first ROM area of a file Example SECTION DATA Marks the start of the DATA section datatop nulldt BLKB 8 SECTION STACK Marks the start of the STACK section BLKB 16 stacktop SECTION PROG Marks the start of the PROG section anes LDX stacktop TXS LDA SIZEOF DATA LDX datatop 1 95 5 Renesas Technology Corp Appendix D The pseudo commands SEXT External reference specification Special page Format A SEXT abel or symbol label or symbol label or symbol Description Specifies that the label specified in the operand may be subject to external reference in the special page addressing mode JSR V only or in the absolute addressing mode If you wish to carry out the assembly operation in the zero page addressing mode then the specification should be made with ZEXT
176. ss 1 74 PE processing pass 2 74 115 E025 LOOP2 EST A74 115 1 Error 18 Relative jump is out of range 127 E031 data EST A74 127 1 Error 22 Value is out of range data F42B EST2 FC 593 work x data set Error 23 format error T 551 1 Error 18 Relative jump is out of range ERROR COU WARNING COU STRUCTURED LINES OTAL LINI LINES OTAL LIN LINES COMMENT LIN LINES COMMENT LIN LINES OBJEC SIZI 000A BYTI OBJEC SIZI 0035 BYTI EC SIZI 0792 BYTE Fig 8 4 Example of error display 1 56 SRA74 5 Renesas Technology Corp 8 4 Errors 8 4 2 Value for return to operating system When entering an execution command into an operating system batch file for example there are times when you may wish to change the contents of the processing operation in accordance with the outcome of the execution In SRA74 the execution results are divided into 4 error levels as shown in Table 8 2 and returned to the operating system Table 8 2 List of error levels Error level Description of execution results 0 Normal termination 1 Error relating to content of source file which constitutes the object of the assembly
177. t lt imm ASL 27 zz zz zz imm LSR ZZ zz zz lt lt WITH C ROL 27 221 zz gt gt imm WITH C ROR 27 Bit FLAG 0 CLB FLAG operation FLAG 1 SEB FLAG C Addressing mode assignment statement generation examples Table F 4 Addressing mode assignment statement generation examples Type Structured command Assembly command A zz X LDA zz X A hhll LDA Load A hhll X LDA hhll X A hhll Y 1 LDA hhil Y commands 22 LDA 22 1 123 5 Renesas Technology Corp Appendix F List of structured commands Type Structured command Assembly command 22 LDA zz X 22 LDX zz Y Load X hhll LDX X hhll Y 1 LDX hhll Y commands Y zz X LDY zz X Y hhll LDY hhli Y hhll X LDY hhll X zzX 2A STA 22 hhll A STA hhii Store hhll X A STA hhll X hhl Y A STA hhll Y commands zzX A STA 22 zz Y A STA zz Y zzY X STX zz Y hhll 2 X STX zzX Y STY zz X Y STY A A zz X WITH C ADC 22 A A hhll WITH C ADC hhll A A hhl X WITH C ADC hhll X WITH C ADC hhll Y A A zzX WITH C ADC zz X A A zz Y WITH C ADC zz Add 22 WITH C SBC 22 A A hhll WITH C SBC hhll subtract A A hhll X WITH C SBC hhll X A A hhl
178. t be inserted between the label and a pseudo command D 2 Summary of the pseudo commands 1 77 434 NESAS Renesas Technology Corp Appendix D The pseudo commands ASSERT Assemble assertion directive Format A ASSERT character string Description Displays the character string to be entered into an operand on the VDU during the course of the assembly operation Example IF MODE ELSE ASSERT MODE is FALSE ENDIF BEXT External reference setting General page bit symbol Format A BEST Abit symbol bit symbol bit symbol Description Specifies that the bit symbol specified in the operand may be subject to external reference A bit symbol specified by this pseudo command is understood to be located on a general page This pseudo command should be entered before the line which refers to the label Example BEXT BITO BIT1 BIT2 1 78 SRA74 5 Renesas Technology Corp D 2 Summary of the pseudo commands BLKB RAM area secure unit byte Format A label numerical expression Description Secures an area of a size specified by a numerical expression unit 1 byte Any labels or symbols used in the numerical expression should be defined prior to the line in question Labels with relocatable values cannot be entered into the operand Example label BLKB 10 Secures a 10 byte area BYTE Byte data settin
179. t comes before case or default in a default switch statement Check the program 6 EQU symbol is multiple defined Pseudo command EQU is defined more than once with the same symbol 7 SECTION E requires command Programs section E Specify the BANK command option BANK option to assemble programs 1 65 434 NESAS Renesas Technology Corp Appendix B List of commands APPENDIX B List of Commands B 1 List of symbols Table B 1 indicates the significance of the symbols used in the list of commands Table B 1 List of symbols Symbol Description Symbol Description A Accumulator X Index register X Y Index register Y imm Immediate data 27 Zero page address hhll General page address Bit value 0 7 bitsym Bit symbol Immediate mode Special page mode B 2 List of commands Table B 2 lists all the commands which can be used in SRA74 Its addressing mode name and entry format is given alongside each command 1 66 SRA74 5 Renesas Technology Corp Table B 2 List of commands B 2 List of commands Command Addressing mode Entry format ADC Immediate ADC imm Zero page ADC 22 Zero page ADC zz X Zero page indirect X ADC 22 Zero page indirect ADC 22 Absolute ADC hhll Absolute X ADC hhll X Absolute Y ADC hhll Y AND Immediate AND imm Zero page AND 22
180. t of the command lines to activate CV74 Please study the contents of this chapter and then re enter the relevant commands 3 Errors relating to the contents of the source files being processed An error has occurred with the contents of the HEX and symbol files to be converted Check the contents and reinput as necessary 434 NESAS Renesas Technology Corp Chapter 3 Operation method A gt CV74 lt RET gt HEX SYM file converter for 7200 Series V 1 00 00 Copyright 1998 MITSUBISHI ELECTRIC CORPORATION AND MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION All Rights Reserved Error No input files specified Usage cv74 Input filename Ooutput filename S or H cr Fig 3 2 Error display If an error occurs while CV74 is running an error message is displayed on the monitor Remedy the error as explained in Appendix A Error Messages 3 4 2 Value for return to operating system When entering an execution command into an operating system DOS batch file for example there are times when you may wish to change the contents of the processing operation in accordance with the outcome of the execution In CV74 the execution results are divided into 5 error levels as shown in Table 3 2 and returned to the operating system For an explanation of how to make best use of these error levels please refer to a commercially available OS handbook Table 3 2 List of error levels
181. t the physical arrangement ROM or RAM The former is called the address attribute and the latter is called the physical attribute Details of each these attributes are given below 3 2 1 Address attributes There are two address attributes relative attribute and absolute attribute They are determined by the presence or absence of the pseudo command ORG or in the appropriate section of the source program Details are given below 1 Relative attribute If there is no pseudo command ORG in a section it becomes a relative attribute section Relative attribute sections can be relocated and their start addresses can be specified at the time of linking 2 Absolute attribute If there is a pseudo command ORG in a section it becomes an absolute attribute section Absolute attribute sections are located at the address specified by the pseudo command ORG The start address of an absolute attribute section cannot be specified at the time of linking Sections with the same name in different relocatable files can have different address attributes 3 2 2 Physical attribute There are two physical attributes ROM attribute and RAM attribute They indicate the physical characteristics of the area where the section will be located Details are given below 1 ROM attribute Sections including code generating statements in the assembly language source pro gram are ROM attribute sections ROM attribute sections generate HEX files
182. ter 3 Operation method 3 3 3 12 9 U When updating modules in the library file the update date for the relocatable file speci fied with the F option is compared with the update date of the module stored in the library file The update is only performed if the update date of the relocatable file is the newest files The update date for the relocatable file is taken form the operating system file manage ment data Methods of entry 3 3 1 Command line input Command line input has the following features 1 With command line input the whole command is entered on the operating system command line 2 Command line input should be used when the number of relocatable files or parameters is small 3 Command line input may also be used inside batch files and make files Fig 3 1 shows the example of deleting module FILE1 R74 from the library file TEST LIB A gt LIB74 D O TEST LIB F FILE1 lt RET gt Fig 3 1 Command line input Example 1 deleting a module Fig 3 2 shows the example of adding relocatable files FILE2 R74 and FILE3 R74 to the library file TEST LIB A gt LIB74 AO TEST LIB F FILE2 FILE3 lt RET gt Fig 3 2 Command line input Example 2 Adding relocatable files 3 3 2 Command file input Command file input has the following features 1 With command file input a command file is created in advance using an editor and specified when LIB74 is activated SRA74
183. tered between IO and ENDIO will be deemed to fall within the I O area Example porto portl ENDPROC Format A ENDPROC Description IO EQU 00H EQU 01 ENDIO Program module termination directive Reserved Directs the termination of all modules of a main program subprogram or interrupt program The area enclosed by either PROCINT PROCMAIN or PROCSUB and ENDPROC is deemed to be a single program module Example MAIN 1 100 PROCMAIN P MAIN ENDPROC SRA74 5 Renesas Technology Corp D 3 List of reserved pseudo commands ENDRAM RAM area termination directive Reserved Format A ENDRAM Description e Directs the termination of the RAM area Any labels and symbols entered between RAM and ENDRAM are deemed to belong to the RAM area Example RAM workO0 BLKB 1 workl BLKB 1 ENDRAM UO area start directive Reserved Format Description e Directs the start of an I O area Any labels or symbols entered between JO and ENDIO are deemed to belong to the I O area Example IO porto EQU 00H portl EQU 01 ENDIO 1 101 434 NESAS Renesas Technology Corp Appendix D The pseudo commands PROCINT Interrupt program start directive Reserved Format A PROCINT label Description Directs the start of an interrupt program area between PROCINT and ENDPROC is deemed to be an interru
184. tronics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics To all our customers Regarding the change of names mentioned in the document such as Mitsubishi Electric and Mitsubishi XX to Renesas Technology Corp The semiconductor operations of Hitachi and Mitsubishi Electric were transferred to Renesas Technology Corporation on April 1st 2003 These operations include microcomputer logic analog and discrete devices and memory chips other than DRAMs flash memory SRAMS etc Accordingly although Mitsubishi Electric Mitsubishi Electric Corporation Mitsubishi Semiconductors and other Mitsubishi brand names are mentioned in the document these names have in fact all been changed to Renesas Technology Corp Thank you for your understanding Except for our corporate trademark logo and corporate statement no changes whatsoever have been made to the contents of the document and these changes do not constitute any alteration to the contents of the document itself Note Mitsubishi Electric will continue the business operations of high frequency amp optical devices and power devices Renesas Technology Corp Customer Support Dept April 1 2003 24 N SAS Renesas T
185. tructions for LOOP 74 to process per file 5 Renesas Technology Corp 8 Warning If warning is detected while LOOP 74 is running a warning message will be displayed on the monitor LOOP 74 processing will continue Warning messages are given below Warning message Description Remedial action Relative address is specified A relative address is written in the branch instruction operand This lineis not converted 9 Values returned to the OS When processing ends LOOP74 returns the below values to the OS Returned value Meaning 0 Ended successfully 1 Error in source file or tag file read by LOOP 74 2 Error in command line input 3 Operating system error 4 Ended by C control C input 10 Environmental variables LOOP74 does not use environmental variables 5 Renesas Technology Corp MEMO 5 Renesas Technology Corp M3T SRA74 V 4 10 User s Manual Rev 1 00 August 01 2003 REJ10J0155 0100Z COPYRIGHT 2003 RENESAS TECHNOLOGY CORPORATION AND RENESAS SOLUTIONS CORPORATION ALL RIGHTS RESERVED M3T SRA74 V 4 10 User s Manual 21 NE SAS Renesas Electronics Corporation 1753 Shimonumabe Nakahara ku Kawasaki shi Kanagawa 211 8668 Japan REJ10J0155 0100Z
186. u utu aen m urinae EES EE 6 6 Debug supportk a 6 7 Reserved pseudo commands Chapter 7 Macro commands 7 1 Functions of macro commands 7 2 Types of macro command 7 3 Macro operators J Chapter 8 Operation method 8 1 Activation method J 8 2 Input parameters 8 2 1 Source 8 22 Command parameters sse enne 8 3 Method of entry 84 e TC 8 4 1 Types of error sassa aula laaya paya Ach 8 4 2 Values for return to operating system 8 5 Environment variables Appendix A Error messages AT System GIONS osito dicic co iade B Fg rk Vs A 2 List of assembly errors List of warnings bon cione Appendix B List of commands List of symbolS cecinit inr iade reddas B 2 List of commands
187. ub 1 sub 100 E COUNT 000002 BAL SYMBOL COUNT 000019 3 5 Example of display when LIB74 terminates normally 3 13 5 Renesas Technology Corp Chapter 3 Operation method 3 4 Errors 3 4 1 Types of error The types of errors which occur during the operation of LIB74 have the following causes 1 Errors relating to the operating system These are errors such as insufficient disc or memory capacity which relate to LIB74 s operat ing system Please refer to the list of error messages in Appendix A and proceed according to the operating system commands 2 Errors relating to the input of LIB74 command lines These are errors relating to the input of the command lines to activate LIB74 If the input is incorrect a label screen such as the one shown in fig 3 6 is displayed Please study the contents of this chapter and then re enter the relevant commands 3 Errors relating to the contents of the relocatable files being processed These are errors relating to the relocatable files such as dual definition of a public label Refer to the LST file to make the necessary corrections A gt LIB74 lt RET gt 740 Family LIBRARY MANAGER V 1 00 10 Copyright 1989 1998 MITSUBISHI ELECTRIC CORPORATION AND MITSUBISHI FL ECTRIC SEMICONDUCTOR SYSTEMS CORPORATION All Rights Reserved Usage A gt LIB74 ardxluv o filename f filename library file name rel
188. value The function of the command is equivalent to that of the pseudo command EQU The specification format is as follows When defining more than one symbol at a time each symbol and value entry should be separated from the next by a Dsymbol numerical value symbol numerical value symbol numerical value Example A gt SRA74 SRCFILE DS1 10 S2 20 lt RET gt E Generates the TAG file and activates the editor The format for specifi cation of the editor s program name is as follows E editor name Example A gt SRA74 SRCFILE lt gt The part contained within the brackets may be omitted If omitted however only a TAG file will be generated In cases where the editor name has been specified the editor will be activated with the TAG file as argument after completion of the assembly operation If however no error occurs then the editor will not be activated even though its name has been specified l Generates the source 1 in which the structured language com mands are expanded into assembly language commands When this parameter is specified at the same time as L then the expanded sec tions will also be output to the print file which has been generated 1 51 5 Renesas Technology Corp Chapter 8 Operation method Command parameter Description 1 52 K Suppresses the output of label information such as generated by SRA
189. which have the same section name The section sequence and start address for individual section units can be specified Library files created by LIB74 can be used LINK74 produces the map files required for debugging LINK74 produces the symbol files required for symbolic debugging Element differing physically from other elements such as the ROM area and RAM area making up a program 2 2 SRA74 5 Renesas Technology Corp 2 2 Generating files 2 2 Generating files LINK74 generates 3 file types as outlined below 1 Machine language file Hereafter referred to as the HEX file ntel HEX format machine language file file attribute is HES 2 Map file Hereafter referred to as the MAP file Contains address data for the eventual locations of each section This file can be output to the printer and used for debugging or understanding the memory requirements of each section MAP file generated on specification of command parameter attribute is MAP 3 Symbol file Hereafter referred to as the SYM file File containing the information required for symbolic debugging This file is not in a format designed for listing so it should not be printed out File generated on specification of command parameter S file attribute is SYM 2 3 434 NESAS Renesas Technology Corp Chapter 2 Outline 2 3 Configuration of the MAP file Fig 2 1 show
190. will be processed If the attribute part of the filename is omitted the attribute LIB is selected as the default If the full filename is specified it is possibly to specify files with attributes other than LIB Specifies a relocatable file to be added to the library file updated or extracted or speci fies a module to be deleted from the library file Several files can be specified separated by space or tab characters The file name can be specified with a directory path name Example A gt LIB74 AO TEST LIB F B WORK SUB1 C SUB2 lt RET gt If the directory path specification is omitted a file in the current directory on the current drive will be processed If the attribute part of the filename is omitted the attribute R74 is selected as the default If the full filename is specified it is possibly to specify files with attributes other than R74 Creates a new library file or adds a relocatable file to an existing library file When creating a new library file the relocatable files specified using the F parameter are added to the start of the new library in order of specification When adding relocatable files to an existing library file the relocatable files specified using the F parameter are added to the end of the library file in order of specification SRA74 5 Renesas Technology Corp 3 2 Input parameter No check is made to see if a specified relocatable file has the same name as a module alre
191. x F List of structured commands Variable Memory variable Tx dE Memory bit variable E Variable name Register variable ado tee Register bit variable A4 BIT_A5 BIT_A6 BIT_A7 1 142 SRA74 5 5 Renesas Technology Corp F 4 Syntax maps of structured commands TH HOD Constant Numeric constant Character constant Symbol constant Numeric constant T Sma DT gt B 3 dra Sei Character constant 1 143 5 Renesas Technology Corp Appendix F List of structured commands Symbol constant Ce Variable name sizeof BANK OFFSET 1 144 Nee Numeric constant Character constant Symbol constant SRA74 5 Renesas Technology Corp List of Reserved Words Symbol 0 65535 label ASSERT pseudo command pseudo command BLKB pseudo command BYTE pseudo command COL pseudo command D0 D65535 label ELSE pseudo command END pseudo command ENDFUNC pseudo command ENDIF pseudo command E
192. xpression 1 60 SRA74 5 Renesas Technology Corp A 2 List of assembly errors Error number Error Message Description and User Action 4 Illegal operand The operand contains a character which should not have been used Example LDA amp 10 Check the entry of the operand Improper operand type The combination of mnemonic and operand is at fault Example ASL work Y Check the entry format of the command Invalid label definition The definition of the label has been entered into an improper area Example 1 1 LINE 60 gt Delete the label Example 2 jABEL2 EQU 100 Change the label to a symbol Invalid symbol definition The definition of the symbol has been entered into an improper area Example SYMBOL LINE 60 Delete the symbol Out of maximum program size The address is outside OFFFF16 Example ORG OFFFOH WORD 1 2 3 4 5 6 7 8 9 Modify the program such that the address falls within the permissible boundaries Label or symbol is multiple defined The same label or symbol is defined more than once Example MAIN NOP MAIN NOP Check the label or symbol name 10 Nesting error The maximum nesting level has been exceeded Reduce the number of nests to within the allowed maximum 1 61 434 NESAS Renesas Technology Corp Appendix A Error messages Error numb
193. ymbols syntax 451 1 52 2 make tag file and start editor syntax e or eeditor name make assembler source file suppress system label information to R74 file make list file or symbol list file macro listing select drive and directory for output syntax otmp local symbol data output to R74 file don t care at end of label xecute crf74 Fig 8 2 Help page for command error 1 53 5 Renesas Technology Corp Chapter 8 Operation method A gt SRA74 TEST lt RET gt 740 Family SRA74 V 4 00 00 Copyright 1989 1998 MITS U AND MITSUBISHI ELECTRIC SE All Rights Reserved now processing pass 1 ed ert ed Ri Sat ee now processing pass 2 ie et SE d ERROR COUNT WARNING COUNT STRUCTURED 5 OTAL LINE OTAL LINE LINE LINE SIZE SIZE SIZE D BISHI ELECTRIC CORPORATION ICONDUCTOR SYSTEMS CORPORATION LINES LINES LINES LINES LINES 000A BY 0035 BYTE 0792 BYTE Fig 8 3 VDU display on normal termination 1 54 SRA74 5 Renesas Technology Corp 8 4 Errors 8 4 Errors 8 4 1 Types of error The types of errors which occur during the operation of SRA74 have the following causes 1 Errors relating to the operating system These are errors such as insufficient disc or m
Download Pdf Manuals
Related Search
Related Contents
Copyright © All rights reserved.
Failed to retrieve file