Z80 Assembly 11: Self-Modifying Code and Look-Up Tables

Look-Up Tables (LUTs): Trading Memory for Speed A Look-Up Table (LUT) is a pre-calculated block of data stored in memory. Instead of performing a time-consuming calculation (like a sine function or a multiplication), the CPU simply uses the input value as an index to quickly read the pre-computed result. How to Use a LUT: Use the input value (N) to calculate the offset within the table. Add this offset to the table’s starting address. Read the byte (result) at that final calculated address. Example: 10-Value Square Root Table ...

September 27, 2025