aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2025-09-19 07:57:48 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2025-09-19 07:57:48 +0200
commitc0422cf048c1305ec75ddcfd68b81afb8ec5b3f6 (patch)
tree2d4ce0ee3b24bba753006bcf2c9c1e30bd5aecaf
parent1b18c250d57e29fd318058bd2356b626e4cc1c47 (diff)
downloadtools.nes-c0422cf048c1305ec75ddcfd68b81afb8ec5b3f6.tar.gz
tools.nes-c0422cf048c1305ec75ddcfd68b81afb8ec5b3f6.zip
nasm: Better wording on the README file
Instead of only bringing up the pedantic nature of nasm, also note on some of its improvements over ca65. Also, some minor grammar fixes here and there. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
-rw-r--r--crates/nasm/README.md24
1 files changed, 19 insertions, 5 deletions
diff --git a/crates/nasm/README.md b/crates/nasm/README.md
index 4b4cf50..bc58232 100644
--- a/crates/nasm/README.md
+++ b/crates/nasm/README.md
@@ -40,6 +40,20 @@ it will also print a warning telling the programmer about this, as this might be
unexpected at first. Hence, as a general rule `nasm` will be more noisy than
`ca65`, in the hope that the programmer is more aware about the end result.
+That being said, `nasm` is at the same time more flexible than `ca65`. For
+exemple, the order of declaration for variables, proc's, etc. is not
+important. Hence, the following code is valid in `nasm`, but not in `ca65`:
+
+```asm
+.proc foo
+ ;; 'ca65' will complain that 'Variable' is not known.
+ lda #Variable
+ rts
+.endproc
+
+Variable = $00
+```
+
## Mappers
By default `nasm` will assume the configuration for an `NROM` mapper, but this
@@ -102,8 +116,8 @@ zp_buffer = $20 ; asan:reserve $0F
```
Then the address sanitizer will assume that `zp_buffer = $20..$2F
-(included)`. Any access to this reserved range will be considered a
-conflict. For example:
+(included)`. Any access to this reserved range that is not strictly via
+`zp_buffer` will be considered a conflict. For example:
```asm
zp_buffer = $20 ; asan:reserve $0F
@@ -166,6 +180,6 @@ In NES/Famicom programs you have to advertise on the header whether Working RAM
is being used or not (see [byte 6 on the iNES
format](https://www.nesdev.org/wiki/INES)). The programmer is expected to set
this flag on if PRG RAM is available. If there are memory accesses to PRG RAM
-but the programmer did not advertise that on the header flag, then the `nasm`
-will error out as it cannot assume that these accesses are valid. This check
-will happen regardless of the `-a/--asan` flag.
+but the programmer did not advertise that on the header flag, then `nasm` will
+error out as it cannot assume that these accesses are valid. This check will
+happen regardless of the `-a/--asan` flag.