pub enum Expression {
Show 34 variants
Constant(u32),
SymbolAddressIndex(u16),
SectionAddressIndex(u16),
Bank(u16),
SectOf(u16),
Offset(u16),
SectionStart(u16),
GroupStart(u16),
GroupOf(u16),
Segment(u16),
GroupOrg(u16),
SectionEnd(u16),
Equals(Box<Expression>, Box<Expression>),
NotEquals(Box<Expression>, Box<Expression>),
LTE(Box<Expression>, Box<Expression>),
LessThan(Box<Expression>, Box<Expression>),
GTE(Box<Expression>, Box<Expression>),
GreaterThan(Box<Expression>, Box<Expression>),
Add(Box<Expression>, Box<Expression>),
Subtract(Box<Expression>, Box<Expression>),
Multiply(Box<Expression>, Box<Expression>),
Divide(Box<Expression>, Box<Expression>),
And(Box<Expression>, Box<Expression>),
Or(Box<Expression>, Box<Expression>),
XOR(Box<Expression>, Box<Expression>),
LeftShift(Box<Expression>, Box<Expression>),
RightShift(Box<Expression>, Box<Expression>),
Mod(Box<Expression>, Box<Expression>),
Dashes(Box<Expression>, Box<Expression>),
Revword(Box<Expression>, Box<Expression>),
Check0(Box<Expression>, Box<Expression>),
Check1(Box<Expression>, Box<Expression>),
BitRange(Box<Expression>, Box<Expression>),
ArshiftChk(Box<Expression>, Box<Expression>),
}Expand description
An expression used in relocations.
PSY-Q uses a sophisticated expression system for calculating relocated addresses. Expressions can be constants, symbol references, or complex arithmetic operations.
§Example Expressions
$1000- Constant value 0x1000[5]- Address of symbol #5sectbase(2)- Base address of section #2(sectstart(1)+$100)- Section 1 start plus 0x100
Variants§
Constant(u32)
A constant value (tag 0x00).
SymbolAddressIndex(u16)
Index of a symbol’s address (tag 0x02).
SectionAddressIndex(u16)
Base address of a section (tag 0x04).
Bank(u16)
Untested
SectOf(u16)
Untested
Offset(u16)
Untested
SectionStart(u16)
Start address of a section (tag 0x0C).
GroupStart(u16)
Untested
GroupOf(u16)
Untested
Segment(u16)
Untested
GroupOrg(u16)
Untested
SectionEnd(u16)
End address of a section (tag 0x16).
Equals(Box<Expression>, Box<Expression>)
Equality comparison (tag 0x20).
NotEquals(Box<Expression>, Box<Expression>)
Inequality comparison (tag 0x22).
LTE(Box<Expression>, Box<Expression>)
Less than or equal (tag 0x24).
LessThan(Box<Expression>, Box<Expression>)
Less than (tag 0x26).
GTE(Box<Expression>, Box<Expression>)
Greater than or equal (tag 0x28).
GreaterThan(Box<Expression>, Box<Expression>)
Greater than (tag 0x2A).
Add(Box<Expression>, Box<Expression>)
Addition (tag 0x2C).
Subtract(Box<Expression>, Box<Expression>)
Subtraction (tag 0x2E).
Multiply(Box<Expression>, Box<Expression>)
Multiplication (tag 0x30).
Divide(Box<Expression>, Box<Expression>)
Division (tag 0x32).
And(Box<Expression>, Box<Expression>)
Bitwise AND (tag 0x34).
Or(Box<Expression>, Box<Expression>)
Bitwise OR operator (tag 0x36).
XOR(Box<Expression>, Box<Expression>)
Bitwise XOR (tag 0x38).
LeftShift(Box<Expression>, Box<Expression>)
Left shift (tag 0x3A).
RightShift(Box<Expression>, Box<Expression>)
Right shift (tag 0x3C).
Mod(Box<Expression>, Box<Expression>)
Modulo (tag 0x3E).
Dashes(Box<Expression>, Box<Expression>)
Dashes operator (tag 0x40).
Revword(Box<Expression>, Box<Expression>)
Reverse word (tag 0x42).
Check0(Box<Expression>, Box<Expression>)
Check0 (tag 0x44).
Check1(Box<Expression>, Box<Expression>)
Check1 (tag 0x46).
BitRange(Box<Expression>, Box<Expression>)
Bit range extraction (tag 0x48).
ArshiftChk(Box<Expression>, Box<Expression>)
Arithmetic shift with check (tag 0x4A).
Trait Implementations§
Source§impl BinRead for Expression
impl BinRead for Expression
Source§fn read_options<R: Read + Seek>(
__binrw_generated_var_reader: &mut R,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>
Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments. Read moreSource§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
T from the reader assuming native-endian byte order. Read moreSource§fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self from the reader using the given arguments. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§impl BinWrite for Expression
impl BinWrite for Expression
Source§fn write_options<W: Write + Seek>(
&self,
__binrw_generated_var_writer: &mut W,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<()>
fn write_options<W: Write + Seek>( &self, __binrw_generated_var_writer: &mut W, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<()>
Source§fn write<W>(&self, writer: &mut W) -> Result<(), Error>
fn write<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer using default arguments. Read moreSource§fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming big-endian byte order. Read moreSource§fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming little-endian byte order. Read moreSource§fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming native-endian byte order. Read moreSource§fn write_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Self to the writer using the given arguments. Read moreSource§fn write_be_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_be_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Self to the writer, assuming big-endian byte order, using the
given arguments. Read moreSource§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more