15 comment adding function, 16 priority of pseudo-instructions, 2 warning – Epson S5U1C63000A User Manual

Page 96: Precautions

Advertising
background image

CHAPTER 4: ASSEMBLER

82

EPSON

S5U1C63000A MANUAL

(S1C63 FAMILY ASSEMBLER PACKAGE)

4.7.15 Comment Adding Function

The preprocessing pseudo-instructions that begin with "#" are all expanded to codes that can be as-
sembled, and delivered in the preprocessed file. Even after that, those instructions are rewritten with
comments beginning with a semicolon (;), so that the original instructions can be identified. However,
note that the replacements of Define names will not subsist as comments.

The comment is added to the first line following the expansion. In case the original statement is accompa-
nied by a comment, that comment is also added.
A macro definition should have a semicolon (;) placed at top of the line.

Example:

• Before expansion

#define

Areg

%a

#macro

ADDX2Y

VALUE

ld

Areg, VALUE

add

Areg, [%x]

ld

[%y], Areg

#endm

ADDX2Y

10h

; MX + 10h -> MY

• After expansion (no debugging information)

;#define

Areg

%a

;#macro

ADDX2Y

VALUE

;

ld

Areg, VALUE

;

add

Areg, [%x]

;

ld

[%y], Areg

;#endm

;ADDX2Y

10h

; MX + 10h -> MY

ld

%a, 0x10

add

%a, [%x]

ld

[%y], %a

4.7.16 Priority of Pseudo-Instructions

Some remarks concerning the priority among the preprocessing pseudo-instructions will be given below:

1. The conditional assembly instructions (#ifdef, #ifndef) have the first priority. Nesting cannot be made

of those instructions.

2. Define instruction (#define), include instruction (#include), or macro instruction (#macro) can be

described within a conditional assembly instruction.

3. Define instruction (#define), include instruction (#include), and macro instruction (#macro) cannot be

described within a macro definition.

4. Define name definitions are expanded with priority over macro definitions.

Advertising