background image

MICROCOMPUTER

MN1030

MN1030 Series

Cross Assembler

User’s Manual

Pub.No.13110-120E

Содержание PanaXSeries MN1030 Series

Страница 1: ...MICROCOMPUTER MN1030 MN1030 Series Cross Assembler User s Manual Pub No 13110 120E ...

Страница 2: ......

Страница 3: ...sales staff in advance for information on the following applications Special applications such as for airplanes aerospace automobiles traffic control equipment combustion equipment life support systems and safety devices in which exceptional quality and reliability are required or if the failure or malfunction of the products may directly jeopardize life or harm the human body Any applications oth...

Страница 4: ...d macro control statement Use of the library manager a tool for managing library files is also explained For users of engineering workstations EWS a separate chapter describes differences from the MS DOS version Chapters provides listings of machine language instructions and error messages as well as sample programs that demonstrate usage Reference Techniques This document supports four techniques...

Страница 5: ...fore using the Cross Assembler verify or change the following two files CONFIG SYS If FILES and BUFFERS specifications do not already exist in CONFIG SYS then you must add them If they do already exist then check their settings and change them if necessary NOTE Be sure to make these settings If the assembler is started without them then the error message bad tmpbss w will be output and processing ...

Страница 6: ... syntax of the C Compiler MN1030 MN103S MN103E Series C Compiler User s Manual Library Reference Describes the standard library of the C Compiler MN1030 Series C Source Code Debugger for Windows User s Manual Describes the use of the C source code debugger for Windows MN1030 MN103S MN103E Series Onboard Debug Unit Setup Manual Describes the connection of the Debug Unit and explains about initial s...

Страница 7: ...es of Source Statements Chapter 8 Writing Source Statements Chapter 9 Writing Machine Language Instruction Statements and Directive Statements Chapter 10 Writing Assembler Control Statements Chapter 11 Writing Macro Control Statements Chapter 12 List of Machine Language Instructions Chapter 13 Error Messages Chapter 14 Reading List Files Chapter 15 Using Library Manager Chapter 16 Notes on Operati...

Страница 8: ...les Used by Assembler and Linker 23 3 3 Basic Operation of Assembler and Linker 25 3 4 Assembling and Linking Multiple Sections 30 3 5 Conditional Assembly and Linking 38 Chapter 4 Optimization 4 1 Purpose of This Chapter 44 4 2 Rules of Usage 45 4 3 Usage Example 46 Chapter 5 Using Assembler 5 1 Purpose of This Chapter 60 5 2 Starting Assembler 61 5 3 Command Options 63 5 3 1 Output File Options ...

Страница 9: ...ments 124 7 7 Blank Statements 125 Chapter 8 Writing Source Statements 8 1 Purpose of This Chapter 128 8 2 Permitted Characters 129 8 3 Numbers 130 8 4 Character Constants 133 8 5 Address Constants 135 8 6 Location Counter 136 8 7 Expressions 137 8 7 1 Operators 138 8 7 2 Expression Evaluation 140 8 7 3 Expression Syntax 141 8 7 4 Expression Attributes 142 8 8 Reserved Words 144 Chapter 9 Writing ...

Страница 10: ... 188 10 4 Conditional Assembly 189 10 4 1 ifdef ifndef 191 10 4 2 if ifn 193 10 4 3 ifeq ifneq 195 10 4 4 iflt ifle 198 10 4 5 ifgt ifge 200 10 4 6 ifb ifnb 202 Chapter 11 Writing Macro Control Statements 11 1 Purpose of This Chapter 206 11 2 Macro Definitions macro endm 207 11 3 Macro Calls and Expansion 209 11 4 Macro Operators 211 11 5 Local Symbol Declaration local 213 11 6 Forced Termination ...

Страница 11: ... 14 1 Purpose of This Chapter 266 14 2 Reading List Files 267 14 2 1 Output Format of Machine Language Code 268 14 2 2 Symbol Table 271 Chapter 15 Using Library Manager 15 1 Purpose of This Chapter 274 15 2 Starting Library Manager 275 15 3 Command Options 276 15 3 1 Error Message Options 276 15 3 2 Program Generation Options 282 15 3 3 Functional Options 284 15 3 4 Other Options 290 15 4 Error Me...

Страница 12: ...Chapter 17 Appendix 17 1 Numeric Restrictions 310 17 2 List of Command Options 311 17 2 1 List of Assembler Command Options 312 17 2 2 List of Linker Command Options 315 17 3 List of Assembler Directives 318 17 4 List of Assembler Control Statements 321 ...

Страница 13: ...1 Chapter 1 Getting Started ...

Страница 14: ...Chapter 1 Getting Started 2 Purpose of This Chapter 1 1 Purpose of This Chapter This chapter describes the operating environment for this system and the usage of the file conversion tool ...

Страница 15: ...cause of such differences as the ability to display Japanese this Manual indicates a machine running the English only operating system as a PC AT and one running the Japanese operating system as a DOS V machine Refer to the Release Notes for other restrictions Host machine Operating system Version of OS Sun Sparc Solaris 2 6 or later PC AT Windows 98 Me 2000 XP DOS V Windows 98 Me 2000 XP ...

Страница 16: ...b103 library manager slib103 is the library manager a utility for creating library files For a description see Chapter 15 Using Library Manager excv103 file conversion utility This utility converts an executable produced by the linker into a file in Motorola S format Intel HEX format or Matsushita format In addition to the above files the installation media may contain a README or README DOC file ...

Страница 17: ...Chapter 1 Getting Started Installation 5 1 4 Installation For the installation media installation procedures and notes on installation see the Installation Manual ...

Страница 18: ...g start up variables The assembler start up file as103rc contains statements specifying the following three items 1 The default language and character coding scheme for messages from the assembler 2 The radix notation used for numbers 3 The default toggle switch setting for optimization The linker start up file ld103rc contains statements specifying the following eight items 1 The language and cha...

Страница 19: ...e following format keyword parameter The first field is a keyword giving the name of the start up parameter The second field specifies the value to assign to that parameter The two fields must be separated by at least one tab or space A sharp may be used to incorporate comments into these start up files The assembler and linker then ignore all text from the sharp through to the end of the line NOT...

Страница 20: ...lt setting is in extended C language format O OPTION This entry controls optimization Either ON or OFF of the parameters comes after the keyword O OPTION followed by a blank space These parameters have the following meanings O OPTION ON Enable optimization O OPTION OFF Disable optimization The default setting is to disable optimization Keyword Description message This entry specifies the language ...

Страница 21: ...e parameters comes after the keyword m OPTION followed by a blank space These parameters have the following meanings m OPTION ON Enable output of the map file m OPTION OFF Disable output of the map file The default setting is to disable output of the map file r OPTION This entry controls the output of the executable file when there are assembler errors Either ON or OFF of the parameters comes afte...

Страница 22: ...ion regarding file conversion utility options to the screen w Perform conversion using a work file during execution This enables a large amount of data to be converted even if the personal computer has little memory However conversion speed will be slower i Output the execution file in Intel HEX format S3 Output the execution file in Motorola S3 format S2 Output the execution file in Motorola S2 f...

Страница 23: ...option specified In addition a file with rom extension is output with them The file contains its tool information Operation Default Setting Message to output UNIX and PC AT versions English DOS V version Japanese Conversion method Not with a work file Output format Intel HEX format Padding No padding Output file name The same file name as EX format file but with hex or rom extensions Conversion ra...

Страница 24: ...has performed as the start address for the address 1000 excv103 A4000 8000 A1000 sample ex Converts the data between the address 4000 and the address 8000 in the file of sample ex into the data of the address 1000 3 Convert into a file in Intel HEX format excv103 i sample ex Perform conversion a file into a file in Intel HEX format 4 Convert into a file in Motorola S format excv103 S1 sample ex ex...

Страница 25: ...2 Chapter 2 Program Development Flow ...

Страница 26: ...eveloped with a compiler or an assembler Currently most program development is done with a compiler but an assembler is where compact code generation or faster processing speed is required This chapter gives an overview of development with the assembler and explains the flow of development through completion ...

Страница 27: ...op programs for the microcomputers Compared to assembly language C language is a more productive language Programs coded using a high level language also offer superior ability for documentation On the other hand microcomputer operations can be directly coded by programming with assembly language Compared to high level languages programs can be created with more compact code size less redundancy a...

Страница 28: ...ource code debugger is a program for controlling the in circuit emulator s hardware The debugger downloads the application developed on a workstation or personal computer to the emulator s memory to create an environment in which the application runs as if it were in the microcomputer s ROM It can start program execution as the address of any source statement and can temporarily stop execution Als...

Страница 29: ...ithout error If this is not done an old undebugged program could be linked within the iterative development process The solution lies with the following program which runs on the workstation or personal computer MAKE With MAKE the programmer defines the dependency relationships of the files needed to generate the final executable file and list files Afterwards MAKE will automatically assemble and ...

Страница 30: ...Optimization This Series optimizations apply to unconditional branches data transfer instructions arithmetic instructions logical instructions bit manipulation instructions and user defined instructions Unconditional branches that undergo optimization Data transfer arithmetic logical bit manipulation and user defined instructions that undergo optimization Coding is not a simple task if the program...

Страница 31: ...ifferent versions of programs can be managed in a single source file Reference Chapter 10 Writing Assembler Control Statements for details Macros Macros are an important function of the assembler A macro assigns a name to a process thereby simplifying the coding of that process By assigning an appropriate macro name to a block of multiple machine language instructions the programmer can create cus...

Страница 32: ...Chapter 2 Program Development Flow 20 Programming with Assembler ...

Страница 33: ...3 Chapter 3 Introduction to Operation ...

Страница 34: ...apter explains how to use the most useful options while demonstrating actual operation This chapter first uses an example to show how to run the assembler and linker Next it explains assembler and linker use when assembler control statements and macro instructions are included for high level operations After reading this chapter once through and trying actual operation you will have mastered basic...

Страница 35: ...include files and outputs relocatable object files Include files are not special files but are just files that comprise parts of the source file They are incorporated into assembly at the location of include directives defined within source statements Source file SANPLE ASM Include file SAMPLE H Map file SAMPLE MAP Assembler Linker Executable file m103 ex Map file m103 map Relocatable object files...

Страница 36: ...catable object files of frequently used programs and hardware interface programs Only needed modules are specified to have the linker extract the appropriate relocatable object files from library files and load them into the executable format file Several library files are provided but you can maintain them or newly create them yourself Refer to chapter 15 Using The Library Manager for details You...

Страница 37: ... related external references and external definitions where the subroutine of program2 asm is called from program1 asm Therefore the final list files cannot be created just by assembling program1 asm In this example you will generate with the linker a map file and generate the final list files Create source files First create the source files Using an editor create the two programs shown below pro...

Страница 38: ...created to generate relocatable object files as103 program1 asm as103 program2 asm This will generate two relocatable object files program1 rf and program2 rf List files cannot be generated at this stage These files will be generated after linking when the relationships of external references and external definitions are resolved global data_set __CODE section CODE PUBLIC 1 data_set mov 0 D2 data_...

Страница 39: ...map file It uses the same default name as the executable file m103 and the extension map The output directory is the same as that used for the executable file Generate final list files After link processing is complete generate the final list files using the map file m103 map as103 l a m103 map program1 asm as103 l a m103 map program2 asm l option Option to output a list file a option Option to re...

Страница 40: ...t Line Source 1 global data_set 2 3 _CODE section CODE PUBLIC 1 40000000 4 main 40000000 9000 5 mov 0 A0 40000002 2CFF00 6 mov 0xff D0 40000005 2D8000 7 mov 0x80 D1 40000008 F8FEFCFCFF0C0000 8 jsr data_set 40000010 00F8FE04 8 40000014 CAF2 9 bra main 10 11 _DATA section DATA PUBLIC 4 40000024 00000000 12 data1 ds 4 13 end program1 lst Page 2 Symbol Table 40000016 T data_set 40000000 T main 4000002...

Страница 41: ...s converted to machine language by the assembler Instructions consist of one to four bytes 1 byte 8 bits shown as two to eight hex digits After some machine language code the symbol M will be added The M indicates an instruction that was expanded from a macro instruction The Line heading shows line numbers added by the assembler The Source heading shows the source statements as coded program2 lst ...

Страница 42: ...ore when a program divided into multiple files is developed work can proceed without the programmer staying aware of the code size of each file The programmer an also freely change the order in which files are linked The following explanation illustrates a simple example dividing two source files into sections for each routine allocated to two sections Create source files Using an editor create th...

Страница 43: ...o output debug information in the relocatable object file l option Option to output list file not normally specified at this stage before linking but specify it here to see intermediate values This will assemble the two source files program3 asm and program4 asm in the current directory It will add debug information g option to the relocatable object files program3 rf and program4 rf and global da...

Страница 44: ... this list file is not the final list file Line number 11 also has a plus sign This indicator warns that the line contains a symbol that is not assigned a final value until linking Finally notice that the list begins from location 000000 The start addresses of section format programs are specified with the linker Here the assembler uses relative values beginning from 000000 as location counter val...

Страница 45: ...030 Cross Assembler Loc Object Line Source 1 global data_Set time_filler 2 global data_set time_filler 3 _CODE_01 section CODE PUBLIC 1 00000000 4 data_set 00000000 8A00 5 mov 0 D2 6 00000002 7 data_set_loo p 00000002 A6 8 cmp D1 D2 00000003 C600 9 bcc data_set_end 10 00000005 60 11 mov D0 A0 00000006 2A01 12 add 1 D2 00000008 2002 13 add 2 A0 0000000a CA00 14 bra data_set_loop 15 16 data_set_end ...

