infinite loop bug in example causes infinite loop
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gnusim8085 |
New
|
Undecided
|
Unassigned |
Bug Description
The sorting example supplied in the documentation (sorting.asm) has a bug.
I defined a few bytes at the (can't easily insert data at address 0050 without a the ".org" directive).
I discovered that if the byte array to be sorted contains two identical elements the sort program never completes.
This is because when two elements are identical the program swaps them and sets the 'recheck' flag in D.
It is easy enough to fix the program (attached).
However I was unable to interrupt gnusim when in the inifinite loop.
I think there might be a couple of ways to fix this.
1) Put a flag in the main simulator loop I think this might be in one of the functions of bridge.c - the flag (a volatile) gets set by some sort of button call back.
2) Implement interrupt buttons to simulate the interrupts and make the service-code halt the simulator (perhaps by using an illegal opcode?).