Skip to navigation

Aviator on the BBC Micro

Maths: shift4Left

Name: shift4Left [Show more] Type: Variable Category: Maths Summary: Lookup table for shifting a byte four places to the left, to extract the low nibble 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 shift4Left * Multiply4x16 calls shift4Left * Multiply8x8 calls shift4Left * ScaleUp calls shift4Left

In the table below, shift4Left,X contains the low byte of X * 16. So if X is %XXXXxxxx, shift4Left,X contains %xxxx0000.
.shift4Left FOR I%, 0, 255 EQUB LO(I% * 16) NEXT