Страница 46: ...eates an executable file m103 ex including debugging information and a map file m103 map in the current directory Parameter file during linking The following command was input to link A ld103 m g T_CODE_00 800000000 T_CODE_01 80005000 program3 rf program4 rf Repeated input of lines like this is tedious and prone to errors For this reason the very convenient option is provided with the linker With ...

Страница 47: ... files with all addresses resolved The contents of the final list file program3 lst are as follows Note that the symbol table is not displayed Compare this listing file to the one with indeterminate addresses Note how the plus signs have disappeared from lines 9 11 and how the addresses start from 80000000 hex the number specified with the T option program3 lst Page 1 PanaX series Series MN1030 Cr...

Страница 48: ...m4 lst Page 1 PanaX series Series MN1030 Cross Assembler Loc Object Line Source 1 global data_set time_filler 2 3 _CODE_01 section CODE PUBLIC 1 80005000 4 data_set 80005000 8A00 5 mov 0 D2 6 80005002 7 data_set_ loop 80005002 A6 8 cmp D1 D2 80005003 C60A 9 bcc data_set_end 10 80005005 60 11 mov D0 A0 80005006 2A01 12 add 1 D2 80005008 2002 13 add 2 A0 8000500a CAF8 14 bra data_set_loop 15 8000500...

Страница 49: ...me and section attributes are merged in the order specified to the linker that is in the order in which they appear in the object file names following the linker options Rules for joining sections 1 Join in the order in which the sections appear during linking 2 Join sections for which both name and attribute match 3 Join sections for which either name or attribute match For further details see Ch...

Страница 50: ...ing an editor create the program program5 asm shown below The contents of program5 asm are as follows The operation of this program is meaningless The program will be used instead to explain program structure as it pertains to conditional assembly The define DEBUG on the first line selects DEBUG as a condition by defining the identifier DEBUG In the assembly control block starting with ifdef DEBUG...

Страница 51: ... where the macro instruction statement is shown and a is added after the line numbers where the instruction statements from macro expansion are shown DEBUG has been defined so the block between ifdef to else was assembled Line number 16 has an X after the line number This indicates a statement that was not assembled because a condition was not fulfilled program5 lst Page 1 PanaX series Series MN10...

Страница 52: ... command Until this point the condition has been specified by define in the source file but it has been bothersome to edit the source file each time The explanation below describes how to directly specify conditions with command options This operation is valid only with regards to ifdef program5 lst Page 1 PanaX series Series MN1030 Cross Assembler Loc Object Line Source 1 define DEBUG 2 3 M4 dat_...

Страница 53: ...number 16 instead This technique enables the programmer to freely choose assembly conditions with command option specifications There is also an assembler option for suppressing the source code lines not selected during conditional assembly For further details see Chapter 5 Using the Assembler and Chapter 6 Using the Linker program5 lst Page 1 PanaX series Series MN1030 Cross Assembler Loc Object ...

Страница 54: ...Chapter 3 Introduction to Operation 42 Conditional Assembly and Linking ...

Страница 55: ...4 Chapter 4 Optimization ...

Страница 56: ...ons bit manipulation instructions and user defined instructions to determine the shortest possible machine language instruction corresponding to the instruction This chapter uses examples to explain what optimization is NOTE The assembler and linker make changes to object code not instruction mnemonics Pay close attention to this point when viewing list files When an is displayed before a line num...

Страница 57: ...les of Usage 45 4 2 Rules of Usage To use the optimization function optimization must be turned on by using the O option or by placing an opt directive at the start of the source file NOTE Optimization is off by default opt on ...

Страница 58: ...anch Instructions Instruction Type Branch Range BLT label Relative branch instruction Branch within 128 to 127 bytes of the PC BGT label BGE label BLE label BCS label BHI label BCC label BLS label BEQ label BNE label BVC label BVS label BNC label BNS label Table 4 2 Unconditional Branches and Subroutine Calls Subject to Optimization Instruction Type Branch Range BRA label Relative branch instructi...

Страница 59: ...VH abs Dn MOVH Dn abs MOV d An An Register relative indirect addressing Branches possible to anywhere in the 4 gigabyte memory space MOV d An Dn MOV d SP An MOV d SP Dn MOV An d An MOV An d SP MOV Dn d An MOV Dn d SP MOVBU d An Dn MOVBU d SP Dn MOVBU Dn d An MOVBU Dn d SP MOVB d An Dn MOVB d SP Dn MOVB Dn d An MOVB Dn d SP MOVHU d An Dn MOVHU d SP Dn MOVHU Dn d An MOVHU Dn d SP MOVH d An Dn MOVH d...

Страница 60: ... bit immediate data ADD imm Dn ADD imm SP AND imm Dn CMP imm An CMP imm Dn Table 4 5 Logical Instructions Subject To Optimization Instruction Type Branch Range OR imm Dn Immediate addressing 32 bit immediate data XOR imm Dn Table 4 6 Logical Instructions Subject To Optimization Instruction Type Branch Range BTST imm Dn Immediate addressing 32 bit immediate data ...

Страница 61: ...n Instruction Type Branch Range UDF00 imm Dn Immediate addressing 32 bit immediate data UDF01 imm Dn UDF02 imm Dn UDF03 imm Dn UDF04 imm Dn UDF05 imm Dn UDF06 imm Dn UDF07 imm Dn UDF08 imm Dn UDF09 imm Dn UDF10 imm Dn UDF11 imm Dn UDF12 imm Dn UDF13 imm Dn UDF14 imm Dn UDF15 imm Dn UDFU00 imm Dn UDFU01 imm Dn UDFU02 imm Dn UDFU03 imm Dn UDFU04 imm Dn UDFU05 imm Dn UDFU06 imm dn UDFU07 imm Dn UDFU0...

Страница 62: ...l of the BEQ instructions must be in the range 128 to 127 However the assembler cannot make that determination so the following determinations are made during assembly and linking Assembler processing The assembler outputs information about instructions to be optimized to the linker Linker processing 1 The linker inputs information from the assembler 2 The linker determines if the branch destinati...

Страница 63: ...ets up the stack frame When this source file is assembled and linked the linker eliminates section 2 This section is preserved when the symbol _func is referred For further details on machine instructions and directives see the Instruction Manual and Section 9 4 Writing Directives NOTE This optimization of function calls is always carried out regardless of the state of the optimization option O It...

Страница 64: ...JMP LABEL BGE 7 JMP LABEL BGT LABEL BGT LABEL BLE 5 JMP LABEL BLE 7 JMP LABEL BGE LABEL BGE LABEL BLT 5 JMP LABEL BLT 7 JMP LABEL BLE LABEL BLE LABEL BGT 5 JMP LABEL BGT 7 JMP LABEL BCS LABEL BCS LABEL BCC 5 JMP LABEL BCC 7 JMP LABEL BHI LABEL BHI LABEL BLS 5 JMP LABEL BLS 7 JMP LABEL BCC LABEL BCC LABEL BCS 5 JMP LABEL BCS 7 JMP LABEL BLS LABEL BLS LABEL BHI 5 JMP LABEL BHI 7 JMP LABEL BEQ LABEL ...

Страница 65: ...MOV An d16 SP MOV An d32 SP MOV Dn abs MOV Dn abs 16 MOV Dn abs32 MOV Dn d An MOV Dn d8 An MOV Dn d16 An MOV Dn d32 An MOV Dn d SP MOV Dn d8 SP MOV Dn d16 SP MOV Dn d32 SP MOV imm An MOV imm8 An MOV imm16 An MOV imm32 An MOV imm Dn MOV imm8 Dn MOV imm16 Dn MOV imm32 Dn MOVBU abs Dn MOVBU abs16 Dn MOVBU abs32 Dn MOVBU d An Dn MOVBU d8 An Dn MOVBU d16 An Dn MOVBU d32 An Dn MOVBU d SP Dn MOVBU d8 SP ...

Страница 66: ... imm Dn UDF10 imm8 Dn UDF10 imm16 Dn UDF10 imm32 Dn UDF11 imm Dn UDF11 imm8 Dn UDF11 imm16 Dn UDF11 imm32 Dn UDF12 imm Dn UDF12 imm8 Dn UDF12 imm16 Dn UDF12 imm32 Dn UDF13 imm Dn UDF13 imm8 Dn UDF13 imm16 Dn UDF13 imm32 Dn UDF14 imm Dn UDF14 imm8 Dn UDF14 imm16 Dn UDF14 imm32 Dn UDF15 imm Dn UDF15 imm8 Dn UDF15 imm16 Dn UDF15 imm32 Dn UDFU00 imm Dn UDFU00 imm8 Dn UDFU00 imm16 Dn UDFU00 imm32 Dn UD...

Страница 67: ...ject of optimi zation Since the target address is within the range of a relative jump the assembler generates a BCC LABEL instruction opt on _TEXT section CODE PUBLIC 1 sub_func mov 0 D2 cmp D1 D2 addr_set bcc func_end org addr_set 127 func_end rts end opt1 lst Page 1 PanaX series Series MN1030 Cross Assembler Loc Object Line Source 1 opt on 2 _TEXT section CODE PUBLIC 1 40000000 3 sub_func 400000...

Страница 68: ...verted to BCS 5 JMP LABEL Note that the mnemonics and object code are different opt on _TEXT section CODE PUBLIC 1 sub_func mov 0 D2 cmp D1 D2 addr_set bcc func_end org addr_set 128 func_end rts end opt2 lst Page 1 PanaX series Series MN1030 Cross Assembler Loc Object Line Source 1 opt on 2 _TEXT section CODE PUBLIC 1 40000000 3 sub_func 40000000 8A00 4 mov 0 D2 40000002 A6 5 cmp D1 D2 40000003 C4...

Страница 69: ...ction on line number 4 is in the permitted range for relative branching so it has been converted to BRA LA BEL Note that the mnemonics and object code are different opt on _TEXT section CODE PUBLIC 1 sub_func addr_set jmp func_end org addr_set 127 fun_end end opt3 lst Page 1 PanaX series Series MN1030 Cross Assembler Loc Object Line Source 1 opt on 2 _TEXT section CODE PUBLIC 1 40000000 3 sub_func...

Страница 70: ... that may be expressed with a 2 byte relative branch the assembler replaces it with the CALLS LABEL variant with a 2 byte address field Note that the mnemonics and object code are different opt on _TEXT section CODE PUBLIC 1 sub_func addr_set calls func_end org addr_set 128 func_end rts end opt4 lst Page 1 PanaX series Series MN1030 Cross Assembler Loc Object Line Source 1 opt on 2 _TEXT section C...

Страница 71: ...5 Chapter 5 Using Assembler ...

Страница 72: ...Purpose of This Chapter This Chapter describes assembler operating procedures Chapter 3 Introduction to Operation described the basic operation of the assembler and linker but this one describes the many options available with the assembler and gives examples ...

Страница 73: ...ed by parameters can be specified as multiple characters following the hyphen option specifier The order is optional gl When an option is accompanied by a parameter and other options are to follow add a space after the parameter and follow with the hyphen option specifier I user source Li Lc Parameters can be specified right after the option character or separated by one space I user source or I u...

Страница 74: ...ng EUC encoding to the console and if specified the listing file Js Output error and warning messages in Japanese using Shift JIS encoding to the console and if specified the listing file Jj Output error and warning messages in Japanese using JIS encoding to the console and if specified the listing file e Output error and warning messages in English Output will be to the screen and when a list fil...

Страница 75: ...d output files Not all options are available at the same time Certain options have default values that are used when the option is not specified These defaults have been chosen to reflect the most frequently used settings As long as the default settings are acceptable it is possible to omit most options For the details of the interpretation when an option is omitted see the description below for t...

Страница 76: ...lowed by the lower case letter o then either immediately followed by the file name or a space and the file name If the file is to be output to the current directory only the file name needs to be specified If the file is to be output to a different directory both a path name and a file name must be specified as103 o user obj test rf main asm Default Specification The assembler creates a file with ...

Страница 77: ...lst The list file will be generated in the same directory as the source file If any assembler errors are detected error information will also be written to the list file Rules of Use This option is specified with the hyphen option specification character followed by the lower case letter l as103 l sample asm Default Specification No list file will be output l Output a list file ...

Страница 78: ...with the hyphen option specification character followed by the upper case letter L and lower case letter i The pair of characters of Li are handled as a single option as103 Li l sample asm NOTE This option is used in conjunction with the l option lower case l list output Default Specification Source files included by include will be output to the list file Operation Example The following command l...

Страница 79: ...ored even if specified Source files with no macro expansion will be assembled normally even if assembled with the Lm option Rules of Use This option is specified with the hyphen option specification character followed by the upper case letter L and lower case letter m The pair of characters of Lm are handled as a single option as103 Lm l sample asm NOTE The Lm option is specified with the hyphen o...

Страница 80: ...acters of Lc are handled as a single option as103 Lc l sample asm NOTE This option is used in conjunction with the l option lower case l list output Default Specification Blocks of unsatisfied conditions will be output to the list file Operation Example The following command line assembles the source file samp1 asm and creates a listing file samp1 lst that suppresses all text from conditional asse...

Страница 81: ...ith the linker Then using this map file reassemble with the a option to generate the final list file Specifying the wrong map file or specifying the different option from the one assembled at first results in an error Rules of Use This option is specified with the hyphen option specification character followed by the lower case letter a then followed by the map file name as103 a sample map l sampl...

