4 SOUrCE filES
(3) Symbols
In specifying an address with immediate data, you can use a symbol defined in the source files.
Definition of symbols
Usable symbols are defined as 24-bit values by any of the following methods:
1. It is described as a label (in text, data or bss section)
Example: LABEL1:
LABEL1 is a symbol that indicates the address of a described location in the .text, .data, or .bss
section.
2. It is defined with the .set directive
Example: .set
ADDR1 is a symbol that represents absolute address 0x00ff00.
restrictions on characters
The characters that can be used are limited to the following:
A–Z a–z _ 0–9
Note that a symbol cannot begin with a numeral. Uppercase and lowercase characters are discriminated.
local and global symbols
Defined symbols are normally local symbols that can only be referenced in the file where they are defined.
Therefore, you can define symbols with the same name in multiple files. To reference a symbol defined
in some other file, you must declare it to be global in the file where the symbol is defined by using the
.global directive.
Extended notation of symbols
When referencing an address with a symbol, you normally write the name of that symbol in the operand
where an address is specified.
Examples: call
ld.a
The as assembler also accepts the referencing of an address with a specified displacement as shown below.
LABEL + imm24 LABEL + sign24
Example: xcall
4-10
ADDR1,0xff00
← LABEL = sign10
LABEL
%rd,LABEL ← LABEL = sign7
LABEL+0x10
EPSOn
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
S5U1C17001C ManUal
Need help?
Do you have a question about the S5U1C17001C and is the answer not in the manual?
Questions and answers