added custom syntax for DSA, minor changes to doc formatting

This commit is contained in:
2025-06-27 22:45:39 +01:00
parent afb2761a2b
commit 790bc597d3
12 changed files with 2900 additions and 110 deletions
+10 -6
View File
@@ -1,6 +1,6 @@
# Data Directives
### Data Definition
## Data Definition
| Mnemonic | Syntax | Description |
|----------|--------|-------------|
@@ -9,6 +9,7 @@
| **DW** | `name: value1 [, value2, ...]` | Define words</br>*(4 byte aligned)*|
**Examples:**
```dsa
db message: "Hello World", 0, 0x20, 231
dh numbers: 1000, 2000, 3000
@@ -16,26 +17,29 @@ dw stack: 0x10000
```
**Notes:**
- All string literals are automatically *null-terminated*
-
### Memory Reservation
- All string literals are automatically *null-terminated*
## Memory Reservation
| Mnemonic | Syntax | Description |
|----------|--------|-------------|
| **RESB** | `name: size` | Reserve bytes |
| **RESH** | `name: size` | Reserve half-words |
| **RESH** | `name: size` | Reserve half-words |
| **RESW** | `name: size` | Reserve words |
**Examples:**
```dsa
resb buffer: 256 ; Reserve 256 bytes
resh array: 100 ; Reserve space for 100 half-words
resw heap: 1024 ; Reserve space for 1024 words
```
### Imports
## Imports
| Mnemonic | Syntax | Description |
|----------|--------|-------------|
| **INCLUDE** | `module_name "path"` | Include module symbols |
[More details on the module System](../imports.md)