Страница 82: ... lower case letter j as103 j sample asm NOTE This option is not available on PC AT machines Default Specification The default language used depends on the host machine and the operating system It is also possible to change the default message specification with an entry in the assembler s start up file See Chapter 1 Getting Started Section 1 5 Setup j Output error and warning messages in Japanese ...

Страница 83: ...tters together function as a single option as103 Je sample asm NOTE This option is not available on DOS V or PC AT machines Default Specification The default language used depends on the host machine and the operating system It is also possible to change the default message specification with an entry in the assembler s start up file See Chapter 1 Getting Started Section 1 5 Setup Je Output error ...

Страница 84: ...wo letters together function as a single option as103 Js sample asm NOTE This option is not available on PC AT machines Default Specification The default language used depends on the host machine and the operating system It is also possible to change the default message specification with an entry in the assembler s start up file See Chapter 1 Getting Started Section 1 5 Setup Js Output error and ...

Страница 85: ...tters together function as a single option as103 Jj sample asm NOTE This option is not available on DOS V or PC AT machines Default Specification The default language used depends on the host machine and the operating system It is also possible to change the default message specification with an entry in the assembler s start up file See Chapter 1 Getting Started Section 1 5 Setup Jj Output error ...

Страница 86: ...followed by the lower case letter e as103 e sample asm Default Specification The default language used depends on the host machine and the operating system It is also possible to change the default message specification with an entry in the assembler s start up file See Chapter 1 Getting Started Section 1 5 Setup e Output error and warning messages in English Host machine Message language Sun Spar...

Страница 87: ...he option enter the hyphen followed by the upper case letter W and the number as103 W 2001 sample asm Default Specification The default is to display all warning messages Functional Description This option suppresses output of all warning messages generated during assembler operation Rules of Use To specify the option enter the hyphen followed by the letters Wall as103 Wall sample asm Default Spec...

Страница 88: ...he directory as follows 1 Directory contains assembler source file 2 Directory specified with I option Rules of Use This option is specified with the hyphen option specification character followed by the upper case letter I then either immediately followed by the path name or a space and the path name as103 I user defs main asm Default Specification If not specifying this option the assembler trac...

Страница 89: ... fixing the conditions with define directives in source statements There are two conditional assembly directives that can make use of the D option ifdef ifndef No error will occur if identifiers specified by the D option are not used in the source file Assembly will process as though conditions are unfulfilled Rules of Use This option is specified with the hyphen option specification character fol...

Страница 90: ...ion is not specified for either the assembler or linker debug information will not be output to the executable format file EX NOTE If the number of lines per source file exceeds 65535 some part of the debug information will not be output Make sure when you debug programs one source file can contain up to 65535 lines Divide a file with more than 65535 lines to avoid errors Note that the file names ...

Страница 91: ...of instructions by the assembler and linker For the instructions subject to optimization see Chapter 4 Optimization Functions This option overrides any opt on directives included in the source files For further details on the opt on directive see Chapter 9 Writing Machine Language Instructions and Directives Section 9 4 Writing Directives Section 9 4 opt Rules of Use To specify the option enter th...

Страница 92: ...aying help information version number is also displayed on the screen Default Specification Help information will not be displayed to the screen Functional Description This option displays the assembler s version number on the console Rules of Use To specify the option enter the hyphen followed by the lower case letter v as103 v Default Specification The default is to not display the version numbe...

Страница 93: ...ION o test rf user source main asm The above command assembles the source file main asm in the user source directory For conditional assembly of the source file assembly will proceed as though VERSION were defined The above command also generates a relocatable object file named test rf with debug information in the current directory as103 g o test rf I user lib sample asm The above example assembl...

Страница 94: ...ed by the linker with the assembler s a option If the I or D options are specified the parameters at this stage must be the same as those of the first assembly The following descriptions assume that a map file has already been generated as103 l a main map sub asm In the above example all files exist in or are output to the current directory The source file sub asm is assembled using a map file mai...

Страница 95: ...6 Chapter 6 Using Linker ...

Страница 96: ...In addition the linker also resolves forward references For programs in section address format the start address of each section is specified when linking The linker links relocatable object files by section in the order specified by the link command and outputs an executable format file Figure 6 1 Link Model of Section Address Format sectionA sectionC sectionA sectionA sectionA sectionC 0x4000000...

Страница 97: ...Ellipses indicate item may be repeated Specifying options Except for the option an option starts with a hyphen as the options specifier followed by a character that indicate the particular option g The option is not preceded by hyphen Option specifications are case sensitive so upper case and lower case letters must be specified correctly Ed Single character options not accompanied by parameters c...

Страница 98: ...TE When specifying multiple files separate them with spaces Files without path specifications are assumed to be in the current directory The map file and executable file are always generated in the current directory regardless of any path specifications on the relocatable object files The default names for the executable file and the map file are m103 ex and m103 map respectively The o option is a...

Страница 99: ...sages and their corresponding numbers Wall Do not output any warning messages Program generation options g Output debug information to the executable format file T section address Specify the start end addresses of a start address end address section section group r Output an executable format file even if errors are detected En Do not output symbol table within the executable format file Ed Enabl...

Страница 100: ...s The linker reads multiple relocatable object files links them into one and creates an executable format file If optimization was selected at the assembly stage the linker will output the optimal machine language code for conditional and unconditional branch instructions regardless of the mnemonics defined in the source file In addition the linker resolves the values of forward referenced symbols...

Страница 101: ...does not exist is specified an error message will be displayed NOTE Because the symbol is used as the character for specifying parameter files it cannot be used as the first character of file names Rules of use This option is specified with the hyphen option specification character followed by the lower case letter o then either immediately followed by the file name or a space and the file name ld...

Страница 102: ...m main rf sub rf Default specification A map file will not be output The default can be changed to output a map file by using customization Refer to section 1 5 User Customization Operation example ld103 o user obj main ex m T CODE 80000000 prog1 rf prog2 rf The above command line links two relocatable object files prog1 rf and prog2 rf located in the current directory locates the resulting CODE s...

Страница 103: ...r followed by the lower case letter j ld103 j sample rf NOTE This option is not available on PC AT machines Default specification The default language used depends on the host machine and the operating system It is also possible to change the default message specification with an entry in the linker s start up file See Chapter 1 Getting Started Section 1 5 Setup j Output error and warning messages...

Страница 104: ...letter e The two letters together function as a single option ld103 Je sample rf NOTE This option is not available on DOS V or PC AT machines Default specification The default language used depends on the host machine and the operating system It is also possible to change the default message specification with an entry in the linker s start up file See Chapter 1 Getting Started Section 1 5 Setup J...

Страница 105: ...ase letter e The two letters together function as a single option ld103 Js sample rf NOTE This option is not available on PC AT machines Default specification The default language used depends on the host machine and the operating system It is also possible to change the default message specification with an entry in the linker s start up file See Chapter 1 Getting Started Section 1 5 Setup Js Out...

Страница 106: ...letter e The two letters together function as a single option ld103 Jj sample rf NOTE This option is not available on DOS V or PC AT machines Default specification The default language used depends on the host machine and the operating system It is also possible to change the default message specification with an entry in the linker s start up file See Chapter 1 Getting Started Section 1 5 Setup J...

Страница 107: ...on specification character followed by the lower case letter e ld103 e sample rf Default specification The default language used depends on the host machine and the operating system It is also possible to change the default message specification with an entry in the linker s start up file See Chapter 1 Getting Started Section 1 5 Setup e Output error and warning messages in English Host machine Ch...

Страница 108: ...use This option is specified with the hyphen option specification character followed by the upper case letter W and followed by the warning number specification ld103 W3001 progr1 rf prog2 rf Default specification Warning messages are output Function description This option suppresses output of all warnings detected during linking Rules of use This option is specified with the slash or hyphen opti...

Страница 109: ...d when assembling If the g option is not specified for either the assembler or linker debug information will not be output to the executable format file EX If files assembled with the g option and files not assembled with the g option are linked with the g option debug information will be output only for the files assembled with the g option Rules of use This option is specified with the hyphen op...

Страница 110: ...d103 T CODE 80000000 T DATA 0 prog1 rf prog2 rf ld103 T_TEXT _CONST 80000000 main rf T_TEXT _CONST 80002000 sub rf ld103 T_TEXT CODE 80000000 test1 rf test2 rf Be careful with the specification order for files since that order is the order in which the linker merges sections Section layout rules The sections are merged according to the following rules 1 Sections appearing with T option specificati...

Страница 111: ...ut files starting at address 0 It merges the DATA sections in the order in which they appear starting at address 0 It merges the DATA sections in the order in which they appear ld103 T CODE 80000000 T DATA 0 main rf sub rf The linker merges the DATA sections in the order that they appear in the input files starting at address 0 It merges the CODE sections in the order in which they appear starting...

Страница 112: ...rting at address 0 The DATA section from main rf do not have an address specification so are merged following the DATA section from sub rf NOTE For specifying a parameter of _T option a parameter file can not be used because the character would not be considered as an attribute specifying letter In addition the description should include the _T option in order to use a parameter file ...

Страница 113: ...e r option is only a temporary measure Do not run the executable that results Rules of use This option is specified with the hyphen option specification character followed by the lower case letter r ld103 r prog1 rf Default specification An executable format file will not be generated It is also possible to force creation of executable file by default with an entry in the linker s start up file Se...

Страница 114: ...table output by default with an entry in the linker s Start up file See Chapter 1 Getting Started Section 1 5 Setup Functional description This option causes the linker to write sections with the DATA attribute to the executable Rules of use This option is specified with the hyphen option specification character followed by the upper case letter E and lower case letter d The pair of characters of ...

Страница 115: ...t be coded end of the command line ld103 l usr lib sample lib main rf sub rf Default specification No library files will be read NOTE The linker will search for a library file one time only in order to solve the problem of the undefined symbols For instance if an undefined symbol has defined in the former library file the linker could never solve the problem and a error message will be appeared Be...

Страница 116: ...he order of definition If any library file is not found the linker outputs an error message to terminate operation Rules of use This option is specified with the hyphen option specification character followed by the upper case letter L then either immediately followed by the path name or a space and the path name ld103 L usr lib lsample lib sample2 lib prog1 rf prog2 rf The files sample lib and sa...

Страница 117: ...s of use This option does not use the slash or hyphen option specification character It specified alone followed by the parameter file name ld103 pfile NOTE Comments may be inserted into parameter files by starting them with a sharp The linker ignores everything from the sharp to the end of the line Default specification Not applicable Operational example Assume the following contents for pfile Th...

Страница 118: ... version number is also displayed on the screen Default specification Help information will not be displayed to the screen Functional description This option displays the linker s version number on the console Rules of use This option is specified with the hyphen option specification character followed by the lower case letter v ld103 v Default specification Version number will not be displayed on...

Страница 119: ...h instruction RAM for use in copying program portions to RAM for execution there The linker therefore supports special options for creating executable files with support for instruction RAM This section gives the particulars of the instruction RAM format for executable files and the procedures for creating them ...

Страница 120: ...es the last entry in this table by setting the highest bit in the ID number field to 1 The linker creates a extra symbol __overlay_table indicating the location of this table D Transfer program This portion copies the instruction RAM program from the external memory to the instruction RAM It refers to the instruction RAM program management table in the process The developer must create this portio...

Страница 121: ...ra symbol _ _overlay_table management table RAM addresses Program 1 Program 2 information A Fixed portion B Instruction RAM portion information address of CODE attribute Executable file created by linker RF file specified by T option RF file specified by OVL option RF file specified by OVL option Automatically generated table information Referring instruction program D Transfer Assigned at the hig...

Страница 122: ...olves address references to other portions of the program assuming that the instruction RAM portions are running at the specified addresses in instruction RAM 4 The linker creates an instruction RAM transfer unit for each OVL option making entry for each one in the instruction RAM program management table The transfer program D obtains its parameters from this table during actual transfers 5 When ...

Страница 123: ...n with the CODE attribute NOTE The linker produces an error message if the relevant object files do not contain the specified section Specifying an OVL option without a following file produces the same result Rules of use This option is specified with the hyphen option specification character followed by the upper case letters OVL the ID number a colon the section specification an equals sign and ...

Страница 124: ...rf OVL 2 CODE 40000000 seg2 rf ld103 T CODE 80000000 main rf sub rf OVL 1 _TEXT _CONST 40000000 seg1 rf OVL 2 _TEXT _CONST 40000000 seg2 rf ld103 T CODE 80000000 main rf sub rf OVL 1 _TEXT CODE 40000000 seg1 rf OVL 2 _TEXT CODE 40000000 seg2 rf Default specification If there are no OVL options the instruction RAM function is not used and linking proceeds in the normal fashion ...

Страница 125: ...y the upper case letters PUT the name of an extra symbol an equals sign and the address for that symbol There are two extra symbols __overlay_table and __iram_manage The address is in hexadecimal ld103 T CODE 80000000 main rf sub rf OVL 1 _TEXT 40000000 seg1 rf PUT __overlay_table a0000000 PUT __iram_manage 30000000 Default specification The default for the extra symbol __iram_manage is the addres...

Страница 126: ...DE attribute as placed with the T option Finally at the address following the end of all segments in external memory with the CODE option the linker creates the instruction RAM program management table used by the routine for copying sections to instruction RAM Assignment to the same address in instruction RAM ld103 T CODE 80000000 T DATA 1000 main rf sub rf OVL 1 _TEXT 40000000 prog1 rf OVL 2 _TE...

