Skip to navigation

Aviator on the BBC Micro

Maths: shift4Right

Name: shift4Right [Show more] Type: Variable Category: Maths Summary: Lookup table for shifting a byte four places to the right, to extract the high 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 shift4Right * Multiply4x16 calls shift4Right * Multiply8x8 calls shift4Right * ScaleUp calls shift4Right * SetObjPointCoords (Part 1 of 2) calls shift4Right

In the table below, shift4Right,X contains the high byte of X * 16. So if X is %XXXXxxxx, shift4Right,X contains %0000XXXX.
.shift4Right FOR I%, 0, 255 EQUB HI(I% * 16) NEXT