Skip to navigation

Elite on the BBC Micro

Maths (Arithmetic): SQUA2 [Disc version, Flight]

Name: SQUA2 [Show more] Type: Subroutine Category: Maths (Arithmetic) Summary: Calculate (A P) = A * A
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * HITCH calls SQUA2 * MAS3 calls SQUA2 * SUN (Part 1 of 4) calls SQUA2 * SUN (Part 3 of 4) calls SQUA2 * TT111 calls SQUA2

Do the following multiplication of unsigned 8-bit numbers: (A P) = A * A
.SQUA2 STA P \ Copy A into P and X TAX BNE MU11 \ If X = 0 fall through into MU1 to return a 0, \ otherwise jump to MU11 to return P * X