Skip to navigation


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 uses shift4Right * Multiply4x16 uses shift4Right * Multiply8x8 uses shift4Right * ScaleUp uses shift4Right * SetObjPointCoords (Part 1 of 2) uses 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