Страница 127: ...ty The linker automatically detects such conflicts and suppresses executable file output Specifying an address for the instruction RAM program management table ld103 T CODE 80000000 T DATA 1000 main rf sub rf OVL 1 _TEXT 40000000 prog1 rf OVL 2 _TEXT 40000000 prog2 rf OVL 3 _TEXT 40000000 prog3 rf PUT __overlay_table a0000000 The section layout is the same as the previous example The only differen...

Страница 128: ...Chapter 6 Using Linker 116 Instruction RAM Support ...

Страница 129: ...7 Chapter 7 Types of Source Statements ...

Страница 130: ...nts There are five types of source statements classified by their purpose Machine language instruction statements and directive statements Assembler control statements Macro control statements Comment statements Blank statements This chapter describes these five types of statements and at the same time explains their position and use when constructing a program ...

Страница 131: ...ing programs Always declare an attribute and link type for a section name the first time it appears in a file The same section name cannot be set to a different attribute or link type The effective scope of a directive coding rule section is until the line preceding the next directive coding rule section Ignore all text after the directive coding rule instruction Comment statement Write comments a...

Страница 132: ...itional assembly KEYBORD equ 0x32 define a constant data_set macro data define a macro movw data A0 mov 0x12 D0 mov D0 A0 endm end of macro _CODE section CODE PUBLIC 1 blank statement main statement with label only mov 0x10 D1 machine language instruction statement ifdef TYPE conditional assembly directive data_set KEYBORD expand macro else mov 0 D1 endif end end of program ...

Страница 133: ...rted to ROM these statements will be executed by the microprocessor The instructions have the following features Memory oriented instruction set all calculations performed throughout memory Single and double operand instructions Minimized instruction set and instruction codes Six addressing formats The example below shows machine language instruction statements Directive statements Directive state...

Страница 134: ...es include directives that include files and conditional assembly directives that specify conditions for changing which instructions are assembled The example below shows assembler control statements include FILE1 ASM include a file define MODE define an identifier ifdef MODE begin conditional assembly mov 0x22 D0 block to assemble if condition is fulfilled else mov 0x11 D0 block to assemble if un...

Страница 135: ...age instructions to construct a single program process A macro call is just a macro name coded as a source statement The assembler will replace it with all the machine language instructions coded in the macro body This process is called macro expansion The basic difference between a macro call and a subroutine call is that a macro call actually outputs ma chine language instructions as source stat...

Страница 136: ... is the comment statement No matter what a comment is it will not affect program operation of function Comments are used to explain data structures program algorithms etc Comment statements are an important structural element of documentation You should add comments that are detailed as possible to enhance program maintenance The example below shows comment statements MN1030 Series Cross Assembler...

Страница 137: ...Chapter 7 Type of Source Statements Blank Statements 125 7 7 Blank Statements A blank statement consists of a single carriage return Blank statements are used to make printed lists easier to read ...

Страница 138: ...Chapter 7 Type of Source Statements 126 Blank Statements ...

Страница 139: ...8 Chapter 8 Writing Source Statements ...

Страница 140: ...rce statements Source statements include machine language instruction statements assembler control statements and macro control statements This chapter explains how to code the characters and numbers that can be used when writing source statements and it describes how to write character constants address constants location counters and expressions ...

Страница 141: ...of characters that can be coded in source statements for the cross assembler of this series Digits 0 1 2 3 4 5 6 7 8 9 Letters Upper case A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Lower case a b c d e f g h i j k l m n o p q r s t u v w x y z Control characters space tab carriage return line feed _ ...

Страница 142: ... 16 hexadecimal Any radix can be selected by using the radix directive but only decimal is allowed in extended C language format The default is decimal regardless of coding format To code numbers with a radix other than the default a fixed suffix indicating the radix is appended to the digits Radices and allowed digits The next page shows how the various radices and formats are coded Radix 2 binar...

Страница 143: ... q When the default is octal the suffix O or Q may be omitted Decimal Follow decimal digits with letter D or d When the default is decimal the suffix D may be omitted Hexadecimal Follow hexadecimal digits with letter H or h If the digits begin with a letter A F they must be prefixed with the digit 0 zero When the default is hexadecimal the suffix H may be omitted Current default radix Radix Binary...

Страница 144: ... Start with letter F or f and enclose decimal digits in single quotation marks When the default is decimal code the decimal number as is Hexadecimal Start with letter X or x and enclose hexadecimal digits in single quotation marks When the default is hexadecimal code the hexadecimal number as is When the number begins with a letter prefix it with 0 zero Current default radix Radix Binary Octal Dec...

Страница 145: ...is selected using the notation directive The default is extended C language format NOTE The coding format also applies to numbers Refer to section 8 3 Numbers for details Coding rules In extended C format and Intel format character constants are specified just with the character enclosed in single quotation marks In Matsushita format the enclosed character is preceded by the letter C or c The char...

Страница 146: ...tring constants are specified by enclosing the string in double quotation marks ABCDEFG Specifies the string ABCDEFG as ASCII code Specifies the string as ASCII code NOTE To specify a double quotation mark or a backslash in a character constant a backslash precedes the character NOTE Note that string constants are specified the same regardless of coding format The coding format has no effect even ...

Страница 147: ... by operators with the result representing a single value refer to section 8 7 Expressions for details The address specifiers are shown below A or a Return the lower 32 bits of the expression value bits 0 to 31 Example Assume that the following address is assigned to the label with the name MESSAGE address 00000000001110010101011011101001 binary a MESSAGE represents 0000000000111001010101101110100...

Страница 148: ...rst set during linking for each section defined by the section directive so location counter values during assembly will not necessarily match the addresses assigned to instructions during execution Location counter values during execution will be offset values from the start of each section The address of the current instruction can be coded as an asterisk This asterisk is called the self referen...

Страница 149: ...uction When a symbol or self reference address included in an expression is a forward referenced symbol a relocatable symbol or an undefined symbol the result of the expression cannot be resolved by the assembler It will then be resolved by the linker NOTE If a section name in the expression was used as a symbol declaration with the section directive must be done in the file Without doing this wou...

Страница 150: ...operand1 operand2 COUNT 4 operand1 operand2 SATRT 0x10 operand1 operand2 STACK 16 operand SIGN operand SIGN Shift operators The shift operators shift to the left or right in bit units Formats operand countADDRESS 3 3 bit right shift operand countADDRESS 4 4 bit left shift Binary 0 zero will be shifted in Shifted out bits will be lost Operator Meaning Multiplication Division Modulo operator remaind...

Страница 151: ...rs Logical operators perform calculation in bit units Formats Example operand1 operand2 ADDRESS MASK operand1 operand2 CONST 0b0011110000 operand1 operand2 VECT 0b0011110000 operand MAIN Operator Meaning Logical AND Exclusive OR Logical OR Unary negation 1 s complement ...

Страница 152: ...rator so take care in its use The expression will be multiplication of the self reference address symbol by itself Precedence Operator Description Highest Unary negation unary plus unary minus Multiplication division remainder Addition subtraction Left shift right shift Logical AND Exclusive OR Lowest Logical OR c1 equ 10 c2 equ 0b01101110 _CODE section CODE PUBLIC 1 data1 dc c1 3 3 4 data2 dc c1 ...

Страница 153: ...ions it will be regarded as an address reference To be proceeded as expressions put 0 before the parenthesis and distinguish them from others mov 10 5 d0 move the value of address 15 to d0 equal to mov 15 d0 mov 0 10 5 d0 move the value of constant 15 to d0 equal to mov 15 d0 mov 10 5 2 d0 Error 10 5 is regarded as an address reference It causes syntax error expression expression expression binary...

Страница 154: ...bel itself or the labels are following four UND undefined attributes The label is undefined at the reference ABS absolute attributes The label is undefined with equ pseudo instruction The value is not changed The constant value written directly will be regarded as an absolute attribute REL relative attributes The label is already defined in the same file at the reference the label referring forwar...

Страница 155: ...te attributes ABS addition Operand 2 UND ABS REL EXT Operand 1 UND UND UND UND UND ABS UND ABS REL EXT REL UND REL REL EXT EXT UND EXT EXT EXT operand1 operand2 SUBTRACTION Operand 2 UND ABS REL EXT Operand 1 UND UND UND UND UND ABS UND ABS REL EXT REL UND REL REL EXT EXT UND EXT EXT EXT operand1 operator operand2 Operand 2 UND ABS REL EXT Operand 1 UND UND UND UND UND ABS UND ABS REL EXT REL UND ...

Страница 156: ... Port names Register names Address constants Directives Assembler control instructions Macro control instructions Except for machine language instruction mnemonics and port names the reserved words are listed below Register name d0 d1 d2 d3 a0 a1 a2 a3 PSW mdr sp Address constants a Directives align dc ds dw end equ global listoff liston xlistoff xliston notation org opt page radix section tit fun...

Страница 157: ...9 Chapter 9 Writing Machine Language Instruction Statements and Directive Statements ...

Страница 158: ...ontrol statements that code assembler control instructions Macro control statements that code macro control instructions Comment statements Blank statements Each is coded differently This chapter explains in detail the code syntax and usage examples of machine language instructions and directives Refer to Chapter 8 Writing Source Statements regarding address constants numeric constants expressions...

Страница 159: ...perand operand comment Contents of brackets can be omitted Coding rules Source statements may contain a label field only Depending on the operation source statements may contain no operand Fields are delimited by at least one space or tab Two operands are delimited by a comma A statement with an LF only omitting all fields is a blank statement Statements are terminated by the LF character line fee...

Страница 160: ...irst column The first character of a label must not be a digit Labels are case sensitive The same label name cannot be defined twice When the label is omitted it must be replaced with at least one space or tab Terminology Column This is a column on the display or printer paper One character takes one column Columns are counted from the left as column 1 2 etc Coding examples The following examples ...

Страница 161: ...49 9 2 2 Writing Operation Field The operation field is written with a machine language instruction or directive Coding rules Machine language instructions cannot mix case They must use either upper or lower case throughout Coding examples CONST1 equ 10 _CODE section CODE PUBLIC 2 start mov CONST1 D0 rts ...

Страница 162: ...ield Refer to the Instruction Manual for details on coding machine language instructions Coding rules Operands are written with expressions and reserved words register names etc Operands cannot include spaces except for character constants and string constants When two operands are coded they must be delimited by a comma Coding examples ROL D0 One operand mov CONST 3 D0 Operands are register and e...

Страница 163: ...d the comment field Comments coded in this position are called end of line comments as opposed to comment statements where the entire line is a comment Coding rules Comments being with a semicolon and end with a line feed LF Comment fields may be written with letters digits special characters and control characters other than carriage return and line feed Coding examples mov 0x10 D0 Set count valu...

Страница 164: ...nd lower case letters may be used Insert at least one space or tab between the operation field and operand field The assembler and linker optimization function will adjust conditional and unconditional branch instructions to generate the optimal code When a relative address is specified in an operand and only labels with specific addresses are coded the assembler will calculate and set the relativ...

Страница 165: ...Selects the coding format for numbers org Changes the program address opt Enables disables optimization functions page Specifies the number of columns and rows on one page of the list file radix Selects the radix to be specified by default dc Stores an 8 bit constant in a memory area ds Reserves an 8 bit data area in a memory area dw Stores a 16 bit constant in a memory area dd Stores a 32 bit con...

Страница 166: ...n name appears for the first time in the file the following defaults are used definition1 CODE definition2 PUBLIC expression 1 For subsequent appearances of the section name the section inherits the values from previous appear ances Functional description The section directive specifies a section name as well as its attribute link type and location boundary During linking the linker gathers sectio...

Страница 167: ...fined actual value will be inherited from the setting of the very first section If there is the same section name in a file with a different attribute link type or location boundary the linker warns Directive coding rules The section directive has no restrictions on where in the source file it can be defined Usage example Below is an example use of the section directive NOTE Assembler instructions...

Страница 168: ...ter is 30 the statement counter will have its location counter changed to 32 Thus the align directive rounds up the current location counter value up to the next greater multiple of the expression value Operand coding rules The attribute of the calculated result of the expression coded in the operand must be abs absolute For a discussion of expression attributes see Chapter 8 Writing Source Statem...

Страница 169: ...lign 8 on line 10 The location counter there is 000B hex which is between 0008 and 0010 hex Therefore the next line will start from location 0010 hex Similarly the align 16 on line 13 uses the series 16 10 32 20 48 30 The location counter there is 0012 hex which is between 0010 and 0020 hex Therefore the next line will start from location 0020 hex align lst Page 1 PanaX Series MN1030 Cross Assembl...

Страница 170: ...ion This directive is coded once at the end of a program All text coded after the end directive will be ignored by the assembler but it will be output to the source list When a name is coded in the label field the current location counter value will be assigned to it Operand coding rules The end directive takes no operands If operands are coded they will cause an assembler syntax error Usage examp...

Страница 171: ...be output to the list file These directives are used when you do not want to output an already debugged program to the list file NOTE The listoff and liston directives themselves are output Only output to the list file will be suppressed Output of object code will not be suppressed at all Operand coding rules These directives take no operands Usage example Below is an example use of the listoff an...

Страница 172: ...ific way to represent binary octal decimal and hexadecimal numbers as well as character constants The notation directive selects which format numbers and character constants will be coded with This directive can be coded any number of times in a program Refer to Chapter 8 Writing Source Statements section 8 7 Expressions section 8 7 4 Expression Attributes Operand coding rules The strings that can...

