aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-04-30 13:14:51 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-04-30 13:14:51 +0200
commitfdfc017b68a397fc2a1c02378a6c86ca7966954d (patch)
treee6bff83ec4d3e0b8d04067c604fdcb42441aec25
parentc05e3fcec1623deb9c2fa4b023b1e2a6dc289bbb (diff)
downloadtools.nes-fdfc017b68a397fc2a1c02378a6c86ca7966954d.tar.gz
tools.nes-fdfc017b68a397fc2a1c02378a6c86ca7966954d.zip
nasm: add documentation to the 'unused' checks
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
-rw-r--r--crates/nasm/README.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/nasm/README.md b/crates/nasm/README.md
index d61c84e..355b28b 100644
--- a/crates/nasm/README.md
+++ b/crates/nasm/README.md
@@ -246,6 +246,29 @@ fit in a byte. Hence, you could have a code like follows:
If you compile the code with `-D PAL=1`, then the first branch will be taken
instead of the second one.
+### Unused code
+
+This assembler will also issue a warning whenever it finds unreferenced
+variables or labels. Hence, if you have something like:
+
+```asm
+foo:
+ rts
+
+;; code that never references 'foo'.
+```
+
+Then you will get:
+
+```
+warning: raw address 'foo' is unused (unused.s)
+```
+
+In the case for subroutines defined via `.proc`, this warning will actually be
+an error, as `nasm` can rightly identify that this is dead code.
+
+This check can be skipped by providing the `--allow-unused` flag on nasm.
+
## Address sanitizer
This assembler comes with a set of tools that builds up an "address