Skip to navigation

Elite on the BBC Micro

Maths (Arithmetic): MU5 [Elite-A, Parasite]

Name: MU5 [Show more] Type: Subroutine Category: Maths (Arithmetic) Summary: Set K(3 2 1 0) = (A A A A) and clear the C flGag
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MULT3 calls MU5 * DVID3B2 calls entry point 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 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 CLC \ Clear the C flag RTS \ Return from the subroutine