Define Instruction (#Define) - Epson S5U1C63000A User Manual

Cmos 4-bit single chip microcomputer manual
Table of Contents

Advertisement

4.7.2 Define Instruction (#define)

Any substitute character string can be left defined as a Define name by the define instruction (#define),
and the details of that definition can be referred to from various parts of the program using the Define
name.
Instruction format
#define
<Define name> [<Substitute character string>]
<Define name>:
• The first character is limited to a–z, A–Z, ? and _.
• The second and the subsequent characters can use a–z, A–Z, 0–9, ? and _.
• Uppercase and lowercase characters are discriminated. (#define itself is case insensitive.)
When assembling with the "-c" option, all symbols are case insensitive.
• One or more spaces or tabs are necessary between the instruction and the Define name.
<Substitute character string>:
• When writing all characters can be used, but a semicolon (;) is interpreted as the start of a comment.
• Uppercase and lowercase characters are discriminated.
• One or more spaces or tabs are necessary between the Define name and the substitute character string.
• The substitute character string can be omitted. In that case, NULL is defined in lieu of the substitute
character string. It can be used for the conditional assembly instruction.
Sample definitions:
#define
TYPE1
#define
L1
#define
Xreg
#define
CONST
Expansion rule
If a Define name defined appears in the source, the assembler substitutes a defined character string
for that Define name.
Sample expansion:
#define INT_F1
#define INT_F1_1
:
set
[INT_F1], INT_F1_1
:
S5U1C63000A MANUAL
(S1C63 FAMILY ASSEMBLER PACKAGE)
LABEL_01
%x
(DATA1+DATA2)*2
0xfff0
0
... Expanded to "set [0xfff0],0".
EPSON
CHAPTER 4: ASSEMBLER
65

Advertisement

Table of Contents
loading

Table of Contents