diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-04-30 13:14:51 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-04-30 13:14:51 +0200 |
| commit | fdfc017b68a397fc2a1c02378a6c86ca7966954d (patch) | |
| tree | e6bff83ec4d3e0b8d04067c604fdcb42441aec25 /crates/nasm | |
| parent | c05e3fcec1623deb9c2fa4b023b1e2a6dc289bbb (diff) | |
| download | tools.nes-fdfc017b68a397fc2a1c02378a6c86ca7966954d.tar.gz tools.nes-fdfc017b68a397fc2a1c02378a6c86ca7966954d.zip | |
nasm: add documentation to the 'unused' checks
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'crates/nasm')
| -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 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 |
