Menu

#161 No wrapping in absolute addressing modes for opcodes TSB, TRB, STX, STY, LDX, LDY

v3.x
closed-accepted
supercpu (1)
bugfix
2018-01-10
2017-12-11
No

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.

1 Attachments

Discussion

  • gpz

    gpz - 2017-12-11

    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)

     
  • J. E. Klasek

    J. E. Klasek - 2017-12-11

    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)

     
  • gpz

    gpz - 2017-12-11

    you could look at testprogs/testbench/selftest/c64.asm

    there are no 816 tests right now, not sure where to put them :)

     
  • J. E. Klasek

    J. E. Klasek - 2017-12-11

    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
  • J. E. Klasek

    J. E. Klasek - 2017-12-13

    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.

     
  • J. E. Klasek

    J. E. Klasek - 2018-01-10

    I hope this simple patch in conjunction with the test program provided gets a chance to be incorporated soon. ;)

     
  • gpz

    gpz - 2018-01-10

    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

     
  • Marco van den Heuvel

    • status: open --> closed-accepted
    • assigned_to: Marco van den Heuvel
     
  • Marco van den Heuvel

    Applied in rev 34297, thanks for the patch.

     

Log in to post a comment.

MongoDB Logo MongoDB