# RISC-V Directives

[RISC-V Documentation](https://asm-editor.specy.app/documentation/risc-v.md)

Web page: https://asm-editor.specy.app/documentation/risc-v/directive

What the assembler does with the lines that start with a dot.

32 entries, each with its own page of markdown:

- [What directives are](https://asm-editor.specy.app/documentation/risc-v/directive/what-directives-are.md): RISC-V directives are used to define the structure of the program.
- [`.data`](https://asm-editor.specy.app/documentation/risc-v/directive/data.md): Subsequent items stored in Data segment at next available address
- [`.text`](https://asm-editor.specy.app/documentation/risc-v/directive/text.md): Subsequent items (instructions) stored in Text segment at next available address
- [`.word`](https://asm-editor.specy.app/documentation/risc-v/directive/word.md): Store the listed value(s) as 32 bit words on word boundary
- [`.dword`](https://asm-editor.specy.app/documentation/risc-v/directive/dword.md): Store the listed value(s) as 64 bit double-word on word boundary
- [`.ascii`](https://asm-editor.specy.app/documentation/risc-v/directive/ascii.md): Store the string in the Data segment but do not add null terminator
- [`.asciz`](https://asm-editor.specy.app/documentation/risc-v/directive/asciz.md): Store the string in the Data segment and add null terminator
- [`.string`](https://asm-editor.specy.app/documentation/risc-v/directive/string.md): Alias for .asciz
- [`.byte`](https://asm-editor.specy.app/documentation/risc-v/directive/byte.md): Store the listed value(s) as 8 bit bytes
- [`.align`](https://asm-editor.specy.app/documentation/risc-v/directive/align.md): Aligns the next data address to a 2^n-byte boundary: .align 0 is byte alignment, .align 1 is 2 bytes, .align 2 is 4 bytes, and .align 3 is 8 bytes.
- [`.half`](https://asm-editor.specy.app/documentation/risc-v/directive/half.md): Store the listed value(s) as 16 bit halfwords on halfword boundary
- [`.space`](https://asm-editor.specy.app/documentation/risc-v/directive/space.md): Reserve the next specified number of bytes in Data segment
- [`.double`](https://asm-editor.specy.app/documentation/risc-v/directive/double.md): Store the listed value(s) as double precision floating point
- [`.float`](https://asm-editor.specy.app/documentation/risc-v/directive/float.md): Store the listed value(s) as single precision floating point
- [`.extern`](https://asm-editor.specy.app/documentation/risc-v/directive/extern.md): Declares an external data symbol and its size in bytes, so the assembler can reserve its address for references to that symbol.
- [`.globl`](https://asm-editor.specy.app/documentation/risc-v/directive/globl.md): Marks the listed symbol as global so it can be used as an external name, such as a program entry point: .globl main.
- [`.global`](https://asm-editor.specy.app/documentation/risc-v/directive/global.md): Alias for .globl: marks a symbol as global, for example .global main.
- [`.eqv`](https://asm-editor.specy.app/documentation/risc-v/directive/eqv.md): Substitute second operand for first.
- [`.macro`](https://asm-editor.specy.app/documentation/risc-v/directive/macro.md): Begin macro definition.
- [`.end_macro`](https://asm-editor.specy.app/documentation/risc-v/directive/end_macro.md): End macro definition.
- [`.include`](https://asm-editor.specy.app/documentation/risc-v/directive/include.md): Insert the contents of the specified file.
- [`.section`](https://asm-editor.specy.app/documentation/risc-v/directive/section.md): Switches to the named section, such as .text, .data, .rodata, or .bss.
- [`.bss`](https://asm-editor.specy.app/documentation/risc-v/directive/bss.md): Subsequent items stored in the Data segment, which starts out zeroed
- [`.sbss`](https://asm-editor.specy.app/documentation/risc-v/directive/sbss.md): Alias for .bss
- [`.zero`](https://asm-editor.specy.app/documentation/risc-v/directive/zero.md): Reserve the next specified number of bytes, which read as zero.
- [`.comm`](https://asm-editor.specy.app/documentation/risc-v/directive/comm.md): Reserve the given number of bytes for a global symbol, the way a C compiler declares an uninitialized global variable.
- [`.lcomm`](https://asm-editor.specy.app/documentation/risc-v/directive/lcomm.md): Reserve the given number of bytes for a symbol local to this file, the way a C compiler declares an uninitialized static variable
- [`.p2align`](https://asm-editor.specy.app/documentation/risc-v/directive/p2align.md): Align next data item on a 2^n byte boundary.
- [`.balign`](https://asm-editor.specy.app/documentation/risc-v/directive/balign.md): Align next data item on the given byte boundary, written directly rather than as a power of two
- [`.2byte`](https://asm-editor.specy.app/documentation/risc-v/directive/2byte.md): Alias for .half
- [`.4byte`](https://asm-editor.specy.app/documentation/risc-v/directive/4byte.md): Alias for .word
- [`.8byte`](https://asm-editor.specy.app/documentation/risc-v/directive/8byte.md): Alias for .dword
