Z80 Assembly 92: Block Compare with Difference (memcmp and Mismatch)

The Need for a Detailed Compare The standard `memcmp′ routine (Part 89) tells you only if two blocks are the same or different. For debugging purposes, you often need to know where the corruption or difference first occurred. Goal: Compare two memory blocks, and if they differ, return the address of the first byte that does not match. The Comparison Strategy We will modify the simple comparison loop to preserve the address and exit immediately upon the first failure. ...

September 28, 2025