(2) assembler Directives
The as assembler supports the standard directives provided in the gnu assembler. Refer to the gnu assembler
manual for the standard directives. Each directive begins with a period (.). The following lists often-utilized
directives.
.text
.section .data
.section .rodata
.section .bss
<data>
.long
<data>
.short
<data>
.byte
<string>
.ascii
<length>
.space
<length>
.zero
<value>
.align
<symbol>
.global
<symbol>,<address>
.set
(3) labels
A label is an identifier designed to refer to an arbitrary address in the program. You can refer to a branch
destination of a program or an address in the .text/.data section by using a symbol defined as a label.
Definition of a label
A symbol described in the following format is regarded as a label.
<Symbol>:
Preceding spaces and tabs are ignored. It is a general practice to describe from the top of a line.
A defined symbol denotes the address of a described location.
An actual address value will be determined in the linking process.
restrictions
Only the following characters can be used:
A–Z a–z _ 0–9
A label cannot begin with a numeral. Uppercase and lowercase are discriminated.
Examples: ;OK
FOO:
_Abcd:
L1:
S5U1C17001C ManUal
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
Declares a .text section.
Declares a .data section.
Declares a .rodata section.
Declares a .bss section.
Defines a 4-byte data.
Defines a 2-byte data.
Defines a byte data.
Defines an ASCII character strings.
Defines a blank (0x0) space.
Defines a blank (0x0) space.
Alignment to a specified boundary address.
Defines a global symbol.
Defines a symbol with an absolute address.
;Error
1label:
0_ABC:
EPSOn
4 SOUrCE filES
4
SrcFiles
4-7
Need help?
Do you have a question about the S5U1C17001C and is the answer not in the manual?