BL output
Line 2841 is a short indexed divide, which should be 4 bytes of code.
BL has used the fourth byte '34' as part of line 2841 & 2844.
Line 2849 is where it becomes obvious.
Appears to be all short indexed divides are wrong, but not all are as obvious.
Code: Select all
283F 0134 clr REG_34
2841 8F7280 divu REG_34,$80[REG_72]
2844 343F35 jbc REG_3F,BIT_04,L287C
2847 02D5 not REG_D5
2849 04 byte $04 ;**** Invalid Op Code ****
284A A1008034 ld REG_34,#$8000
284E 884234 cmp REG_34,REG_42
2851 D903 jh L2856
2853 A04234 ld REG_34,REG_42
Works as expected
Code: Select all
283f: 01,34 clrw R34 R34 = 0;
2841: 8f,72,80,34 divw R34,[R72+80] R34 = R34L / [R72+80];
2845: 3f,35,02 jb B7,R35,284a if (B7_R35) goto 284a;
2848: d5,04 jnv 284e if (!OV) goto 284e;
284a: a1,00,80,34 ldw R34,8000 R34 = 8000;
284e: 88,42,34 cmpw R34,R42
2851: d9,03 jgtu 2856 if ((uns) R34 <= R42) {
2853: a0,42,34 ldw R34,R42 R34 = R42; }