Страница 173: ...embler Loc Object Line Source 1 _DATA section CODE PUBLIC 4 2 notation INTEL 00000000 FF 3 dc 11111111b 00000001 FF 4 dc 377q 00000002 FF 5 dc 377o 00000003 FF 6 dc 255d 00000004 FF 7 dc 0ffh 8 notation CLANG 00000005 FF 9 dc 0b11111111 00000006 FF 10 dc 0377 00000007 FF 11 dc 255 00000008 FF 12 dc 0xff 13 notation PANA 00000009 FF 14 dc b 11111111 0000000a FF 15 dc o 377 0000000b FF 16 dc f 255 0...

Страница 174: ...fied by expression Operand coding rules For the expression coded in the operand the attribute of the calculation result must be abs absolute For a discussion of attributes of expressions see Chapter 8 Writing Source Statements Section 8 7 Expressions Section 8 7 4 Expression Attributes If the expression value is less than the current location counter it causes an error Usage example Below is an ex...

Страница 175: ... source statements are coded and converts them to the optimal code with the linker While the linker is linking multiple files it outputs the instructions with the smallest possible code size for the instructions subject to optimization Refer to chapter 4 Optimization for details NOTE The Od assembler option disables the optimization function however optimization will be enabled if opt on is coded ...

Страница 176: ...lf is specified the assembler will output a carriage return and apply the newly set values Operand coding rules The expressions coded in the operand must result in the attribute abs absolute Refer to section 8 7 4 Expression Attributes regarding attributes of expressions Specify the number of lines in the range 10 255 Specify the number of columns in the range 60 255 If a value outside the allowab...

Страница 177: ... operand Select one from radix 2 binary radix 8 octal radix 10 decimal and radix 16 hexadecimal NOTE In extended C language format the default radix cannot be specified by the radix directive The default is fixed as radix 10 decimal and it cannot be changed to another radix Operand coding rules The expression coded in the operand must result in the attribute abs absolute Refer to section 8 7 4 Exp...

Страница 178: ... regafding attributes of expressions Specify one of the following constants or the operand character constant string constant The operands are delimited with commas Any number of operands can be coded If data that exceeds 8 bits is specified the lower 8 bits will be valid and the upper bits will be lost The assembler will output a warning message in such cases When the specified data has fewer tha...

Страница 179: ...is specified that memory area will be filled with the initial value Note that expression2 can be specified only when the value of expression1 is 4 or less When expression3 iterations is specified the same specification will be repeated for the number of iterations For example if the operand is 4 0 3 a 4 byte area will be filled with 0 three times Thus a 12 byte area will be reserved When a name is...

Страница 180: ...g Directive Statements Usage example Below is an example use of the ds directive DC LST Page 1 PanaX Series MN1030 Cross Assembler Loc Object Line Source 1 _DATA section DATA PUBLIC 4 00000000 00 2 ds0 ds 1 00000001 1122 3 ds 2 0x1122 00000003 3344556633445566 4 ds1 ds 4 0x33445566 2 ...

Страница 181: ...ounter value to that name Operand coding rules The operands are delimited with commas Any number of operands can be coded If data that exceeds 16 bits is specified the lower 16 bits will be valid and the upper bits will be lost The assembler will output a warning message in such cases When the specified data has fewer than 16 bits those bits will fill the lower bits and the upper bits will be padd...

Страница 182: ... coded for the label the assembler will assign the current location counter value to that name Operand coding rules The operands are delimited with commas Any number of operands can be coded When the specified data has fewer than 24 bits those bits will fill the lower bits and the upper bits will be padded with zeros Usage example Below is an example use of the dw directive dd LST Page 1 PanaX Ser...

Страница 183: ... wherever it is used This makes programs easier to maintain Operand coding rules The expression coded in the operand must result in the attribute abs absolute Refer to Section 8 7 4 Expression Attributes regarding attributes of expressions If the attributes of expressions are not the attribute abs absolute define of the assembler control state ment should be used instead of the equ of the directiv...

Страница 184: ...n example use of the equ directive equ lst Page 1 PanaX Series MN1030 Cross Assembler Loc Object Line Source 1 MEMORY equ 0x20 2 MOTOR equ 10 3 STOP equ 0b00001000 4 BASE equ 0x1000 5 6 _TEXT section CODE PUBLIC 1 00000000 8020 7 mov MEMORY D0 00000002 800A 8 mov MOTOR D0 00000004 8008 9 mov STOP D0 00000006 2C0010 10 mov BASE D0 ...

Страница 185: ... directive declares that the names coded in the operand are from other files For external declarations the global directive declares that the names coded in the operand can be referenced externally The global directive can be coded anywhere in a source programs Operand coding rules Write the name coded in the label field as an operand Generally this will be a program name The names are delimited w...

Страница 186: ...he global directive NOTE If a section name was referred as an external label declaration with the section directive not with the global directive is necessary Example sec section CODE PUBLIC 1 _TEXT section CODE PUBLIC 1 mov sec A0 global SUB1 external declaration global READ WRITE external reference main jsr READ jsr WRITE SUB1 mov 0x11 D0 rts end ...

Страница 187: ...be output as the header of the list file Typically the string is written with the program name function author version company date etc Operand coding rules The operand is written with any string enclosed by double quotation marks A double quotation mark itself cannot be included in the string Usage example Below is an example use of the tit directive TIT LST Page 1 TEST PROGRAM Loc Object Line So...

Страница 188: ... list file These directives are used when you do not want to output an already debugged program to the list file NOTE The xlistoff and xliston directives themselves are not output Only output to the list file will be suppressed Output of object code will not be suppressed at all Operand coding rules These directives take no operand Usage example Below is an example use of the xlistoff and xliston ...

Страница 189: ...other instructions call it In that case assign a label to any empty statement immediately preceding the funcinfo directive and use the name of that label The label_name must be defined prior to the funcinfo directive Otherwise an error results The expression gives the size of the stack frame used by the function It must evaluate to a value be tween 0 and255 A value outside this range results in an...

Страница 190: ...structions free the stack frame and restore registers from the stack The assembler bases this code on the information provided by the funcinfo directive For this reason the ret and retf instructions cannot precede the funcinfo directive global _0func _TEXT section CODE PUBLIC 1 call _0func global _0func _func _TEXT section CODE PUBLIC 1 _func movm D2 SP add 4 SP _0func funcinfo _func 8 D2 ret ...

Страница 191: ...iting Source Statements section 8 7 Expressions section 8 7 4 Expression Attributes regarding attributes of expression Names defined with the assign directive can be defined again with the assign directive Names defined with the assign directive cannot be declared external references or external declarations No memory ares is reserved when an assign directive statement is executed Usage examples T...

Страница 192: ...Chapter 9 Writing Machine Language Instructions and Directive Statements 180 Writing Directive Statements ...

Страница 193: ...10 Chapter 10 Writing Assembler Control Statements ...

Страница 194: ... only within macro definitions Refer to chapter 11 Writing Macro Statements as needed Common coding rules Here are some rules common to coding of all assembly control statements The assembler directive should be coded from the first column of its statement Both upper and lower case letters can be used The characters that can be used as identifiers are upper and lower case letter digits and undersc...

Страница 195: ...File Inclusion 183 10 2 File Inclusion The file inclusion is an assembler control instruction that reads the specific file to the source file It is used for the following purpose Using same macro or same declarations variables in several source files ...

Страница 196: ...g the assembler s Li option you can suppress output of include files to the list file Coding rules The file is specified by the file name enclosed in double quotation marks If the file is in a different directory the file name specification must include the path name The assembler will assume an ASM extension if the extension is omitted NOTE By adding the I option when starting the assembler you c...

Страница 197: ...ists of the following statement The file to be assembled consists of the following statements The above file is assembled with the file inc h included For this reason at points after the include statement the operand data is interpreted as the numerical value 0x12 data equ 0x12 include inc h _TEXT section CODE PUBLIC 1 main mov data A0 mov 0x34 D0 mov D0 A0 end ...

Страница 198: ...fier definement names a variable or a set of steps and replace the name the identifier in the source code to the string that has been defined It is used for the following purposes If the same process or the same variable has been used several times To make clear of the meaning of the process or the variable ...

Страница 199: ...cement_string is omitted the identifier will be defined as a null character Everything after a semicolon is considered a comment Therefore semicolons cannot be included in the replacement_string The same identifier cannot just be redefined with another define directive When used in conjunction with the undef directive redefinition is possible Refer to section 10 4 undef for details If the replacem...

Страница 200: ...efine the replacement string of an identifier redefine it with define after performing an undef Coding rules The identifier for an undef directive must be the same string as the identifier for the corresponding define directive The string is case sensitive Usage example A source file that uses undef is shown below define data1 0x11 define data2 0x22 _CODE section CODE PUBLIC 2 mov data1 D0 mov dat...

Страница 201: ...onditional assembly is shown below NOTE The contents of brackets from else on can be omitted The basic function of conditional assembly directives are for the assembler to evaluate the condition specified by if and then to select the block to assemble based on the result Conditional assembly directives are used for the following purposes Different object code for different versions can be output w...

Страница 202: ...alue is 0 Expression value is not 0 ifeq see note Parameters 1 and 2 are the same string Parameters 1 and 2 are not the same string ifneq see note Parameters 1 and 2 are not the same string Parameters 1 and 2 are the same string iflt Expression value is negative Expression value is not negative ifle Expression value is 0 or negative Expression value is not 0 and not negative ifgt Expression value ...

Страница 203: ... else directive has been coded block2 will be assembled ifndef If the identifier has not been defined by a define directive before the ifndef statement block1 will be assembled If it has been defined and an else directive has been coded block2 will be assembled Coding rules These directives can be used within macro definitions and wherever machine language instructions can be coded If an identifie...

Страница 204: ...number 5 here and will not assemble block 2 shown as line number X The ifndef directive inverts the condition so block 2 line number 12 will be assembled define VERSION _TEXT section CODE PUBLIC 1 ifdef VERSION mov 0x01 D0 else mov 0x02 D0 endif ifndef VERSION mov 0x03 D1 else mov 0x04 D1 endif ifdef lst Page 1 PanaX Series MN1030 Cross Assembler Loc Object Line Source 1 define VERSION 2 3 _TEXT s...

Страница 205: ...al description if If the value of expression is not 0 block1 will be assembled If it is 0 and an else directive has been coded block2 will be assembled ifn If the value of expression is 0 block1 will be assembled If it is not 0 and an else directive has been coded block2 will be assembled Coding rules These directives can be used within macro definitions and wherever machine language instructions ...

Страница 206: ...r 7 to be assembled and the ifn directive causes line number 10 to be assembled DEVICE equ 1 _TEXT section CODE PUBLIC 1 if DEVICE 1 mov 0x01 D0 else mov 0x02 D0 endif ifn DEVICE 1 mov 0x03 D0 else mov 0x04 D0 endif if lst Page 1 PanaX Series MN1030 Cross Assembler Loc Object Line Source 00000001 1 DEVICE equ 1 2 3 _TEXT section CODE PUBLIC 1 4 if DEVICE 1 5X mov 0x01 D0 6 else 00000000 8002 7 mov...

Страница 207: ...and parameter2 are the same string block1 will be assembled If they are different and an else directive has been coded block2 will be assembled ifneq If parameter1 and parameter2 are different strings block1 will be assembled If they are the same and an else directive has been coded block2 will be assembled Coding rules These directives can only be used within macro definitions Either or both of p...

Страница 208: ...mpares the strings of those dummy parameters If they match an instruction that sets the A register to 1 will be assembled If they do not match an instruction that sets the A register to 0 will be assembled The macro is called by specifying strings to be passed to the dummy parameters compare macro data1 data2 ifeq data1 data2 mov 0x01 D0 else mov 0x02 D0 endif endm _TEXT section CODE PUBLIC 1 comp...

Страница 209: ...r a mismatch ifeq lst Page 1 PanaX Series MN1030 Cross Assembler Loc Object Line Source 1 compare macro data1 data2 2 ifeq data1 data2 3 mov 0x01 D0 4 else 5 mov 0x02 D0 6 endif 7 endm 8 9 _TEXT section CODE PUBLIC 1 M10 compare abc abc 10 ifeq abc abc 00000000 8001 10 mov 0x01 D0 10 else 10X mov 0x02 D0 10 endif M11 compare abc acb 11 ifeq abc acb 11X mov 0x01 D0 11 else 00000002 8002 11 mov 0x02...

Страница 210: ...t is not negative and an else directive has been coded block2 will be assembled ifle If the value of expression is 0 or negative block1 will be assembled If it is positive and an else directive has been coded block2 will be assembled Usage example The first example will be of iflt A source file is shown below The size 16 expression of the iflt is not negative so block 2 is assembled MNXXX equ 32 d...

Страница 211: ...low iflt lst Page 1 PanaX Series MN1030 Cross Assembler Loc Object Line Source 1 MNXXX equ 32 2 M3 dsize macro size 4 iflt size 32 5 mov 0x01 D0 6 else 7 mov 0x02 D0 8 endif 9 endm 10 11 _TEXT section CODE PUBLIC 1 M12 dsize MNXXX 12 iflt MNXXX 32 12X mov 0x01 D0 12 else 00000000 8002 12 mov 0x02 D0 12 endif ...

Страница 212: ...mbled If it is not positive and an else directive has been coded block2 will be assembled ifge If the value of expression is 0 or positive block1 will be assembled If it is negative and an else directive has been coded block2 will be assembled Note that 0 is not included in positive numbers Usage example A source file that uses ifgt is shown below DEVICE equ 1 _TEXT section CODE PUBLIC 1 ifgt DEVI...

