Skip to navigation


Maths (Arithmetic): MU5

[Elite-A, Flight]

Name: MU5 [Show more] Type: Subroutine Category: Maths (Arithmetic) Summary: Set K(3 2 1 0) = (A A A A) and clear the C flag
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MULT3 calls MU5 * DVID3B2 calls via n_store

In practice this is only called via a BEQ following an AND instruction, in which case A = 0, so this routine effectively does this: K(3 2 1 0) = 0
Other entry points: n_store Set K(3 2 1) = (A A A) and clear the C flag
.MU5 \ --- Mod: Code removed for Elite-A: ------------------> \STA K \ Set K(3 2 1 0) to (A A A A) \STA K+1 \STA K+2 \STA K+3 \ --- And replaced by: --------------------------------> STA K \ Set K(3 2 1 0) to (A A A A), starting with the lowest \ byte .n_store STA K+1 \ And then the high bytes STA K+2 STA K+3 \ --- End of replacement ------------------------------> CLC \ Clear the C flag RTS \ Return from the subroutine