This is where the BIN Hackers and definition junkies discuss the inner workings of the EEC code and hardware. General tuning questions do not go here. Only technical/hardware-specific/code questions and discussions belong here.

Moderators: EDS50, cgrey8, 2Shaker, Jon 94GT

Post Reply
jsa
Tuning Addict
Posts: 1289
Joined: Sat Nov 23, 2013 7:28 pm
Location: 'straya

Short Indexed DIVU in Bill Lawrence Disassembler

Post by jsa » Sat Feb 27, 2016 5:50 pm

I'm using the last version of the DL disassembler that MPaton built and posted on this site. Could well be the same for earlier versions, but they don't work on the BIN file size I have.

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
SAD output
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; }
Does someone have a fixed version of BL to share please ?
Cheers

John

95 Escort RS Cosworth - CARD QUIK COSY ANTI / GHAJ0
Moates QH & BE
ForDiag

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests