Skip to navigation

Elite on the BBC Micro and NES

Maths (Arithmetic): GC2

[Elite-A, Flight]

Name: GC2 [Show more] Type: Subroutine Category: Maths (Arithmetic) Summary: Calculate (Y X) = (A P) * 4
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * TT151 calls GC2

Calculate the following multiplication of unsigned 16-bit numbers: (Y X) = (A P) * 4
Other entry points: price_xy Set (Y X) = (A P)
.GC2 ASL P \ Set (A P) = (A P) * 4 ROL A ASL P ROL A \ --- Mod: Code added for Elite-A: --------------------> .price_xy \ --- End of added code -------------------------------> TAY \ Set (Y X) = (A P) LDX P RTS \ Return from the subroutine