Directives
Assembler directives are special commands that control how the assembler organizes data in memory.
Unlike normal instructions, directives do not generate machine code. Instead, they inform the assembler how to allocate and initialize data before program execution.
In the ÆRIS simulator, directives are typically used within the .data section.
Currently, three data directives are supported:
.word.ascii.string
The .word directive stores 32-bit integer values in memory.
Each value occupies 4 bytes and is stored sequentially in the data segment.
Example:
.datavalue: .word 10This stores the value 10 as a 32-bit integer.
It is also possible to define multiple values in a single directive:
.datanumbers: .word 1, 2, 3, 4This creates four consecutive 32-bit words in memory
.ascii
Section titled “.ascii”The .ascii directive stores a sequence of characters in memory
Example:
.datamsg: .ascii "Hello"This stores the ASCII bytes corresponding to the characters:
H e l l oSince there is no null terminator, .ascii is generally used to store raw character data
.string
Section titled “.string”The .string directive stores a sequence of characters in memory.
In the ÆRIS simulator, .string is just an alias for .ascii.
This means both directives have exactly the same behavior.
Example:
.datamsg: .string "Hello"