Thursday, February 25, 2016

Watchpoint data reads don't seem to display the right data for wpdata

I thought I'd add some "memory snooping" to my trace to see what is read and written and upon close inspection the wpdata doesn't seem to display correctly.


WP 9800,200,rw,1,{tracelog " addr=%x data=%x ", wpaddr,wpdata;g}

trace >>mytrace.txt,0,{tracelog "A=%02X EA=%04X HL=%04X DE=%04X BC=%04X SKIP=%1X 9937=%02X | ",a,ea,hl,de,bc,(psw&0x20)!=0,pb@9937}

which generates this:

A=68 EA=0078 HL=2D00 DE=8007 BC=0080 SKIP=0 9937=76 | 221B: CALL $2205
A=68 EA=0078 HL=2D00 DE=8007 BC=0080 SKIP=0 9937=76 | 2205: LBCD $9939
addr=9939 data=1E addr=993A data=1E
A=68 EA=0078 HL=2D00 DE=8007 BC=9A79 SKIP=0 9937=76 | 2209: LXI EA,$9DA9
A=68 EA=9DA9 HL=2D00 DE=8007 BC=9A79 SKIP=0 9937=76 | 220C: DGT EA,BC
A=68 EA=9DA9 HL=2D00 DE=8007 BC=9A79 SKIP=1 9937=76 | 220E: RET
A=68 EA=9DA9 HL=2D00 DE=8007 BC=9A79 SKIP=0 9937=76 | 220F: RETS
A=68 EA=9DA9 HL=2D00 DE=8007 BC=9A79 SKIP=1 9937=76 | 221E: CALT ($0096)
A=68 EA=9DA9 HL=2D00 DE=8007 BC=9A79 SKIP=0 9937=76 | 221F: ANIW VV:03,$7F
addr=9803 data=1E addr=9803 data=8
A=68 EA=9DA9 HL=2D00 DE=8007 BC=9A79 SKIP=0 9937=76 | 2222: LXI HL,$9901
A=68 EA=9DA9 HL=9901 DE=8007 BC=9A79 SKIP=0 9937=76 | 2225: LDEAX (HL)
addr=9901 data=8 addr=9902 data=8
A=68 EA=0000 HL=9901 DE=8007 BC=9A79 SKIP=0 9937=76 | 2227: LDED $993B
addr=993B data=8 addr=993C data=8
A=68 EA=0000 HL=9901 DE=0078 BC=9A79 SKIP=0 9937=76 | 222B: DADD EA,DE
A=68 EA=0078 HL=9901 DE=0078 BC=9A79 SKIP=0 9937=76 | 222D: STEAX (HL)
addr=9901 data=78 addr=9902 data=0
A=68 EA=0078 HL=9901 DE=0078 BC=9A79 SKIP=0 9937=76 | 222F: OFFIW VV:09,$10
addr=9809 data=0
A=68 EA=0078 HL=9901 DE=0078 BC=9A79 SKIP=1 9937=76 | 2232: ORIW VV:11,$10
A=68 EA=0078 HL=9901 DE=0078 BC=9A79 SKIP=0 9937=76 | 2235: OFFIW VV:08,$20
addr=9808 data=0
A=68 EA=0078 HL=9901 DE=0078 BC=9A79 SKIP=1 9937=76 | 2238: ORIW VV:11,$08
A=68 EA=0078 HL=9901 DE=0078 BC=9A79 SKIP=0 9937=76 | 223B: LXI HL,$9808
A=68 EA=0078 HL=9808 DE=0078 BC=9A79 SKIP=0 9937=76 | 223E: LDEAX (HL)

if you look at the 221F: ANIW VV:03,$7F the first one should be the read, 9803 data=1E, AND with $7F then ends up writing 9803 data=8.

That can't be right. It looks like the wpdata doesn't get updated for a read, instead displaying the wpdata for the last value that was written.


LDED $9938 loads DE=0078 but it wpdata says it read the values 8 and 8.

No comments:

Post a Comment