aboutsummaryrefslogtreecommitdiff
path: root/lib/xixanta/src/opcodes.rs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-01-14 21:07:07 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-01-14 22:19:50 +0100
commitfb836cb4cae07b2c66a41ad1413a8cab1a080e6a (patch)
treeb55996b2fd0c7642a0dbf3c74ebefff0150bc9cf /lib/xixanta/src/opcodes.rs
parent52bab4714b8f9301e4ad2a8c5dddf0787b8698f2 (diff)
downloadtools.nes-fb836cb4cae07b2c66a41ad1413a8cab1a080e6a.tar.gz
tools.nes-fb836cb4cae07b2c66a41ad1413a8cab1a080e6a.zip
Implement the .res control statement
Similarly to other assemblers, this allows the programmer to write a definite amount of bytes with the same values. Compared to other assemblers there are two things to notice. First, there is a limit to it (i.e. whatever can fit in 2 bytes). Second, if the fill value is not provided, then it will default to the current mapping's fill value, or just 0x00 if the current mapping doesn't define one of its own. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'lib/xixanta/src/opcodes.rs')
-rw-r--r--lib/xixanta/src/opcodes.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/xixanta/src/opcodes.rs b/lib/xixanta/src/opcodes.rs
index 593d279..455a8ea 100644
--- a/lib/xixanta/src/opcodes.rs
+++ b/lib/xixanta/src/opcodes.rs
@@ -749,6 +749,7 @@ lazy_static! {
functions.insert(String::from(".repeat"), Control { control_type: ControlType::StartRepeat, has_identifier: Some(true), required_args: Some((1, 2)), touches_context: true });
functions.insert(String::from(".endrepeat"), Control { control_type: ControlType::EndRepeat, has_identifier: None, required_args: None, touches_context: true });
functions.insert(String::from(".include"), Control { control_type: ControlType::IncludeSource, has_identifier: None, required_args: Some((1, 1)), touches_context: false });
+ functions.insert(String::from(".res"), Control { control_type: ControlType::ReserveMemory, has_identifier: None, required_args: Some((1, 2)), touches_context: false });
functions
};