diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-04-08 22:07:23 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-04-08 22:07:23 +0200 |
| commit | 619adba5854a40773eb674437ef4608ac280ba90 (patch) | |
| tree | 7c504dffaa8fb04bd8c7b5e1a778e84b2c085043 | |
| parent | a2cb050ca18fd7c5533d69e9aa093e4f0a40d0fa (diff) | |
| download | tools.nes-619adba5854a40773eb674437ef4608ac280ba90.tar.gz tools.nes-619adba5854a40773eb674437ef4608ac280ba90.zip | |
Add documentation for asan:stack
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
| -rw-r--r-- | crates/nasm/README.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/nasm/README.md b/crates/nasm/README.md index 775ee7a..de388f7 100644 --- a/crates/nasm/README.md +++ b/crates/nasm/README.md @@ -301,6 +301,29 @@ lda zp_variable + 2 ; bad: arithmetics that would point to out of bounds. lda zp_variable - 1 ; bad: same as before but wrapping around. ``` +Last but not least, what if we want to reserve some space which is not exactly +assigned to a variable? This happens basically with the stack, and for this you +can use the following statement: + +```asm +;; asan:stack $0100-$01FF +``` + +Only one of these statements is allowed for a project. You can explicitely +indicate that we are on the `$0100` page as above, or you can especify just a +byte: + +```asm +;; asan:stack $00-$FF +``` + +The above will implicitely assume we are on the `$0100` page. But, for this +simple case, a shorthand is given when you want to use the whole page: + +```asm +;; asan:stack full +``` + With all of this, `nasm` will be able to tell how much memory you've been using so far, and if you add the `--write-info` option, you will also know how this memory is laid out by reading the `.nasm/memory.txt` file. Couple that with the |
