• Keine Ergebnisse gefunden

EPSON.lcomm pseudo-instruction

Instruction format

.lcomm <Symbol>[,] <Size>

<Symbol>: Symbols for memory access (address reference)

· The 1st character is limited to a–z, A–Z and _.

· The 2nd and the subsequent character can use a–z, A–Z, 0–9 and _.

· Up to 32 characters can be used for symbol names.

· Uppercase and lowercase are discriminated.

· One or more spaces, tabs or a comma (,) are necessary between instruction and symbol.

<Size>: Number of bytes of the area to be secured

· Only decimal, binary and hexadecimal numbers can be described.

· One or more spaces, tabs or a comma (,) are necessary between symbol and size.

Sample description:

.lcomm BAR 0x10 Function

Sets an area of the specified size in the BSS section, and creates a symbol indicating its top address with the specified name. By using this symbol, you can describe an instruction to access the memory. The symbols created by the .lcomm pseudo-instruction are local symbols, which cannot be referred to from other modules.

Only the .lcomm and .comm pseudo-instructions are processed as BSS sections. If some other statement follows the .lcomm or .comm pseudo-instruction, the previous section type applies from that point.

For details on the sections, refer to Section 11.7 "Definition of Sections".

Precautions

· A BSS section can be divided among multiple locations of a source file for purposes of definition (describing the .lcomm pseudo-instruction in the respective start positions).

However, not that multiple BSS section cannot be defined in an absolute source file. The total of sections that can be defined in one source file is maximum 256 in the absolute assembling.

· The address to be assigned the symbol is adjusted to the boundary according to the data size.

Data size: 1 Byte boundary

2 Half word boundary

3 or more Word boundary

11.8.4 Location Counter Control Pseudo-Instruction (.org)

.org pseudo-instruction

Instruction format .org <Address>

<Address>: Absolute address specification

· Only decimal, binary and hexadecimal numbers can be described.

· The addresses that can be specified are from 0 to 0xfffffff.

· One or more spaces, tabs or a comma (,) are necessary between the instruction and the address.

Sample description:

.org 0 .org 0x80000 Function

Specifies an absolute address in an absolute assembly source file. The as33 performs assembling by assuming that statements following this instruction start from the specified address.

Precautions

· The .org pseudo-instruction cannot be used (within a relocatable source), if the .abs pseudo-instruction was not described. If used under such condition, an error will result.

· The .org pseudo-instruction specifies a section start address with the operand value. Note, however, if an odd address is specified, the address may be adjusted to the boundary address according to the subsequent instruction or definition.

CHAPTER 11: ASSEMBLER

EPSON

11.8.5 Symbol Defining Pseudo-Instruction (.set)

.set pseudo-instruction

Instruction format

.set <Symbol>[,] <Address>

<Symbol>: Symbols for memory access (address reference)

· The 1st character is limited to a–z, A–Z and _.

· The 2nd and the subsequent character can use a–z, A–Z, 0–9 and _.

· Uppercase and lowercase are discriminated.

· One or more spaces, tabs or a comma (,) are necessary between the instruction and the symbol.

<Address>: Absolute address specification

· Only decimal, binary, and hexadecimal numbers can be described.

· The addresses that can grammatically be specified are from 0 to 0xfffffff.

· One or more spaces, tabs or a comma (,) are necessary between the instruction and the address.

Sample description:

.set DATA1 0x80000 Function

Defines an absolute address (32-bit) for a symbol.

Precautions

· The .set pseudo-instruction cannot be used (within a relocatable source), if the .abs pseudo-instruction was not described. If used in such situation, an error will result.

· The set symbol becomes a local symbol. To use it as a global symbol, global declaration using the .global pseudo-instruction is necessary.

Reference

To define general-use data and character strings, use the #define pseudo-instruction of the preprocessor. (See Section 9.5.2.)

11.8.6 Data Defining Pseudo-Instruction (.word, .half, .byte, .ascii, .space)

.word pseudo-instruction

Instruction format

Format 1) .word <Data>[[,] <Data> . . . [,] <Data>]

Format 2) .word <Symbol>

<Data>: Word data (32 bits)

· Only decimal, binary and hexadecimal numbers can be described.

· The data that can be specified are from 0 to 0xffffffff.

· One or more spaces, tabs or a comma (,) are necessary between the instruction and the first data and between one data and another.

<Symbol>: Symbol name that has been defined Sample description:

.word 0x10000000 0x20000000 0x30000000 0x4000000 .word 256

.word FOO Function

Format 1) Defines word data. Data can be defined in a CODE section or DATA section.

Format 2) Defines the symbol value as a word data. Data can be defined in a CODE section or DATA section.

Precautions

· The .word pseudo-instruction can be used in a CODE section or a DATA section.

· Two or more data can be defined at a time in Format 1. However, one line is limited to 255 characters, including blank characters.

· The defined data is located beginning with a word boundary address unless it is immediately preceded by the .align pseudo-instruction. If the current position is not a word boundary address, 0x00 is set in the interval from that position to the nearest word boundary address.

.half pseudo-instruction Instruction format

.half <Data>[[,] <Data> . . . [,] <Data>]

<Data>: Half word data (16 bits)

· Only decimal, binary and hexadecimal numbers can be described.

· The data that can be specified are from 0 to 0xffff.

· One or more spaces, tabs or a comma (,) are necessary between the instruction and the first

CHAPTER 11: ASSEMBLER

EPSON