Страница 213: ...at the expression s value is 0 so block 2 was assembled ifgt lst Page 1 PanaX Series MN1030 Cross Assembler Loc Object Line Source 1 DEVICE equ 1 2 3 _TEXT section CODE PUBLIC 1 4 ifgt DEVICE 1 5 mov 0x01 D0 6 else 00000000 8002 7 mov 0x02 D0 8 endif 9 ifge DEVICE 1 00000002 8503 10 mov 0x03 D1 11 else 12X mov 0x04 D1 13 endif ...

Страница 214: ...fb If the dummy_parameter is a null character block1 will be assembled If it is not a null character and an else directive has been coded block2 will be assembled ifnb If the value of expression is not a null character block1 will be assembled If it is a null character and an else directive has been coded block2 will be assembled Coding rules These directives can only be used within macro definiti...

Страница 215: ..._cycle If it is not a null character the program will execute test and then execute next_cycle In this example the identifier MODE is passed to the macro debug When a replacement string has been specified the call is without a null character global check proc debug macro string ifb string jsr check jsr proc else jsr proc endif endm _TEXT section CODE PUBLIC 1 define MODE debug_on debug MODE undef ...

Страница 216: ...e Source 1 global check proc 2 M3 debug macro string 4 ifb string 5 jsr check 6 jsr proc 7 else 8 jsr proc 9 endif 10 endm 11 12 _TEXT section CODE PUBLIC 1 13 define MODE debug_on M14 debug MODE 14 ifb debug_on 14X jsr check 14X jsr proc 14 else 00000000 F8FEFCFCFF000000 14 jsr proc 00000008 00F8FE04 14 14 endif 15 undef MODE 16 define MODE M17 debug MODE 17 ifb 0000000c F8FEFCFCFF000000 17 jsr c...

Страница 217: ...11 Chapter 11 Writing Macro Control Statements ...

Страница 218: ... The characters that can be used for macro names dummy parameters parameters and identifiers are upper and lower case letters digits and underscores _ The first character must not be a digit Symbols used in expressions must have been previously defined The following directives cannot be coded within macro blocks include directive macro definitions Refer to section 11 2 Macro Definitions regarding ...

Страница 219: ... body A macro is called by coding its name in the operation field of a source statement The assembler then inserts the text of the macro body at that position This is called macro expansion Macro definitions can have up to 10 dummy parameters Dummy parameters are used within the macro body to allow the caller to modify some of the expanded text Reference Subroutines have similar functions but macr...

Страница 220: ...from the outside using dummy parameters Refer to section 11 5 Local Symbol Declaration local for details A macro can be redefined The new definition will be effective from the following line on The purge directive can purge a macro definition The macro will be recognized as an instruction or symbol from the following line on The macro name cannot be the same as a machine language mnemonic The asse...

Страница 221: ...meters as follows para1 address para2 data para3 count Coding rules Any string can be specified as a parameter To specify a string that includes commas or spaces use the macro operator Refer to section 11 4 Macro Operators for details If there are more parameters than there were dummy parameters in the macro definition an error will occur If there are fewer parameters than there were dummy paramet...

Страница 222: ...instruction within the macro body Take note whether a macro name is the same as a machine language instruction The macro is called with var1 and var2 as parameters Reference By adding the Lm option when the assembler is started you can suppress the output of mnemonics of macros expanded by the assembler var1 equ 0x10 var2 equ var1 2 add_adr macro adr add adr A0 endm _CODE section CODE PUBLIC 2 mai...

Страница 223: ...indicates a logical AND Operator Description Concatenates strings Macro definition dummy parameters Macro call Macro expansion p1 p2 p3 abc def ghi abcdefghi p1 p2 p3 data 1 3 data13 Escape characters for including normally unusable characters in parameters of macro calls Macro definition dummy parameters Macro call Macro expansion p1 p2 p3 0x0f var 3 2 var3 2 0x0f Passes the enclosed string as a ...

Страница 224: ...ow macexp lst Page 1 Panax Series MN1030 Cross Assembler Loc Object Line Source M1 mac1 macro p1 p2 p3 2 mov p1 p2 p3 0x0f D0 3 endm 4 M5 mac2 macro p1 p2 6 p1 p2 7 endm 8 9 _TEXT SECTION CODE PUBLIC 1 M10 mac1 1 2 3 00000000 8001 10 mov 12 3 0x0f D0 M11 mac2 add 1 D0 00000002 2801 11 add 1 D0 12 end ...

Страница 225: ...ols used in a macro body When local symbols are expanded they will be expanded in the form XXXXX where XXXXX is in the range starting 00001 to 99999 Coding rules Symbols specified with the local directive should not be used outside the macro definition The local directive can be used only within macro definitions Local symbols should be used after they have been declared by the local directive If ...

Страница 226: ... loc 0 loc 1 local lst Page 1 Panax Series MN1030 Cross Assembler Loc Object Line Source M1 loc macro p1 2 local lab1 lab2 3 mov p1 D0 4 lab1 cmp 0 D0 5 jmp lab2 6 mov 1 A1 7 lab2 mov 0 A0 8 endm 9 10 _TEXT section CODE PUBLIC 1 M11 loc 0 M11 local lab1 lab2 00000000 8000 11 mov 0 D0 00000002 A000 11 00001 cmp 0 D0 00000004 DC00000000 11 jmp 00002 00000009 9501 11 mov 1 A1 0000000b 9000 11 00002 m...

Страница 227: ... are reversed when ifdef is used Coding rules In addition to ifdef endif all directives listed in chapter 10 Writing Assembler Control Statements section 10 5 Conditional Assembly can be used The exitm directive can be used at any location The assembler will terminate macro expansion after it appears The exitm directive can only be used within macro definitions Usage example Usage example with ifb...

Страница 228: ...section CODE PUBLIC 1 extm1 define TEST extm1 exitm lst Page 1 Panax Series MN1030 Cross Assembler Loc Object Line Source 1 global debug 2 M3 extm1 macro 4 mov 1 D0 5 ifndef TEST 6 exitm 7 endif 8 jsr debug 9 endm 10 11 _TEXT section CODE PUBLIC 1 M12 extm1 00000000 8001 12 mov 1 D0 12 ifndef TEST M12 exitm 13 define TEST M14 extm1 00000002 8001 14 mov 1 D0 14 itndef TEST 14x exitm 14 endif 000000...

Страница 229: ...d even if they are called They will be processed as instructions or symbols The purge directive cannot be used within macro definitions When multiple macro names are specified they are delimited by commas Usage example The following example illustrates the use of the purge control statement The above example contains two definitions for the same macro name The first instance of mac1 ex pands to a ...

Страница 230: ...ram or even within a macro definition Coding rules Symbols cannot be used within a block If used a double definition error will occur The local directive cannot be used either Further rept and irp directives and macro calls can be coded within a block Up to 20 nesting levels are allowed Usage example In the following example the rept directive is in a macro definition that is used twice in the pro...

Страница 231: ...030 Cross Assembler Loc Object Line Source M1 repeat macro p1 2 rept p1 3 add 1 D0 4 endm 5 endm 6 7 _TEXT section CODE PUBLIC 1 M8 repeat 2 M8 rept 2 8 add 1 D0 8 endm 00000000 2801 8 add 1 D0 00000002 2801 8 add 1 D0 M9 rept 3 10 add 1 D0 11 endm 00000004 2901 11 add 1 D0 00000006 2901 11 add 1 D0 00000008 2901 11 add 1 D0 ...

Страница 232: ... for the number of parameters Coding rules Symbols cannot be used within a block If used a double definition error will occur The local directive cannot be used either If a comma delimiters in a row are specified the corresponding parameter will be processed as though a null character had been specified To specify strings that include commas and spaces use the macro operator Usage example In the f...

Страница 233: ...Series MN1030 Cross Assembler Loc Object Line Source M1 init macro p1 2 irp opr p1 0x0f 3 mov opr D0 4 endm 5 endm 6 7 _TEXT section CODE PUBLIC 1 M8 init 1 M8 irp opr 1 0x0f 8 mov opr D0 8 endm 00000000 8001 8 mov 1 0x0f D0 M9 irp reg D2 D3 10 mov 0 reg 11 endm 00000002 8A00 11 mov 0 D2 00000004 8F00 11 mov 0 D3 ...

Страница 234: ...ansion replaces the dummy parameter with each character in turn repeated for the number of characters Coding rules The string cannot include the characters and Symbols cannot be used within a block If used a double definition error will occur The local directive cannot be used either A dummy parameter appearing in a string or character constant inside the irpc block is not expanded Usage example T...

Страница 235: ...Series MN1030 Cross Assembler Loc Object Line Source 1 _DATA section DATA PUBLIC 1 M2 irpc dummy 0123456789 3 dc dummy 4 endm 00000000 00 4 dc 0 00000001 01 4 dc 1 00000002 02 4 dc 2 00000003 03 4 dc 3 00000004 04 4 dc 4 00000005 05 4 dc 5 00000006 06 4 dc 6 00000007 07 4 dc 7 00000008 08 4 dc 8 00000009 09 4 dc 9 ...

Страница 236: ...Chapter 11 Writing Macro Control Statements 224 irpc ...

Страница 237: ...12 Chapter 12 List of Machine Language Instructions ...

Страница 238: ...guage instructions of this series microcomputers This comprehensive list of addressing modes and mnemonics for every instruction can be quite useful when you are coding machine language instruction statements If you need to know about the detailed operation of individual instructions refer to the MN1030 MN103S Series Instruction Manual ...

Страница 239: ...mats are methods for accessing an address specified as an address register s contents or as the sum of an address register s contents and a displacement Register indirect addressing Register relative indirect addressing Absolute addressing Index addressing Register indirect addressing Register indirect addressing specifies the address to access with the address register An RAM An 0 31 Address spec...

Страница 240: ...llowing three combinations 1 An address register An plus a sign extended 8 bit or 16 bit displacement or the stack pointer register SP plus a zero extended 8 bit or 16 bit displacement 2 An address register An or the stack pointer register SP plus a 32 bit displacement RAM 0 31 An SP 0 31 31 0 d16 d8 16 0 Address specification sign extended RAM 0 31 An SP 0 31 d32 31 0 Address specification ...

Страница 241: ...a sign extended 8 bit or 16 bit displacement or a 32 bit displace ment Absolute addressing Absolute addressing specifies the address to be accessed as a 16 bit or 32 bit displacement RAM 0 31 PC 0 31 31 0 d32 d16 d8 0 16 31 Address specification sign extended RAM abs32 abs16 0 31 Address specification ...

Страница 242: ...achine Language Instructions 230 Addressing Modes Index addressing Index addressing adds the contents of an address register An and a data register Dn to yield a displacement RAM 0 31 An 0 31 Dn 31 0 Address specification ...

Страница 243: ... bit immediate data specified with an instruction abs16 A 16 bit absolute address specified by the instruction abs32 A 32 bit absolute address specified by the instruction d Displacement data d8 8 bit offset data specified with an instruction d16 16 bit offset data specified with an instruction d32 32 bit offset data specified with an instruction MDR Multiply divide register LIR Loop instruction r...

Страница 244: ...sfers the contents of Dm to the memory location specified by An MOV Am An Transfers the contents of Am to the memory location specified by An MOVBU Am Dn Transfers with zero extension the 8 bit contents of the memory location specified by Am to Dn MOVBU Dm An Transfers the lowest 8 bits of Dm to the memory location specified by An MOVB Am Dn Transfers with sign extension the 8 bit contents of the ...

Страница 245: ...ified by An and 8 bit displacement d8 8 bit displacements are sign extended MOVBU d Am Dn Transfers with zero extension the 8 bit contents of the memory location specified by Am and displacement d to Dn 8 and 16 bit displacements are sign extended MOVBU d SP Dn Transfers with zero extension the 8 bit contents of the memory location specified by SP and displacement d to Dn 8 and 16 bit displacement...

Страница 246: ...he lowest 16 bits of Dm to the memory location specified by SP and displacement d 8 and 16 bit displacements are zero extended Index MOV Di Am Dn Transfers the 32 bit contents of the memory location specified by Di and Am to Dn MOV Di Am An Transfers the 32 bit contents of the memory location specified by Di and Am to An MOV Dm Di An Transfers the contents of Dm to the memory location specified by...

Страница 247: ...on specified by abs32 MOVB abs16 Dn Transfer with sign extension the 8 bit contents of the memory location specified by abs16 to Dn abs16 is zero extended MOVB abs32 Dn Transfer with sign extension the 8 bit contents of the memory location specified by abs32 to Dn MOVB Dm abs16 Transfer the lowest 8 bits of Dm to the memory location specified by abs16 abs16 is zero extended MOVB Dm abs32 Transfer ...

Страница 248: ...tend the lowest 8 bits of Dn to fill Dn EXTBU Dn Zero extend the lowest 8 bits of Dn to fill Dn EXTH Dn Sign extend the lowest 16 bits of Dn to fill Dn EXTHU Dn Zero extend the lowest 16 bits of Dn to fill Dn Mnemonic Description of operation MOVM SP regs Load the specified registers from a block in memory MOVM regs SP Save the specified registers to a block in memory Mnemonic Description of opera...

Страница 249: ...sign extended imm16 or imm32 to the contents of An and store the result in An ADD imm SP Add the sign extended imm8 sign extended imm16 or imm32 to the contents of SP and store the result in SP Mnemonic Description of operation ADDC Dm Dn Add the contents of Dm and the carry flag to Dn and store the result in Dn Mnemonic Description of operation SUB Dm Dn Subtract the contents of Dm from Dn and st...

