diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-07-17 15:09:36 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-12-12 07:33:40 +0100 |
| commit | 376dcb684ce779a7051bbc9a95359114e94cae5e (patch) | |
| tree | 7bff7cc3dcbb4055efffcb3a172fc4aa238e9380 /crates | |
| parent | 7822c00e8689c99ded0a360026f4e7ace1f2c87f (diff) | |
| download | tools.nes-376dcb684ce779a7051bbc9a95359114e94cae5e.tar.gz tools.nes-376dcb684ce779a7051bbc9a95359114e94cae5e.zip | |
Add support for procedures
Procedures are marked with the '.proc' control statement and work both
as a scoping mechanism and as a label that can be referenced.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/nasm/src/main.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/crates/nasm/src/main.rs b/crates/nasm/src/main.rs index 940e04b..5242784 100644 --- a/crates/nasm/src/main.rs +++ b/crates/nasm/src/main.rs @@ -3,8 +3,7 @@ use clap::Parser as ClapParser; use std::fs::File; use std::io::{self, Read, Write}; use xixanta::assembler::Assembler; -use xixanta::instruction::Fill; -use xixanta::mapping::Segment; +use xixanta::mapping::NROM; /// Assembler for the 6502 microprocessor that targets the NES. #[derive(ClapParser, Debug)] @@ -32,13 +31,7 @@ struct Args { fn main() -> Result<()> { let args = Args::parse(); - // TODO: provide a handier way for this. - let mut assembler = Assembler::new(vec![Segment { - name: String::from("CODE"), - start: 0x1000, - size: 10, - fill_value: Some(Fill { value: 0x00 }), - }]); + let mut assembler = Assembler::new(NROM.to_vec()); // Select the input stream. let input: Box<dyn Read> = match args.file { |
