Symbols (Labels) - Epson S5U1C63000A User Manual

Cmos 4-bit single chip microcomputer manual
Table of Contents

Advertisement

CHAPTER 4: ASSEMBLER
Types of pseudo-instructions
The following 25 types of pseudo-instructions are available:
#include #define #macro #endm #ifdef #ifndef #else #endif #defnum
.abs .align .org .code .data .bss .codeword .word .comm .lcomm
.global .set .list .nolist .stabs .stabn
For details of each pseudo-instruction and its functionality, refer to Section 4.7, "Assembler Pseudo-
Instructions".
Restriction
The mnemonics and pseudo-instructions are all not case sensitive. Therefore, they can be written in
uppercase (A–Z) characters, lowercase (a–z) characters, or both. For example, "ld", "LD", and "Ld" are
all accepted as "ld" instructions. However, the user defined symbols used in the operands or param-
eters are case sensitive. They must be the same with the defined characters. When assembling with the
"-c" option, all symbols are case insensitive.

4.5.3 Symbols (Labels)

A symbol (label) is an identifier designed to refer to an arbitrary address in the program. It is possible to
refer to a branch destination of a program or a data memory address using the defined symbol.
Definition of a symbol
Usable symbols are defined as 16-bit values by any of the following methods:
1. <Symbol>:
Example: LABEL1:
Preceding spaces and tabs are ignored. It is a general practice to describe from the top of a line.
2. Definition using the .set pseudo-instruction
Example: .set
3. Definition using the .comm or .lcomm pseudo-instruction
Example: .comm
The .comm and .lcomm pseudo instructions can define labels only in bss sections (data memory
such as RAM). Program memory addresses cannot be defined.
Reference with symbols
A defined symbol denotes an address.
The actual address value should be determined in the linking process, except in the case of absolute
sections.
Examples: LABEL1:
jr
.set
IO_M
.org
0x0000
.bss
.comm COUNT1 1
.code
ldb
%ext,IO_M@h
ldb
%xl,IO_M@l
inc
[COUNT1]
54
... LABEL1 is a label that indicates the address of a described location.
ADDR1 0xff00
... ADDR1 is a symbol that represents absolute address 0xff00.
BUF1
4
... BUF1 is a label that represents a RAM address.
:
LABEL1
0xfff0
... 0xfff0 is loaded to X-register. (@h and @l are symbol masks.)
... Regarded as inc [0x0000].
... jumps to the LABEL1 location.
EPSON
(S1C63 FAMILY ASSEMBLER PACKAGE)
S5U1C63000A MANUAL

Advertisement

Table of Contents
loading

Table of Contents