Page 1 of 10 123456 ... LastLast
Results 1 to 15 of 145

Thread: EE dissection

  1. #1
    LT1 specialist steveo's Avatar
    Join Date
    Aug 2013
    Posts
    4,007

    EE dissection

    decided to start a thread just to follow along the stupid observations im making about EE code, just in case anyone is interested or has any pointers, or wants to watch a total ameture try to blunder his way through 68k assembly for entertainment purposes.

    posts to follow

    wish me luck

  2. #2
    Fuel Injected!
    Join Date
    Jan 2014
    Location
    AZ
    Posts
    93
    Good luck Steveo
    Hope you can unlock some of the uncharted territory. You have been a big help to me. I'll stick to the basic tolls for now and follow in others footsteps here.

  3. #3
    LT1 specialist steveo's Avatar
    Join Date
    Aug 2013
    Posts
    4,007
    tonight looking at a mystery bit i've always been interested in, discovered by lt1edit's author a long time ago, which he labeled as disabling CCP fueling calcs and otherwise labeled as 'transient fuel' but never quite investigated.

    it's in E-side 0x2028, bit 6.

    observationally, setting/unsetting this bit does not tickle the butt dyno very much, so it must be a fairly subtle change.

    that byte seems to contain some primary flags, as it also contains the known/documented bits for:

    - f-body VATS enable
    - traction control spark retard enable
    - air pump enable
    - force speed density mode.

    it's used for a branch at 0x6588:

    Code:
    6588	B6 20 28        @241	ldaA	b_2028_sw_b3vats_b2spddens_b0tcs
    658B	85 40           	bitA	#%01000000                        ;what switch bit
    658D	26 03           	bne	@242                              ; if switch bit is set, do lookups
    658F	7E 67 13        	jmp	@269                              ;else (if bit clr) skip what f(cooltmp,load) lookups
    that bit enables/disables a particularly gigantic fueling calc subroutine;

    Code:
    6592	B6 01 68        @242	ldaA	l_0168_RPM_31.25/bit
    6595	81 80           	cmpA	#$80                              ; 4000 rpm
    6597	25 06           	bcs	@243                              ; br if RPM<4000
    6599	96 A5           	ldaA	l_00a5_countr_skip_lkups          ;else
    659B	81 06           	cmpA	#$06
    659D	26 76           	bne	@252                              ; maybe skip lookup of what f(cooltmp,load) wallwetting?
    659F	B6 01 93        @243	ldaA	l_0193_CoolTmp_fltrd_$f0_max_$e0
    65A2	F6 01 6B        	ldaB	l_016b_(ADMAP-26)*151*2/256
    65A5	54              	lsrB	
    65A6	54              	lsrB	
    65A7	CE 26 F2        	ldX	#$26F2
    ;;		lkup3d_sub:		; A row, B col, X tbl addr,  A returned val
    65AA	A0 00           	subA	0, X                              ; CALC ROW ARG OFFSET, (LIMITED TO 0)
    65AC	24 01           	bcc	@244
    65AE	4F              	clrA	                                  ; ... ELSE
    65AF	E0 01           @244	subB	1, X                              ; CALC COL ARG OFFSET, (LIMITED TO 0)
    65B1	24 01           	bcc	@245
    65B3	5F              	clrB	                                  ; ... ELSE
    65B4	3C              @245	pushX	                                  ; XFER TABLE ADDR TO Y REG
    65B5	18 38           	popY	
    65B7	36              	pushA	                                  ; SAVE ROW ADDRESS
    65B8	86 10           	ldaA	#$10                              ; SPLIT COL ARG INTO TABLE OFFSET
    65BA	3D              	mul	                                  ; & INTERP PORTION
    65BB	37              	pushB	                                  ; SAVE INTERP PORTION TO STACK
    65BC	16              	tAB	
    65BD	3A              	aBX	
    65BE	33              	popB	
    65BF	32              	popA	                                  ; GET ROW ARG
    65C0	37              	pushB	
    65C1	C6 10           	ldaB	#$10                              ; SPLIT ROW ARG INTO R
    65C3	3D              	mul	                                  ; TABLE NUMBER
    65C4	37              	pushB	                                  ; (MAX RESULT IS 255D)
    65C5	18 E6 02        	ldaB	2, Y
    65C8	3D              	mul	
    65C9	3A              	aBX	
    65CA	3C              	pushX	
    65CB	18 E6 02        	ldaB	2, Y
    65CE	3A              	aBX	
    65CF	18 30           	tSY	
    65D1	EC 03           	ldD	3, X
    65D3	10              	sBA	
    65D4	18 E6 03        	ldaB	3, Y
    65D7	24 06           	bcc	@246
    65D9	40              	negA	
    65DA	3D              	mul	
    65DB	A9 03           	adcA	3, X
    65DD	20 06           	jr	@247
    ;
    65DF	3D              @246	mul	
    65E0	89 00           	adcA	#$00
    65E2	40              	negA	
    65E3	AB 03           	addA	3, X
    65E5	38              @247	popX	
    65E6	36              	pushA	
    65E7	EC 03           	ldD	3, X
    65E9	10              	sBA	
    65EA	18 E6 03        	ldaB	3, Y
    65ED	24 06           	bcc	@248
    65EF	40              	negA	
    65F0	3D              	mul	
    65F1	A9 03           	adcA	3, X
    65F3	20 06           	jr	@249
    ;
    65F5	3D              @248	mul	
    65F6	89 00           	adcA	#$00
    65F8	40              	negA	
    65F9	AB 03           	addA	3, X
    65FB	33              @249	popB	
    65FC	36              	pushA	
    65FD	10              	sBA	                                  ; Y1 - Y2
    65FE	18 E6 02        	ldaB	2, Y                              ; FRACTION MULT
    6601	24 07           	bcc	@250                              ; BR IF D >= 0
    6603	40              	negA	                                  ;ELSE INTERP Y (RND UP IF Req)
    6604	3D              	mul	
    6605	18 A9 01        	adcA	1, Y
    6608	20 07           	jr	@251
    ;
    660A	3D              @250	mul	
    660B	89 00           	adcA	#$00
    660D	40              	negA	
    660E	18 AB 01        	addA	1, Y
    6611	31              @251	incS	
    6612	38              	popX	                                  ; end of lkup3d, result in A
    6613	97 FD           	staA	L00FD
    6615	B6 01 68        @252	ldaA	l_0168_RPM_31.25/bit
    6618	81 80           	cmpA	#$80                              ;4000 rpm
    661A	25 06           	bcs	@253                              ; br if RPM<4000
    661C	96 A5           	ldaA	l_00a5_countr_skip_lkups          ;else
    661E	81 07           	cmpA	#$07
    6620	26 77           	bne	@262                              ; maybe skip lookup of what f(cooltmp,load)
    6622	B6 01 93        @253	ldaA	l_0193_CoolTmp_fltrd_$f0_max_$e0
    6625	F6 01 6B        	ldaB	l_016b_(ADMAP-26)*151*2/256       ; (ADMAP-26)*151*2/256
    6628	54              	lsrB	                                  ;*2
    6629	54              	lsrB	                                  ;*2
    662A	CE 28 45        	ldX	#$2845                            ;B=(ADMAP-26)*151*2/256*4
    ;;            		lkup3d_sub:		; A row, B col, X tbl addr,  A returned val
    ;; INPUTs  1. R min value, (Rows)  2. Q min value, (Col's) 
    ;;	3. RNUM, number of Q Vals, (col's) in each R table
    ;; 	4. Thr 1st R table, R num entries in length
    662D	A0 00           	subA	0, X                              ; CALC ROW ARG OFFSET, (LIMITED TO 0)
    662F	24 01           	bcc	@254
    6631	4F              	clrA	                                  ; ... ELSE
    6632	E0 01           @254	subB	1, X                              ; CALC COL ARG OFFSET, (LIMITED TO 0)
    6634	24 01           	bcc	@255
    6636	5F              	clrB	                                  ; ... ELSE
    6637	3C              @255	pushX	                                  ; XFER TABLE ADDR TO Y REG
    6638	18 38           	popY	
    663A	36              	pushA	                                  ; SAVE ROW ADDRESS
    663B	86 10           	ldaA	#$10                              ; SPLIT COL ARG INTO TABLE OFFSET
    663D	3D              	mul	                                  ; & INTERP PORTION
    663E	37              	pushB	                                  ; SAVE INTERP PORTION TO STACK
    663F	16              	tAB	
    6640	3A              	aBX	
    6641	33              	popB	
    6642	32              	popA	                                  ; GET ROW ARG
    6643	37              	pushB	
    6644	C6 10           	ldaB	#$10                              ; SPLIT ROW ARG INTO R
    6646	3D              	mul	                                  ; TABLE NUMBER
    6647	37              	pushB	                                  ; (MAX RESULT IS 255D)
    6648	18 E6 02        	ldaB	2, Y
    664B	3D              	mul	
    664C	3A              	aBX	
    664D	3C              	pushX	
    664E	18 E6 02        	ldaB	2, Y
    6651	3A              	aBX	
    6652	18 30           	tSY	
    6654	EC 03           	ldD	3, X
    6656	10              	sBA	
    6657	18 E6 03        	ldaB	3, Y
    665A	24 06           	bcc	@256
    665C	40              	negA	
    665D	3D              	mul	
    665E	A9 03           	adcA	3, X
    6660	20 06           	jr	@257
    ;
    6662	3D              @256	mul	
    6663	89 00           	adcA	#$00
    6665	40              	negA	
    6666	AB 03           	addA	3, X
    6668	38              @257	popX	
    6669	36              	pushA	
    666A	EC 03           	ldD	3, X
    666C	10              	sBA	
    666D	18 E6 03        	ldaB	3, Y
    6670	24 06           	bcc	@258
    6672	40              	negA	
    6673	3D              	mul	
    6674	A9 03           	adcA	3, X
    6676	20 06           	jr	@259
    ;
    6678	3D              @258	mul	
    6679	89 00           	adcA	#$00
    667B	40              	negA	
    667C	AB 03           	addA	3, X
    667E	33              @259	popB	
    667F	36              	pushA	
    6680	10              	sBA	                                  ; Y1 - Y2
    6681	18 E6 02        	ldaB	2, Y                              ; FRACTION MULT
    6684	24 07           	bcc	@260                              ; BR IF D >= 0
    6686	40              	negA	                                  ;ELSE INTERP Y (RND UP IF Req)
    6687	3D              	mul	
    6688	18 A9 01        	adcA	1, Y
    668B	20 07           	jr	@261
    ;
    668D	3D              @260	mul	
    668E	89 00           	adcA	#$00
    6690	40              	negA	
    6691	18 AB 01        	addA	1, Y
    6694	31              @261	incS	
    6695	38              	popX	                                  ; end 3dlkup, result in A
    6696	B7 01 1C        	staA	L011C
    6699	CE 00 8A        @262	ldX	#$008A
    669C	DC 7A           	ldD	L007A
    669E	A3 00           	subD	0, X
    66A0	DE A1           	ldX	l_00a1_ref_period_12x
    66A2	BC 26 ED        	cmpX	L26ED
    66A5	25 0D           	bcs	@263
    66A7	DF FB           	stX	L00FB
    66A9	96 FD           	ldaA	L00FD
    66AB	C6 52           	ldaB	#$52
    66AD	3D              	mul	
    66AE	89 00           	adcA	#$00
    66B0	16              	tAB	
    66B1	4F              	clrA	
    66B2	20 0D           	jr	@264
    ;
    66B4	DD FB           @263	stD	L00FB
    66B6	8F              	xgDX	
    66B7	96 FD           	ldaA	L00FD
    66B9	C6 F6           	ldaB	#$F6
    66BB	3D              	mul	
    66BC	04              	lsrD	
    66BD	04              	lsrD	
    66BE	04              	lsrD	
    66BF	04              	lsrD	
    66C0	04              	lsrD	
    66C1	DD FE           @264	stD	L00FE
    66C3	8F              	xgDX	
    66C4	02              	idiv	
    66C5	05              	lslD	
    66C6	1A 93 FE        	cmpD	L00FE
    66C9	25 01           	bcs	@265
    66CB	08              	incX	
    66CC	8C 04 FF        @265	cmpX	#$04FF
    66CF	23 03           	bls	@266
    66D1	CE 04 FF        	ldX	#$04FF                            ;max limit to $04ff
    66D4	FF 01 00        @266	stX	L0100
    66D7	FC 01 00        	ldD	L0100
    66DA	37              	pushB	                                  ; D=index, set aside B				   
    66DB	16              	tAB	                                  ; A -> B, msb index, (index/256),   A stays in A
    66DC	CE 28 40        	ldX	#$2840                            ; 				   
    66DF	3A              	aBX	                                  ; X=X+(index)/256		
    66E0	A6 00           	ldaA	0, X                              ;  load table value f(msb L0100)		
    66E2	33              	popB	                                  ; B, lsb index,  		
    66E3	CE 27 40        	ldX	#$2740                            ; 				
    66E6	3A              	aBX	                                  ; X=X+(index)/256		
    66E7	E6 00           	ldaB	0, X                              ;  load table value f(lsb L0100)		
    66E9	3D              	mul	                                  ;  A*B -> D			
    66EA	89 00           	adcA	#$00
    66EC	40              	negA	
    66ED	B7 01 1D        	staA	L011D
    66F0	B6 01 1C        	ldaA	L011C
    66F3	40              	negA	
    66F4	F6 26 F1        	ldaB	L26F1
    66F7	3D              	mul	
    66F8	05              	lslD	
    66F9	24 02           	bcc	@267
    66FB	86 FF           	ldaA	#$FF
    66FD	B7 01 1E        @267	staA	L011E
    6700	B1 01 1D        	cmpA	L011D
    6703	23 03           	bls	@268
    6705	B6 01 1D        	ldaA	L011D
    6708	B7 01 1F        @268	staA	L011F
    670B	CE 01 04        	ldX	#$0104
    670E	D6 A5           	ldaB	l_00a5_countr_skip_lkups
    6710	58              	lslB	
    6711	24 07           	bcc	@270
    now i want to figure out what it does, and how i can screw around with it. if it's truly transient fuel calcs, perhaps we can get some pump shot out of it, or other fun things. and if it truly has compensation for CCP duty cycle air n' fumes, how can that be nerfed without taking the rest of the routine with it....

  4. #4
    LT1 specialist steveo's Avatar
    Join Date
    Aug 2013
    Posts
    4,007
    Quote Originally Posted by beestoys View Post
    Good luck Steveo
    Hope you can unlock some of the uncharted territory. You have been a big help to me. I'll stick to the basic tolls for now and follow in others footsteps here.
    thanks bud i'll need it!

    anything else i can do, let me know.. there's not a big lt1 crowd left that gives a shit, we have to stick together

  5. #5
    LT1 specialist steveo's Avatar
    Join Date
    Aug 2013
    Posts
    4,007
    first off the CCP element.

    i see no real evidence that there's any link to a variable charcoal canister purge duty cycle, which is in t-side memory 022A. although possibly:

    1. it's a static formula that assumes that the duty cycle will happen (seems unlikely, especially considering it doesn't have any knowledge of when the duty cycle will occur temp-wise, @ constant 0x2625 in t-side, or at what throttle positions, which is also on the t-side)

    2. it does get the duty cycle from the t-side and i just can't see it

    3. it was misunderstood in previous tuning software

    next is investigate the table....

  6. #6
    LT1 specialist steveo's Avatar
    Join Date
    Aug 2013
    Posts
    4,007
    reviews of logs with this bit enabled/disabled in similar tunes do reveal substantial differences in BLM averages. this set of instructions is definitely doing.................something!

    3d tables @ 0x26F5 and 0x2848 to play with, working on that now

  7. #7
    Super Moderator dave w's Avatar
    Join Date
    Feb 2011
    Posts
    6,268
    I greatly appreciate your efforts / progress!

    dave w

  8. #8
    LT1 specialist steveo's Avatar
    Join Date
    Aug 2013
    Posts
    4,007
    all this table lookup code is tripping me up a bit; trying to figure out how to interpret enough it to confirm table dimensions. back to school with me for a while.

  9. #9
    LT1 specialist steveo's Avatar
    Join Date
    Aug 2013
    Posts
    4,007
    table at 0x26F2 appears to be, unless im misunderstanding it, 5x15 of map vs coolant, which means the fueling routine is probably fairly temperature oriented, and operates only at either really coarse or a specific range of MAP values.

    this may point towards this actually being the wall pooling compensations

    result stored in 0x00FD, used only once. it appears to make a choice based on rpm,

    Code:
    6699	CE 00 8A        @262	ldX	#$008A
    669C	DC 7A           	ldD	L007A
    669E	A3 00           	subD	0, X
    66A0	DE A1           	ldX	l_00a1_ref_period_12x
    66A2	BC 26 ED        	cmpX	L26ED
    66A5	25 0D           	bcs	@263
    whether to perform this calc on the result:

    Code:
    66A7	DF FB           	stX	L00FB
    66A9	96 FD           	ldaA	L00FD   ; load mystery value
    66AB	C6 52           	ldaB	#$52   ; multiply with dec 82
    66AD	3D              	mul	          ; ..
    66AE	89 00           	adcA	#$00   ; add carry bit of nil back to register?  i don't understand that
    66B0	16              	tAB	  ; result to register b
    66B1	4F              	clrA	
    66B2	20 0D           	jr	@264
    .. or this one

    Code:
    66B4	DD FB           @263	stD	L00FB
    66B6	8F              	xgDX	
    66B7	96 FD           	ldaA	L00FD  ; load mystery value
    66B9	C6 F6           	ldaB	#$F6  ; multiply with 246 ??
    66BB	3D              	mul	   ;
    66BC	04              	lsrD	   ; ok im lost
    66BD	04              	lsrD	   ; 5 right shifts
    66BE	04              	lsrD	   ; need more coffee
    66BF	04              	lsrD	   ; 
    66C0	04              	lsrD	   ;

  10. #10
    LT1 specialist steveo's Avatar
    Join Date
    Aug 2013
    Posts
    4,007
    staring at that last code snippet for a few minutes proves to me how noob i am with this stuff right now, so i gave it my best shot on a hunk of paper with the instruction set beside me.

    my best guess is:

    - multiplies our mystery table lookup result by 0xF6 into the 16 bit D register, a good choice since multiplying two 8 bits into a 16 bit is a very cheap operation for a processor. D must be a 16 bit, otherwise multiplication on 8 bit values would be rediculous.
    - im thinking sequential right shifts on an integer of that size should result in exponential division to the number of shifts, so 5x LSRD is the equivalent of a less expensive version of /(2^5)

    so this basically does (X*246)/32

    can someone check my work to see if i'm even close?

  11. #11
    LT1 specialist steveo's Avatar
    Join Date
    Aug 2013
    Posts
    4,007
    if the first equation runs, though, $0x008A is subtracted from whatever is in 0x007A, which actually might be from the t-side?.. need to look at that more

    so looks like whether rpm is a factor in whether _some other variable_ is used. this might actually be ccp related...?


    scratch that i was missing a peice of the puzzle.

  12. #12
    Super Moderator
    Join Date
    Mar 2011
    Location
    Camden, MI
    Age
    35
    Posts
    3,026
    looks right to me. depending on how the code afterwards deals with what is in D, the 246 could be a 246 multiplier or it could be 246/256(if only A were used afterwards, for example).
    1995 Chevrolet Monte Carlo LS 3100 + 4T60E


  13. #13

  14. #14
    LT1 specialist steveo's Avatar
    Join Date
    Aug 2013
    Posts
    4,007
    this is taking a long time for me to figure, but I'm concluding pretty quick here that it performs more than one fueling compensation. might be wall wetting and something else in the same code block.

  15. #15
    Fuel Injected! fbody_Brian's Avatar
    Join Date
    Mar 2013
    Location
    Biloxi MS
    Posts
    166
    Very interesting

    Subscribed!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •