# Data Directives - damn_simple_architecture

## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

# Data Directives

### Data Definition

Mnemonic | Syntax | Description
--- | --- | ---
DB | `name: value1 [, value2, ...]` | Define bytes(byte aligned)
DH | `name: value1 [, value2, ...]` | Define half-words(2 byte aligned)
DW | `name: value1 [, value2, ...]` | Define words(4 byte aligned)

Examples:

    db message: "Hello World", 0, 0x20, 231
    dh numbers: 1000, 2000, 3000
    dw stack: 0x10000

Notes:

- All string literals are automatically null-terminated

### Memory Reservation

Mnemonic | Syntax | Description
--- | --- | ---
RESB | `name: size` | Reserve bytes
RESH | `name: size` | Reserve half-words
RESW | `name: size` | Reserve words

Examples:

    resb buffer: 256    ; Reserve 256 bytes
    resh array: 100     ; Reserve space for 100 half-words
    resw heap: 1024     ; Reserve space for 1024 words

### Imports

Mnemonic | Syntax | Description
--- | --- | ---
INCLUDE | `module_name "path"` | Include module symbols
More details on the module System |  |