Skip to navigation

Elite on the BBC Micro and NES

Maths (Arithmetic): DV41, Removed

[Elite-A, Docked]

Name: DV41, Removed [Show more] Type: Subroutine Category: Maths (Arithmetic) Summary: Calculate (P R) = 256 * DELTA / A
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file

Calculate the following division and remainder: P = DELTA / A R = remainder as a fraction of A, where 1.0 = 255 Another way of saying the above is this: (P R) = 256 * DELTA / A This uses the same shift-and-subtract algorithm as TIS2, but this time we keep the remainder.
Returns: C flag The C flag is cleared
\ --- Mod: Code removed for Elite-A: ------------------> \.DV41 \ \ STA Q \ Store A in Q \ \ LDA DELTA \ Fetch the speed from DELTA into A \ \ \ Fall through into DVID4 to do: \ \ \ \ (P R) = 256 * A / Q \ \ = 256 * DELTA / A \ --- End of removed code ----------------------------->