Skip to main content

sub

Function sub 

Source
pub const fn sub(
    op1: u32,
    op2: u32,
    carry_in: bool,
    prior: Flags,
) -> (u32, Flags)
Expand description

ARM SUB-family: Add(op1, !op2, carry_in, ...).

ARM’s subtract IS add-with-inverted-operand-and-carry, not an independently-implemented subtraction (Mesen2 Sub); porting it as a direct call to add, not a separate formula, is deliberate — the two must never drift.