Panasonic MN1030 manuel d'utilisation
- Voir en ligne ou télécharger le manuel d’utilisation
- 340 pages
- 0.98 mb
Aller à la page of
Les manuels d’utilisation similaires
-
Laptop
Panasonic CF-Y4
68 pages 2.91 mb -
Laptop
Panasonic CF-72 Series P
36 pages 1.12 mb -
Laptop
Panasonic CF-T7
44 pages 2.1 mb -
Laptop
Panasonic CF-19 series
40 pages 2.63 mb -
Laptop
Panasonic PCG-GR150
99 pages 2.47 mb -
Laptop
Panasonic CF-28MCFAZ
9 pages 0.51 mb -
Laptop
Panasonic C3303N
42 pages 2.37 mb -
Laptop
Panasonic CF-W5
36 pages 4.68 mb
Un bon manuel d’utilisation
Les règles imposent au revendeur l'obligation de fournir à l'acheteur, avec des marchandises, le manuel d’utilisation Panasonic MN1030. Le manque du manuel d’utilisation ou les informations incorrectes fournies au consommateur sont à la base d'une plainte pour non-conformité du dispositif avec le contrat. Conformément à la loi, l’inclusion du manuel d’utilisation sous une forme autre que le papier est autorisée, ce qui est souvent utilisé récemment, en incluant la forme graphique ou électronique du manuel Panasonic MN1030 ou les vidéos d'instruction pour les utilisateurs. La condition est son caractère lisible et compréhensible.
Qu'est ce que le manuel d’utilisation?
Le mot vient du latin "Instructio", à savoir organiser. Ainsi, le manuel d’utilisation Panasonic MN1030 décrit les étapes de la procédure. Le but du manuel d’utilisation est d’instruire, de faciliter le démarrage, l'utilisation de l'équipement ou l'exécution des actions spécifiques. Le manuel d’utilisation est une collection d'informations sur l'objet/service, une indice.
Malheureusement, peu d'utilisateurs prennent le temps de lire le manuel d’utilisation, et un bon manuel permet non seulement d’apprendre à connaître un certain nombre de fonctionnalités supplémentaires du dispositif acheté, mais aussi éviter la majorité des défaillances.
Donc, ce qui devrait contenir le manuel parfait?
Tout d'abord, le manuel d’utilisation Panasonic MN1030 devrait contenir:
- informations sur les caractéristiques techniques du dispositif Panasonic MN1030
- nom du fabricant et année de fabrication Panasonic MN1030
- instructions d'utilisation, de réglage et d’entretien de l'équipement Panasonic MN1030
- signes de sécurité et attestations confirmant la conformité avec les normes pertinentes
Pourquoi nous ne lisons pas les manuels d’utilisation?
Habituellement, cela est dû au manque de temps et de certitude quant à la fonctionnalité spécifique de l'équipement acheté. Malheureusement, la connexion et le démarrage Panasonic MN1030 ne suffisent pas. Le manuel d’utilisation contient un certain nombre de lignes directrices concernant les fonctionnalités spécifiques, la sécurité, les méthodes d'entretien (même les moyens qui doivent être utilisés), les défauts possibles Panasonic MN1030 et les moyens de résoudre des problèmes communs lors de l'utilisation. Enfin, le manuel contient les coordonnées du service Panasonic en l'absence de l'efficacité des solutions proposées. Actuellement, les manuels d’utilisation sous la forme d'animations intéressantes et de vidéos pédagogiques qui sont meilleurs que la brochure, sont très populaires. Ce type de manuel permet à l'utilisateur de voir toute la vidéo d'instruction sans sauter les spécifications et les descriptions techniques compliquées Panasonic MN1030, comme c’est le cas pour la version papier.
Pourquoi lire le manuel d’utilisation?
Tout d'abord, il contient la réponse sur la structure, les possibilités du dispositif Panasonic MN1030, l'utilisation de divers accessoires et une gamme d'informations pour profiter pleinement de toutes les fonctionnalités et commodités.
Après un achat réussi de l’équipement/dispositif, prenez un moment pour vous familiariser avec toutes les parties du manuel d'utilisation Panasonic MN1030. À l'heure actuelle, ils sont soigneusement préparés et traduits pour qu'ils soient non seulement compréhensibles pour les utilisateurs, mais pour qu’ils remplissent leur fonction de base de l'information et d’aide.
Table des matières du manuel d’utilisation
-
Page 1
MICROCOMPUTER MN1030 MN1030 Series Cross Assembler User’s Manual Pub.No.13110-120E[...]
-
Page 2
[...]
-
Page 3
PanaXSeries is a trademark of Matsus hita Electric Industrial Co., Ltd. Sun and Sun OS are registered trademarks of Sun Microsystems Inc. of the United States. MS-DOS is a registere d trad em ark of Mi crosoft Corporation of the United States. VZ Editor is a registered tr ademark of Village Center, Inc. PC/AT is a registered trad emark of the Inter[...]
-
Page 4
< About This Manual 1 > About This Manual This manual describes the functions and op eration of th e cross assembler for this series of micr ocomputers. • Manual Features • Chapters on installation, program develo pment fl ow, and introducto ry op eration are provided, so first-time users can quickly get an overview and easily master oper[...]
-
Page 5
<About This Manual 2 > • How to read • Heading Chapter titles are shown here on each page, so the reader can get a quick idea of contents while flipping through the pages. • Program example These are actual examples of co mmand options and instructions used by the assembler. First- time users should refer to these exam ples when trying [...]
-
Page 6
< About This Manual 3 > • Related Manuals The following related manuals are available. Please contact our sales representative for more details. • MN1030/MN103S Series Instruction Man ual <Describes the instruction set> • MN1030 Series C Compiler Us er's Manual: Usage Guide <Describes the installation, the comm ands, and o[...]
-
Page 7
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 index Chapter 1 Getting Started Chapter 2 Program Development Flow Chapter 3 Introdu ction to Operation Chapter 4 Optimization Chapter 5 Using Assembler Chapter 6 Using Linker Chapter 7 Types of Source Statements Chapter 8 Writing Source Statements Chapter 9 Writing Machine Language Instruction Statements[...]
-
Page 8
< 1 TOC > Table of Contents Chapter 1 Getting Started 1.1 Purpose of This Chapter ............. ................. .............. ................. ................. .............. ...... ........ ... .............. .. 2 1.2 Operating Environment ........ ................. .............. ................. ................. .............. .....[...]
-
Page 9
< TOC 2 > 6.2 Starting Linker ................... ................. ................. .............. ................. .............. .............. .............. ........... 85 6.3 Command Options ..................... .............. ................. .............. ................. .............. ............... ................ ... 88 6.[...]
-
Page 10
< 3 TOC > 9.4.4 listoff, liston ..................... ................. ................. .............. ................. .............. .............. ............... 159 9.4.5 notation ....................... ................. .............. ................. .............. ................. .. .................. ............... 160 9.4.6 [...]
-
Page 11
< TOC 4 > 12.3.1 Data Move Instructions ......................... .............. ................. ................. .............. .. ............ ......... 232 12.3.2 Arithmetic Instructions ........... .............. ................. ................. ................. ............ ............. ... ...... 237 12.3.3 Logical Instructions [...]
-
Page 12
< 5 TOC > 16.2. 6 Error Correction Using Tag Jumps ..................... ................. ................. ................ ........ ......... .... 306 Chapter 17 Appendix 17.1 Numeric Restrictions ................... ................. ................. .............. ................. ................ ........................ 310 17.2 List[...]
-
Page 13
1 Chapter 1 Getting S tarted[...]
-
Page 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.[...]
-
Page 15
Chapter 1 Getting Started Operating Environment 3 1.2 Operating Environment This system runs on the following workstations, personal compu ters and com pati bles. For the PC/AT and compatibles, because of such diff erences as the ability to displa y Japanese, this Manual indicates a machine running the Engl ish-only operating system as a PC/AT and [...]
-
Page 16
Chapter 1 Getting Started 4 File Organization 1.3 File Organization The installation media fo r thi s system contain the following files. as103 (assembler) as103 is the assembler. For a descrip tion, see Chapter 5 "Using Assembler." ld103 (linker) ld103 is the linker. For a description, see Chapter 6 "Using Linker." slib103 (lib[...]
-
Page 17
Chapter 1 Getting Started Installation 5 1.4 Installation For the installation media, instal lation procedures , and notes on installation, see the Inst allation Manual.[...]
-
Page 18
Chapter 1 Getting Started 6 Setup 1.5 Setup These procedures are for setting up this system wh en it has just been installed or for altering basic settings. Setting command path Unix uses the environment variable PATH when searching for executable files. Setting up thi s variable properly allows users to omit the directory name for commands and run[...]
-
Page 19
Chapter 1 Getting Started Setup 7 NOTE: Note that the command line is preced ed when specifying the option wh ich ca n be set in an environmen tal setting file with the command line at starting the assembler a nd the linker. Refer to the Chapter 5 “Using Assembler” for the assembler and to the Chapter 6 “Using Link er” for the linker. The o[...]
-
Page 20
Chapter 1 Getting Started 8 Setup The start-up file .as103rc supports the follo win g keywords. The start-up file .ld103rc supports the following keyboards. Keyword Des cription message This entry specifies the language and coding scheme for messages from the assembler. One of the parameters ENGLISH, EUC, SJIS , or JIS comes after the keyword “me[...]
-
Page 21
Chapter 1 Getting Started Setup 9 En-OPTION This entry controls the output of debu ggi ng of the symbol table to the executable file . Either ON or OFF of the parameters comes after the keyword En-OPTION followed by a blank space. These parame ters have the following meanings. En-OPTION ON Disable output of the symbol table to the executable file. [...]
-
Page 22
Chapter 1 Getting Started 10 File Conversion Utility 1.6 File Conversion Utility This file conversion utility converts an EX form at fil e prod uced by th e linker into a file in Intel HEX format, or Motorola S format. General command format The general command format used to start th e file conversion utility is shown below. excv103 [options] EX f[...]
-
Page 23
Chapter 1 Getting Started File Conversion Utility 11 Default specification See the default setting s for the following operations. Rules of output file name Based on input file name or the file name specified with “o” option, change th e extension . It is an output file name. The rules are di fferent from each option specified. In addition, a f[...]
-
Page 24
Chapter 1 Getting Started 12 File Conversion Utility Example of specifying options 1. Specify the range of data conversion. (-R) excv103 -R1000, 1020 sample.ex Converts the data between the address 1000 an d the address 1020 in the file of sample.ex. 2. Specify the start address upon form at conv ersion. (-A) excv103 -A1000 sample.ex In the file of[...]
-
Page 25
2 Chapter 2 Program Development Flow[...]
-
Page 26
Chapter 2 Program Development Flow 14 Purpose of This Chapter 2.1 Purpose of This Chapter Programs can b e developed with a compiler or an assembler. Currently most program dev elopment is done with a compiler, but an assembler i s where compact code generation or faster processing speed is required. This chapter gives an overview of development w [...]
-
Page 27
Chapter 2 Program Development Flow Program Development Flow 15 2.2 Program Development Flow Main development flow The microcomputers are used in such diverse appl ications as AV equipment, household electronics, information equipment, automob iles, robots, po rt able phones, computer peripherals, etc. Programs developed with the Cross-Assem bler ar[...]
-
Page 28
Chapter 2 Program Development Flow 16 Program Development Flow Source code debugger The software developed on a workstation or personal com put er mu st be checked using a hardware environment similar to that used by the final pr od uct. Nearly all of this seri es microcomputers will ulti matel y be incorporated within end products. Therefore, prog[...]
-
Page 29
Chapter 2 Program Development Flow Programming with Assembler 17 2.3 Programming with Assembler Before creating programs using the assembler, you must understand the follo wing items. Required knowledge • Machine-language instructions • Device operation • Editor use • C compiler use • Assembler and linker use (in this manual) • Debugger[...]
-
Page 30
Chapter 2 Program Development Flow 18 Programming with Assembler Programming style It is important to use a consistent style for program coding from start to finish. When several peopl e are to create a program, they should meet in advance to decide on a common style. You should consider the follo wing points regarding the fixed style of the Cross [...]
-
Page 31
Chapter 2 Program Development Flow Programming with Assembler 19 Conditional assembly If a program for pro duct A is to be created b y partially modifying a p rogram for product B, bo th can be combined into a single program by using conditional assembler control inst ructions. Conditional assembly is done by defin ing a single symbol at the start [...]
-
Page 32
Chapter 2 Program Development Flow 20 Programming with Assembler[...]
-
Page 33
3 Chapter 3 Introdu ction to Operation[...]
-
Page 34
Chapter 3 Introduction to Operation 22 Purpose of This Chapter 3.1 Purpose of This Chapter Many options are provided with the Cross-Assembler and Link er, but you can use the assembler and linker without knowing all of them. This chapter explains how to use the most useful options whi le demonstrating actu al operation. This chapter first uses an e[...]
-
Page 35
Chapter 3 Introduction to Operation Files Used by Assembler and Linker 23 3.2 Files Used by Assembler and Linker Figure 3-1 shows the inter-relationships of the files used by the assembler and lin ker. Figure: 3-1 Files Used The assembler inputs source file s and include files, and output s relocatable object files. Include files are not special fi[...]
-
Page 36
Chapter 3 Introduction to Operation 24 Files Used by Assembler and Linker Depending on the option specificatio ns inpu t for the source file and map file, a list file will be output with fully resolved addresses. The map file is used to output a list file with fully resolved ad dresses. The linker inputs relocatable object files ou tput by the asse[...]
-
Page 37
Chapter 3 Introduction to Operation Basic Operation of Assembler and Linker 25 3.3 Basic Operation of Assembler and Linker The Cross-Assembler uses a sectio n address format, in which the st art address for each section as defined with the section directive corresponds to its start address when li nked. This allows the programmer to freely change t[...]
-
Page 38
Chapter 3 Introduction to Operation 26 Basic Operation of Assembler and Linker The contents of program2.asm are as follows. program2.asm also consists of a section called _C ODE (attribute CODE, link type PUBLIC), and it makes an external declaration of data_set. Assemble Assemble the two programs that you creat ed to generate relocatable object fi[...]
-
Page 39
Chapter 3 Introduction to Operation Basic Operation of Assembler and Linker 27 Link Link the two relocatable object files to gen erate an executable format file. A map file will be generated along with the executable fo rmat file at this time. ld103 -m -T_CODE=40000000 program1.rf program2.rf m option Option to output map file. T option Option to s[...]
-
Page 40
Chapter 3 Introduction to Operation 28 Basic Operation of Assembler and Linker The contents of the final list fi le program1.lst are as follows. program1.lst Page 1 *** PanaX Series MN1030 Cross Assemble r *** Loc Object 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 0[...]
-
Page 41
Chapter 3 Introduction to Operation Basic Operation of Assembler and Linker 29 The contents of the final list file program2.lst are as follows. Here is a simple explanation of how to read the list files. A list file shows fou r items of information. Source statements and machine language cod e • Source statements and machine language code • Sym[...]
-
Page 42
Chapter 3 Introduction to Operation 30 Assembling and Linking Multiple Sections 3.4 Assembling and Linking Multiple Sections In section 3.3, "Basic Operatio n of the Assembler and Linker", source files each comprising one section were assigned to the same section as a ba sic example. However, normally a program will be divided into multip[...]
-
Page 43
Chapter 3 Introduction to Operation Assembling and Linking Multiple Sections 31 The contents of program 4.asm are as follows. As can be seen from the above two files, these pro grams are divi ded as follows. • main, time_filler ..._CODE_00 • data_set ..._CODE_01 • data1 ..._DATA Assemble and gener ate list files Next assemble the two programs[...]
-
Page 44
Chapter 3 Introduction to Operation 32 Assembling and Linking Multiple Sections generate list files (program 3.lst and program4.lst) respectively in the curr ent dir ecto r y (l option). Adding debug informati on (g option) enables symbols to be used during debuggi ng. Let's take a look at the list files that were created. The contents of the [...]
-
Page 45
Chapter 3 Introduction to Operation Assembling and Linking Multiple Sections 33 The contents of the list file program4.lst are as follows. Note that the symbol table is not disp layed. This file is defined as two sections. The addresses of the starting lo cat ions of both sections is assumed 00000000. The plus signs in lines 14 and 27 have the same[...]
-
Page 46
Chapter 3 Introduction to Operation 34 Assembling and Linking Multiple Sections Link Link the two relocatable object files to generate an executable format file. Specify the g option to add debug information to the execut able fo rmat file. A>ld103 -m -g -T_CODE_00 =800 0000 00 -T_C ODE_01=8000500 0 pro gram3.rf program4.rf m option Option to ou[...]
-
Page 47
Chapter 3 Introduction to Operation Assembling and Linking Multiple Sections 35 Generate final list files After link processing is complete, ge nerate the final l ist files using the map file (program3.MAP). This will show what happen s to the previous '+' and 'R' marks. as103 -l -a m103.map program3.asm as103 -l -a m103.map pro[...]
-
Page 48
Chapter 3 Introduction to Operation 36 Assembling and Linking Multiple Sections The contents of the final list fi le program4.lst are as follows. Note that the symbol tabl e is not displ ayed. In this file the '+' on line n umbers 14 and 27 have disappeared, and the start ad dress of the first section _CODE_01 has been changed to address [...]
-
Page 49
Chapter 3 Introduction to Operation Assembling and Linking Multiple Sections 37 program locations after linking program locations in the executable file after linking as above are shown below. Figure: 3-2 pro gra m Location If the program contains multiple sect ions, it is laid ou t using the following rules. • Each section is assigned the starti[...]
-
Page 50
Chapter 3 Introduction to Operation 38 Conditional Assembly and Linking 3.5 Conditional Assembly and Linking The Cross-Assembler provides many assembler direct ives. Assembler directives are not converted directly to machine language , but are used to control how the ass embler processes. For example, during the devel opmen t stage a programmer may[...]
-
Page 51
Chapter 3 Introduction to Operation Conditional Assembly and Linking 39 Assemble and link Assemble and link the program that you have creat ed. as103 program5.asm ld103 -m -T_CODE=400000000 program5.rf as103 -l -a m103. program5.asm The first assembly generates the relocatable object fi le program5.rf. The second assembly generates the final list f[...]
-
Page 52
Chapter 3 Introduction to Operation 40 Conditional Assembly and Linking Select false condition, assemble, and link Make the define source statement line into a comment line, or just delete it. Then assemble and link with the same procedure as before. as103 program5.asm ld103 -m -T_CODE=40000000 program5.rf as103 -l -a m103.map program5.asm The cont[...]
-
Page 53
Chapter 3 Introduction to Operation Conditional Assembly and Linking 41 In the previous file, you eith er deleted the define li ne or made it into a comment, so you can use it to once again select the true condition. as103 -D DEBUG program5.asm ld103 -m -T_CODE=40000000 program5.rf as103 -l -a m103.map -D DEBUG program5.asm D option Option to speci[...]
-
Page 54
Chapter 3 Introduction to Operation 42 Conditional Assembly and Linking[...]
-
Page 55
4 Chapter 4 Optimization[...]
-
Page 56
Chapter 4 Optimization 44 Purpose of This Chapter 4.1 Purpose of This Chapter The assembler and linker examine source statements containin g cond itio nal branches, unconditional branches, subroutine calls, data tran sfer instructions, arithmetic instructions, logical instructions, bit manipulation instructio ns, and user-defined instruc tions to d[...]
-
Page 57
Chapter 4 Optimization Rules of Usage 45 4.2 Rules of Usage To use the optimization function, opt imization must be turn ed 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[...]
-
Page 58
Chapter 4 Optimization 46 Usage Example 4.3 Usage Example Optimization Instructions Optimization covers the following conditional branches, unco nditional branches, su broutine calls, data transfer instructions, arithmetic instructions, logical instructions, bit manipulation instructions, an d user-defined instructions. T able 4-1 Optimized Conditi[...]
-
Page 59
Chapter 4 Optimization Usage Example 47 T able 4-3 Dat a T ransfer Instructions Subject T o Optimization Instruction T ype Branch Range MOV (abs), An Absolute addressing 16M-byte memory space MOV (abs), Dn MOV An, (abs) MOV Dn, (abs) MOVBU (abs), Dn MOVBU Dn, (abs) MOVB (abs), Dn MOVB Dn, (abs) MOVHU (abs), Dn MOVHU Dn, (abs) MOVH (abs), Dn MOVH Dn[...]
-
Page 60
Chapter 4 Optimization 48 Usage Example T able 4-4 Arithmetic Instructions Subje ct T o Optimization Instruction T ype Branch R ange ADD imm, An Immediate addressing 32-bit immediate data ADD imm, Dn ADD imm, SP AND imm, Dn CMP imm, An CMP imm, Dn T able 4-5 Logical Instruct ions Subject T o Optimizatio n Instruction T ype Branch R ange OR imm, Dn [...]
-
Page 61
Chapter 4 Optimization Usage Example 49 Optimization processing The assembler informs the linker about all instructions t o be optimized. Based on th e information from the assembler, the lin ker outputs instru ction codes with the sm allest code size. T able 4-7 Data T ransfer Instructions Subject T o Optimization Instruction T ype Branch Range UD[...]
-
Page 62
Chapter 4 Optimization 50 Usage Example Optimization processing of conditional branch instructions The linker resolves address values for la bels when linking multiple files. In the example below, the linker will d etermine whether or not the label coded as an operand is within the allowable range of the current instruction. If not in range, the li[...]
-
Page 63
Chapter 4 Optimization Usage Example 51 Optimization of function calls This section describes the optimization of function calls by the link er. The assembler provides advanced processing for functio n calls. This processing uses a combinat ion of the call and ret instructions and the global and fu ncinfo directives. The fo llowing is an example. ([...]
-
Page 64
Chapter 4 Optimization 52 Usage Example Optimization of branches For unconditional branch in structions, a JMP label instruction is replaced by a BRA label instruction if the jump target is within the range available for the shorter, relative branch instruction BRA . Similarly, a CALL label, CALLS label, or JS R label instruction is replaced by the[...]
-
Page 65
Chapter 4 Optimization Usage Example 53 Optimization of data transfer, arithmetic, logica l, bit manipulati on and user-defined instructions For data transfer, arithmet ic, logical, bit manipulati on, and user-defined instructions, the assembler uses the shortest instruction available for expressing the specified immediat e data, memo ry address, o[...]
-
Page 66
Chapter 4 Optimization 54 Usage Example MOVH (d,SP),Dn MOVH (d8,SP),Dn MOVH (d16,SP),Dn MOVH (d32,SP),Dn MOVH Dn,(abs) MOVH Dn,(abs16) MOVH Dn,(abs32) MOVH Dn,(d,An) MOVH Dn,(d8,An) MOVH Dn,(d16,An) MOVH Dn,(d32,An) MOVH Dn,(d,SP) MOVH Dn,(d8,SP) MOVH Dn,(d16,SP) MOVH Dn,(d32,SP) ADD imm,An ADD imm8,An ADD imm16 ,An ADD imm32,An ADD imm,Dn ADD imm8[...]
-
Page 67
Chapter 4 Optimization Usage Example 55 Example: branch destinati on of conditional branch instructio n within range This example shows a branch in the permitted range (-128 to 127 of PC) of a BCC LABEL conditi onal branch instruction. The source list is as follows. The final list file after assembly is shown next. The start address during linking [...]
-
Page 68
Chapter 4 Optimization 56 Usage Example Example: branch destination of condition al branch instruct ion out of range This example shows a branch outside the permitted range (-128 to +127 of PC) of a BCC LABEL con- ditional branch instruct ion . The source list is as follows. The final list file after assembly is shown next. LABEL exceeds the permit[...]
-
Page 69
Chapter 4 Optimization Usage Example 57 Example: unconditional br anch instruction convert ed to relative branch This example shows the branch de stination of a JMP LABEL unconditional branch instru ction within the permitted range (-128 to +127 of PC) for relative branching. The source list is as follows. The final list file after assemb ly is sho[...]
-
Page 70
Chapter 4 Optimization 58 Usage Example Example: subroutine call c onverted to a relative branch This section gives an example of a CALLS LABEL inst ruction with a target address within the range of a relative jump--that is, between -32,768 and +32,767 from the current prog ram counter. The source list is as follows. The final list file after assem[...]
-
Page 71
5 Chapter 5 Using Assembler[...]
-
Page 72
Chapter 5 Using Asssembler 60 Purpose of This Chapter 5.1 Purpose of This Chapter This Chapter describes assembler operating proced ures. Chapter 3 "Introduction to Operation" described the basic operation of the assembler and li nker, but this one descri bes the man y opti ons available with the assembler and gives examples.[...]
-
Page 73
Chapter 5 Using Assembler Starting Assembler 61 5.2 Starting Assembler The assembler is started by entering the comman d name and the desired parameters. The command name differs depending on the device being used. Th is chapter uses the terminology of as103 as its general format. General format of commands Below is the general format of the comm a[...]
-
Page 74
Chapter 5 Using Asssembler 62 Starting Assembler Summary of options The following Table lists the available command line options. T able 5-1 Assembler Options Option T ype Symbol Description Output file o file_name Specify the relocatable object file name to be output. l Output a list file. Li Do not output files in cluded by include to the list fi[...]
-
Page 75
Chapter 5 Using Assembler Command Options 63 5.3 Command Options This section describes the options available for th e assembler. The assembler has an abundance of options for controlling assem bler pro cessing and output files. Not all options are available at the same time. Certai n options have default values that are used when the option is not[...]
-
Page 76
Chapter 5 Using Asssembler 64 Command Options 5.3.1 Output File Options Functional description This option specifies the relocatable ob ject file nam e to be output by th e assembler. If the specified file already exists, its prev ious contents will be erased. If a path name that does not exist is specified, the assembler will display an error mess[...]
-
Page 77
Chapter 5 Using Assembler Command Options 65 Functional Description This option outputs a list file. The file name of th e list file will be the source fil e name with the extension .lst. The list file will be generated in the same directory as the source file. If any assembler errors are det ected, error information will also be written to the lis[...]
-
Page 78
Chapter 5 Using Asssembler 66 Command Options Functional Description This option suppresses output of source file contents inclu ded by assemb ler di rective (include) to the list file. However, the machine lan guage code will be written to the relocatable object file. This option is convenient when you need a listi ng only for a particular source [...]
-
Page 79
Chapter 5 Using Assembler Command Options 67 Functional Description This option suppresses output of assembler source created by macro expansion using macro directives macro and irp to the list file. Only display of m achine language inst ruct ion mnemonics will be suppressed; machine language code will be output. By using names that represent thei[...]
-
Page 80
Chapter 5 Using Asssembler 68 Command Options Functional Description This option suppresses output of blocks of unsatisfied con ditions with conditional assem bl y to the list file. It also suppresses source stat ements of conditional directives. Rules of Use This option is speci fied with the h yphen (-) option specification character, fo llowed b[...]
-
Page 81
Chapter 5 Using Assembler Command Options 69 Functional Description This directive suppresses output of a symbol table when the list file is output. Rules of Use This option is specified with the hyphen (-) optio n specification character, followed by the upper-case letter 'L' and lower-case letter 's'. The pair of characters of[...]
-
Page 82
Chapter 5 Using Asssembler 70 Command Options 5.3.2 Error Message Options Functional Description This option causes all error and warning messages and help screens sen t to the console or the listing file to appear in Japanese. The character coding depends on the host machine and the operating system. Rules of Use To specify the option, enter the h[...]
-
Page 83
Chapter 5 Using Assembler Command Options 71 Functional Description This option causes all error and warning messages and help screens sent to the console or th e listing file to appear in Japanese using EUC coding. Rules of Use To specify the option, enter the hyphen (-) foll owed by the upper case letter 'J' and the lower case letter &a[...]
-
Page 84
Chapter 5 Using Asssembler 72 Command Options Functional Description This option causes all error and warning messages and help screens sen t to the console or the listing file to appear in Japanese using Shift JIS coding. Rules of Use To specify the option, enter the hyphen (-) followe d by the upper case letter 'J' and the lower cas e l[...]
-
Page 85
Chapter 5 Using Assembler Command Options 73 Functional Description This option causes all error and warning messages and help screens sent to the console or th e listing file to appear in Japanese using JIS coding. Rules of Use To specify the option, enter the hyphen (-) foll owed by the upper case letter 'J' and the lower case letter &a[...]
-
Page 86
Chapter 5 Using Asssembler 74 Command Options Functional Description This option causes all error and warning messages and help screens sen t to the console or the listing file to appear in English . Rules of Use To specify the option, enter the hyphen (-) follo wed by th e lower case letter 'e'. as103 -e sample.asm Default Specification [...]
-
Page 87
Chapter 5 Using Assembler Command Options 75 Functional Description This option suppresses output of warnin g messages generated during assem bler operation. For a list of warning messages an d their numbers, see Chapter 13 "Error Messages." The assembler ignores specifications for warning numbers that do not have messages assigned t o th[...]
-
Page 88
Chapter 5 Using Asssembler 76 Command Options 5.3.3 Preprocessor Options Functional Description Trace from the directory that specifi es the include file in the assembler source file. If the absolu te path starting with “/” is written, tis op tion is invalid. Assembler traces the in clude file from the directory as follows. 1. Directory contain[...]
-
Page 89
Chapter 5 Using Assembler Command Options 77 Functional Description The assembler directives #ifdef, #else, and #endif se lect which source statements are to be assembled depending on whether an identifier has been defined by a define directive. The D opt ion has the same function as th e define direct ive, but with direct specification fr om th e [...]
-
Page 90
Chapter 5 Using Asssembler 78 Command Options 5.3.4 Program Generation Options Functional Description This option causes the assembler to i nclude in the relocatable object file information for use in debugging at t he source code level. This informatio n includes the follo w in g: • Names and addresses of variables • Detailed information on va[...]
-
Page 91
Chapter 5 Using Assembler Command Options 79 Functional Description This option enables optimization of instructions by th e assembler and linker. For the instructio ns subject to optimizatio n, see Chapter 4 "Opti mization Function s ." Rules of Use To specify the option, enter the hyphen (- ) followed by the upper case letter 'O&ap[...]
-
Page 92
Chapter 5 Using Asssembler 80 Command Options 5.3.5 Other Options Functional Description This option displ ays assembler command options and their descript ions to the screen. The -j, -Je, -Js, -Jj, and -e options, if they appear , control the language and the coding scheme used to display this informati on. Rules of Use To specify the option, ente[...]
-
Page 93
Chapter 5 Using Assembler Operation Examples 81 5.4 Operation Examples There are three steps to perfor m when you need a final list file with resolved addresses. 1. With the assembler, generate a relocatable object file (.rf). 2. With the linker, generate an executable format file (.ex) and map file (.ma p) . 3. With the assembler again, use the ma[...]
-
Page 94
Chapter 5 Using Asssembler 82 Operation Examples Generation of final list file with resolved program addresses The final list file is generated as follows. 1. First use the assembler to generate a relocatable object file. Valid options at this stage are o, I, D, g, and the opti mization options (O, Od). 2. Next use the linker to generate an executa[...]
-
Page 95
6 Chapter 6 Using Linker[...]
-
Page 96
Chapter 6 Using Linker 84 Purpose of This Chapter 6.1 Purpose of This Chapter This chapter explains how to use all the options provided by the linker. The linker reads relocatable object files output by the assembler, outputs an executable format file, an d if specified by option outputs a map file containing link information. If op timization was [...]
-
Page 97
Chapter 6 Using Linker Starting Linker 85 6.2 Starting Linker The linker is started by entering a command name and parameters, just as for other MS-DOS external commands. The parameters are linker options and nam e s of files to be linked . The command name differs depending on the dev ice being used. This chapter uses the terminology of ld103 as i[...]
-
Page 98
Chapter 6 Using Linker 86 Starting Linker Parameters can be specified right after the option character or separated by one space. -T@CODE=80000000 or -T @CODE=80000000 When options are omitted, assembly will be performed in acco rdan ce with the default interpretations built in to the assembler. Refer to section 6. 3, "Command O ptions," [...]
-
Page 99
Chapter 6 Using Linker Starting Linker 87 Summary of Options T able 6-1 Linker options Option T yp e Symbol Description Output file options o filename Specify the path name and file name of the executable format file to be output. m O utput a map file Error message options j Output error and warning messages in Japanese. Je Output error and warning[...]
-
Page 100
Chapter 6 Using Linker 88 Command Options 6.3 Command Options This section describes the options used by the linker. The lin ker has man y options for controlling output file specifications and the inform ati on written to files. The linker reads multiple rel ocatable object files, links them into one, an d creates an executable format file. If opt[...]
-
Page 101
Chapter 6 Using Linker Command Options 89 6.3.1 Output File Options Functional description This option specifies the directory an d file name of the executable format file to be outp ut by the linker. If the directory is omitted, the file will be output to the current directory. If a file name that already exists is specified, that file will be ove[...]
-
Page 102
Chapter 6 Using Linker 90 Command Options Functional description The map file lists the addresses and sizes of a ll sections linked by the linker plus identifying information and valu es for lo cal and global symbols. For all programs, the addresses assigned to sections and symbols are not determined until linking. To create a final list file, reas[...]
-
Page 103
Chapter 6 Using Linker Command Options 91 6.3.2 E rror Message Options Functional description This option causes all error and warning messages and help screens sent to the console or th e listing file to appear in Japanese. The character coding depends on the host machine and the operating system. Rules of use This option is specified with the hyp[...]
-
Page 104
Chapter 6 Using Linker 92 Command Options Functional description This option causes all error and warning messages and help screens sen t to the console or the listing file to appear in Japanese using EUC coding. Rules of use This option is speci fied with the h yphen (-) option specification character, fo llowed by the upper-case letter “J” an[...]
-
Page 105
Chapter 6 Using Linker Command Options 93 Functional description This option causes all error and warning messages and help screens sent to the console or th e listing file to appear in Japanese using Shift JIS coding. Rules of use This option is specified with the hyphen (-) optio n specification character, followed by the upper-case letter “J?[...]
-
Page 106
Chapter 6 Using Linker 94 Command Options Functional description This option causes all error and warning messages and help screens sen t to the console or the listing file to appear in Japanese using JIS coding. Rules of use This option is speci fied with the h yphen (-) option specification character, fo llowed by the upper-case letter “J” an[...]
-
Page 107
Chapter 6 Using Linker Command Options 95 Functional description This option displays messages for errors and warnings detected in li nk commands and link processing to the screen and list file in English. Rules of use This option is specified with the slash (/) or hyphen (-) optio n sp ecifi cation character, followed by the lower-case letter &apo[...]
-
Page 108
Chapter 6 Using Linker 96 Command Options Functional description This option suppresses output of specified warnings detected during linki ng. Unli ke errors, warni ngs are not fatal, so the W option is used when you understand thei r mean ings sufficiently and need to suppress their output. Specifying Wall will suppress output of all warnin gs. Re[...]
-
Page 109
Chapter 6 Using Linker Command Options 97 6.3.3 P rogram Generation Options Functional description This option causes the linker to include in the executa ble file information for use in debugging at the source code level. This information includes the follo win g; • Names and addresses of variables • Detailed informatio n on variables • Corr[...]
-
Page 110
Chapter 6 Using Linker 98 Command Options Functional description This option specifies the st arting address for the specified section. It changes the starting address for all sections in all relocatable object files specified to the right of this option. The linker checks these specificati ons for overlap between sections. Rules of use This option[...]
-
Page 111
Chapter 6 Using Linker Command Options 99 Figure: 6-2 Memo ry Sp ace Layout Default specification When there are no address specifica tions whatsoever, the fi rst section in the first file is assigned to address 0. The remaining sections are as signed using the rule 2 mention ed above. NOTE: If a section has been divided into two or more par ts (se[...]
-
Page 112
Chapter 6 Using Linker 100 Command Options The linker merges the CODE sections from the input fil es, st arting at address 80000000 (hex). It merges the DATA sections from the file sub.rf, starting at address 0. The DA TA section from main.rf do not have an address specification, so are merged following the DATA section from sub.rf. NOTE: For speci[...]
-
Page 113
Chapter 6 Using Linker Command Options 101 Functional description The linker normally suppresses the creat ion of an executable file if it detects errors during linking. This option forces file creation even if there are errors. NOTE: An executable created with known linke r errors will not exec ute properly. The r option is on ly a temporar y meas[...]
-
Page 114
Chapter 6 Using Linker 102 Command Options Functional description This option su ppresses output of a sym bol table in the executable format file . Only executable code will be output to the executable format file. Rules of use This option is speci fied with the h yphen (-) option specification character, fo llowed by the upper-case letter 'E&[...]
-
Page 115
Chapter 6 Using Linker Command Options 103 6.3.4 Library File Options Functional description This option specifies a library file. Rules of use This option is specified with the hyphen (-) optio n specification character, followed by the lower-case letter 'l', then either immediately followed by the path name and file name or a space and [...]
-
Page 116
Chapter 6 Using Linker 104 Command Options Functional description This option specifies a director y that contains library files. Library files following the L optio n specification will be searched for in the speci fied directory. First, the current directory is searched. And then, the specified directory is searched. When the L option is used mul[...]
-
Page 117
Chapter 6 Using Linker Command Options 105 6.3.5 Other Options Functional description By writing various option used by th e linker in a file, the @ option lets you specify just that file during execution, and the linker will repl ace it with the option specifications. All options other than the @ option can be written in a parameter file. If a par[...]
-
Page 118
Chapter 6 Using Linker 106 Command Options Functional description This option displays linker comm and options and their descriptions to the screen. Th e h optio n is used alone. Rules of use This option is speci fied with the h yphen (-) option specification character, followed by the lower-case letter 'h'. ld103 -h NOTE: Even if the h o[...]
-
Page 119
Chapter 6 Using Linker Instruction RAM Support 107 6.4 Instruction RAM Support This series includes members with instruction RAM for use in copy ing program portions to RAM for execution there. The linker therefore suppo rts special options for creating executabl e files with support for in st ruction RAM. This section gives the particulars of the [...]
-
Page 120
Chapter 6 Using Linker 108 Instruction RAM Support 6.4.1 Structure of IRAM Support Executable File Structural Elements of an IRAM Support Executable (A) Fixed pr o gr am portion This portion resides in external memory and runs us ing addresses as is in the normal fashion. Normal executable files contain only this portion. (B) Instruction RAM pro gr[...]
-
Page 121
Chapter 6 Using Linker Instruction RAM Support 109 Figure: 6-3 Layout Image for Instruction RAM and Exter nal Memory NOTE: When the instruction RAM function is in use , the linker reserves the extra symbol names __overlay_tabl e and __iram_manage for its own use , so do not use these names fo r or din ar y sym bo ls 2 6 5 1 4 3 External memory mana[...]
-
Page 122
Chapter 6 Using Linker 110 Instruction RAM Support File layout and transfer operations for an instru ction RAM executable file 1. Use the linker's T and OVL layou t options to divide th e program into a fixed port ion (A) and an instruction RAM po rtion (B). The linker assigns th e latter to a location in external memory immediately following [...]
-
Page 123
Chapter 6 Using Linker Instruction RAM Support 111 6.4.2 IRAM Support Options Using the following options creat es an ex ecutable file supporting instruction RAM operatio n. Functional description This option assigns an address in instruction RAM for the specified section. The linker reso lves all addresses to assume that the relocatable object fil[...]
-
Page 124
Chapter 6 Using Linker 112 Instruction RAM Support The starting address in instruction RAM is given in hex adecimal. ld103 -T @CODE=80000000 main.rf sub.rf -OVL 1:@CODE=40000000 seg1.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=800000[...]
-
Page 125
Chapter 6 Using Linker Instruction RAM Support 113 Functional description This option is used to specify addresses for the extra symbols used by the instruct ion RAM function. NOTE: A PUT option is only valid when there are one or mo re -OVL options. Rules of use This option is specified with the hyphen (-) optio n specification character, followed[...]
-
Page 126
Chapter 6 Using Linker 114 Instruction RAM Support 6.4.3 Operation Examples The following are examples of s ection layouts using the OVL option for the five relocatable obj ect files, main.rf, sub.rf, prog1.rf, prog2.rf, and prog3.rf, in t he curren t directory. All files contain mul tiple CODE and DATA sections. Assigning to different addr esses i[...]
-
Page 127
Chapter 6 Using Linker Instruction RAM Support 115 NOTE: If multiple sections share the same or overlapping regions in instruction RAM, their code mu st be mutua lly exclusive. In other words, in the abov e exampl e, the files prog1.rf, prog2.rf, and prog3.rf must not contain references to each other's symbols because that would require th at [...]
-
Page 128
Chapter 6 Using Linker 116 Instruction RAM Support[...]
-
Page 129
7 Chapter 7 T ypes of Source S tatements[...]
-
Page 130
Chapter 7 Type of Source Statements 118 Purpose of This Chapter 7.1 Purpose of This Chapter Programs used by the Cross Assembler are collections of source statements. Th ere are five types of source statements, classi fied by their purpose. • Machine language instruction statem ents and directiv e statements • Assembler control statemen ts • [...]
-
Page 131
Chapter 7 Type of Source Statements Program Format 119 7.2 Program Format A program is text created to assemble as machine language instru ctions in or der to operate a micropro- cessor. The assembler translates the text into mach ine language code, while the linker joins that code to make an executabl e form at fi le. One line of text is called a [...]
-
Page 132
Chapter 7 Type of Source Statements 120 Program Format Below is an example source file. ; SAMPLE PROGRAM ; comment #include "FILE1.H ;include a file #define ;define identifier for conditio nal assem bly 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 secti[...]
-
Page 133
Chapter 7 Type of Source Statements Machine Language Instruction Statements an d Directive Statements 121 7.3 Machine Language Instruction Statements and Directive Statements Machine language instruction statements Machine language instructio ns are instructions th at the microprocesso r directl y executes on its own hardware. Each machine language[...]
-
Page 134
Chapter 7 Type of Source Statements 122 Assembler Control Statements 7.4 Assembler Control Statements Assembler control statements ar e source statements that contro l how th e assembler processes. The assembler provides include dir ectives that include fi les and conditional asse mbly directives that specify conditions for changing wh ich instruct[...]
-
Page 135
Chapter 7 Type of Source Statements Macro Control Statements 123 7.5 Macro Control Statements Macro control statements reduce coding effort by replacing strings code d in source statements with other strings. This enables low-level assembly language for a program bloc k to be abstracted as a macro name. Macros are coded in two formats: macro defini[...]
-
Page 136
Chapter 7 Type of Source Statements 124 Comment Statements 7.6 Comment Statements The comment statements start from: 1) an asterisk (*) in the beginnin g of the line 2) a semicolon (;) in the beginning or middle of the lin e If you find an asterisk (*) in a line, the whole line is th e comment statement. If you find a semi colon (;) in a line, the [...]
-
Page 137
Chapter 7 Type of Source Statements Blank Statements 125 7.7 Blank Statements A blank statement consists of a si ngle carriage return. Blank statements are used to make printed lists easier to read.[...]
-
Page 138
Chapter 7 Type of Source Statements 126 Blank Statements[...]
-
Page 139
8 Chapter 8 Writi ng Source S t atements[...]
-
Page 140
Chapter 8 Writing Source Statements 128 Purpose of This Chapter 8.1 Purpose of This Chapter This chapter explains common info rmation for writing so urce statem ents. Source statements include machine language instruction statem ents, assembler control statements , and macro control statements. This chapter explains how to code the characters and n[...]
-
Page 141
Chapter 8 Writing Source State ments Permitted Characters 129 8.2 Permitted Characters There are three types of characters that can be coded in source s tatem ents 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[...]
-
Page 142
Chapter 8 Writing Source Statements 130 Numbers 8.3 Numbers The cross assembler provides three coding formats fo r use in numbers and (sin gle) character constants (refer to section 8.4, "Character Constants"). • Extended C language format • Intel format • Matsushita format One of these formats is selected by using the notation dire[...]
-
Page 143
Chapter 8 Writing Source State ments Numbers 131 Extended C language format Coding rules: Binary Start with '0' (zero) and l etter 'B' (or 'b'), follo wed by binary digi ts. Octal S tart with '0' (zero), followed by octal digits. Decimal Code decimal number as is. Hexadecimal Start with '0' and lett[...]
-
Page 144
Chapter 8 Writing Source Statements 132 Numbers Matsushita format Coding ru les: Binary Start wit h lett er 'B' (or 'b'), and enclose binary di gits in sin gle quo tation marks ( ' ). When the default is bi nary, code the binary number as is. Octal Start wit h lett er 'O' (or 'o'), and enclose octal digi[...]
-
Page 145
Chapter 8 Writing Source State ments Character Constants 133 8.4 Character Constants ASCII characters ,which can be displayed, can be coded as character cons tants or string constants. The characters that can be used for constants are as follows. • Digits • Letters (upper or lower cases) • Blank letters • Special characters NOTE: “” le[...]
-
Page 146
Chapter 8 Writing Source Statements 134 Character Constants String constants String constants are strings of one or more characters stored as ASCII code. When a string constant is one character it will be the sa me as a character constant. Coding rules: String constants are specified by enclosing the strin g in double quotation marks ( " ). &q[...]
-
Page 147
Chapter 8 Writing Source State ments Address Constants 135 8.5 Address Constants Address constants return p articular bits from expressions that can be evaluated as addresses. They are written as follows. address_specifier (expression) An address constant is written as an expression enclosed in parenthese s following an address specifier. An expres[...]
-
Page 148
Chapter 8 Writing Source Statements 136 Location Counter 8.6 Location Counter The assembler contains an variable for counting addresses of instructi ons. This v ariable is called the location counter. Each time the assembler converts an instruction to machine langua ge, it increments the location counter by the number of words in that instruction .[...]
-
Page 149
Chapter 8 Writing Source State ments Expressions 137 8.7 Expressions Expressions are symbols, self-ref erence address sy mbols, and constants linked by operators, with the result representing a single value. When an expression is coded as an operand, its result will be a number or an address depending on the type of instruction . When a symbol or s[...]
-
Page 150
Chapter 8 Writing Source Statements 138 Expressions 8.7.1 Operators There are three types of operators. • Arithmetic operators • Shift oper ators • Logical operators Arithmetic operators Arithmetic operators perform the fou r standard arithmetic calculatio ns. Formats: Example: operand1 * operand2 123 * LABEL operand1 / operand2 12 3 / 10 ope[...]
-
Page 151
Chapter 8 Writing Source State ments Expressions 139 Logical operators Logical operators perform calculation in bit unit s. Formats: Example: operand1 & operand2 A DDRESS & MASK operand1 ^ operand2 CONST ^ 0b0011110000 operand1 | operan d2 VECT | 0b0011110000 ~operand -MAIN Operator Meaning & Logical AND ^ Exclusive OR | Logical OR - Un[...]
-
Page 152
Chapter 8 Writing Source Statements 140 Expressions 8.7.2 Expression Evaluation There are seven levels of operator precedence. The order of precedence can be changed using parentheses ( ). Operators with the same precedence are eva luated in order from left to right. An example of operat or is shown below. An asterisk * is used as both the self-ref[...]
-
Page 153
Chapter 8 Writing Source State ments Expressions 141 8.7.3 E xpression Syntax Below is an expression syntax diagram Expression Sy ntax NOTE: When the expressions starting with pa renthesis are coded to the ope rands of Machine language instructions, it will be r egarded as an addre ss-reference. To be proceeded as expressions, put 0+ befo re the pa[...]
-
Page 154
Chapter 8 Writing Source Statements 142 Expressions 8.7.4 Expression Attributes When expression operands are connected by an oper ator, the calculated result of the expression will have attributes of the operands and the operator. The most important attributes for expression evaluatio n are as follows. • Undefined (undefined-UND) • Absolute (ab[...]
-
Page 155
Chapter 8 Writing Source State ments Expressions 143 For + (addition) operator For - (subtraction) operator For *, /, %, <<, >>, &, ^ , | operators NOTE: The expressions writing in directive coding instructions and assembler control instruction must result in absolute attributes(ABS). + (addition) Operand 2 UND ABS RE L EXT Operan d[...]
-
Page 156
Chapter 8 Writing Source Statements 144 Reserved Words 8.8 Reserved Words The assembler gives special meanings to the symbols listed below, so they cannot be used fo r other purposes. These symbols are called reserved words. Either all upper-case or all lower-cas e le tt ers may be used to code re served words, but they cannot be mixed within one r[...]
-
Page 157
9 Chapter 9 W riting Machine Language Instruction S t atements and Directive S tatements[...]
-
Page 158
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 146 Purpose of This Chapter 9.1 Purpose of This Chapter This chapter explains how to write machine language in structions and directives. There are five source statement formats • Instruction statements that code machin e language instructions and directives. • Assembler [...]
-
Page 159
Chapter 9 Writing Machine Language Instructions and Directive Statements Instruction Statement Fields 147 9.2 Instruction Statement Fields Source statements that code machin e language instructions and directives are built from four fields. [label] [operation [op e rand [, operand]]] [commen t] Contents of brackets [ ] can be omitted. Coding rules [...]
-
Page 160
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 148 Instruction Statement Fields 9.2.1 Writing Label Field Labels are called both symbols and names. The asse mbler assigns a label the value of the location counter at the point it is defined. Coding rules Labels can use upper-case and lower-cas e letters, digits, underscore[...]
-
Page 161
Chapter 9 Writing Machine Language Instructions and Directive Statements Instruction Statement Fields 149 9.2.2 W riting Operation Field The operation field is writt en with a machine language instruction or directive. Coding rules Machine language instructio ns cannot mix case. They must use either upper or lower case throughou t. Coding examples [...]
-
Page 162
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 150 Instruction Statement Fields 9.2.3 Writing Operand Field The operand field coding is determined by the machine languag e instruction or directive in the operation field. Refer to the "Instruction Manual " fo r details on coding machine lang uage instructions. Co[...]
-
Page 163
Chapter 9 Writing Machine Language Instructions and Directive Statements Instruction Statement Fields 151 9.2.4 W riting Comment Field The field that starts from a semi colon (;) after the operands is call ed the comment field. Comments coded in this position are called end-of-line commen ts, as opposed to commen t statements where the entire line [...]
-
Page 164
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 152 Writing Machine Language Instruction Statements 9.3 Writing Machine Language Instruction Statements Each machine language instru ct ion is defined by specific mnemonics. Mnemonics are formed from operations and operands accurately coded in the statement fields previously [...]
-
Page 165
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 153 9.4 Writing Directive Statements Directives differ from machine language i nstructions in that th ey only have effect on the assembler. Directives specify program structur e and start addresses, set constants and radices, and specify options an[...]
-
Page 166
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 154 Writing Directive Statements 9.4.1 section Syntax label operation operand section_name section [definitio n1 [,definition2 [,expression]]] definition1 Section attribute (CODE or DATA) definition2 Link type (PUBLIC) (Note that the words PRIVATE and COMMON are reserved for [...]
-
Page 167
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 155 Operand coding rules Only specific strin gs can be defined for definitio n1 and definition2. If some other string is defined, the assembler will gener ate an er ror and ignore this directive. The value of expression must be a power of 2 between[...]
-
Page 168
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 156 Writing Directive Statements 9.4.2 align Syntax label operation operand align expression Default settings The current location counter value will be inherited. Functional description The align directive adjusts the location counter to be a multiple of the value indicated [...]
-
Page 169
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 157 Usage example Below is an example use of the align directive. In the align 6 directive on line 6, the expression val ue 6 is not a power of 2, so the assembler w ill convert it to align 8. The series of multiples of 8 is shown below. Numbers in[...]
-
Page 170
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 158 Writing Directive Statements 9.4.3 end Syntax label operation operand [name] end Default settings If the end directive is omitted, the assembler file wil l assum e that th e end of th e file is the end of the program. Functional description This directive is coded once at[...]
-
Page 171
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 159 9.4.4 listoff, liston Syntax label operatio n operand [name] listoff . . . [name] liston Functional description The listoff and liston direct ives are used in pairs. Statements from the statement fo llowing the listoff directive until the state[...]
-
Page 172
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 160 Writing Directive Statements 9.4.5 notation Syntax label operation operand notation CLANG | INTE | PANA Default settings CLANG will be selected. Functional description This directive selects the form at of numbers and character co nstants (single character). The Cross-Ass[...]
-
Page 173
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 161 Usage example Below is an example use of the notation directive. notation.lst page 1 *** PanaX Series MN1030 Cross Assembler *** Loc Object Line Source 1 _DATA section CODE, PUBLIC, 4 2 notation INTEL 00000000 FF 3 dc 11111111b 00000001 FF 4 dc[...]
-
Page 174
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 162 Writing Directive Statements 9.4.6 org Syntax label operation operand org expression Default settings The current location counter value will be inherited. Functional description This directive sets the locat ion counter to the address value speci fied by expression. Oper[...]
-
Page 175
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 163 9.4.7 opt Syntax label operatio n operand opt on | off Default settings If omitted, opt o ff will be assumed. Functional description This directive enables and disa bles the optimizat ion functi ons of the assembler and linker. The optimization[...]
-
Page 176
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 164 Writing Directive Statements 9.4.8 page Syntax label operation operand page lines_expression [,columns_expression] Default settings Number of li nes = 60 Number of columns = 132 Functional description This directive specifies the number of lines and columns per page. At t[...]
-
Page 177
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 165 9.4.9 radix Syntax label operation operand radix expression Default settings Radix 10 (decimal) . Functional description This directive specifies the radix th at will be used by d efault. The Cross-Assembler prov ides three coding formats for n[...]
-
Page 178
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 166 Writing Directive Statements 9.4.10 dc Syntax label operation operand [name] dc constan t | expression (, constant | expression )... Functional description This directive is u sed to define constan ts in a memory area. The 8-bit co nstant specified by the operand will be [...]
-
Page 179
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 167 9.4.11 ds Syntax label operation operand [name] ds expression1 [, e xpression2 [, expression3 ]] expression1 Number of bytes of memory to reserve expression2 Initial value expression3 Number of iterations Default settings expression2 (initial v[...]
-
Page 180
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 168 Writing 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 3344556633[...]
-
Page 181
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 169 9.4.12 dw Syntax label operation operand [name] dw expression (, expression )... Functional description This directive is used to define 16-bit constants in a memory area. The 16-bi t constant specified by the operand will be stored at the loca[...]
-
Page 182
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 170 Writing Directive Statements 9.4.13 dd Syntax label operation operand [name] dd expression(, expression)... Functional description This directive is us ed to defi ne 32-bit cons tan ts in a memo ry area. The 32-bit const ant spe c ifie d by the operand will be stored at t[...]
-
Page 183
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 171 9.4.14 equ Syntax label operation operand name equ expr ession Functional description This directive defines the name to be the value of the expression coded in th e operand. When that name is coded in the op erand of machine language instruct [...]
-
Page 184
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 172 Writing Directive Statements Usage example Below is an example us e 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, P[...]
-
Page 185
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 173 9.4.15 global Syntax label operatio n operand [name] global name(, name)... Default settings External reference when omi tted = undefined label error External declaration when omitted = undefined label error du rin g link ing Functional descrip[...]
-
Page 186
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 174 Writing Directive Statements Usage example Below is an example use of the 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 [...]
-
Page 187
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 175 9.4.16 tit Syntax label operatio n operand tit ["string"] Functional description This directive specifies that the stri ng coded as its op erand is to be outp ut as the header of the list file. Typically the string is written wi th th[...]
-
Page 188
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 176 Writing Directive Statements 9.4.17 xlistoff, xliston Syntax label operation operand [name] xlistoff . . . xliston Functional description The xlistoff and xliston directives are used in pairs. St atem ents from the xlistoff di recti ve unt il the xliston directive will no[...]
-
Page 189
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 177 9.4.18 funcinfo Syntax label operatio n operand function_namefuncinfo label_name, expression, reg ister li st where expression: Stack frame size Functional description This directive provides additional in formation about a function nam e speci[...]
-
Page 190
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 178 Writing Directive Statements Usage Example The following gives an example of funcinfo usage. NOTE: The ret and retf instructions free the stack frame and restore registers fr om the stack. The assem bler bases this code on t he informa tion provide d by the fu ncinfo dire[...]
-
Page 191
Chapter 9 Writing Machine Language Instructions and Directive Statements Writing Directive Statements 179 9.4.19 assign Syntax label operatio n operand name assign expression Functional description This directive defines the name to be the value of the exp ression coded in the operand. When that name is coded in the operand of machine language inst[...]
-
Page 192
Chapter 9 Writing Machine Language Instructions and Directive Statemen ts 180 Writing Directive Statements[...]
-
Page 193
10 Chapter 10 Writi ng Assembler Control S tatement s[...]
-
Page 194
Chapter 10 Writing Assembler Control Statements 182 Purpose of This Chapter 10.1 Purpose of This Chapter Assembler control statements are st atements that control assembler processing. They specify include files and refinement of the identifier and control conditional assembly. Include files are used to place definitions of cons tants, memory areas[...]
-
Page 195
Chapter 10 Writing Assembler Control State ments File Inclusion 183 10.2 File Inclusion The file inclusion is an assembler control instruct ion 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[...]
-
Page 196
Chapter 10 Writing Assembler Control Statements 184 File Inclusion 10.2.1 #include Syntax #include ”filename” Functional description This directive causes the assembler to read in the source file with the specified name at the location of the directive. NOTE: The included file will be assembled and output to the relocatabl e object file and lis[...]
-
Page 197
Chapter 10 Writing Assembler Control State ments File Inclusion 185 Usage example The following example illustrate s the use of an include file. The file inc.h consists of the following statement. The file to be assembled cons is ts of the following statements. The above file is assembled with the file inc.h incl uded. For this reason, at points af[...]
-
Page 198
Chapter 10 Writing Assembler Control Statements 186 Identifier Definement 10.3 Identifier Definement Identifier 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 va riable has been use[...]
-
Page 199
Chapter 10 Writing Assembler Control State ments Identifier Definement 187 10.3.1 #define Syntax #define [replacement_st ring] [; comment] Functional description This directive causes the assembler to replace the iden tifier with the replacemen t_string on all further lines. The #define directive differs from the #equ directive in that a stri ng ca[...]
-
Page 200
Chapter 10 Writing Assembler Control Statements 188 Identifier Definement 10.3.2 #undef Syntax #undef identifier Functional description This directive deletes an ident ifier defined by a #define directive. The effective ra nge of an identifier is from the line following #defin e until the line before #undef. To redefine the replacement string of an[...]
-
Page 201
Chapter 10 Writing Assembler Control State ments Conditional Assembly 189 10.4 Conditional Assembly The cross assembler provides conditional assembly capabiliti es. Th e directives explained in this section are provided for this purpose. By coding conditional assembly directives in a pr ogram, the assembler will select which block to assemble by ju[...]
-
Page 202
Chapter 10 Writing Assembler Control Statements 190 Conditional Assembly The table below lists the conditional assembly directiv es. NOTE: These directives can be us ed only within macr o definitions Directive Condition for selec ting bl ock1 Condition for selecting block2 #ifdef Identifier has been defined by #defin e. Identifier has not been defi[...]
-
Page 203
Chapter 10 Writing Assembler Control State ments Conditional Assembly 191 10.4.1 #ifdef, #ifndef Syntax Syntax for #ifdef Syntax for #ifndef #ifdef identifier #ifndef identifier block1 block1 [#else [#else block2] block2] #endif #endif Functional description #ifdef If the identifier has been defined by a #define dir ective before the #ifdef stateme[...]
-
Page 204
Chapter 10 Writing Assembler Control Statements 192 Conditional Assembly Usage example A source file that uses #ifdef and #ifnd ef is sh own below. The assembled list file is shown below. The identifier VERSION is defined in line number 1 . The replacement string is a null character. Since VERSION has been defined, the #ifdef starting from line num[...]
-
Page 205
Chapter 10 Writing Assembler Control State ments Conditional Assembly 193 10.4.2 #if, #ifn Syntax Syntax for #if Syntax for #ifn #if expression #ifn expression block1 block1 [#else [#else block2] block2] #endif #endif Functional description #if If the value of expression is not 0, block1 will be assembled. If it is 0 and an #else directive has been[...]
-
Page 206
Chapter 10 Writing Assembler Control Statements 194 Conditional Assembly Usage example A source file that uses #if and #ifn is shown below. The assembled list file is shown below. The program first sets DEVICE to 1. Therefore the expression DEVICE-1 wil l be 0 , so the #i f directive causes line number 7 to be assembled and the #ifn directive cause[...]
-
Page 207
Chapter 10 Writing Assembler Control State ments Conditional Assembly 195 10.4.3 #ifeq, #ifneq Syntax Syntax for #ifeq Syntax for #ifneq #ifeq parameter1, parameter2 #ifneq param eter1, parameter2 block1 block1 [#else [#else block2] block2] #endif #endif Functional description #ifeq If parameter1 and parameter2 ar e the same st ring, bloc k1 will b[...]
-
Page 208
Chapter 10 Writing Assembler Control Statements 196 Conditional Assembly Usage example A source file that uses #ifeq and #ifneq is s how n below. The macro named compare uses two dummy parameters(data1,data2). Within the macro it compares the strings of those dummy param eters. If they match, an instruction that sets the A register to 1 will be ass[...]
-
Page 209
Chapter 10 Writing Assembler Control State ments Conditional Assembly 197 The assembled list file is shown belo w. Line numb er 11 assembles the statements for a match, and line number 12 assembles the statements for a mismatch. ifeq.lst Page 1 *** PanaX Series MN1030 Cross Assembler *** Loc Object Line Source 1 compare macro data1, data2 2 #ifeq d[...]
-
Page 210
Chapter 10 Writing Assembler Control Statements 198 Conditional Assembly 10.4.4 #iflt, #ifle Syntax Syntax for #if lt Syntax for #ifle #iflt expressi on #ifle expression block1 block1 [#else [#else block2] block2] #endif #endif Functional description #iflt If the value of expression is negative, block1 will be assembled. If it is not negative and a[...]
-
Page 211
Chapter 10 Writing Assembler Control State ments Conditional Assembly 199 The assembled list file is shown below. 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 9e n d m 10 ; 11 _TEXT section CODE, PUBLIC, 1 M12 [...]
-
Page 212
Chapter 10 Writing Assembler Control Statements 200 Conditional Assembly 10.4.5 #ifgt, #ifge Syntax Syntax for #ifgt Syntax fo r #ifge #ifgt expression #ifge expression block1 block1 [#else [#else block2] block2] #endif #endif Coding rules #ifgt If the value of expression is positive, block1 will be assembled . If it is not positive and an #else di[...]
-
Page 213
Chapter 10 Writing Assembler Control State ments Conditional Assembly 201 The assembled list file is shown below. You can see that 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 0x0[...]
-
Page 214
Chapter 10 Writing Assembler Control Statements 202 Conditional Assembly 10.4.6 #ifb, #ifnb Syntax Syntax for #ifb Syntax for #ifn b #ifb dummy_parameter #ifnb dum my_parameter block1 block1 [#else [#else block2] block2] #endif #endif Functional description #ifb If the dummy_parameter is a null character, block1 wi ll be assembled. If it is not a n[...]
-
Page 215
Chapter 10 Writing Assembler Control State ments Conditional Assembly 203 Usage example A source file that uses #i fb is shown below. If the dummy parameter para to the macro debug is a null character, the program will execute next_cycle. If it is not a null character , the program will execute test and then execute next_cycle. In this example, the[...]
-
Page 216
Chapter 10 Writing Assembler Control Statements 204 Conditional Assembly The assembled list file is shown below. Where the characters debug_on have been specified, bl ock 2 is assembled. Where the null character has been specified, block 1 is assembled. ifb.lst Page 1 *** PanaX Series MN1030 Cross Assembler *** Loc Object Line Source 1 global check[...]
-
Page 217
11 Chapter 1 1 Writing Macro Control S t atements[...]
-
Page 218
Chapter 11 Writing Macro Control Statements 206 Purpose of This Chapter 11.1 Purpose of This Chapter Macros consist of two part s: macro definition s and macro calls. A macro that has been defined can b e coded as a macro call in any source statement after that. When a macro without parameters is called, it become s a simple text substi tution. Whe[...]
-
Page 219
Chapter 11 Writing Macro Control State ments Macro Definitions (macro, endm) 207 11.2 Macro Definitions (macro, endm) Syntax macro_name macro [dummy_parameter (, dummy_parameter)...] macro_body endm NOTE: Up to 10 dummy parameter s can be specified. Functional description A macro assigns a name to a single pr oce ss that is used repeatedly in a pro[...]
-
Page 220
Chapter 11 Writing Macro Control Statements 208 Macro Definitions (macro, endm) Coding rules The following instructions cannot be used withi n macro defi nit ions. • include directive • macro directive — within a macro definition another different macro can not be defined • purge directive — within a macro definition macros cannot be purg[...]
-
Page 221
Chapter 11 Writing Macro Control State ments Macro Calls and Expansion 209 11.3 Macro Calls and Expansion Syntax macro_name [param eter (, parameter)... ] NOTE: Up to10 dummy parameters ca n be specified. Functional description A macro is called by coding its name in the operation fi eld of a sour ce statement. The assembler then inserts the text o[...]
-
Page 222
Chapter 11 Writing Macro Control Statements 210 Macro Calls and Expansion Usage example A source fil e is shown below. The macro add _adr has one dummy pa rameter. T he dummy parameter is used as the operand of an add machine language in struction within the macro body. Tak e note whether a macro name i s the same as a machin e language instruction[...]
-
Page 223
Chapter 11 Writing Macro Control State ments Macro Operators 211 11.4 Macro Operators Macro operators are used in macro bodies to operate on parameters of macro calls. Macro operators are listed below. Usage example The following example uses the operators , <>, an d &. The & characters in the body of macro mac1 are used with two dif[...]
-
Page 224
Chapter 11 Writing Macro Control Statements 212 Macro Operators The assembled list file is shown below. 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 6p 1 p 2 7 endm 8 9 _TEXT SECTION CODE,PUBLIC,1 M10 mac1 1, 2, [...]
-
Page 225
Chapter 11 Writing Macro Control State ments Local Symbol Declaration (local) 213 11.5 Local Symbol Declaration (local) Syntax macro_name macro parameter local symbol (, symbol)... symbol . . . endm NOTE: Up to 30 symbols can be specified. Functional description The local directive declar es local symbols used in a macro bo dy. When local symbols a[...]
-
Page 226
Chapter 11 Writing Macro Control Statements 214 Local Symbol Declaration (local) Usage example An example using the local directive is shown below. The assembled list file is shown next. You can see that each time th e local s ymbol is expanded, it is changed to ??00001, ??00002, ... loc macro p1 local lab1, lab2 mov p1, D0 lab1 cmp 0, D0 jmp lab2 [...]
-
Page 227
Chapter 11 Writing Macro Control State ments Forced Termination of Macro Expan sion (exitm) 215 11.6 Forced Termination of Macro Expansion (exitm) Syntax macro_name macro parameter #ifndef identifier exitm #endif . . . endm Functional description The exitm directive forcibly termin ates macro expan sion at the po int it appears. Used in conjunction[...]
-
Page 228
Chapter 11 Writing Macro Control Statements 216 Forced Termination of Macro Expansion (exitm) The list file is shown below. The second macro call has been expanded after #endif. global debug ; extml macro mov 1, D0 #ifndef TEST exitm #endif jsr debug endm ; _TEXT section CODE, PUBLIC, 1 extm1 #define TEST extm1 exitm.lst Page 1 *** Panax Series MN1[...]
-
Page 229
Chapter 11 Writing Macro Control State ments Purging Macro Definitions (purge) 217 11.7 Purging Macro Definitions (purge) Syntax purge macro_name (, m acro_name)... Functional description The purge directive purges the defini tions of the specified macro names. Coding rules The macro names specified with the purge directiv e are valid for previousl[...]
-
Page 230
Chapter 11 Writing Macro Control Statements 218 rept 11.8 rept Syntax rept expression block endm Functional description The rept directive repeat ed ly exp a n ds the spe cified block the spe cified number of times . It is used for simple repeating wit hout parameters. Th e rept direct ive can be coded anywhere in a program or even within a macro d[...]
-
Page 231
Chapter 11 Writing Macro Control State ments rept 219 The assembled list file is shown below. rept.lst Page 1 *** Panax Series MN1030 Cross Assemb ler *** 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 28[...]
-
Page 232
Chapter 11 Writing Macro Control Statements 220 irp 11.9 irp Syntax irp dummy_parameter, parameter (, parameter) ... block endm NOTE: Up to10 dummy paramet ers can be specified. Functional description The irp directive repeatedly expands the specified block the specif ied number of times. The du mm y parameter is used within the block. The macro ex[...]
-
Page 233
Chapter 11 Writing Macro Control State ments irp 221 The assembled list file is shown below. irp.lst Page 1 *** Panax Series MN1030 Cross Assem bler *** 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+ end[...]
-
Page 234
Chapter 11 Writing Macro Control Statements 222 irpc 11.10 irpc Syntax irpc dummy_parameter, "string" block endm Functional description The irpc description repeatedly replaces the dummy parameter with each character in the specified string one at a time. The dummy parameter can be us ed in the block. The macro expansion replaces the dumm[...]
-
Page 235
Chapter 11 Writing Macro Control State ments irpc 223 The assembled list file is shown below. irpc.lst Page 1 *** Panax Series MN1030 Cross Assemb ler *** 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 0[...]
-
Page 236
Chapter 11 Writing Macro Control Statements 224 irpc[...]
-
Page 237
12 Chapter 12 List of Mach ine Language Instructions[...]
-
Page 238
Chapter 12 List of Machine Language Instructions 226 Purpose of This Chapter 12.1 Purpose of This Chapter The chapter lists machin e lan guage instructions of thi s series microcomputers. This comprehensive list of addressing modes and mnemo nics fo r every instruction can be quit e useful when you are coding machine la nguage instruction statement[...]
-
Page 239
Chapter 12 List of Machine Language Instructions Addressing Modes 227 12.2 Addressing Modes This series of the microcomputers supports four addressing modes for memory accesses. The following four address form ats are methods for accessing an a ddress specified as an address register's contents or as the sum of an ad dress register's cont[...]
-
Page 240
Chapter 12 List of Machine Language Instructions 228 Addressing Modes Register relative indirect addressing Register relative indirect addr essing determines the address to access using the following 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-exten[...]
-
Page 241
Chapter 12 List of Machine Language Instructions Addressing Modes 229 3. The program counter, PC, plus 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 3 1 31 0 + d32/d16/d8 0 16 31 Address specifica[...]
-
Page 242
Chapter 12 List of Machine Language Instructions 230 Addressing Modes Index addressing Index addressing adds t he contents of an address register, An, and a data register, Dn, to yield a displacement. RAM 0 31 An 0 3 1 Dn 31 0 + Address specification[...]
-
Page 243
Chapter 12 List of Machine Language Instructions List of Machine Language Instructions 231 12.3 List of Machine Language Instructions Symbol Description An, Am Address register (n, m=3 to 0) Dn, Dm Data register (n, m = 3 to 0) Di Index, a data register (i=0,1,2,3) SP Stack poi nt e r register imm Immediate data imm8 8-bit immediate data specified [...]
-
Page 244
Chapter 12 List of Machine Language Instructions 232 List of Machine Language Instructions 12.3.1 Data Move Instructions MOVE source to destination Mnemonic Description of operation Register Direct MOV Dm, Dn T ransfers the co ntents of Dm to Dn. MOV Dm, An T ransfers the co ntents of Dm to An. MOV Am, Dn T ransfers the co ntents of Am to Dn. MOV A[...]
-
Page 245
Chapter 12 List of Machine Language Instructions List of Machine Language Instructions 233 Register Relative Indirect MOV (d, Am), An T ransfers the contents of the memo ry location specified by Am and displacemen t d to An . 8- and 16-bit displacemen ts are sign-extended. MOV (d, SP), An T ransfers the contents of the memo ry location specified by[...]
-
Page 246
Chapter 12 List of Machine Language Instructions 234 List of Machine Language Instructions Register Relative Indirect MOVHU (d, Am), Dn T ransfers, with zero-extension, th e 16-bit contents of the memory location specified by Am an d displacement d to Dn. 8- and 16-bit displacemen ts are sign-extended. MOVHU (d, SP), Dn T ransfers, with zero-extens[...]
-
Page 247
Chapter 12 List of Machine Language Instructions List of Machine Language Instructions 235 Absolute MOV (abs32), Dn T ransfer the 32-bit contents of th e memory location specified by abs32 to Dn. MOV (abs16), An T ransfer the 32-bit contents of th e memory location specified by abs16 to An. abs16 is zero-extended. MOV (abs32), An T ransfer the 32-b[...]
-
Page 248
Chapter 12 List of Machine Language Instructions 236 List of Machine Language Instructions EXTEND Sign MOVM CLR Mnemonic Description of o peration EXT Dn Extend Dn to 64 bits and store the highest 32 bits in MDR. EXTB Dn Sign-extend the lowest 8 bit s of Dn to fill Dn. EXTBU Dn Zero-ext end the lowest 8 bits of Dn to fill Dn. EXTH Dn Sign-extend th[...]
-
Page 249
Chapter 12 List of Machine Language Instructions List of Machine Language Instructions 237 12.3.2 Arithmetic Instructions ADD ADD with CARRY SUBTRACT SUBTRACT with BORROW Mnemonic Description of operation ADD Dm, Dn Add the contents of Dm and Dn and store the result in Dn. ADD Dm, An Add the contents of Dm and An and store the result in An. ADD Am,[...]
-
Page 250
Chapter 12 List of Machine Language Instructions 238 List of Machine Language Instructions MULTIPLY DIVIDE INC COMPARE source with destination Mnemonic Description of operation MUL Dm, Dn Multiplies th e 32-bit signed integer multiplican d in Dm by the 32-bit signed integer multiplier in Dn and store the upper 32 bits of the product in MDR and the [...]
-
Page 251
Chapter 12 List of Machine Language Instructions List of Machine Language Instructions 239 12.3.3 Logical Instructions AND source wi th destination OR source with destination EXCLUSIVE-OR sour ce with destination NOT destination Mnemonic Description of operation AND Dm, Dn AND Dm with Dn an d store th e result in Dn. AND imm, Dn AND the zero -exten[...]
-
Page 252
Chapter 12 List of Machine Language Instructions 240 List of Machine Language Instructions ARITHMETIC SHIFT RIGHT LOGICAL SHIFT RIGHT ARITHMETIC SHIFT LEFT ROTATE RIGHT ROTATE LEFT Mnemonic Description of operat ion ASR Dm, Dn Ari thm etical ly shift the contents of Dn right the number of bits specified in Dm and store the result in Dn. ASR imm8, D[...]
-
Page 253
Chapter 12 List of Machine Language Instructions List of Machine Language Instructions 241 12.3.4 Bit Manipulation Instructions Bit operations Mnemonic Description of oper ation BTST imm, Dn AND the zero-extended imm8, zero-extended imm1 6, or imm32 with the contents of Dn and set the flags according to the result. BTST imm8, (d8,An) AND the zero-e[...]
-
Page 254
Chapter 12 List of Machine Language Instructions 242 List of Machine Language Instructions BCLR imm8,(abs32) This instruction p roceeds through the following three stag es: 1.T ransfer , with zero- extension, the 8-bit content s of the memory location specified with abs32 to a 32-bit intern al temporary regi ster . 2.AND the temporary register with[...]
-
Page 255
Chapter 12 List of Machine Language Instructions List of Machine Language Instructions 243 12.3.5 Branching Instructions CALL Subroutine Mnemonic Description of operation CALL label label is either (d16,PC) or (d3 2,PC). Push the program counter containing the address of the next instruction and necessary regi sters onto the stack, secure the neces[...]
-
Page 256
Chapter 12 List of Machine Language Instructions 244 List of Machine Language Instructions Unconditional BRANCH Mnemonic Description of oper ation JMP (An) S tore the contents of An in the program counter . JMP lab el If label is (d16,PC), the 16-bit displacement is sign-extended and added to the program counter . The result is stored in t he progr[...]
-
Page 257
Chapter 12 List of Machine Language Instructions List of Machine Language Instructions 245 Conditional BRANCH Mnemonic Meaning Description of operation BEQ label = ZF=1 If ZF = 1, execute a relative branch to the address specified by label. (Range: -128 to 127) If ZF = 0, execute next i nstruction. BNE label ZF=0 If ZF = 0, execute a relative branc[...]
-
Page 258
Chapter 12 List of Machine Language Instructions 246 List of Machine Language Instructions Conditional BRANCH for LOOP Mnemonic Meaning Descr iption of operation LEQ = ZF=1 If ZF = 1, branch to the top of the loop as specifi ed with SETLB. If ZF = 0, execute next instruction. LNE = ZF=0 If ZF = 0, branch to the top of the loop as speci fied with SE[...]
-
Page 259
Chapter 12 List of Machine Language Instructions List of Machine Language Instructions 247 12.3.6 User-Defined Instructions User Defined FUNCTION Mnemonic Description of operation UDFnn Dm, Dn If nn is between 00 and 15, com pute with the contents of D m and Dn and store the result in Dn. The nature of the calculation and the effects on the flags a[...]
-
Page 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.[...]
-
Page 261
13 Chapter 13 Error Messages[...]
-
Page 262
Chapter 13 Error Messages 250 Purpose of This Chapter 13.1 Purpose of This Chapter Error messages are divided into three categories depending on the severity of the error. • Warnings • Errors • Fatal errors These messages are displayed during assembler and linker operations. A warning message warns the user of some state an d consists of the [...]
-
Page 263
Chapter 13 Error Messages Assembler Errors 251 13.2 Assembler Errors The assembler displays three types of messages: wa rning messages, error mess ages, and fatal error mes- sages.[...]
-
Page 264
Chapter 13 Error Messages 252 Assembler Errors 13.2.1 Warning Messages 2001 Operand error An operand is of the wrong type. Check the number and types of operand s, 2002 Illegal operand value An operand does not have an acceptable value. Change the value of the operand. 2003 Define symbol multiple defined. The same symbol is defined twice. Change th[...]
-
Page 265
Chapter 13 Error Messages Assembler Errors 253 2011 Not guaranteed operand by the instruction allocation. The usage of a series of instructions may be rest ricted in the microcomput er. Careful operation is needed as some operatio ns are not guaranteed. Refer to the notes, attentions or warnings written in the In st ruction Manual fo r 32- bit and [...]
-
Page 266
Chapter 13 Error Messages 254 Assembler Errors 13.2.2 Error Messages 2301 Syntax error. The current line cont ains a syntax error. Consult this Manual and the MN1030/MN103 S Series Instruct ion Manual. 2302 Illegal character. A string contains an illegal character. Use only legal characters 2303 Illegal string. A string contains an error. Correct t[...]
-
Page 267
Chapter 13 Error Messages Assembler Errors 255 2314 Illegal section name. There is an error in a sect ion nam e . Check the spelling of the section name. 2315 Operand error. An operand of the wrong type is used. Check the number and types of operands. 2316 Illegal operand expression. An operand expression does not evaluate to a value within the spe[...]
-
Page 268
Chapter 13 Error Messages 256 Assembler Errors 2328 Too many arguments. A macro invocation has too many arg um e nts. Check the macro definition. 2329 Can’t find FUNCINFO directive. There is a ret or retf machin e instruction before the corr esponding funcinfo directive. Declare funcinfo directive before th e ret or retf machine instruction. 2330[...]
-
Page 269
Chapter 13 Error Messages Assembler Errors 257 13.2.3 Fatal Error Messages 2501 Illegal option (string). There is an unreco gnized option on the command line. Check the command line options. 2502 Too many input files (filename). There is more than one input file name on the command line. Limit the command line to a single input fil e. 2503 Input fi[...]
-
Page 270
Chapter 13 Error Messages 258 Linker Errors 13.3 Linker Errors The linker displays three types of messages : warni ng messages, error messages, and fatal error mes sag- es.[...]
-
Page 271
Chapter 13 Error Messages Linker Errors 259 13.3.1 Warning Messages 3000 filename: Section not found. This file ignored. The input file does not contain sect ion information. Check the contents of the specified input file. 3001 filename: Illegal section[name] attribute or align value. Different files have sections with the same name , but different[...]
-
Page 272
Chapter 13 Error Messages 260 Linker Errors 13.3.2 Error Messages 3300 Bad option switch.(string) There is an error in the option specifications. Check the option specifications 3301 No parameter for (option) option. There is no parame ter for the specified option. Check the command line options. 3302 Illegal parameter with (option) option. The par[...]
-
Page 273
Chapter 13 Error Messages Linker Errors 261 3313 Extra symbol[name] used as normal symbol. The extra symbol, which is reserved for instru ction RAM use, is used in a context other than a - PUT option. Modify the program t o use a diff erent symbol in that context.[...]
-
Page 274
Chapter 13 Error Messages 262 Linker Errors 13.3.3 Fatal Error Messages 3500 No memory space. There is insufficient m emory. Make sure that there is suffic ient memory capacity available 3501 fileneme: Cannot open file. The specified input file does not exist. Check the disk for the file. 3502 filename: Cannot read file. There is an error with th e[...]
-
Page 275
Chapter 13 Error Messages Linker Errors 263 3512 filename: Illegal relocation information.(line lineno) The relocation information in the specified inp ut fi le is inval id. Check the specified line in the source file. If there are no problems there, reassemble the corresponding source file and check the disk for hardware errors. 3513 filename: Ill[...]
-
Page 276
Chapter 13 Error Messages 264 Linker Errors[...]
-
Page 277
14 Chapter 14 Readinig List Files[...]
-
Page 278
Chapter 14 Reading List Files 266 Purpose of This Chapter 14.1 Purpose of This Chapter This chapter explains how to read th e list files output during assembly. There are two types of information output in a list file. • Machine language code • Symbo l table This chapter also explains how to read the information added by individual options and [...]
-
Page 279
Chapter 14 Reading List Files Reading 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 curren t directory. List file contents ar e entirely in text form at, so those can be vi ewed by using an editor.[...]
-
Page 280
Chapter 14 Reading List Files 268 Reading List Files 14.2.1 Output Format of Machine Language Code The output format of the machine language code section is shown below. Each of these fields is descri bed below. Location (Loc) The location field shows the location counter values during assembly. For section address format programs, the location fie[...]
-
Page 281
Chapter 14 Reading List Files Reading List Files 269 Supplemental information A line number can provide additi onal informatio n in the form of preceding pe riods and the suffixes X or +. “.” Line numbers preceding by a period indicate that the li ne was included by an include directive. The number of periods indicate th e nesting levels of inc[...]
-
Page 282
Chapter 14 Reading List Files 270 Reading List Files Source statement (Source) The source statements of the s ource file are output as is. If the Lm optio n is added when t he assembler is invoked, output of source statemen ts resulting from macro expansio n wi ll be suppressed. Below are example of source statement. listspl.lst Page 1 *** PanaX Se[...]
-
Page 283
Chapter 14 Reading List Files Reading List Files 271 14.2.2 Symbol Table If only the l (letter) option is specified, and not the c or s options, when the assembler is invoked, the assembler will output a symb ol table to th e lis t file after the machine language code section. If the c option is specified, a cr oss-reference table will be output in[...]
-
Page 284
Chapter 14 Reading List Files 272 Reading List Files Symbol Name Symbol names are shown up to 255 characters. An output example of a symbol table is sh own bel ow. listspl.lst Page 2 *** Symbol Table *** 12345678 A data -U move 00000000 T main[...]
-
Page 285
15 Chapter 15 Using Library Manager[...]
-
Page 286
Chapter 15 Using Library Manager 274 Purpose of This Chapter 15.1 Purpose of This Chapter A library file is a collection of relocatable object files which you can pull out as needed. Library fi les are convenient for placing frequently used modu les. When a module is called from within a pro gram, th e linker searches the library file, extracts onl[...]
-
Page 287
Chapter 15 Using Library Manager Starting Library Manager 275 15.2 Starting Library Manager The library manager is started by entering a comman d name and parameters, just as for other MS-DOS external commands. General format of commands Below is the general format of the comman d to use when starting th e library manager. slib103 library_file_name[...]
-
Page 288
Chapter 15 Using Library Manager 276 Command Options 15.3 Command Options This section describes t he options using the following categories. 15.3.1 Error Message Options Functional description This option causes an error and warning mes sages and help screens sent to the console to appear in Japanese. The character coding depends on the host machi[...]
-
Page 289
Chapter 15 Using Library Manager Command Options 277 Functional description This option causes all error and warning messages and he lp screens sent to the console to appear in Jap- anese using EUC coding. Rules of use To specify the option, enter the h yphen (-) followed by the upper case letter “J” and the lower case letter “e”. The two l[...]
-
Page 290
Chapter 15 Using Library Manager 278 Command Options Functional description This option causes all error and warning mess ages and help screens sent to th e console to appear in Japanese using Shift JIS coding. Rules of use To specify the optio n, enter the h yphen(-) followed by t he upper case le tter ’J’ and the lower case letter ’s’. Th[...]
-
Page 291
Chapter 15 Using Library Manager Command Options 279 Functional description This option causes all error and warning messages and help screens sent to the console to appear in Japanese using JIS coding. Rules os use To specify the option, enter the h yphen (-) followed by the upper case letter “J” and the lower case letter “j”. The two lett[...]
-
Page 292
Chapter 15 Using Library Manager 280 Command Options Functional description This option causes all error and warning mess ages and help screens sent to th e console to appear in English. Rules of use To specify the option, enter the hyphe n (-) followed by the lower case letter”e”. slib103 test.lib -f -e test1.rf test2.rf test3.rf Default speci[...]
-
Page 293
Chapter 15 Using Library Manager Command Options 281 Functional description This option suppresses outp ut of warning messages ge nerated during lib rary m ana ger op er atio n. Fo r a list of warning messages and nu mbers, see Chapter 15 “Using the Library Manager” Section 15.4 “Error Messages” Section 15.4.1.”Warning Messages”. The li[...]
-
Page 294
Chapter 15 Using Library Manager 282 Command Options 15.3.2 Program Generation Options Functional description If a file with same name of the specified library fi le already exists, the library m anager will inquire if the file should be modified. Based on the response, the library m anager with determine whether or not to create the library file. [...]
-
Page 295
Chapter 15 Using Library Manager Command Options 283 Functional description This option forces creation of the libra ry file. If a file with the same name as the specified library file already exist, the library manager will overwri te it. Rules of use To specify the option, enter the hyphen (- ) followed by the lower case letter “r”. slib103 t[...]
-
Page 296
Chapter 15 Using Library Manager 284 Command Options 15.3.3 Functional Options Functional description This option is used to add relocatable object files to the li brary file. Rules of use To specify the option, enter the hyphen (-) followed by the lower case letter “a”. slib103 test.lib -a test.1.rf Operation example slib103 test.lib -a test.1[...]
-
Page 297
Chapter 15 Using Library Manager Command Options 285 Functional description This option is used to delete relocatable ob ject fi les from the library file. If a specified file does not exist in the library fi le, the library manager will ou tpu t a warning message and continue processing. Rules of use To specify the option, enter the hyphen (- ) fo[...]
-
Page 298
Chapter 15 Using Library Manager 286 Command Options Functional description This option is used when you want kno w the externall y defi ned symbol names that exist in the library file. When a relocatable object file name is specified following the -p option, and a file with the same name exists in the library file, the extern ally defined symbol n[...]
-
Page 299
Chapter 15 Using Library Manager Command Options 287 Functional description This option is used to replace relocatable object files in the library file. If a specified file does not exist in the library file, the library manager will ou tpu t a message add the relocatable object file. Rules of use To specify the option, enter the hyphen (- ) follow[...]
-
Page 300
Chapter 15 Using Library Manager 288 Command Options Functional description This option is used when you want to kn ow the nam e s of the relocatable object files that exist in the library file. When a relocatable o bject file name is specif ied following the -t op tion, and a file with th e same n ame exists in the library file, that file n ame wi[...]
-
Page 301
Chapter 15 Using Library Manager Command Options 289 Functional description This option is used when you want to extract relo catable object files that ex ist in the library file. When a relocatable object file name is specified following the -x option, and a file with the same name exists in the library file, that relocatable object file wi ll be [...]
-
Page 302
Chapter 15 Using Library Manager 290 Command Options 15.3.4 Other Options Functional description The options you will use with slib103 can be wri tten to a file, so instead of specifying all those option s for execution, you can specify just that file name. Every option other than the @ option can be written in a parameter file. If a parameter file[...]
-
Page 303
Chapter 15 Using Library Manager Command Options 291 Functional description This option displays the library manager’s vers ion numb er, comm and li ne options and a brief description on the console. The -j, -Je, -Js, -Jj and -e options, if they appear, control the language and the coding scheme used to display this information . Rules of use To [...]
-
Page 304
Chapter 15 Using Library Manager 292 Error Messages 15.4 Error Messages The library manager displays three types of m ess ages: warning message, error messages, and fatal error messages. These messages are display during library manager operation. A warning message warns the user of some state an d consists of the marker “warning”, the warning [...]
-
Page 305
Chapter 15 Using Library Manager Error Messages 293 15.4.1 Warning Messages 4001 Filename not found The specified file is not in the library. Check the list of files in the library file. 4002 This file has no public symbol inform ation.(filename) There is no public symbol information fo r the file filename. Check whether the file is actually needed[...]
-
Page 306
Chapter 15 Using Library Manager 294 Error Messages 15.4.2 Error Messages 4301 Multiply specified object file name.(filename) Either the same object file is specified twice on th e command line or an obj ect file with the same name is in the librar y. Check the filename specifications. If necessary, change the file names. 4302 Premature EOF. (filen[...]
-
Page 307
Chapter 15 Using Library Manager Error Messages 295 4313 Parameter-file already specified. (fi lename) The same parameter file is specified more than once. Eliminate the duplic ate specifications. 4314 Cannot read parameter-file. (filename ) The library manager cannot read the parameter file--because it co ntains illegal characters, for example. Ch[...]
-
Page 308
Chapter 15 Using Library Manager 296 Error Messages 15.4.3 Fatal Error Messages 4501 Illegal option. (string) The library manager does not support the specified opt ion. Check the command line option specifications. 4502 Library file name not found. Either the command line contains no library file specification or the specification is in th e wrong[...]
-
Page 309
16 Chapter 16 Notes on Operating Environment[...]
-
Page 310
Chapter 16 Notes on the Operating Envir onment 298 Purpose of This Chapter 16.1 Purpose of This Chapter This chapter contains descriptions left out of other chapters.[...]
-
Page 311
Chapter 16 Notes on the Operating Environment Personal Computer Versions 299 16.2 Personal Computer Versions This sectio n contains not es on usin g the personal computer versions of the software in this package.[...]
-
Page 312
Chapter 16 Notes on the Operating Envir onment 300 Personal Computer Versions 16.2.1 Operating Environment This system runs on the following personal comput ers and com pati bles. Host Machine Operating System Version of OS PC/AT Windows 98/2000/Me/XP DOS/V Windows 98/2000/Me/XP[...]
-
Page 313
Chapter 16 Notes on the Operating Environment Personal Computer Versions 301 16.2.2 Files The installation medi a for this syst em contains the following files. AS103.EXE (Assembler) AS103.EXE is the assembler. For a descriptio n, see the chapter 5 “Using the Assembler.” LD103.EXE (linker) LD103.EXE is the linker. For a descriptio n, see the ch[...]
-
Page 314
Chapter 16 Notes on the Operating Envir onment 302 Personal Computer Versions 16.2.3 Installation For the installation media, installation procedures, and notes on in st allat ion, see the MN1030 Series Installation Manual.[...]
-
Page 315
Chapter 16 Notes on the Operating Environment Personal Computer Versions 303 16.2.4 Environment Settings Before using this series Cross-Assembl e r, verif y or change the following two files. CONFIG.SIS If FILES and BUFFER specifications do not already exi st in CONF IG .SYS, you must add th em . If they do already exist, check their se ttings and [...]
-
Page 316
Chapter 16 Notes on the Operating Envir onment 304 Personal Computer Versions NOTE: Once you have edited AUTOEXEC.BAT, reset the co mputer and restart. The new setting will then auto matically take effect. Terminology: AUTOEXEC.BAT AUTOEXEC.BAT is a batch file that MS-DOS automatically runs wh en it loads. SET is the command for sett ing MS-DOS env[...]
-
Page 317
Chapter 16 Notes on the Operating Environment Personal Computer Versions 305 16.2.5 Differences From Workstation Versions The personal computer versions 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, om it th e fi le ext[...]
-
Page 318
Chapter 16 Notes on the Operating Envir onment 306 Personal Computer Versions 16.2.6 Error Correction Using Tag Jumps This section describes a convenient way to fix erro rs. When code mistakes, syntax errors, or other errors and warnings occur in a source file, further development cannot proceed unless they are fixed. In long source files, it can b[...]
-
Page 319
Chapter 16 Notes on the Operating Environment Personal Computer Versions 307 The following explanation is for the programmer’s editor MIFES. Start up MIFES and open two files. MI MAIN.ASM ERROR The contents of the file ERROR will be displayed on the screen. Tag jumps The first error message matches this display on the screen. MAIN.ASM(5): Error 2[...]
-
Page 320
Chapter 16 Notes on the Operating Envir onment 308 Personal Computer Versions Return to error file To return to the error file, press the HOME CLR key (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 [...]
-
Page 321
17 Chapter 17 Appendix[...]
-
Page 322
Chapter 17 Appendix 310 Numeric Restrictions 17.1 Numeric Restrictions This section shows the numeric restriction s on this se ries cross-assembler. Be sure not to exceed these values when writing programs. Assembler restrictions Linker restrictions Directive restrictions Assembler control directive restrictions Macro directive restrictions Paramet[...]
-
Page 323
Chapter 17 Appendix 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_nam e functional_description specification_example[...]
-
Page 324
Chapter 17 Appendix 312 List of Command Options 17.2.1 List of Assembler Command Options Assembler command general format Below is the general format of the co mmand to use when starting the assembler. as103 [options] source_filename Contents of brackets [ ] may be omitted. Output file options o file_name Specify the relocatable object file name to[...]
-
Page 325
Chapter 17 Appendix List of Command Options 313 Error message options Preprocessor options Program generation options j Output error and warning messages in Japanese as103 -j sample.asm Je Output error and warning messages in Japanese using EUC encoding. as103 -Je sample.asm Js Output error and warning messages in Japanese usi ng Shift JIS enco din[...]
-
Page 326
Chapter 17 Appendix 314 List of Command Options Others h Display a listing of available assembl er options on th e console. as103 -h v Display the assembler’s version number on the console. as103 -v[...]
-
Page 327
Chapter 17 Appendix List of Command Options 315 17.2.2 List of Linker Command Options Linker command general format Below is the general format of the co mmand to use when starting the linker. ld103 [options] (filename)... Contents of brackets [ ] may be omitted. Ellipses (...) indicates item may be repeated. Output file options Error message optio[...]
-
Page 328
Chapter 17 Appendix 316 List of Command Options Program generation options Library file options Instruction RAM options g Output debug informati on to the executabl e format file. ld103 -g main.rf sub.rf T section-address Specify a section start address. ld103 -T_TEXT@CODE=80000000 -T@DATA=0 main.rf sub.rf r Output an executable format file even if[...]
-
Page 329
Chapter 17 Appendix List of Command Options 317 Others @ Specify a parameter file. ld103 @ pfile h Display help inform ation on the console. ld103 -h v Display the linker’s version number on the consol e. ld103 -v[...]
-
Page 330
Chapter 17 Appendix 318 List of Assembler Directives 17.3 List of Assembler Directives This section provides a list of assembler directives. Directives for program control Directives for symbols Syntax Function & Notes symbol instruction operand align expression Adjust the location counter to be a multip le of th e value indicated by expression[...]
-
Page 331
Chapter 17 Appendix List of Assembler Directives 319 Directives for dat a area allocation Directives for list control Syntax Function & Notes symbol instruction operan d dc definition | expressi on(,definition | expression)... Allocates 8-bit data areas. dw expression(,expression)... Al locates 16-bit data areas. dd expression(,expression)... A[...]
-
Page 332
Chapter 17 Appendix 320 List of Assembler Directives Other directives Syntax Function & Notes symbol instruction operand notation format Selects the codin g format of numbers, format (CLANG | INTEL | PANA) CLANG: Extended C language format (default) INTEL: Intel forma t PANA: Matsushita format radix expression Specifies th e radix to be used by[...]
-
Page 333
Chapter 17 Appendix List of Assembler Control Statements 321 17.4 List of Assembler Control Statements This section provides a list of assembler control statements. Syntax Function & Notes #include “file_name Reads in the s ource file specified by file_name. #define identifier[replacement_ string] Replaces the identifier with the replacement_[...]
-
Page 334
Chapter 17 Appendix 322 List of Assembler Control Statements #iflt expression block1 Assembles block1 if the expression is negativ e. Assembles block2 if it is not negative (nothi ng wil l be assembled if there is no #else). [#else #endif block2] #ifle expression block1 Assembles block1 if the expressio n is zero or negative. Assembles block2 if it[...]
-
Page 335
< Index 1 > Index Symbols #define ............ ............... ................ ................. ..... 187 #else ........... .............. ................. .............. .............191 #endif .............. ............... ................ ................. ..... 189 #if ............ .............. ................. ................. ..[...]
-
Page 336
< 2 Index > J j ............. .............. ................. .............. ............ 91, 111 L l library_filename ........................... ................. .... 103 L path_name .................. ................. ................. .... 104 Label Field ......... .............. ................. ................. . 148 LD103.EXE ....[...]
-
Page 337
< Index 3 > U Unary minus ................... ................ ................. ..... 138 Unary negation .................... ................. ................139 Unary plus ................... ................. .............. ..........138 Unconditional Branch Inst ruct ions ............ ............ 46 UND .............. .............. ..[...]
-
Page 338
< 4 Index >[...]
-
Page 339
Issued by Matsushita Electric Indust ri al C o., Ltd. Matsushit a Electric Industrial Co., Ltd . MN1030 Series Cross Assembler User’s Manual June, 2004 12th Edition[...]
-
Page 340
SALES OFFICES NORTH AMERICA ˜ U.S.A. Sales Office: Panasonic Industrial Company [PIC] — New Jersey Office: 2 Panasonic W ay Secaucus, New Jersey 07094, U.S.A. Tel:1-201-348-5257 Fax:1-201-392-4652 — Chicago Office: 1707 N. Randall Road Elgin, Illinois 60123-7847, U.S.A. Tel:1-847-468-5720 Fax:1-847-468-5725 — San Jose Office: 2033 Gat[...]