Z80 Assembly 30: Emulating Floating-Point Arithmetic (High-Level Math)
The Challenge of Floating-Point The Z80 is an integer processor—it can only handle whole numbers. Floating-point numbers (like 3.14159 or 1.2e-5) are necessary for high-precision math used in physics simulations, graphics transformations, or advanced financial calculations. To use them, we must emulate the standard IEEE 754 format using multiple bytes of memory. Floating-Point Structure (The Four-Byte Standard): A typical 32-bit (4-byte) single-precision float is stored across four consecutive memory locations: ...