Download RL78,78K0R Coding - Renesas Electronics

Transcript
CubeSuite+ V2.01.00
CHAPTER 4 ASSEMBLY LANGUAGE SPECIFICATIONS
Attribute Type
Classification
CSEG
Segment names defined with the CSEG directive
DSEG
Segment names defined with the DSEG directive
BSEG
Segment names defined with the BSEG directive
MODULE
Module names defined with the NAME directive. (If
Value
These attribute types have no values.
not specified, a module name is created from the primary name of the input source filename.)
MACRO
Macro names defined with the MACRO directive
Example
TEN
EQU
10H
ORG
80H
; The name TEN has the NUMBER attribute and a value of 10H.
START : MOV
A, #10H
; The label START has the ADDRESS attribute and a value of 80H.
BIT1
0FFE20H.0
; The name BIT1 has the BIT attribute and a value of 0FFE20H.0.
EQU
(4) Mnemonic field
Write instruction mnemonics, directives, and macro references in the mnemonic field.
If the instruction or directive requires an operand or operands, the mnemonic field must be separated from the
operand field with one or more blanks or tabs.
However, if the first operand begins with "#", "$","!", or "[", the statement will be assembled properly even if nothing
exists between the mnemonic field and the first operand field.
<Examples of correct mnemonics>
MOV
A, #0H
CALL
!CONVAH
RET
<Examples of incorrect mnemonics>
MOVA
C ALL
#0H
!CONVAH
ZZZ
; There is no blank between the mnemonic and operand fields.
; The mnemonic field contains a blank.
; The RL78,78K0R series does not have a ZZZ instruction.
(5) Operand field
In the operand field, write operands (data) for the instructions, directives, or macro references that require them.
Some instructions and directives require no operands, while others require two or more.
When you provide two or more operands, delimit them with a comma ( , ).
The following types of data can appear in the operand field:
- Constants (numeric or string)
- Character strings
- Register names
- Special characters ($ # ! [ ])
- Relocation attributes of segment definition directives
- Symbols
R20UT2774EJ0100 Rev.1.00
Dec 01, 2013
Page 209 of 872