From 1da66eb87880894d503f26aaa432460cdebc66b5 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 18 Dec 2024 09:38:04 +0100 Subject: Improve documentation on nasm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- README.md | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6d99cd4..6678449 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,32 @@ development and it's **not** currently usable. ## `nasm` -`nasm` is an assembler specifically tailored for the NES/Famicom. You can simply -run it like so: +`nasm` is an assembler specifically tailored for the NES/Famicom. Build it and +run it with cargo, or you can install it somewhere in your `$PATH` and simply: ``` -$ cargo run --bin nasm +$ nasm awesome.s ``` -By default it will assume the configuration for an `NROM` file, but this can be -changed with the `-c/--configuration` flag, which accepts the following values: +This will produce an `out.nes` file placed under the same working directory. You +can change the name of the file with the `-o/--output` flag. Hence, you can call +it like so: + +``` +$ nasm -o awesome.nes awesome.s +``` + +Last but not least, you can actually tell `nasm` to redirect the output to +stdout instead with the `--stdout` flag. This is useful when debugging the +binary format with another CLI tool. For example: + +``` +$ nasm --stdout awesome.s | hexdump -C +``` + +By default it will assume the configuration for an `NROM` mapper, but this can +be changed with the `-c/--configuration` flag, which accepts the following +values: - `empty`: just `HEADER` and `CODE`. Useful for one-liners (e.g. "how is this instruction encoded in binary?"). -- cgit v1.2.3