6 Assembler
Data Defining Directives (.long, .short, .byte, .ascii, .space)
6.5.4
The following assembler directives are used to define data in .data or .text sections:
List of data section defining directives
.long
Define 4-byte data.
.short
Define 2-byte data.
.byte
Define 1-byte data.
.ascii
Define ASCII character strings.
.space
Fills an area with a byte data.
Instruction format
.long
<4-byte data>[,<4-byte data> ... ,<4-byte data>]
.short
<2-byte data>[,<2-byte data> ... ,<2-byte data>]
.byte
<1-byte data>[,<1-byte data> ... ,<1-byte data>]
.ascii
"<character string>"[,"<character string>" ... ,"<character string>"]
.space
<length>[,<1-byte data>]
<4-byte data>
<2-byte data>
<1-byte data>
<character string>
< length>
Description
(1) .long, .short, .byte
Defines one or more 4-byte data, 2-byte data, or 1-byte data. When specifying two or more data, separate them with a
comma. The defined data is located beginning with a boundary address matched to the data size by the data defining
directive unless it is immediately preceded by the .align directive. If the current position is not a boundary address, 0x00
is set in the interval from that position to the nearest boundary address.
Example: .long 0x0,0x1,0x2
.byte 0xff
In addition to these directives, the directives listed below can also be used.
.hword same as .short
.word
same as .short
.int
same as .short
(2) .ascii
Defines one or more string literals. Enclose a character string in double quotes. ASCII characters and an escape sequence
that begins with a symbol "\" can be written in a character string. For example, if you want to set double quote in a character
string, write \"; to set a \, write \\. When specifying two or more strings, separate them with a comma. The defined data is
located beginning with the current address first, unless it is immediately preceded by the .align directive.
Example: .ascii "abc","xyz"
.ascii "abc\"D\"efg"
(3) .space
An area of the specified <length> bytes long is set to <1-byte data>. The area begins from the current address unless it is
immediately preceded by the .align directive.
If <1-byte data> is omitted, the area is filled with 0x0. To fill the area with 0x0, the .zero directive (see the next page) can
also be used.
Example: .space
.zero
6-8
0x0-0xffffffff
0x0-0xffff
0x0-0xff
ASCII character string
Area size to be filled
4,0xff
4
Seiko Epson Corporation
(= abc"D"efg)
Sets 0xff to the 4-byte area beginning from the current address.
(= .space 4,0x0)
S5U1C17001C Manual
(Rev. 1.0)
Need help?
Do you have a question about the S5U1C17001C and is the answer not in the manual?