Dear VICE developers!
Wrap-around for addressing modes "absolute" and "absolute indexed" for opcodes TSB, TRB, STX, STY, LDX, LDY is wrong.
Tested it on a real WDC 65C816 with test program contained in the attached archive, named test-816.txt.
The current VICE behavior isn't documented in any document I'm knowing of. In contrary, in http://6502.org/tutorials/65c816opcodes.html#5.4 one can find the correct description of these address modes. Most of the opcodes do it as expected, but the above mentioned doesn't and there is no reason, why these should be handled different ... To proof correctness, I have checked this with the program (case 1) in the given test-816.txt.
The patch is easy, see 65816core.c.patch in the archive.
Regards,
Johann K.
it would be great if you could provide that test program as an actual program that can be run and be merged into the testsuite (ie it should display a clear yes/no result)
Ok, should be possible. ;)
Is there a template that can be used or a current test which you could recommend?
I'm right to look in testprogs/ hierachy? Would CPU/ the right place for it?
Are there already any other 816/802 test? (just for orientation)
you could look at testprogs/testbench/selftest/c64.asm
there are no 816 tests right now, not sure where to put them :)
I found testbench/selftest/scpu.asm ... maybe this is the right place where to finally insert it.
Edited: My bad, I hadn't worked it out. That's only the part of the test framework ..
Ok, we have to start some 816 test module ... ;)
Last edit: J. E. Klasek 2017-12-12
I just created a test similar to vice/testprogs/CPU/hmc6502/ ...
It's a PRG (including source, Makefile and so on). If run (see included RUN script) it shows a green border on success and writes the resulting status to the debugging port. Otherwise failure codes appears on screen with red border. See readme.txt for further details.
I hope this simple patch in conjunction with the test program provided gets a chance to be incorporated soon. ;)
sorry, i will look at it, but i cant promise it will be soon... right now pretty much all time spent goes into pushing the gtk3 ui
Applied in rev 34297, thanks for the patch.