diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-12-16 16:29:49 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-12-16 16:29:49 +0100 |
| commit | 5cea733924c3fd9df91a19c7d7c59ae85915221b (patch) | |
| tree | c8a3dceb6b4673d9299f2dc187625a25ece9195a | |
| parent | 1d0bb4d384d391b5603622d813a63cb192e0defb (diff) | |
| download | tools.nes-5cea733924c3fd9df91a19c7d7c59ae85915221b.tar.gz tools.nes-5cea733924c3fd9df91a19c7d7c59ae85915221b.zip | |
Update the README for open sourcing the project
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
| -rw-r--r-- | CONTRIBUTING.md | 3 | ||||
| -rw-r--r-- | README.md | 22 | ||||
| -rw-r--r-- | crates/nasm/src/main.rs | 1 | ||||
| -rw-r--r-- | lib/xixanta/src/assembler.rs | 2 |
4 files changed, 25 insertions, 3 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 467dca7..dd58352 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,6 @@ This project uses [Rust](https://www.rust-lang.org/), so use the usual -[cargo](https://doc.rust-lang.org/cargo/) commands in order to build and run +[cargo](https://doc.rust-lang.org/cargo/) commands in order to build and run the +desired binaries/tests. ## Issue reporting @@ -1 +1,21 @@ -Under development +Utilities for NES/Famicom development. Note that this repository is under heavy +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: + +``` +$ cargo run --bin nasm <path-to-assembly-file> +``` + +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: + +- `empty`: just `HEADER` and `CODE`. Useful for one-liners (e.g. "how is this + instruction encoded in binary?"). +- `nrom`: the default configuration. It has the following segments: `HEADER`, + `CODE`, `VECTORS`, and `CHARS`. +- `nrom65`: same as `nrom` but it also has `STARTUP` for compatibility with the + default linker configuration from [cc65](https://github.com/cc65/cc65). diff --git a/crates/nasm/src/main.rs b/crates/nasm/src/main.rs index 527455a..9ad710b 100644 --- a/crates/nasm/src/main.rs +++ b/crates/nasm/src/main.rs @@ -75,6 +75,7 @@ fn main() -> Result<()> { // After the parse operation, just print the results. if args.disassemble { + println!("TBD"); // let instructions = assembler.disassemble(input)?; // for instr in instructions { diff --git a/lib/xixanta/src/assembler.rs b/lib/xixanta/src/assembler.rs index a155d3b..35f7ada 100644 --- a/lib/xixanta/src/assembler.rs +++ b/lib/xixanta/src/assembler.rs @@ -412,7 +412,7 @@ impl Assembler { fn push_bundle(&mut self, mut bundle: Bundle, node: &PNode) -> Result<(), EvalError> { let current = &mut self.mappings[self.current_mapping]; - bundle.address = current.start as usize + current.offset; // TODO: here + bundle.address = current.start as usize + current.offset; current.offset += bundle.size as usize; current.segments[self.current_segment].offset += bundle.size as usize; |