Страница 250: ...unsigned integer dividend with its upper 32 bits in MDR and its lower 32 bits in Dn by the 32 bit unsigned divisor in Dm and store the 32 bit remainder in MDR and the 32 bit quotient in Dn Mnemonic Description of operation INC Dn Add 1 to the contents of Dn and store the result in Dn INC An Add 1 to the contents of An and store the result in An INC4 An Add 4 to the contents of An and store the res...

Страница 251: ...and store the result in Dn AND imm16 PSW AND imm16 with PSW and store the result in PSW Mnemonic Description of operation OR Dn Dm OR Dm with Dn and store the result in Dn OR imm Dn OR the zero extended imm8 zero extended imm16 or imm32 with Dn and store the result in Dn OR imm16 PSW OR imm16 with PSW and store the result in PSW Mnemonic Description of operation XOR Dm Dn XOR Dm with Dn and store ...

Страница 252: ...shift the contents of Dn right the number of bits specified by imm8 and store the result in Dn LSR Dn Logically shift the contents of Dn right one bit and store the result in Dn Mnemonic Description of operation ASL Dm Dn Arithmetically shift the contents of Dn left the number of bits specified in Dm and store the result in Dn Zeros enter from the least significant bit ASL imm8 Dn Arithmetically s...

Страница 253: ...t the flags according to the result 3 OR the temporary register with zero extended imm8 and store the lowest 8 bits of the result in the memory location specified with d8 and An BSET imm8 abs32 This instruction proceeds through the following three stages 1 Transfer with zero extension the 8 bit contents of the memory location specified with abs32 to a 32 bit internal temporary register 2 AND the t...

Страница 254: ...ion the 8 bit contents of the memory location specified with abs32 to a 32 bit internal temporary register 2 AND the temporary register with zero extended imm8 and set the flags according to the result 3 AND the temporary register with the ones complement of zero extended imm8 and store the lowest 8 bits of the result in the memory location specified with abs32 Mnemonic Description of operation ...

Страница 255: ...e the registers to be saved and the size of the stack area are not known and for situations requiring backward compatibility with JSR RET Restore saved registers from the stack free the stack area and branch to the return address saved on the stack RET is used paired with CALL and the funcinfo directive RETF Restore saved registers from the stack free the stack area and branch to the return addres...

Страница 256: ...is d16 PC the 16 bit displacement is sign extended and added to the program counter The result is stored in the program counter Any overflow during the addition is ignored The result is stored in the program counter If label is d32 PC the 32 bit displacement is added to the program counter The result is stored in the program counter Any overflow during the addition is ignored The result is stored ...

Страница 257: ...nstruction BHI label unsigned If CF 0 and ZF 0 execute a relative branch to the address specified by label Range 128 to 127 If CF 1 or ZF 1 execute next instruction BCC label unsigned CF 0 If CF 0 execute a relative branch to the address specified by label Range 128 to 127 If CF 1 execute next instruction BLS label unsigned If CF 1 or ZF 1 execute a relative branch to the address specified by labe...

Страница 258: ...on LLT signed If NF 1 and VF 1 or NF 0 and VF 0 branch to the top of the loop as specified with SETLB If NF 1 and VF 0 or NF 0 and VF 1 execute next instruction LHI unsigned If CF 0 and ZF 0 branch to the top of the loop as specified with SETLB If CF 1 or ZF 1 execute next instruction LCC unsigned CF 0 If CF 0 branch to the top of the loop as specified with SETLB If CF 1 execute next instruction L...

Страница 259: ...fined If nn is between 20 and 35 compute with the contents of Dm and Dn Do not store the result in Dn or modify the flags UDFnn imm Dn Compute with the contents of Dn and the sign extended imm8 sign extended imm16 or imm32 and store the result in Dn The nature of the calculation and the effects on the flags are user defined UDFUnn imm Dn If nn is between 00 and 15 compute with the contents of Dn a...

Страница 260: ...Chapter 12 List of Machine Language Instructions 248 List of Machine Language Instructions 12 3 7 Other Instructions NO OPERATION Mnemonic Description of operation NOP Do nothing ...

Страница 261: ...13 Chapter 13 Error Messages ...

Страница 262: ...f some state and consists of the marker Warning the warning number and the text of the message After displaying the warning message the assembler or linker con tinues processing An error message notifies the user of an error and consists of the marker Error the error number and the text of the message A fatal error message notifies the user of a system error and consists of the marker Fatal error ...

Страница 263: ...Chapter 13 Error Messages Assembler Errors 251 13 2 Assembler Errors The assembler displays three types of messages warning messages error messages and fatal error mes sages ...

Страница 264: ...os share the same name Change the names of the extra macros 2009 The usage of a series of instructions may be restricted in MN1030 103S series The usage of a series of instructions may be restricted in MN1030 series Careful operation is needed as some operations are not guaranteed Refer to the notes attentions or warnings written in MN1030 MN103S Series Instruction Manual for 32 bit and ensure tha...

Страница 265: ...warnings written in the Instruction Manual for 32 bit and ensure that the expected operation is guaranteed If it is not guaranteed modify the program 2012 Symbol name too long The symbol name exceeds the length limit Edit the symbol name so that its length is within the limit 2013 The line of the source file exceed 65535 lines Some pieces of debug information are not outputted for the instruction ...

Страница 266: ...smaller parts 2306 Multiple define symbol A symbol is defined more than once Use different symbol names 2307 Illegal symbol name There is an error in a symbol name Change the symbol name 2308 Label symbol is reserved word A reserved word is used as a label Change the label name 2309 Label not permitted A label specification is not permitted here Eliminate the label specification 2310 Label nothing...

Страница 267: ...lue Specify an absolute value for the operand 2320 Debug operand error The assembler and the C compiler have different version numbers Check that the assembler and C compiler are the most recent versions 2321 Illegal location counter The location counter value for an org direction has an illegal value Change the location counter value for the org directive 2322 Operand not need There is a superflu...

Страница 268: ...rective before the ret or retf machine instruction 2330 Line too long A source statement exceeds the length limit Edit the source statement so that its length is within the limit 2331 No optimizing information The map file does not contain optimization information Check the map file 2332 Error in configure file There is an error in the start up file Correct the start up file 2333 Illegal map file ...

Страница 269: ...fication Specify an output file 2505 Can t open filename file There is an error in the input output file specifications Alternatively the disk is full or defective In the former case check the file name specification in the latter check the disk 2506 Memory allocation error The assembler was unable to allocate memory Check the amount of memory available 2507 Data write error The assembler was unab...

Страница 270: ...Chapter 13 Error Messages 258 Linker Errors 13 3 Linker Errors The linker displays three types of messages warning messages error messages and fatal error messag es ...

Страница 271: ...alignment values Make sure that the attributes and alignment value for all sections with the same name agree across files 3002 Extra symbol name address aligned address The linker s alignment processing has changed the address assigned to the specified extra symbol Generate a map file and check the value for the extra symbol 3003 Address overlay with IRAM manager A section address overlaps the are...

Страница 272: ...parameter file includes another parameter file Edit the parameter file to eliminate the duplication 3307 Multiply defined symbol A symbol is defined more than once Check the symbol declarations 3308 Undefined symbol A symbol is undefined Check the symbol declarations 3309 filename Relocation address out of range line lineno The results of a relocatable address calculation are out of range Check th...

Страница 273: ...Linker Errors 261 3313 Extra symbol name used as normal symbol The extra symbol which is reserved for instruction RAM use is used in a context other than a PUT option Modify the program to use a different symbol in that context ...

Страница 274: ...not a relocatable object file Check the file name specification for errors 3506 filename This file is not a library file for MN1030 The input file is not a library file Check the file name specification for errors 3507 filename Invalid file information type type There is a problem with the specified file Reassemble the corresponding source file and check the disk for hardware errors 3508 filename ...

Страница 275: ...tion s layout overflows the upper bound of memory If a map file is available check that Re evaluate the options for specifying section layout or the program itself 3516 Section address overlay Sections have relocation address that overlap If a map file is available check that Re evaluate the options for specifying section layout or the program itself 3517 Not exist CODE section in external memory ...

Страница 276: ...Chapter 13 Error Messages 264 Linker Errors ...

Страница 277: ...14 Chapter 14 Readinig List Files ...

Страница 278: ...er This chapter explains how to read the list files output during assembly There are two types of information output in a list file Machine language code Symbol table This chapter also explains how to read the information added by individual options and the meanings of special symbols ...

Страница 279: ... List Files 267 14 2 Reading List Files Adding the l letter option when the assembler is invoked will generate the list file in the current directory List file contents are entirely in text format so those can be viewed by using an editor ...

Страница 280: ...byte are shown as two hexadecimal digits These are 1 byte 2 byte 3 byte and 4 byte instructions Machine language code supplemental information The characters M and may be added to the machine language code as supplemental information The meaning of each character is as follows This line includes an externally defined symbol whose value will be determined during linking The machine language code do...

Страница 281: ...dded when the assembler is invoked output of lines included by include directives will be suppressed X The suffix on the line number indicates a line that the assembler ignores and does not process During conditional assembly this is used for lines in the block of the unfulfilled condition If the Lc option is added when the assembler is invoked output of blocks of unfulfilled conditions will be su...

Страница 282: ... Source 1 include outlist h 1 data equ 0x12345678 2 3 global move 4 M5 load macro 6 mov A0 D0 7 mov D0 A1 8 add 4 A0 9 add 4 A1 10 endm 11 12 _TEXT section CODE PUBLIC 1 00000000 13 main 14 ifdef VERSION 15x mov data D0 16x mov D0 A0 17 else M18 load 00000000 70 18 mov A0 D0 00000001 61 18 mov D0 A1 00000002 2004 18 add 4 A0 00000004 2104 18 add 4 A1 00000006 70 19 mov A0 D0 00000007 61 20 mov D0 ...

Страница 283: ...ue is shown as eight hexadecimal digits Supplemental Information The symbol type may be preceded by a or This indicates an externally defined symbol This indicates an undefined symbol This indicates an externally referenced symbol Symbol Type This indicates the type of symbol All symbols can be classified into four types A U T and D A This indicates that the symbol value is absolute T This indicat...

Страница 284: ...ding List Files 272 Reading List Files Symbol Name Symbol names are shown up to 255 characters An output example of a symbol table is shown below listspl lst Page 2 Symbol Table 12345678 A data U move 00000000 T main ...

Страница 285: ...15 Chapter 15 Using Library Manager ...

Страница 286: ...r placing frequently used modules When a module is called from within a program the linker searches the library file extracts only the required relocatable object file and loads it in the executable format file The library manager is a utility for managing library files It can create library files and add delete replace and search for relocatable object files This chapter explains how to use the l...

Страница 287: ...d warning messages in Japanese Je Output error and warning messages in Japanese using EUC encoding Js Output error and warning messages in Japanese using Shift JIS encoding Jj Output error and warning messages in Japanese using JIS encoding e Output error and warning messages in English W number Do not output warning messages of the specified number Wall Do not output any warning messages Program ...

Страница 288: ...t machine and the operating system Rules of use To specify the option enter the hyphen followed by the lower case letter j slib103 test lib f j test1 rf test2 rf test3 rf NOTE This option is not available on PC AT machines Default specification The default language used depends on the host machine and the operating system j Output error and warning messages in Japanese Host machine Character codin...

Страница 289: ...e upper case letter J and the lower case letter e The two letters together function as a single option slib103 test lib f Je test1 rf test2 rf test3 rf NOTE This option is not available on DOS V or PC AT machines Default specification The default language used depends on the host machine and the operating system Je Output error and warning messages in Japanese using EUC encoding Host machine Messa...

Страница 290: ...y the upper case letter J and the lower case letter s The two letters together function as a single option slib103 test lib f Js test1 rf test2 rf test3 rf NOTE This option is not available on PC AT machines Default specification The default language used depends on the host machine and the operating system Js Output error and warning messages in Japanese using Shift JIS encoding Host machine Mess...

Страница 291: ... upper case letter J and the lower case letter j The two letters together function as a single option slig103 test lib f Jj test1 rf test2 rf test3 rf NOTE This option is not available on DOS V or PC AT machines Default specification The default language used depends on the host machine and the operating system Jj Output error and warning messages in Japanese using JIS encoding Host machine Messag...

Страница 292: ...glish Rules of use To specify the option enter the hyphen followed by the lower case letter e slib103 test lib f e test1 rf test2 rf test3 rf Default specification The default language used depends on the host machine and the operating system e Output error and warning messages in English Host machine Message language Sun Sparc English DOS V Japanese in Shift JIS PC AT English ...

Страница 293: ...To specify the option enter the hyphen followed by the upper case letter W and the number slib103 test lib W4001 o test1 rf test2 rf test3 rf Default specification The default is to display all warning messages Functional description This option suppresses output of all warning messages generated during library manager operation Rules of use To specify the option enter the hyphen followed by the l...

Страница 294: ...fy the option enter the hyphen followed by the lower case letter c slib103 test lib c test1 rf Operation example slib103 test lib c test1 rf test2 rf test3 rf test4 rf This example will create a library file called test lib from the four relocatable object files test1 rf test2 rf test3 rf and test4 rf NOTE slib103 cannot create a library file from an relocatable object file with the same name NOTE...

