tyogav
- 14
- 0
That's why I put the note about DPL in my last post.rcgldr said:This isn't a bubble sort. The code increments DPTR twice on each loop. It should only increment DPTR once on each loop.
XCH A,DPL
JNZ D1
DEC DPH
D1: DEC A
XCH A,DPL
.Scott said:I think the problem is that when you loop from DJNZ R1,L3, R0 is not reset.
Thanks. So overwriting R0 has been the problem. I will replace R0 with another register and check.rcgldr said:Why not use this to decrement DPTR, and also avoid overwriting R0?
