sorenroug / osnine-java

6809 and OS-9 emulator in Java
GNU General Public License v3.0
19 stars 8 forks source link

indirect.c/Doffset2 assertX(0x8E7A); ? #13

Closed gtoal closed 3 years ago

gtoal commented 3 years ago

In indirect.c, test "Doffset2", could you confirm that the expected value in X after execution is correct? Thanks.

--------------------------------------------------- Doffset2 CC=0x28 X=0EFA Y=0EF8 A=FF B=82 -> X=8E7A Z=0 PC=0400 A=ff B=82 X=0efa Y=0ef8 S=03fe U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 ENTRYPT PSHS U,Y,X,DP,B,A,CC ; 0400: 34 7F PC=0402 A=ff B=82 X=0efa Y=0ef8 S=03f4 U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 STS $046E ; 0402: 10 FF 04 6E PC=0406 A=ff B=82 X=0efa Y=0ef8 S=03f4 U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 LDS #$0464 ; 0406: 10 CE 04 64 PC=040A A=ff B=82 X=0efa Y=0ef8 S=0464 U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 PULS CC,A,B,DP,X,Y,U ; 040A: 35 7F PC=040C A=ff B=82 X=0efa Y=0ef8 S=046e U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 JSR Doffset2 ; 040C: BD 00 00 PC=0000 A=ff B=82 X=0efa Y=0ef8 S=046c U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 Doffset2 LEAX D,Y ; 0000: 30 AB PC=0002 A=ff B=82 X=0e7a Y=0ef8 S=046c U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 RTS ; 0002: 39 PC=040F A=ff B=82 X=0e7a Y=0ef8 S=046e U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 L040F PSHS U,Y,X,DP,B,A,CC ; 040F: 34 7F PC=0411 A=ff B=82 X=0e7a Y=0ef8 S=0464 U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 LDS $046E ; 0411: 10 FE 04 6E PC=0415 A=ff B=82 X=0e7a Y=0ef8 S=03f4 U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 PULS CC,A,B,DP,X,Y,U ; 0415: 35 7F PC=0417 A=ff B=82 X=0efa Y=0ef8 S=03fe U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 RTS ; 0417: 39 Doffset2:X expected 8e7a - actual 0e7a

sorenroug commented 3 years ago

I can confirm that the correct value for X is 0x0e7a. This is tested on a real 6809 CPU. The test is wrong. I must have made a typo when I copied the code over to the source code repository.