Страница 295: ... slib103 test lib f test1 rf Operation example slib103 test lib f test1 rf test2 rf test3 rf test4 rf This example will create a library file called test lib from the four relocatable object files test1 rf test2 rf test3 rf and test4 rf NOTE With slib103 files that mutually reference symbols cannot be placed in library files with the same name NOTE If specifying a file name with path name for relo...

Страница 296: ...table file test1 rf to the library file test lib Multiple files can be added with one a option To add test rf test2 rf and test3 rf to test lib specify the following slib103 test lib a test1 rf test2 rf test3 rf NOTE If any of the relocatable object files to add already exists in this library file the library manage will output an error messages and terminates without performing any processing If ...

Страница 297: ...Rules of use To specify the option enter the hyphen followed by the lower case letter d slib103 test lib d test1 rf Operation example slib103 test lib d test1 rf This example deletes the relocatable file test1 rf from the library file test lib Multiple files can be deleted with one d option To delete test1 rf test2 rf and test3 rf from test lib specify the following slib103 test lib d test1 rf tes...

Страница 298: ... and continue processing When no relocatable object file name is specified the externally defined symbols in all relocatable object files that exist in the library file will be output Rules of use To specify the option enter the hyphen followed by the lower case letter p slib103 test lib p Operation example slib103 test lib p test1 rf slib103 test lib p The first example checks whether or not the ...

Страница 299: ...fy the following to replace the relocatable object file test1 rf in the library file test lib slib103 test lib r test1 rf Multiple files can be replaced with one r option To delete test1 rf test2 rf and test3 rf from test lib specify the following slib103 test lib r test1 rf test2 rf test3 rf This example replaces the relocatable object files test1 rf test2 rf and test3 rf in test lib NOTE If spec...

Страница 300: ...output a warning message and continue processing When no relocatable object file name is specified the names of all relocatable object files that exist in the library file will be output Rules of use To specify the option enter the hyphen followed by the lower case letter t slib103 test lib t test1 rf Operation example slib103 test lib t test1 rf slib103 test lib t The first example checks whether...

Страница 301: ...ssing When no relocatable object file name is specified all relocatable object files that exist in the library file will be extracted Rules of use To specify the option enter the hyphen followed by the lower case letter x slib103 test lib x test1 rf Operation example slib103 test lib x test1 rf slib103 test lib x The first example checks whether or not the file test1 rf exists in test lib and if i...

Страница 302: ... doesn t exist is specified the library manager will display an error message Rules of use This option uses neither a hyphen nor an option letter Enter alone followed by the name of the parameter file slib103 pfile Default specification There is no default specification Operation example Assume that the file pfile contains the following line slib103 pfile slib103 test lib f test1 rf test2 rf test3...

Страница 303: ... letter h slib103 h Default specification The default is not to display this help information on the console NOTE If the h option is not used input of slib103 will also display help information Functional description This option displays the library manager s version number on the console Rules of use To specify the option enter the hyphen followed by the lower case letter v slib103 v Default spec...

Страница 304: ...rary manager continue processing An error message notifies the user of an error and consists of the marker error the error number and the text of the message A fatal error message notifies the user of a system error and consists of the marker Fatal error the error number and the text of the message The library manager aborts after displaying the message The following pages list the error messages ...

Страница 305: ...is file has no public symbol information filename There is no public symbol information for the file filename Check whether the file is actually needed 4003 filename not found In addition to library This message indicates that the file to be replaced does not exist in the library In this case slib103 adds the file to the library Check whether the object file to be replaced is in the library ...

Страница 306: ...is file is not library file for MN1030 filename The specified library file is not a library file Check the library file specification If it is correct the file is most likely corrupted so re create it 4307 Object file name not found An option calling for an object file name is missing an object file specification Check the option syntax 4308 Invalid file information type exist filename The specifi...

Страница 307: ...ame The library manager cannot read the parameter file because it contains illegal characters for example Check the parameter file for control characters and kanji codes outside comments If the parameter file passes this test the problem could be insufficient memory so check the memory capacity 4315 Not warning message number There is no warning message for the number specified with the W option C...

Страница 308: ... contains multiple library file specification Check the library file specification 4504 Memory allocation error The library manager was unable to allocate memory Check the amount of memory available 4505 Cannot open file filename The library manager was unable to open the specified file Make sure that the file name exists and has the proper access permissions 4506 Cannot read file filename The lib...

Страница 309: ...16 Chapter 16 Notes on Operating Environment ...

Страница 310: ...Chapter 16 Notes on the Operating Environment 298 Purpose of This Chapter 16 1 Purpose of This Chapter This chapter contains descriptions left out of other chapters ...

Страница 311: ...pter 16 Notes on the Operating Environment Personal Computer Versions 299 16 2 Personal Computer Versions This section contains notes on using the personal computer versions of the software in this package ...

Страница 312: ...vironment 300 Personal Computer Versions 16 2 1 Operating Environment This system runs on the following personal computers and compatibles Host Machine Operating System Version of OS PC AT Windows 98 2000 Me XP DOS V Windows 98 2000 Me XP ...

Страница 313: ...Using the Assembler LD103 EXE linker LD103 EXE is the linker For a description see the chapter 6 Using the Linker SLIB103 EXE library manager SLIB103 EXE is the library manager a utility for creating library files For a description see the chapter 15 Using the Library Manager EXCV103 EXE file conversion utility This utility converts an executable produced by the linker into a file in Motorola S fo...

Страница 314: ... 16 Notes on the Operating Environment 302 Personal Computer Versions 16 2 3 Installation For the installation media installation procedures and notes on installation see the MN1030 Series Installation Manual ...

Страница 315: ... This is the file that sets the MS DOS operating environment FILES specifies the number of files that can be read and written simultaneously BUFFERS specifies the size of memory used for reading writing disks AUTOEXEC BAT To be able to run the software simply by typing in its name include its directory in the path search list given by the environment variable PATH Under MS DOS adding the directory...

Страница 316: ...OS automatically runs when it loads SET is the command for setting MS DOS environment variables Application programs have free access to these variables Start up files The assembler and linker start by reading start up files that provides a means of changing initial settings For a detailed description see Chapter 1 Getting Started Section 1 5 Setup Paragraph Start Up Files and substitute the file ...

Страница 317: ...rsions of the assembler linker function and the library manager are exactly the same as their workstation counterparts Command line differences When specifying the command name omit the file extension EXE The personal computer versions use the forward slash and backslash as directory separators NOTE Example AS103 1 0 USER TMP SAMPLE RF SAMPLE ASM ...

Страница 318: ...fied and the assembler detects errors you can assemble again such that errors are not displayed to the screen but are redirected to an error files that the assembler generates The list file will include correct source statements in which errors were not detected while the file created by redirection will consist only of source statements in which errors were detected It is accordingly faster to ac...

Страница 319: ...ould be Tag JP This key specifies a tag jump so try pressing F10 The screen will switch and the cursor will be placed at the source file statement in which the error was detected Fix errors The cursor will be located on the fifth line Fix the error here Change move to mov That alone fixes the line Switch the screen again to the error file 5 move 0x11 D0 MAIN ASM 5 Error 2304 Instruction not found ...

Страница 320: ...y above and to the left of the period key When the screen switches to the error file the cursor will move to the next error line MAIN ASM 7 Error 2306 Multiple define symbol Press F10 for the source screen By repeating this procedure you can fix all the errors Supplemental Explanation You can use other editors that support tag jumps VZ Editor RED ...

Страница 321: ...17 Chapter 17 Appendix ...

Страница 322: ...tem Numeric Restriction Characters per symbol 255 characters Characters per line 1022 characters Lines per file Certain restrictions apply to source files with 65536 lines or more Item Numeric Restriction Number of OVL options 255 Item Numeric Restriction Section directives Number of distinct section names 255 Item Numeric Restriction Include nesting levels 3 levels ifXX nesting levels 255 levels ...

Страница 323: ...ppendix List of Command Options 311 17 2 List of Command Options How to read The entries in the command option tables below and their meanings are as follows option_name functional_description specification_example ...

Страница 324: ...sample asm l Output a list file as103 1 sample asm Li Do not output files included by include to the list file as103 Li l sample asm Lm Do not output assembler source created by macro expansion using macro or irp to the list file as103 Lm l sample asm Ls Do not output a symbol table to the list file as103 Ls l sample asm Lc Do not output source statements that were not assembled due to unfulfilled...

Страница 325: ...ing as103 Jj sample asm e Output error and warning messages in English as103 e sample asm W number Do not output warning messages of the specified number as103 W 2016 sample asm Wall Do not output any warning messages as103 Wall sample asm I path_name Specify the path name of the directory that contains files specified by include as103 I usr defs sample asm D identifier Specify an identifier to be...

Страница 326: ...Chapter 17 Appendix 314 List of Command Options Others h Display a listing of available assembler options on the console as103 h v Display the assembler s version number on the console as103 v ...

Страница 327: ...t ex main rf sub rf m Output a map file ld103 m main rf sub rf j Output error and warning messages in Japanese ld103 j main rf sub rf Je Output error and warning messages in Japanese using EUC encoding ld103 Je main rf sub rf Js Output error and warning messages in Japanese using Shift JIS encoding ld103 Js main rf sub rf Jj Output error and warning messages in Japanese using JIS encoding ld103 Jj...

Страница 328: ...nable output of DATA sections to the executable file ld103 Ed main rf sub rf l library_filename Specify a library file ld103 l usr local lib sample lib main rf sub rf L path_name Specify a pathname for library files ld103 L usr lib L usr local lib lsample lib main rf sub rf OVL ID_number section address Specify starting address for section in instruction RAM ldld103 T CODE 80000000 main rf sub rf ...

Страница 329: ...Chapter 17 Appendix List of Command Options 317 Others Specify a parameter file ld103 pfile h Display help information on the console ld103 h v Display the linker s version number on the console ld103 v ...

Страница 330: ...xpression Change the program address to the value special by expression expression label_name constant name section definition1 definition2 expression Sets the start of a section definition 1 section attribute CODE DATA definition 2 link type PUBLIC PRIVATE COMMON expression location counter boundary value power of 2 opt on off Enables disables optimization Syntax Function Notes symbol instruction...

Страница 331: ...area If expression2 initial value is specified the data area will be filled with that initial value If expression3 repeat count is specified this operation will be repeated for the specific number of times Syntax Function Notes symbol instruction operand tit string Specifies the header for the list file listoff Suppresses list output from the next line after this directives liston Resume list outp...

Страница 332: ...ntel format PANA Matsushita format radix expression Specifies the radix to be used by default The result of expression must be either 2 8 10 or 16 If the default is 10 and if extended C language format has been selected the radix will always be 10 regardless of the specification name funcinfo label expression register list Specifies additional information for a function name that appears as an ope...

Страница 333: ...e if expression block1 Assembles block1 if the expression is not 0 else endif block2 Assembles block2 if it is 0 nothing will be assembled if there is no else ifn expression block1 Assembles block1 if the expression is 0 else block2 endif Assembles block2 if it is not 0 nothing will be assembled if there is no else ifeq parameter1 parameter2 block1 Assembles block1 if parameter1 and parameter2 are...

Страница 334: ...othing will be assembled if there is no else else endif block2 ifge expression block1 Assembles block1 if the expression is zero or positive Assembles block2 if it is negative nothing will be assembled if there is no else else endif block2 ifb dummy_ parameter block1 Assembles block1 if dummy_parameter is a null character Assembles block2 if it is not equal nothing will be assembled if there is no...

Страница 335: ...BAT 301 B Blank Statements 125 C Character Constants 133 CLANG 160 Command Options 276 Comment Field 151 Comment Statements 124 Conditional Assembly 189 CONFIG SYS 301 D d 278 285 dc 166 Differences From Workstation Versions 303 Directive statements 121 Division 138 ds 167 dummy_parameter 202 dw 169 E e 95 279 Ed 102 En 102 end 158 endm 207 Environment Settings 301 equ 171 Error Messages 252 259 3...

Страница 336: ...Macro Control Statements 123 Macro Operators 211 macro_body 207 macro_name 207 209 Matsushita format 132 mnemonics 152 Modulo operator remainder 138 Multiplication 138 N notation 160 Numbers 130 O o filename 89 Object 268 Operand Field 150 Operation Field 149 Operators 138 opt 163 org 162 Output File Options 89 P p 281 286 page 164 PANA 160 Permitted Characters 129 Program Format 61 119 Program Ge...

Страница 337: ...ex 3 U Unary minus 138 Unary negation 139 Unary plus 138 Unconditional Branch Instructions 46 UND 142 Undefined 142 undefined 173 W W number 96 Wall 96 Warning Messages 313 X x 289 xlistoff 176 xliston 176 ...

Страница 338: ... 4 Index ...

Страница 339: ...Issued by Matsushita Electric Industrial Co Ltd Matsushita Electric Industrial Co Ltd MN1030 Series Cross Assembler User s Manual June 2004 12th Edition ...

Страница 340: ...6 2284 6898 Penang Office Suite 20 07 20th Floor MWE Plaza No 8 Lebuh Farquhar 10200 Penang Malaysia Tel 60 4 201 5113 Fax 60 4 261 9989 Johore Sales Office Menara Pelangi Suite8 3A Level8 No 2 Jalan Kuning Taman Pelangi 80400 Johor Bahru Johor Malaysia Tel 60 7 331 3822 Fax 60 7 355 3996 Thailand Sales Office Panasonic Industrial Thailand Ltd PICT 252 133 Muang Thai Phatra Complex Building 31st F...

Отзывы: