diff options
| author | Aetias <aetias@outlook.com> | 2024-04-16 17:18:18 +0200 |
|---|---|---|
| committer | Aetias <aetias@outlook.com> | 2024-04-16 17:18:18 +0200 |
| commit | 95ff668c539ce05296b1eec1c7c147c7815486eb (patch) | |
| tree | 4545eed3706c325d5ed0ceb8c0be6e320dc93573 /docs/inline_assembler.md | |
| parent | 9ac440e5ec100de026204c49aae118bdc79a5349 (diff) | |
Update `inline_assembler.md`
Diffstat (limited to 'docs/inline_assembler.md')
| -rw-r--r-- | docs/inline_assembler.md | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/docs/inline_assembler.md b/docs/inline_assembler.md index a6489998..0ef8d669 100644 --- a/docs/inline_assembler.md +++ b/docs/inline_assembler.md @@ -9,20 +9,27 @@ to contribute to the list! - [Comments](#comments) ### Pool constants -There is no `.word` or other data directives in the inline assembler. Instead, use the built-in `dcd` instruction: +There is no `.word` or other data directives in the inline assembler. Instead, there are three built-in instructions you can +use: + +#### `dcd`: Emits a literal 32-bit value ```asm mov r0, [pc, #0] bx lr dcd 0x1234 ``` -This can also be written as: +#### `ldconst`: Loads a literal 32-bit value ```asm ldconst 0x1234 bx lr ``` +This code is equivalent to the above example using `dcd`. -The built-in `ldconst` instruction will be replaced by an ARM load instruction and also append a pool constant to the function. +#### `lda`: Loads the address to a symbol +``` +lda r0, data_ov00_02abcdef +``` ### Data sections Directives such as `.section`, `.data` and `.bss` are not supported in the inline assembler. It's possible to change section |
