gotaproblem / Z80Playground

CP/M CBIOS and ROM Monitor plus CP/M tools for the Z80 Playground
12 stars 1 forks source link

Monitor: Peek row memory address error #2

Closed gd-99 closed 3 years ago

gd-99 commented 3 years ago

When using the monitor peek function, the left hand side starting memory address for the row, is incorrect.

E.G.: after a cold boot, Peek 8000 should produce a single row starting with 8000 then a string of 00 until 800F. Instead the display will be 0000 string of 00 until 800F.

The bug is in peek_memory function found in commands.asm. Just under row_loop: the original code is: ld a, (hl)
call PRINT_HEX ; print the starting address inc hl
ld a, (hl)
call PRINT_HEX

To correct the bug replace (or comment out) the original code above with: ld a, h ;A=H, address hi byte call PRINT_HEX ; print the starting address ld a, l ;A=L, address low byte call PRINT_HEX

gotaproblem commented 3 years ago

Thankyou for highlighting the problem and providing a solution