Skip to navigation

Aviator on the BBC Micro

Maths: timesTable

Name: timesTable [Show more] Type: Variable Category: Maths Summary: Lookup table for multiplication times tables Deep dive: Times tables and nibble arithmetic
Context: See this variable in context in the source code References: This variable is used as follows: * DivideScaled calls timesTable * Multiply4x16 calls timesTable * Multiply8x8 calls timesTable

In the table below, timesTable+X*16,Y contains X * Y. To put it another way, X and Y are both in the range 0 to 15, so they are 4-bit values. If, in binary, they are X = %xxxx and Y = %yyyy, then: timesTable,%xxxxyyyy contains X * Y. This table is used in conjunction with the highNibble and lowNibble tables to look up multiplication results.
.timesTable FOR I%, 0, 15 FOR J%, 0, 15 EQUB I% * J% NEXT NEXT