From 1410c98545d00c8508a715a566cf8e3e4e424773 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 24 Apr 2026 22:29:47 +0200 Subject: Add a big endian control statement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default everything is little endian, and that should always be the case. That being said, if a literal is better expressed in big endian format for whatever reason, you can now use the .be or the .bigendian control statements. The terribly named .dbyt control statement can also be used for this purpose, but that's just to be compatible with the implementation from ca65. Signed-off-by: Miquel Sabaté Solà --- lib/xixanta/src/opcodes.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'lib/xixanta/src/opcodes.rs') diff --git a/lib/xixanta/src/opcodes.rs b/lib/xixanta/src/opcodes.rs index 150813e..25b3add 100644 --- a/lib/xixanta/src/opcodes.rs +++ b/lib/xixanta/src/opcodes.rs @@ -1829,6 +1829,36 @@ pub static CONTROL_FUNCTIONS: LazyLock> = LazyLock::new only_string: false, }, ); + functions.insert( + String::from(".dbyt"), + Control { + control_type: ControlType::BigEndianWord, + has_identifier: None, + required_args: None, + touches_context: false, + only_string: false, + }, + ); + functions.insert( + String::from(".be"), + Control { + control_type: ControlType::BigEndianWord, + has_identifier: None, + required_args: None, + touches_context: false, + only_string: false, + }, + ); + functions.insert( + String::from(".bigendian"), + Control { + control_type: ControlType::BigEndianWord, + has_identifier: None, + required_args: None, + touches_context: false, + only_string: false, + }, + ); functions.insert( String::from(".incbin"), Control { -- cgit v1.2.3