RISC-V directives
RISC-V directives are used to define the structure of the program. They are not instructions that are executed by the CPU, but rather instructions that are used by the assembler to define the structure of the program.
.data
Subsequent items stored in Data segment at next available address
.text
Subsequent items (instructions) stored in Text segment at next available address
.word
Store the listed value(s) as 32 bit words on word boundary
.dword
Store the listed value(s) as 64 bit double-word on word boundary
.ascii
Store the string in the Data segment but do not add null terminator
.asciz
Store the string in the Data segment and add null terminator
.string
Alias for .asciz
.byte
Store the listed value(s) as 8 bit bytes
.align
Align next data item on specified byte boundary (0=byte, 1=half, 2=word, 3=double)
.half
Store the listed value(s) as 16 bit halfwords on halfword boundary
.space
Reserve the next specified number of bytes in Data segment
.double
Store the listed value(s) as double precision floating point
.float
Store the listed value(s) as single precision floating point
.extern
Declare the listed label and byte length to be a global data field
.globl
Declare the listed label(s) as global to enable referencing from other files
.global
Declare the listed label(s) as global to enable referencing from other files
.eqv
Substitute second operand for first. First operand is symbol, second operand is expression (like #define)
.macro
Begin macro definition. See .end_macro
.end_macro
End macro definition. See .macro
.include
Insert the contents of the specified file. Put filename in quotes.
.section
Allows specifying sections without .text or .data directives. Included for gcc comparability