<назад

Мозг A5B - ревизия финиш

Отправлено Ken@t: 26.02.04 15:13
http://www.coral-club.com/kn/A5B_LST.TXT
http://www.auto.ru/wwwboards/ford/1538/480824.shtml 

Мериканские мозги от ранних В6

------------ code analysis ------------



2000: e7,1d,00,        jump  2020             goto INITIALISE;


2003: ff,              fill  
2004: ff,ff,ff,ff,ff,ff, fill  
200a: 41,84,00,60,5d,00, ??    b  65,132,  0, 96, 93,  0, h 8441,6000,  5d, d -31679,24576,   93,

2010: 04,d0,           vect  d004,             I_CALCON();
2012: a0,2c,           vect  2ca0,             I_Timer_ovf();
2014: b2,2c,           vect  2cb2,             I_Dummy();
2016: b3,2c,           vect  2cb3,             I_HSin();
2018: b2,2c,           vect  2cb2,             I_Dummy();
201a: b0,2d,           vect  2db0,             I_HSout();
201c: b2,2c,           vect  2cb2,             I_Dummy();
201e: b2,2c,           vect  2cb2,             I_Dummy(); 

 ######################### 
 ## INITIALISE AND START UP 
 #########################


   INITIALISE:
2020: fa,              di                     disable ints
2021: ff,              nop                    
2022: 01,16,           clrw  R16              codeflags = 0;
2024: 11,02,           clrb  R2               LS_PORT = 0;    ## Init I/O
2026: a3,01,50,20,30,  ldw   R30,[2050]       R30 = ROMSTART;
202b: a3,01,5e,20,32,  ldw   R32,[205e]       R32 = ROMEND;    ## ROM checksum loop (2000-3fff)
2030: 01,34,           clrw  R34              R34 = 0;
2032: 95,40,02,        xorb  R2,40            LS_PORT = LS_PORT ^ 40;
2035: ff,              nop                    
2036: ff,              nop                    
2037: 11,05,           clrb  R5               AD_HIGH = 0;
2039: 95,40,02,        xorb  R2,40            LS_PORT = LS_PORT ^ 40;    ## bit 6 => CPU OK
203c: 66,31,34,        ad2w  R34,[R30++]      R34 += [R30++];
203f: 88,32,30,        cmpw  R30,R32          
2042: da,ee,           jle   2032             if (R30 <= R32) goto 2032;
2044: 89,00,00,34,     cmpw  R34,0            
2048: df,04,           je    204e             if (R34 != 0)  {
204a: 81,00,02,16,     orw   R16,200          ROM_fail = 1;   }     ## Checksum failed
204e: 20,12,           sjmp  2062             goto 2062;


   ROMSTART:
2050: 00,20,           word  2000   8192

2052: ff,27,00,28,ff,2f, ??    b 255, 39,  0, 40,255, 47, h 27ff,2800,2fff, d 10239,10240,12287,
2058: 00,30,ff,37,00,38, ??    b   0, 48,255, 55,  0, 56, h 3000,37ff,3800, d 12288,14335,14336,

   ROMEND:
205e: ff,3f,           word  3fff  16383

2060: 00,00,           ??    b   0,  0, h    0, d     0,

2062: b1,ff,08,        ldb   R8,ff            INT_MSK = ff;
2065: b1,55,0c,        ldb   Rc,55            HSI_MASK = 55;
2068: a1,67,01,18,     ldw   R18,167          R18 = 167;     ## RAM Test loop 100-17f (128 bytes)
206c: 3f,08,03,        jb    B7,R8,2072       if (!B7_INT_MSK)  {
206f: b1,aa,0c,        ldb   Rc,aa            HSI_MASK = aa;  }
2072: 05,18,           decw  R18              R18--;
2074: df,1a,           je    2090             if (0 == R18) goto 2090;
2076: 95,40,02,        xorb  R2,40            LS_PORT = LS_PORT ^ 40;
2079: ff,              nop                    
207a: ff,              nop                    
207b: 11,05,           clrb  R5               AD_HIGH = 0;
207d: 95,40,02,        xorb  R2,40            LS_PORT = LS_PORT ^ 40;    ## bit 6 => CPU OK
2080: c7,18,19,0c,     stb   Rc,[R18+19]      [R18+19] = HSI_MASK;
2084: 9b,18,19,0c,     cmpb  Rc,[R18+19]      
2088: df,e8,           je    2072             if (HSI_MASK == [R18+19]) goto 2072;
208a: 81,00,01,16,     orw   R16,100          RAM_fail = 1; 
208e: 20,08,           sjmp  2098             goto 2098;

2090: 17,08,           incb  R8               INT_MSK++;
2092: df,d4,           je    2068             if (0 == INT_MSK) goto 2068;
2094: 61,ff,fe,16,     an2w  R16,feff         RAM_fail = 0; 
2098: 01,30,           clrw  R30              R30 = 0;    ## loop, clear regs & RAM
209a: c2,31,00,        stw   0,[R30++]        [R30++] = 0;
209d: 89,16,00,30,     cmpw  R30,16           
20a1: df,06,           je    20a9             if (R30 == 16) goto 20a9;
20a3: 89,30,00,30,     cmpw  R30,30           
20a7: d7,04,           jne   20ad             if (R30 == 30)  {
20a9: 65,02,00,30,     ad2w  R30,2            R30 += 2;  }
20ad: 89,00,02,30,     cmpw  R30,200          
20b1: d7,e7,           jne   209a             if (R30 != 200) goto 209a;
20b3: b1,2a,08,        ldb   R8,2a            INT_MSK = 2a;
20b6: b1,0f,0d,        ldb   Rd,f             HSIO_DATA = f;    ## Set software interrupt
20b9: a1,b2,00,0e,     ldw   Re,b2            HSIO_TIME = b2;   ## in 0.854 mSecs
20bd: a1,1a,01,10,     ldw   R10,11a          STACK = 11a;    ## stack has 28 entries
20c1: a1,32,00,98,     ldw   R98,32           TaskNum = 32;
20c5: b1,64,ae,        ldb   Rae,64           flags1 = 64;    ## B6 (First PIP), B5 (Timer0), B2 (?)
20c8: a1,ff,ff,4e,     ldw   R4e,ffff         T7WmSU = ffff;   ## init timer7 - set zero if inj_inh set
20cc: a1,00,80,c8,     ldw   Rc8,8000         TPS_prev = 8000;
20d0: a1,00,80,ec,     ldw   Rec,8000         TPS_val = 8000;
20d4: b1,40,b4,        ldb   Rb4,40           OP_flags = 40;    ## Set SPOUT reqd
20d7: b1,05,0c,        ldb   Rc,5             HSI_MASK = 5;
20da: b1,08,2a,        ldb   R2a,8            8ths_sec = 8;
20dd: b1,c0,1a,        ldb   R1a,c0           IgnFlags = c0;    ## set 450/600rpm, Ign Adv Flag (low rpm, no advance ?)
20e0: a0,06,56,        ldw   R56,R6           Last_KA = IO_TIMER;    ## last keep alive
20e3: 11,05,           clrb  R5               AD_HIGH = 0;
20e5: 11,05,           clrb  R5               AD_HIGH = 0;    ## watchdog ??
20e7: b1,0b,30,        ldb   R30,b            R30 = b;
20ea: b0,0d,32,        ldb   R32,Rd           R32 = HSIO_DATA;    ## Clear HSI store (12 slots)
20ed: ff,              nop                    
20ee: ff,              nop                    
20ef: 15,30,           decb  R30              R30--;
20f1: d7,f7,           jne   20ea             if (0 != R30) goto 20ea;
20f3: fb,              ei                     enable ints 

 ######################### 
 ## MAIN LOOP STARTS HERE 
 #########################
   main_loop:
20f4: c9,f4,20,        pushw 20f4             push (main_loop);
20f7: 28,9e,           scall 2197             Do_outputs();
20f9: 99,01,5b,        cmpb  R5b,1            
20fc: d7,02,           jne   2100             if (MAIN_TASK != 1) goto 2100;
20fe: 20,69,           sjmp  2169             goto Run_Tasks;

2100: 99,04,5b,        cmpb  R5b,4            
2103: d1,03,           jleu  2108             if ((uns) MAIN_TASK > 4 )  {
2105: 91,02,b7,        orb   Rb7,2            B1_Rb7 = 1;   }
2108: b1,02,5b,        ldb   R5b,2            MAIN_TASK = 2;
210b: 39,b7,08,        jb    B1,Rb7,2116      if (B1_Rb7) goto 2116;
210e: 89,00,00,98,     cmpw  R98,0            
2112: d7,04,           jne   2118             if (TaskNum != 0) goto 2118;
2114: 20,1c,           sjmp  2132             goto Read_A/D;

2116: 27,08,           sjmp  2020             goto INITIALISE;

2118: 45,42,03,56,30,  ad3w  R30,R56,342      R30 = Last_KA + 342;    ## Keep Alive every 4 mS
211d: 88,30,06,        cmpw  R6,R30           
2120: de,04,           jlt   2126             if (IO_TIMER < R30) goto 2126;
2122: d5,32,           jnv   2156             if (!overflow) goto Keep_Alive;
2124: 20,02,           sjmp  2128             goto 2128;

2126: dd,2e,           jv    2156             if (overflow) goto Keep_Alive;
2128: 3a,b7,46,        jb    B2,Rb7,2171      if (!B2_Rb7)  {
212b: 99,02,7a,        cmpb  R7a,2            
212e: d1,39,           jleu  2169             if ((uns) R7a <= 2) goto Run_Tasks;
2130: 20,3f,           sjmp  2171             goto 2171;

   Read_A/D:
2132: b1,01,5b,        ldb   R5b,1            MAIN_TASK = 1;    ## Here when Tasknum = 0 
2135: 11,bb,           clrb  Rbb              Rbb = 0;    ## Read A/D Inputs
2137: a1,7e,00,30,     ldw   R30,7e           R30 = 7e;    ## first A/D register
213b: b0,bb,04,        ldb   R4,Rbb           AD_LOW = Rbb;
213e: 33,0a,fd,        jnb   B3,Ra,213e       if (!A/D_RDY) goto 213e;
2141: c4,32,04,        stb   R4,R32           R32 = AD_LOW;
2144: c4,33,05,        stb   R5,R33           R33 = AD_HIGH;
2147: 61,c0,ff,32,     an2w  R32,ffc0         B0_R32 = 0; B1_R32 = 0; B2_R32 = 0; B3_R32 = 0; B4_R32 = 0; B5_R32 = 0; 
214b: c2,31,32,        stw   R32,[R30++]      [R30++] = R32;
214e: 17,bb,           incb  Rbb              Rbb++;
2150: 99,0d,bb,        cmpb  Rbb,d            
2153: de,e6,           jlt   213b             if (Rbb < d) goto 213b;    ## End Read A/D
2155: f0,              ret                    return

   Keep_Alive:
2156: 17,05,           incb  R5               AD_HIGH++;
2158: fa,              di                     disable ints
2159: ff,              nop                    
215a: 95,40,02,        xorb  R2,40            LS_PORT = LS_PORT ^ 40;    ## flip bit 6 = CPU OK
215d: ff,              nop                    
215e: ff,              nop                    
215f: 17,05,           incb  R5               AD_HIGH++;    ## reset watchdog ?
2161: 95,40,02,        xorb  R2,40            LS_PORT = LS_PORT ^ 40;
2164: fb,              ei                     enable ints
2165: a0,06,56,        ldw   R56,R6           Last_KA = IO_TIMER;
2168: f0,              ret                    return

   Run_Tasks:
2169: 11,5b,           clrb  R5b              MAIN_TASK = 0;
216b: 17,7a,           incb  R7a              R7a++;
216d: e7,37,0a,        jump  2ba7             goto Do_TASKS;

2170: f0,              ret                    return  }

2171: b1,03,5b,        ldb   R5b,3            MAIN_TASK = 3;
2174: 3a,5a,05,        jb    B2,R5a,217c      if (!PUMP_ON_RQD)  {
2177: 71,7f,02,        an2b  R2,7f            FPUMP_DRV = 0; 
217a: 20,03,           sjmp  217f             goto 217f;  }

217c: 91,80,02,        orb   R2,80            FPUMP_DRV = 1; 
217f: 71,ef,5a,        an2b  R5a,ef           STI_Required = 0; 
2182: 3b,0b,03,        jb    B3,Rb,2188       if (!B3_HSI_DATA)  {
2185: 91,10,5a,        orb   R5a,10           STI_Required = 1;   }
2188: 71,df,b7,        an2b  Rb7,df           Idle_Adjust = 0; 
218b: 3d,0b,03,        jb    B5,Rb,2191       if (!B5_HSI_DATA)  {
218e: 91,20,b7,        orb   Rb7,20           Idle_Adjust = 1;   }
2191: ef,f6,09,        call  2b8a             Do_STO2();
2194: 11,7a,           clrb  R7a              R7a = 0;
2196: f0,              ret                    return

   Do_outputs:
2197: 32,b4,02,        jnb   B2,Rb4,219c      if (SPOUTrqd)  {
219a: 28,19,           scall 21b5             Do_SPOUT();  }
219c: 30,b4,02,        jnb   B0,Rb4,21a1      if (Inj0rqd)  {
219f: 29,0e,           scall 22af             Do_InjBank0();  }
21a1: 31,b4,02,        jnb   B1,Rb4,21a6      if (Inj1rqd)  {
21a4: 29,61,           scall 2307             Do_InjBank1();  }
21a6: 36,b4,02,        jnb   B6,Rb4,21ab      if (STOrqd)  {
21a9: 29,b4,           scall 235f             Do_STO();  }
21ab: 37,b4,03,        jnb   B7,Rb4,21b1      if (ISCrqd)  {
21ae: ef,0a,0a,        call  2bbb             Do_ISC();  }
21b1: ef,74,0a,        call  2c28             Do_EGR();
21b4: f0,              ret                    return

   Do_SPOUT:
21b5: 8b,01,64,24,70,  cmpw  R70,[2464]       
21ba: d1,0a,           jleu  21c6             if ((uns) RPMx4 > RPM_6600 )  {
21bc: a0,06,5e,        ldw   R5e,R6           Last_SPOUT_On = IO_TIMER;
21bf: a0,06,60,        ldw   R60,R6           Last_SPOUT_Off = IO_TIMER;
21c2: 11,1a,           clrb  R1a              IgnFlags = 0;
21c4: 20,e8,           sjmp  22ae             goto endfunc;  }

21c6: 3d,1a,05,        jb    B5,R1a,21ce      if (IgnImmed2) goto 21ce;
21c9: 3c,1a,02,        jb    B4,R1a,21ce      if (IgnImmed1) goto 21ce;    ## ? missed/extra spout event ?
21cc: 20,3c,           sjmp  220a             goto 220a;

21ce: 3b,1a,34,        jb    B3,R1a,2205      if (Ignore_IgnImm) goto 2205;
21d1: 11,b2,           clrb  Rb2              Rb2 = 0;
21d3: 30,54,12,        jnb   B0,R54,21e8      if (B0_PREV_HSI)  {    ## On or Off Reqd ?(Immediate)
21d6: b1,15,ba,        ldb   Rba,15           Rba = 15;
21d9: 29,ba,           scall 2395             HS_OUT();    ## SPOUT On - Immediate - First ever PIP (zero diffs ?)
21db: 30,b2,02,        jnb   B0,Rb2,21e0      if (!HSO_BUSY) goto 21e0;
21de: 20,10,           sjmp  21f0             goto 21f0;

21e0: 91,04,1a,        orb   R1a,4            SPOUT_state = 1; 
21e3: a0,30,5e,        ldw   R5e,R30          Last_SPOUT_On = R30;
21e6: 20,13,           sjmp  21fb             goto 21fb;  }

21e8: b1,05,ba,        ldb   Rba,5            Rba = 5;
21eb: 29,a8,           scall 2395             HS_OUT();    ## SPOUT Off - Immediate
21ed: 30,b2,05,        jnb   B0,Rb2,21f5      if (HSO_BUSY)  {
21f0: 91,10,b6,        orb   Rb6,10           SPOUT_Missed = 1;     ## used only here ?
21f3: 20,b9,           sjmp  22ae             goto endfunc;  }

21f5: 71,fb,1a,        an2b  R1a,fb           SPOUT_state = 0; 
21f8: a0,30,60,        ldw   R60,R30          Last_SPOUT_Off = R30;
21fb: 35,1a,02,        jnb   B5,R1a,2200      if (!IgnImmed2) goto 2200;
21fe: 20,ab,           sjmp  22ab             goto Clearexit;

2200: 3c,1a,07,        jb    B4,R1a,220a      if (IgnImmed1) goto 220a;
2203: 20,a6,           sjmp  22ab             goto Clearexit;

2205: 71,f7,1a,        an2b  R1a,f7           Ignore_IgnImm = 0; 
2208: 20,a1,           sjmp  22ab             goto Clearexit;

220a: 91,08,1a,        orb   R1a,8            Ignore_IgnImm = 1;     # Goes here if no Ignimm flags set, stops flags next time ?
220d: 30,1a,02,        jnb   B0,R1a,2212      if (!SPOUT_delay_off) goto 2212;
2210: 20,6c,           sjmp  227e             goto 227e;

2212: 39,1a,05,        jb    B1,R1a,221a      if (SPOUT_Delay_on) goto 221a;
2215: 32,1a,02,        jnb   B2,R1a,221a      if (!SPOUT_state) goto 221a;
2218: 20,64,           sjmp  227e             goto 227e;

221a: a0,42,58,        ldw   R58,R42          IGN_DELAY = R42;
221d: 91,80,1b,        orb   R1b,80           B7_flagsw5 = 1; 
2220: 3d,a9,2a,        jb    B5,Ra9,224d      if (PIP_State) goto 224d;
2223: 31,a9,03,        jnb   B1,Ra9,2229      if (Recalc_IgnWait)  {
2226: ef,1c,0d,        call  2f45             Calc_Ign_Wait();  }    # complex delay (allows for RPM change ?)
2229: 91,04,a9,        orb   Ra9,4            Ign_Delay_Cx = 1; 
222c: 4c,58,f0,30,     ml3w  R30,Rf0,R58      R30 = (long) IGN_ELAPSE * IGN_DELAY;
2230: 0d,01,30,        shldw R30,1            R30 = (long) R30 << 1;
2233: 49,00,80,f0,30,  sb3w  R30,Rf0,8000     R30 = IGN_ELAPSE - 8000;
2238: 03,30,           negw  R30              R30 = -R30;
223a: 48,30,32,34,     sb3w  R34,R32,R30      R34 = R32 - R30;
223e: 6c,1e,34,        ml2w  R34,R1e          R34 *= PIP_High_PW;
2241: 0d,01,34,        shldw R34,1            R34 = (long) R34 << 1;
2244: a0,36,34,        ldw   R34,R36          R34 = R36;
2247: a1,ee,00,3c,     ldw   R3c,ee           R3c = ee;    ## Ree = LAST_PIP1
224b: 20,17,           sjmp  2264             goto 2264;

224d: 39,a9,03,        jb    B1,Ra9,2253      if (!Recalc_IgnWait)  {
2250: ef,f2,0c,        call  2f45             Calc_Ign_Wait();  }    ## plain delay ? (no RPM change or fixed calc)
2253: 71,fb,a9,        an2b  Ra9,fb           Ign_Delay_Cx = 0; 
2256: 4c,44,58,30,     ml3w  R30,R58,R44      R30 = (long) IGN_DELAY * PIP_Interval;
225a: 0d,01,30,        shldw R30,1            R30 = (long) R30 << 1;
225d: a0,32,34,        ldw   R34,R32          R34 = R32;
2260: a1,40,00,3c,     ldw   R3c,40           R3c = 40;    ## R40 = LAST_PIP
2264: b1,15,ba,        ldb   Rba,15           Rba = 15;    ## SPOUT On at LAST_PIP + R34
2267: b1,c0,b2,        ldb   Rb2,c0           Rb2 = c0;
226a: ef,28,01,        call  2395             HS_OUT();
226d: 30,b2,05,        jnb   B0,Rb2,2275      if (HSO_BUSY)  {
2270: 91,02,1a,        orb   R1a,2            SPOUT_Delay_on = 1; 
2273: 20,39,           sjmp  22ae             goto endfunc;  }

2275: a0,30,5e,        ldw   R5e,R30          Last_SPOUT_On = R30;
2278: 71,fd,1a,        an2b  R1a,fd           SPOUT_Delay_on = 0; 
227b: 91,04,1a,        orb   R1a,4            SPOUT_state = 1; 
227e: a0,1e,34,        ldw   R34,R1e          R34 = PIP_High_PW;
2281: 89,30,01,34,     cmpw  R34,130          
2285: d3,06,           jnc   228d             if ((uns) R34 < Idle_PW_len) goto 228d;
2287: 89,b1,28,34,     cmpw  R34,28b1             # 10417*4.8uS, 50mS, 20hz/2 = 200rpm?
228b: d1,04,           jleu  2291             if ((uns) R34 > 28b1 )  {
228d: a1,30,01,34,     ldw   R34,130          R34 = Idle_PW_len;  }    # 304*4.8uS, 1.4mS, 685Hz/2 = 6853rpm?
   SPOUT_Off:
2291: a1,5e,00,3c,     ldw   R3c,5e           R3c = 5e;    ## R5e = LaST_SPOUT_ON 
2295: b1,05,ba,        ldb   Rba,5            Rba = 5;
2298: b1,c0,b2,        ldb   Rb2,c0           Rb2 = c0;
229b: 28,f8,           scall 2395             HS_OUT();    ## SPOUT Off at R34 + [R5e]
229d: 30,b2,05,        jnb   B0,Rb2,22a5      if (HSO_BUSY)  {
22a0: 91,01,1a,        orb   R1a,1            SPOUT_delay_off = 1; 
22a3: 20,09,           sjmp  22ae             goto endfunc;  }

   Clearfexit:
22a5: 71,fa,1a,        an2b  R1a,fa           SPOUT_delay_off = 0; SPOUT_state = 0; 
22a8: a0,30,60,        ldw   R60,R30          Last_SPOUT_Off = R30;
   Clearexit:
22ab: 71,fb,b4,        an2b  Rb4,fb           SPOUTrqd = 0; 
   endfunc:
22ae: f0,              ret                    
 

################## 
# Injection Bank 0 Output. 
# handles scheduling of on and off events for Injector 
####################

   Do_InjBank0:
22af: 3e,b6,19,        jb    B6,Rb6,22cb      if (B0_On_Dlyd) goto Inj0_on;    ## delayed On - do now
22b2: 3a,b6,2b,        jb    B2,Rb6,22e0      if (B0_Off_Dlyd) goto Inj0_off;    ## delayed Off - do now
22b5: 31,2c,05,        jnb   B1,R2c,22bd      if (Inj_Inhibit)  {
22b8: a0,06,c4,        ldw   Rc4,R6           Inj0TimeOff = IO_TIMER;    ## Nothing to do ? 
22bb: 20,43,           sjmp  2300             goto 2300;  }

22bd: 48,c4,06,30,     sb3w  R30,R6,Rc4       R30 = IO_TIMER - Inj0TimeOff;
22c1: d5,04,           jnv   22c7             if (!overflow) goto 22c7;
22c3: de,06,           jlt   22cb             if (IO_TIMER < Inj0TimeOff) goto Inj0_on;
22c5: 20,3f,           sjmp  2306             goto endfunc;

22c7: d6,02,           jge   22cb             if (IO_TIMER >= Inj0TimeOff) goto Inj0_on;
22c9: 20,3b,           sjmp  2306             goto endfunc;

   Inj0_on:
22cb: 11,b2,           clrb  Rb2              Rb2 = 0;
22cd: b1,16,ba,        ldb   Rba,16           Rba = 16;    ## Inj Bank 0 On - immediate
22d0: 28,c3,           scall 2395             HS_OUT();
22d2: 30,b2,05,        jnb   B0,Rb2,22da      if (HSO_BUSY)  {
22d5: 91,40,b6,        orb   Rb6,40           B0_On_Dlyd = 1; 
22d8: 20,2c,           sjmp  2306             goto endfunc;  }

22da: a0,30,c2,        ldw   Rc2,R30          Inj0TimeOn = R30;    ## Save actual start time
22dd: 71,bf,b6,        an2b  Rb6,bf           B0_On_Dlyd = 0; 
   Inj0_off:
22e0: b1,c0,b2,        ldb   Rb2,c0           Rb2 = c0;
22e3: b1,06,ba,        ldb   Rba,6            Rba = 6;
22e6: a1,c2,00,3c,     ldw   R3c,c2           R3c = c2;    ## Inj0 Time On  (Actual)
22ea: a0,c6,34,        ldw   R34,Rc6          R34 = Inj0Length;
22ed: 28,a6,           scall 2395             HS_OUT();    ## Inj Bank 0 Off at Inj0TimeOn + Inj0Length
22ef: 30,b2,05,        jnb   B0,Rb2,22f7      if (HSO_BUSY)  {
22f2: 91,04,b6,        orb   Rb6,4            B0_Off_Dlyd = 1; 
22f5: 20,0f,           sjmp  2306             goto endfunc;  }

22f7: a0,30,c4,        ldw   Rc4,R30          Inj0TimeOff = R30;
22fa: a0,c6,32,        ldw   R32,Rc6          R32 = Inj0Length;
22fd: ef,47,08,        call  2b47             Inj_Trip();
2300: 71,fe,b4,        an2b  Rb4,fe           Inj0rqd = 0; 
2303: 71,bb,b6,        an2b  Rb6,bb           B0_Off_Dlyd = 0; B0_On_Dlyd = 0; 
   endfunc:
2306: f0,              ret                    
 

################## 
# Injection Bank 1 Output. 
# handles scheduling of on and off events for Injector 
####################

   Do_InjBank1:
2307: 38,49,19,        jb    B0,R49,2323      if (B1_On_Dlyd) goto 2323;    ## delayed On - do now
230a: 3a,49,2b,        jb    B2,R49,2338      if (B1_Off_Dlyd) goto 2338;    ## delayed Off - do now
230d: 31,2c,05,        jnb   B1,R2c,2315      if (Inj_Inhibit)  {
2310: a0,06,d6,        ldw   Rd6,R6           Inj1TimeOff = IO_TIMER;    ## Nothing to do ? 
2313: 20,43,           sjmp  2358             goto Clearfexit;  }

2315: 48,d6,06,30,     sb3w  R30,R6,Rd6       R30 = IO_TIMER - Inj1TimeOff;
2319: d5,04,           jnv   231f             if (!overflow) goto 231f;
231b: de,06,           jlt   2323             if (IO_TIMER < Inj1TimeOff) goto 2323;
231d: 20,3f,           sjmp  235e             goto endfunc;

231f: d6,02,           jge   2323             if (IO_TIMER >= Inj1TimeOff) goto 2323;
2321: 20,3b,           sjmp  235e             goto endfunc;

2323: 11,b2,           clrb  Rb2              Rb2 = 0;
2325: b1,17,ba,        ldb   Rba,17           Rba = 17;
2328: 28,6b,           scall 2395             HS_OUT();    ## Inj bank 1 On - Immediate
232a: 30,b2,05,        jnb   B0,Rb2,2332      if (HSO_BUSY)  {
232d: 91,01,49,        orb   R49,1            B1_On_Dlyd = 1; 
2330: 20,2c,           sjmp  235e             goto endfunc;  }

2332: a0,30,d4,        ldw   Rd4,R30          Inj1TimeOn = R30;    ## Save actual start time
2335: 71,fe,49,        an2b  R49,fe           B1_On_Dlyd = 0; 
2338: b1,c0,b2,        ldb   Rb2,c0           Rb2 = c0;
233b: b1,07,ba,        ldb   Rba,7            Rba = 7;
233e: a1,d4,00,3c,     ldw   R3c,d4           R3c = d4;    ## Inj1 Time On  (Actual)
2342: a0,d8,34,        ldw   R34,Rd8          R34 = Inj1Length;
2345: 28,4e,           scall 2395             HS_OUT();    ## Inj Bank 0 Off at Inj1TimeOn + Inj1Length
2347: 30,b2,05,        jnb   B0,Rb2,234f      if (HSO_BUSY)  {
234a: 91,04,49,        orb   R49,4            B1_Off_Dlyd = 1; 
234d: 20,0f,           sjmp  235e             goto endfunc;  }

234f: a0,30,d6,        ldw   Rd6,R30          Inj1TimeOff = R30;
2352: a0,d8,32,        ldw   R32,Rd8          R32 = Inj1Length;
2355: ef,ef,07,        call  2b47             Inj_Trip();
   Clearfexit:
2358: 71,fd,b4,        an2b  Rb4,fd           Inj1rqd = 0; 
235b: 71,fa,49,        an2b  R49,fa           B1_On_Dlyd = 0; B1_Off_Dlyd = 0; 
   endfunc:
235e: f0,              ret                    

   Do_STO:
235f: 3d,5a,05,        jb    B5,R5a,2367      if (!TRIP_RQD)  {
2362: a0,06,78,        ldw   R78,R6           STO_Out_Time = IO_TIMER;
2365: 20,2d,           sjmp  2394             goto endfunc;  }

2367: 3a,b3,06,        jb    B2,Rb3,2370      if (STO_state) goto 2370;
236a: 89,00,40,76,     cmpw  R76,4000         
236e: d3,03,           jnc   2373             if ((uns) STO_PULSEWD < 4000) goto 2373;
2370: e7,f4,07,        jump  2b67             goto Do_STO_ctd;

2373: a0,76,34,        ldw   R34,R76          R34 = STO_PULSEWD;    ## Must be 50% duty cycle, variable Freq
2376: a0,76,36,        ldw   R36,R76          R36 = STO_PULSEWD;    ## 0x4000 implies 12.7 Hz min freq
2379: a1,78,00,3c,     ldw   R3c,78           R3c = 78;    ## R78 = STO_Time_on (2nd event)
237d: b1,80,b2,        ldb   Rb2,80           Rb2 = 80;
2380: b1,19,ba,        ldb   Rba,19           Rba = 19;
2383: b1,29,bb,        ldb   Rbb,29           Rbb = 29;
2386: 28,0d,           scall 2395             HS_OUT();    ## 2 events, on, off with interrupt
2388: 38,b2,09,        jb    B0,Rb2,2394      if (!HSO_BUSY)  {
238b: 71,bf,b4,        an2b  Rb4,bf           STOrqd = 0; 
238e: 71,fb,b3,        an2b  Rb3,fb           STO_state = 0; 
2391: a0,32,78,        ldw   R78,R32          STO_Out_Time = R32;  }    ## time of SECOND event, i.e. full 'pulse cycle' completion
   endfunc:
2394: f0,              ret                    
 

################## 
# main output routine - 1 or 2 events supported 
# Rba = state 1 reqd  (channel + state) 
# Rbb = state 2 reqd  ( "          "  ) 
# R34 = start time state 1 (see B7)  
# R36 = start time state 2 as increment from state 1 time (R34) 
# R3c = (word) pointer to additional delay  
# Rb2 flags (IN) 
#   B7 set, time = R34 + [R3c] and 2nd event unless B6 
#      otherwise time = NOW (immediate output) 
#   B6 no second event with B7 
#   B4 do second output 
# ANSWERS 
#   R30 = actual time of event 1 
#   R32 = actual time of event 2 
#   Rb2 B5   output delayed if clear (but not used elsewhere) 
#   Rb2 B0   output busy 
##################

   HS_OUT:
2395: 71,fe,b2,        an2b  Rb2,fe           HSO_BUSY = 0; 
2398: 38,0a,4c,        jb    B0,Ra,23e7       if (HSO_OVF) goto Busy_exit;
239b: 05,34,           decw  R34              R34--;
239d: 3f,b2,05,        jb    B7,Rb2,23a5      if (!B7_Rb2)  {
23a0: a0,06,30,        ldw   R30,R6           R30 = IO_TIMER;
23a3: 20,07,           sjmp  23ac             goto 23ac;  }

23a5: 46,3c,34,30,     ad3w  R30,R34,[R3c]    R30 = R34 + [R3c];
23a9: 91,20,b2,        orb   Rb2,20           HSO_ontime = 1; 
23ac: b0,ba,3e,        ldb   R3e,Rba          R3e = Rba;    ## Event 1 state
23af: a0,30,b8,        ldw   Rb8,R30          Rb8 = R30;    ## Event 1 time reqd
23b2: 48,30,06,3a,     sb3w  R3a,R6,R30       R3a = IO_TIMER - R30;    ## Event interval from now
23b6: ef,63,07,        call  2b1c             Do_OUT();
23b9: d3,06,           jnc   23c1             if ((uns) R7 >= Do_OUT)  {
23bb: 71,df,b2,        an2b  Rb2,df           HSO_ontime = 0;     ## Ouput delayed, save true event time
23be: a0,b8,30,        ldw   R30,Rb8          R30 = Rb8;  }
23c1: 3f,b2,05,        jb    B7,Rb2,23c9      if (B7_Rb2) goto 23c9;
23c4: 3c,b2,05,        jb    B4,Rb2,23cc      if (B4_Rb2) goto 23cc;
23c7: 20,21,           sjmp  23ea             goto endfunc;

23c9: 3e,b2,1e,        jb    B6,Rb2,23ea      if (B6_Rb2) goto endfunc;
23cc: 38,0a,18,        jb    B0,Ra,23e7       if (HSO_OVF) goto Busy_exit;
23cf: 44,30,36,32,     ad3w  R32,R36,R30      R32 = R36 + R30;
23d3: b0,bb,3e,        ldb   R3e,Rbb          R3e = Rbb;    ## Event 2 state
23d6: a0,32,b8,        ldw   Rb8,R32          Rb8 = R32;    ## Event 2 time reqd
23d9: 48,32,06,3a,     sb3w  R3a,R6,R32       R3a = IO_TIMER - R32;    ## Event interval from now
23dd: ef,3c,07,        call  2b1c             Do_OUT();
23e0: d3,08,           jnc   23ea             if ((uns) R7 >= Do_OUT)  {
23e2: a0,b8,32,        ldw   R32,Rb8          R32 = Rb8;    ## Save actual event time
23e5: 20,03,           sjmp  23ea             goto endfunc;

   Busy_exit:
23e7: 91,01,b2,        orb   Rb2,1            HSO_BUSY = 1;   }
   endfunc:
23ea: f0,              ret                    


23eb: ff,              fill  
23ec: ff,ff,ff,ff,ff,ff, fill  
23f2: ff,ff,ff,ff,ff,ff, fill  
23f8: ff,ff,ff,ff,ff,ff, fill  
23fe: ff,ff,           fill   
########################################### 
#  Parameters, Tables etc start here 
###########################################

   VAF_SCALE_32768:
2400: 00,80,           word  8000  -32768
   VAF_TRIM_0:
2402: 00,00,           word  0000      0
   VAF_TRIM2_0:
2404: 00,00,           word  0000      0
   VAF_SCALE_32768:
2406: 00,80,           word  8000  -32768
   VAF_TRIM_0:
2408: 00,00,           word  0000      0
   VAF_TRIM2_0:
240a: 00,00,           word  0000      0

   BAP_dft_239:
240c: ef,              byte  -17,

240d: ff,              fill  
240e: e5,3d,           ??    b 229, 61, h 3de5, d 15845,

   RPM_450:
2410: 08,07,           word  0708   1800    # = 450 rpm
   RPM_600:
2412: 60,09,           word  0960   2400    # = 600 rpm
   RPM_505:
2414: e4,07,           word  07e4   2020    # = 505 rpm
   RPM_1500:
2416: 70,17,           word  1770   6000    # = 1500 rpm
   RPM_1800:
2418: 20,1c,           word  1c20   7200    # = 1800 rpm

   127:
241a: 7f,              byte  +127,    # ECT Start min
   -20:
241b: ec,              byte  -20,    # ECT start max

   0:
241c: 00,00,           word  0000      0    # = mSecs
   INJSZ(25166):
241e: 4e,62,           word  624e  25166    # is this 6291.5 g/hr = 13.85 (14) lbs/hr ?
   5872:
2420: f0,16,           word  16f0   5872
   2097:
2422: 31,08,           word  0831   2097
   1280:
2424: 00,05,           word  0500   1280

   83:
2426: 53,              byte  +83,
   -128:
2427: 80,              byte  -128,
   40:
2428: 28,              byte  +40,
   0:
2429: 00,              byte  +0,
   1:
242a: 01,              byte  +1,
   1:
242b: 01,              byte  +1,

   15456:
242c: 60,3c,           word  3c60  15456
   0:
242e: 00,00,           word  0000      0
   RPM_2500:
2430: 10,27,           word  2710  10000    # = 2500 rpm

   0:
2432: 00,              byte  +0,
   0:
2433: c8,              byte  -56,
   -128:
2434: 80,              byte  -128,
   18:
2435: 12,              byte  +18,
   -20:
2436: ec,              byte  -20,
   ECTdflt_50:
2437: 32,              byte  +50,
   ACTdflt_10:
2438: 0a,              byte  +10,

2439: ff,              fill  

   VAFdflt_22400:
243a: 80,57,           word  5780  22400
   650mS:
243c: 8a,02,           word  028a    650    # = mSecs

243e: 3f,              byte  +63,
   TPS_TimTrip(30):
243f: 1e,              byte  +30,

2440: 4b,03,           word  034b    843
2442: 00,20,           word  2000   8192
   RPM_1000:
2444: a0,0f,           word  0fa0   4000
   RPM_50:
2446: c8,00,           word  00c8    200    # Hysteresis for flag at value above (1k rpm)
   TPS_TRG_832:
2448: 40,03,           word  0340    832
   TPS_TRG_41600:
244a: 80,a2,           word  a280  -23936 
# Flags -   B2 = Averaged Injection Calc forced ? 
#    B3 set = Batt comp on ? B4 = Allow NDS2 flag ? (3 NDS flags total)

   FLGS(B3,B0):
244c: 09,              byte  +9,

244d: ff,              fill  

   RPM_sens:
244e: ff,ff,           word  ffff     -1    # = used for digital Filter

2450: 66,              byte  +102,
2451: 80,              byte  -128,
2452: 00,              byte  +0,    # fixed ISC pulsewidth (of [2453])  if set to 1 ??
2453: 40,              byte  +64,    # ISC pulsewidth 'lock' value ??

2454: 14,00,           word  0014     20    # = mSecs
   RPM_1430:
2456: 58,16,           word  1658   5720    # = 1430 rpm

   EGR_Fitted:
2458: 00,              byte  +0,

2459: ff,              fill  
245a: 00,20,           ??    b   0, 32, h 2000, d  8192,

245c: 9a,09,           word  099a   2458
245e: 66,36,           word  3666  13926
   600mS_TMR7:
2460: 58,02,           word  0258    600    # = mSecs

2462: 3a,              byte  +58,

2463: ff,              fill  

   RPM_6600:
2464: 20,67,           word  6720  26400    # = 6600 rpm = rev limit (spark cutoff) 
   1302:
2466: 16,05,           word  0516   1302
   0:
2468: 00,00,           word  0000      0

   1:
246a: 01,              byte  +1,

246b: ff,              fill  

   12sec_TMR0:
246c: e0,2e,           word  2ee0  12000    # = mSecs

246e: f0,ff,           ??    b 240,255, h fff0, d   -16,

   BAP_MAX:
2470: 00,af,           word  af00  -20736    # implies max 350 per sec, min 240 per sec.  175 - 120 Hz ??
   BAP_MIN:
2472: 00,78,           word  7800  30720

   0:
2474: 00,              byte  +0,
   -12:
2475: f4,              byte  -12,    # = -12 (3 deg retard )
   -24:
2476: e8,              byte  -24,    # = -24 (6 deg retard )
   -24:
2477: e8,              byte  -24,    # = -24 (6 deg retard - safety default)
2478: 00,              byte  +0,

2479: ff,              fill  

   3_secs_T2:
247a: 03,00,           word  0003      3    # = mSecs
   ISC_C_MAX:
247c: cd,0c,           word  0ccd   3277
   ISC_ACC_inc:
247e: 00,00,           word  0000      0    # aaded to  ISC for ACC flag
   ISC_NDS_inc:
2480: a4,10,           word  10a4   4260    # added to ISC for nds 1 Flag 
2482: d0,07,           word  07d0   2000    # = mSecs
   TPS_MAX(5v):
2484: 00,fa,           word  fa00  -1536    # = 5.0 Volts
   TPS_MIN(0.125):
2486: 40,06,           word  0640   1600    # = 0.125 Volts
   ECT_MAX(4.6):
2488: 00,e6,           word  e600  -6656    # = 4.6 Volts
   ECT_MIN(0.15):
248a: 80,07,           word  0780   1920    # = 0.15 Volts
   ACT_MAX(4.6):
248c: 00,e6,           word  e600  -6656    # = 4.6 Volts
   ACT_MIN(0.26):
248e: 00,0d,           word  0d00   3328    # = 0.26 Volts
   VAFMAX(5v):
2490: 00,fa,           word  fa00  -1536    # = 5.0 Volts
   VAFMIN(0.2):
2492: 00,0a,           word  0a00   2560    # = 0.2 Volts
   IGN_48:
2494: 30,00,           word  0030     48

2496: 33,33,cd,0c,     ??    b  51, 51,205, 12, h 3333, ccd, d 13107, 3277,

   32_secs_T2:
249a: 20,              byte  +32,    # = mSecs

249b: 20,              ??    b  32,

249c: e8,03,           word  03e8   1000    # = mSecs
249e: e8,03,           word  03e8   1000    # = mSecs
   16384:
24a0: 00,40,           word  4000  16384
   13:
24a2: 0d,00,           word  000d     13
   32768:
24a4: 00,80,           word  8000  -32768
   300:
24a6: 2c,01,           word  012c    300
   26000:
24a8: 90,65,           word  6590  26000
   128:
24aa: 80,00,           word  0080    128
   IGN_NDS1_inc:
24ac: 00,00,           word  0000      0
   RPM_50:
24ae: c8,00,           word  00c8    200    # = 50 rpm
   3.845v:
24b0: 40,c0,           word  c040  -16320    # = 3.845v
   1.92v:
24b2: 00,60,           word  6000  24576    # = 1.92v
   0v:
24b4: 00,00,           word  0000      0
   RPM_1200:
24b6: c0,12,           word  12c0   4800    # = 1200 rpm 

## Base Fuel ? Load ? VAF(down+) x RPM(across+) 11 x 11

   Base_Fuel:
24b8: 8d,8d,8d,8d,80,80,7a,7a,7a,7a,7a, table  141, 141, 141, 141, 128, 128, 122, 122, 122, 122, 122,
24c3: 86,86,85,81,7f,84,89,8d,8d,8d,8d, table  134, 134, 133, 129, 127, 132, 137, 141, 141, 141, 141,
24ce: 86,86,82,80,7d,84,89,8e,92,93,93, table  134, 134, 130, 128, 125, 132, 137, 142, 146, 147, 147,
24d9: 86,88,84,84,84,86,88,8e,8e,8d,98, table  134, 136, 132, 132, 132, 134, 136, 142, 142, 141, 152,
24e4: 86,80,86,86,86,85,86,8c,88,8e,93, table  134, 128, 134, 134, 134, 133, 134, 140, 136, 142, 147,
24ef: 8a,8c,85,89,88,85,83,89,8a,93,92, table  138, 140, 133, 137, 136, 133, 131, 137, 138, 147, 146,
24fa: 8a,86,8c,84,7d,83,85,89,86,89,97, table  138, 134, 140, 132, 125, 131, 133, 137, 134, 137, 151,
2505: 8a,7c,86,84,88,83,88,86,8d,97,96, table  138, 124, 134, 132, 136, 131, 136, 134, 141, 151, 150,
2510: 88,77,77,7a,73,7d,7b,8a,8f,97,96, table  136, 119, 119, 122, 115, 125, 123, 138, 143, 151, 150,
251b: 88,77,77,74,7d,78,73,88,8f,97,96, table  136, 119, 119, 116, 125, 120, 115, 136, 143, 151, 150,
2526: 88,77,77,7b,74,77,7d,88,8f,97,96, table  136, 119, 119, 123, 116, 119, 125, 136, 143, 151, 150, 

## Temp compensation? (Block temp) VAF (down+) x ECT (across+) 12 X 6

   VAFxECT_INJ:
2531: 43,3c,36,33,31,2e,2b,29,27,25,20,20, table   67,  60,  54,  51,  49,  46,  43,  41,  39,  37,  32,  32,
253d: 43,3b,35,32,2d,2a,26,24,23,20,20,20, table   67,  59,  53,  50,  45,  42,  38,  36,  35,  32,  32,  32,
2549: 43,3b,35,32,2d,2a,26,24,23,20,20,20, table   67,  59,  53,  50,  45,  42,  38,  36,  35,  32,  32,  32,
2555: 43,3b,35,32,2d,2a,26,24,23,20,20,20, table   67,  59,  53,  50,  45,  42,  38,  36,  35,  32,  32,  32,
2561: 43,3b,35,32,2d,2a,26,24,23,20,20,20, table   67,  59,  53,  50,  45,  42,  38,  36,  35,  32,  32,  32,
256d: 43,3b,35,32,2d,2a,26,24,23,20,20,20, table   67,  59,  53,  50,  45,  42,  38,  36,  35,  32,  32,  32, 

## Limp ? Alt Ign Timing  VAF (down+) x RPM (across+) 11 X 11 
 # used when start conditions (ECT ACT) very hot or very cold ???   Easy crank option ?

   IGN_ADV_DFLT:
2579: 30,30,30,50,58,54,64,68,70,70,70, table   48,  48,  48,  80,  88,  84, 100, 104, 112, 112, 112,
2584: 30,42,58,58,80,a0,a8,ac,a0,a8,a8, table   48,  66,  88,  88, 128, 160, 168, 172, 160, 168, 168,
258f: 30,8a,8c,94,a4,ac,b4,b4,ac,a8,a8, table   48, 138, 140, 148, 164, 172, 180, 180, 172, 168, 168,
259a: 60,80,7c,88,90,98,a8,a4,a4,98,8c, table   96, 128, 124, 136, 144, 152, 168, 164, 164, 152, 140,
25a5: 48,70,74,84,88,90,a4,a4,a4,98,8c, table   72, 112, 116, 132, 136, 144, 164, 164, 164, 152, 140,
25b0: 48,6c,68,70,84,8c,90,9c,a4,a0,8c, table   72, 108, 104, 112, 132, 140, 144, 156, 164, 160, 140,
25bb: 22,4c,5c,6c,78,8c,8c,94,a4,a0,90, table   34,  76,  92, 108, 120, 140, 140, 148, 164, 160, 144,
25c6: 18,3c,5c,74,78,88,88,8c,98,98,90, table   24,  60,  92, 116, 120, 136, 136, 140, 152, 152, 144,
25d1: 12,2e,4c,68,74,80,84,90,98,8c,90, table   18,  46,  76, 104, 116, 128, 132, 144, 152, 140, 144,
25dc: 12,2c,48,54,68,78,7c,88,88,8c,90, table   18,  44,  72,  84, 104, 120, 124, 136, 136, 140, 144,
25e7: 12,2c,48,54,64,74,78,88,88,8c,90, table   18,  44,  72,  84, 100, 116, 120, 136, 136, 140, 144, 

## Ignition Timing HOT  - VAF (down+) x RPM (across+) 11 X 11 
## Used with COLD table and interpolated with ACT

   IGN_ADV_HOT:
25f2: 30,30,30,50,58,54,64,68,70,70,70, table   48,  48,  48,  80,  88,  84, 100, 104, 112, 112, 112,
25fd: 30,42,58,58,80,a0,a8,ac,a0,a8,a8, table   48,  66,  88,  88, 128, 160, 168, 172, 160, 168, 168,
2608: 30,8a,8c,94,a4,ac,b4,b4,ac,a8,a8, table   48, 138, 140, 148, 164, 172, 180, 180, 172, 168, 168,
2613: 60,80,7c,88,90,98,a8,a4,a4,98,8c, table   96, 128, 124, 136, 144, 152, 168, 164, 164, 152, 140,
261e: 48,70,74,84,88,90,a4,a4,a4,98,8c, table   72, 112, 116, 132, 136, 144, 164, 164, 164, 152, 140,
2629: 40,64,60,68,7c,84,88,94,9c,98,84, table   64, 100,  96, 104, 124, 132, 136, 148, 156, 152, 132,
2634: 1a,44,54,64,70,84,84,8c,9c,98,88, table   26,  68,  84, 100, 112, 132, 132, 140, 156, 152, 136,
263f: 0c,30,50,68,6c,7c,7c,80,8c,8c,84, table   12,  48,  80, 104, 108, 124, 124, 128, 140, 140, 132,
264a: 06,22,40,5c,68,74,78,84,8c,80,84, table    6,  34,  64,  92, 104, 116, 120, 132, 140, 128, 132,
2655: 00,1c,38,44,58,68,6c,78,78,7c,80, table    0,  28,  56,  68,  88, 104, 108, 120, 120, 124, 128,
2660: 00,1c,38,44,54,64,68,78,78,7c,80, table    0,  28,  56,  68,  84, 100, 104, 120, 120, 124, 128, 

 # added to (subtracced from ?)Ign timing calc , can replace calc 
# VAF (down+) x ECT (across+)

   VAFxECT_IGN:
266b: 1c,1c,1c,1c,14,00,00,00, table   28,  28,  28,  28,  20,   0,   0,   0,
2673: 1c,1c,1c,1c,14,00,00,00, table   28,  28,  28,  28,  20,   0,   0,   0,
267b: 1c,1c,1c,1c,14,00,00,00, table   28,  28,  28,  28,  20,   0,   0,   0,
2683: 1c,1c,1c,1c,14,00,00,00, table   28,  28,  28,  28,  20,   0,   0,   0,
268b: 1c,1c,1c,1c,14,00,00,00, table   28,  28,  28,  28,  20,   0,   0,   0,
2693: 1c,1c,1c,1c,14,00,00,00, table   28,  28,  28,  28,  20,   0,   0,   0, 

## Ignition Timing COLD - VAF (down+) x RPM (across+) 11 X 11 
## Used with HOT table and interpolated with ACT - This is more advanced timing

   IGN_ADV_COLD:
269b: 30,30,30,50,58,54,64,68,70,70,70, table   48,  48,  48,  80,  88,  84, 100, 104, 112, 112, 112,
26a6: 30,30,44,48,70,a0,a8,ac,a0,a8,a8, table   48,  48,  68,  72, 112, 160, 168, 172, 160, 168, 168,
26b1: 30,78,78,84,88,ac,b4,b4,ac,a8,a8, table   48, 120, 120, 132, 136, 172, 180, 180, 172, 168, 168,
26bc: 60,6c,68,78,78,98,a8,a4,a4,98,8c, table   96, 108, 104, 120, 120, 152, 168, 164, 164, 152, 140,
26c7: 48,50,64,74,78,90,a4,a4,a4,98,8c, table   72,  80, 100, 116, 120, 144, 164, 164, 164, 152, 140,
26d2: 48,5c,68,64,70,8c,90,9c,a4,a0,8c, table   72,  92, 104, 100, 112, 140, 144, 156, 164, 160, 140,
26dd: 22,32,5c,6c,68,8c,8c,94,a4,a0,90, table   34,  50,  92, 108, 104, 140, 140, 148, 164, 160, 144,
26e8: 18,3c,5c,74,78,88,88,8c,98,98,90, table   24,  60,  92, 116, 120, 136, 136, 140, 152, 152, 144,
26f3: 12,2e,4c,68,74,80,84,90,98,8c,90, table   18,  46,  76, 104, 116, 128, 132, 144, 152, 140, 144,
26fe: 12,2c,48,54,68,78,7c,88,88,8c,90, table   18,  44,  72,  84, 104, 120, 124, 136, 136, 140, 144,
2709: 12,2c,48,54,64,74,78,90,88,8c,90, table   18,  44,  72,  84, 100, 116, 120, 144, 136, 140, 144, 

 ## EGR ? (referenced at 3f80 ?)

   EGR_LU6:
2714: 20,20,20,20,20,20,20,20, table   32,  32,  32,  32,  32,  32,  32,  32,
271c: 20,20,20,20,20,20,20,20, table   32,  32,  32,  32,  32,  32,  32,  32,
2724: 20,20,20,20,20,20,20,20, table   32,  32,  32,  32,  32,  32,  32,  32,
272c: 20,20,20,20,20,20,20,20, table   32,  32,  32,  32,  32,  32,  32,  32,
2734: 20,20,20,20,20,20,20,20, table   32,  32,  32,  32,  32,  32,  32,  32,
273c: 20,20,20,20,20,20,20,20, table   32,  32,  32,  32,  32,  32,  32,  32,
2744: 20,20,20,20,20,20,20,20, table   32,  32,  32,  32,  32,  32,  32,  32,
274c: 20,20,20,20,20,20,20,20, table   32,  32,  32,  32,  32,  32,  32,  32, 

 ## Fuel -> part of limp/start or cranking ?  Timer0 (down+) ECT (across+)  used as multiplier ? ## 
 # Timer0 is a 12 sec timer from startup ?

   Fuel_enrich:
2754: 73,62,46,33,23,1b,14,12,10,0d,09,09, table  115,  98,  70,  51,  35,  27,  20,  18,  16,  13,   9,   9,  #  0 secs
2760: 73,62,3b,2b,1b,0f,0e,0c,0b,09,07,07, table  115,  98,  59,  43,  27,  15,  14,  12,  11,   9,   7,   7,  #  3 secs
276c: 04,62,3b,27,13,0f,0a,08,07,06,06,06, table    4,  98,  59,  39,  19,  15,  10,   8,   7,   6,   6,   6,  #  6 secs
2778: 00,5c,35,21,11,0d,09,07,06,06,06,06, table    0,  92,  53,  33,  17,  13,   9,   7,   6,   6,   6,   6,  #  9 secs
2784: 23,48,27,1b,10,0b,08,07,06,06,06,06, table   35,  72,  39,  27,  16,  11,   8,   7,   6,   6,   6,   6,  # 12 secs
2790: 5c,33,27,14,0e,0a,08,07,06,06,06,06, table   92,  51,  39,  20,  14,  10,   8,   7,   6,   6,   6,   6,  # 15 secs or more 

 ## Battery Voltage -> inject slope compensation ? - added to time calc

   Vss_LU:
279c: ff,ff,4f,00,     table  65535,    79,
27a0: 00,88,4f,00,     table  34816,    79,   ## 0.3   mS Always added ? Base injector slope ? Max val from TFR = 51200
27a4: 00,68,e1,00,     table  26624,   225,   ## 0.858 mS
27a8: 00,50,b1,01,     table  20480,   433,   ## 1.65  mS
27ac: 00,38,ca,03,     table  14336,   970,
27b0: 00,00,ca,03,     table      0,   970,   ## 3.7   mS 

######### next two tables used with Timer2 ######## 
# LU7 as multiplier LU8 as divider/time frame (secs) - code ~ 3605 
#  could be fading enrich for 'n' secs .... 
#################

   ECT_LU7:
27b4: 7f,0a,           table  127,  10,   ## Hot 
27b6: 1e,0a,           table   30,  10,
27b8: 19,0d,           table   25,  13,
27ba: 0a,10,           table   10,  16,
27bc: 00,1a,           table    0,  26,
27be: fb,22,           table   -5,  34,
27c0: f6,30,           table  -10,  48,
27c2: 80,30,           table -128,  48,   ## Cold (& limit)
27c4: 80,30,           table -128,  48,
27c6: 80,30,           table -128,  48,
27c8: 80,30,           table -128,  48,
27ca: 80,30,           table -128,  48, 

######### ECT to timer of some type ######## 
# looks like out value is SECONDS ?  Initial enrich ??  crank ?? 
#################

   ECT_LU8:
27cc: 7f,0a,           table  127,  10,   ## Hot
27ce: 18,0a,           table   24,  10,
27d0: 0a,19,           table   10,  25,
27d2: f6,3c,           table  -10,  60,
27d4: 80,3c,           table -128,  60,   ## Cold (& limit) 
27d6: 80,3c,           table -128,  60,

   ECT_Accel:
27d8: 7f,13,           table  127,  19,   ## Hot   Linked to 2802 for Accel Pump ??
27da: 26,13,           table   38,  19,
27dc: 1e,25,           table   30,  37,
27de: 12,4d,           table   18,  77,
27e0: 0d,7f,           table   13, 127,
27e2: 80,7f,           table -128, 127,   ## Cold 

# IN - Top byte of VAF Raw.  OUT stored in R3c and used for accel_pump calc ?

   VAF_LU_Inj:
27e4: ff,05,           table  255,   5,
27e6: eb,05,           table  235,   5,
27e8: da,08,           table  218,   8,
27ea: ab,15,           table  171,  21,
27ec: 9c,1b,           table  156,  27,
27ee: 89,26,           table  137,  38,
27f0: 74,34,           table  116,  52,
27f2: 62,44,           table   98,  68,
27f4: 50,59,           table   80,  89,
27f6: 46,66,           table   70, 102,
27f8: 3a,7a,           table   58, 122,
27fa: 2b,9a,           table   43, 154,
27fc: 1e,ba,           table   30, 186,
27fe: 0d,ff,           table   13, 255,
2800: 00,ff,           table    0, 255, 

 ## Accel pump ?? VAF(part) => VAF Delta ?  REVERSED PAR, 100-R3c see code

   Accel_LU:
2802: ff,83,           table  255, 131,
2804: 00,83,           table    0, 131,
2806: 00,83,           table    0, 131,
2808: 00,83,           table    0, 131,
280a: 00,83,           table    0, 131,
280c: ff,20,           table  255,  32,
280e: 00,00,           table    0,   0,
2810: 00,00,           table    0,   0,
2812: 00,00,           table    0,   0,
2814: 00,00,           table    0,   0,
2816: 00,00,           table    0,   0, 

# Used with ECT_Start value - ECT default is 50 so only effective when cold ?

   ECT_LU_Time:
2818: ff,7f,00,00,     table  32767,     0,    ## Hot
281c: 28,00,00,00,     table     40,     0,
2820: 12,00,f0,00,     table     18,   240,
2824: 08,00,f0,00,     table      8,   240,
2828: 05,00,f4,01,     table      5,   500,
282c: ec,ff,08,02,     table    -20,   520,
2830: 00,80,08,02,     table -32768,   520,
2834: 00,80,08,02,     table -32768,   520,    ## Cold

   ECT_SCALE_11:
2838: ff,7f,00,0b,     func  32767.00    11    ## Hot - scaled with byte in TOP (strange ?)
283c: 00,4b,00,0b,     func  19200.00    11
2840: 00,23,00,0a,     func  8960.00    10
2844: 00,1e,00,09,     func  7680.00     9
2848: 80,16,00,08,     func  5760.00     8
284c: 80,ee,00,00,     func  -4480.00     0
2850: 00,80,00,00,     func  -32768.00     0
2854: 00,80,00,00,     func  -32768.00     0    ## Cold

   RPM_SCALE_10:
2858: ff,ff,00,0a,     func  16383.75    10    ## scale points, output vs RPM
285c: c0,5d,00,0a,     func  6000.00    10    ## 8=4000, 9=5000, a=6000+
2860: 80,3e,00,08,     func  4000.00     8    ## 5=2500, 6=3000, 7=3500
2864: 40,1f,00,04,     func  2000.00     4    ## 2=1300, 3=1600, 4=2000
2868: 00,19,00,03,     func  1600.00     3    ## 0=0-700, 1=1000,
286c: f0,0a,00,00,     func  700.00     0
2870: 00,00,00,00,     func  0.00     0

   VAF_SCALE_10:
2874: ff,ff,00,0a,     table  65535,  2560,
2878: a1,14,00,0a,     table   5281,  2560,    ## Note linear scale only over small range ... 
287c: c5,02,00,00,     table    709,     0,
2880: 00,00,00,00,     table      0,     0,

   ECT_SCALE_7:
2884: ff,7f,00,07,     table  32767,  1792,    ## Hot
2888: 00,28,00,07,     table  10240,  1792,
288c: 00,23,00,06,     table   8960,  1536,
2890: 00,0a,00,05,     table   2560,  1280,
2894: 00,00,00,04,     table      0,  1024,
2898: 00,ec,00,00,     table  -5120,     0,
289c: 00,80,00,00,     table -32768,     0,    ## Cold

   VAF_SCALE_5:
28a0: ff,ff,00,05,     table  65535,  1280,
28a4: b3,0b,00,05,     table   2995,  1280,    ## Note even lower cutoff point than above, and later start
28a8: c5,02,00,00,     table    709,     0,
28ac: 00,00,00,00,     table      0,     0, 

 ## ACT temp interpolate - for IGN HOT and COLD tables. in = ACT , OUT 0(hot) - 128 (cold)

   ACT_Ign_Interp:
28b0: ff,7f,00,00,     table  32767,     0,    ## Hot
28b4: 17,00,00,00,     table     23,     0,
28b8: 0d,00,80,00,     table     13,   128,    ## ACT default is 10, so does 'COLD' work through normal air temps ?
28bc: 00,80,80,00,     table -32768,   128,    ## Cold

   Vss_TFR:
28c0: ff,ff,00,c8,     func  5.12  51200    ## Linear transfer - proportion of Battery voltage ?
28c4: 00,ed,00,c8,     func  4.74  51200
28c8: 00,00,00,00,     func  0.00     0

   VAF_TFR:
28cc: ff,ff,63,5a,     func  5.12  23139    ## rescaled to Volts in column 1  
28d0: 00,eb,63,5a,     func  4.70  23139
28d4: 00,ea,b1,53,     func  4.68  21425
28d8: 40,e4,ba,44,     func  4.57  17594
28dc: 80,d9,45,39,     func  4.35  14661
28e0: c0,c4,17,28,     func  3.93  10263
28e4: 00,b1,a3,1c,     func  3.54  7331
28e8: 40,9c,0c,14,     func  3.12  5132
28ec: 80,88,52,0e,     func  2.73  3666
28f0: 80,7b,74,0b,     func  2.47  2932
28f4: c0,6a,97,08,     func  2.13  2199
28f8: c0,58,4d,06,     func  1.77  1613
28fc: 40,46,94,04,     func  1.40  1172
2900: 00,3a,b8,03,     func  1.16   952
2904: c0,2a,dd,02,     func  0.86   733
2908: c0,1d,4a,02,     func  0.60   586
290c: c0,0c,b8,01,     func  0.25   440
2910: 00,00,00,00,     func  0.00     0
2914: 00,00,00,00,     func  0.00     0 

# ECT Transfer  NOTE - only upper byte used (code 304b) 
# scale is HALF actual input voltage so that SIGNED works correctly in lookup ... 
# Book indicates c. 0.5V is typical Hot

   ECT_TFR:
2918: ff,7f,00,ec,     func  2.56   -20    ## Maximum - COLD
291c: e0,73,00,ec,     func  2.32   -20
2920: e0,71,00,f1,     func  2.28   -15
2924: c0,6e,00,f6,     func  2.21   -10
2928: e0,69,00,fb,     func  2.12    -5
292c: 00,63,00,00,     func  1.98     0
2930: 00,5a,00,05,     func  1.80     5
2934: 00,4f,00,0a,     func  1.58    10
2938: 20,43,00,0f,     func  1.34    15
293c: 20,37,00,14,     func  1.10    20
2940: 00,2c,00,19,     func  0.88    25
2944: 60,22,00,1e,     func  0.69    30
2948: 80,1a,00,23,     func  0.53    35
294c: 40,14,00,28,     func  0.41    40
2950: 80,0f,00,2d,     func  0.31    45
2954: e0,0b,00,32,     func  0.24    50    ## ECT default value, Normal hot (0.48v)
2958: 20,09,00,37,     func  0.18    55
295c: 00,07,00,3c,     func  0.14    60
2960: 80,05,00,41,     func  0.11    65
2964: 60,03,00,4b,     func  0.07    75
2968: 00,80,00,4b,     func  -2.56    75    ## Safety     Very HOT ! 

 ACT Transfer  only upper byte used - Half scale so signed works

   ACT_TFR:
296c: ff,7f,00,ec,     func  2.56   -20    ## Maximum - COLD
2970: 30,73,00,ec,     func  2.30   -20
2974: d3,70,00,f1,     func  2.26   -15
2978: 3d,6d,00,f6,     func  2.18   -10
297c: 1d,68,00,fb,     func  2.08    -5
2980: 33,61,00,00,     func  1.94     0
2984: 86,58,00,05,     func  1.77     5
2988: 80,4e,00,0a,     func  1.57    10    ## ACT default value (std 20 degrees C ?)
298c: c3,43,00,0f,     func  1.36    15
2990: 0a,39,00,14,     func  1.14    20
2994: ea,2e,00,19,     func  0.94    25
2998: 03,26,00,1e,     func  0.76    30
299c: 7d,1e,00,23,     func  0.61    35
29a0: 43,18,00,28,     func  0.49    40
29a4: 4d,13,00,2d,     func  0.39    45
29a8: 46,0f,00,32,     func  0.31    50
29ac: d6,0b,00,37,     func  0.24    55
29b0: c3,09,00,3c,     func  0.20    60
29b4: d6,07,00,41,     func  0.16    65
29b8: 00,00,00,7f,     func  0.00   127    ## 127  LIMIT - Very HOT
29bc: 00,80,00,7f,     func  -2.56   127    ## Safety  

 Airflow Temp compensation ? (ACT/BAP in )

   AirFlow_temp:
29c0: ff,ff,fd,ff,     table  65535, 65533,
29c4: ad,af,11,d4,     table  44973, 54289,
29c8: 5c,8f,92,bf,     table  36700, 49042,
29cc: 66,66,e8,a1,     table  26214, 41448,
29d0: 33,33,7c,72,     table  13107, 29308,
29d4: 7b,14,69,48,     table   5243, 18537,
29d8: 3d,0a,32,33,     table   2621, 13106,
29dc: 1f,05,6a,24,     table   1311,  9322,
29e0: 06,01,3c,12,     table    262,  4668,
29e4: 00,00,00,00,     table      0,     0,  

## idle speed versus ECT ? ##

   IDLE_ECT:
29e8: ff,7f,48,0d,     table  32767,  3400,    ## 850  rpm - Hot
29ec: 26,00,48,0d,     table     38,  3400,
29f0: 00,00,30,11,     table      0,  4400,    ## 1100 rpm
29f4: ec,ff,50,14,     table    -20,  5200,
29f8: 00,80,50,14,     table -32768,  5200,    ## 1300 rpm - Cold 

### Pulsewidth adjustment for Idle Valve ?? 
 appears to be +/- 25rpm resolution , 50 rpm deadband ?

   ISC_PWxRPM:
29fc: ff,7f,c3,f5,     table  32767, -2621,
2a00: f0,0a,c3,f5,     table   2800, -2621,
2a04: d0,07,d5,f8,     table   2000, -1835,
2a08: c8,00,cc,ff,     table    200,   -52,
2a0c: 64,00,00,00,     table    100,     0,
2a10: 9c,ff,00,00,     table   -100,     0,
2a14: 38,ff,34,00,     table   -200,    52,
2a18: 30,f8,3d,0a,     table  -2000,  2621,
2a1c: 00,80,3d,0a,     table -32768,  2621,
2a20: 00,80,3d,0a,     table -32768,  2621, 

 # used with above ISC table - ECT in , multiplied with ISC table ... ?

   ECT_LU2:
2a24: ff,7f,00,10,     table  32767,  4096,    ## Hot
2a28: 26,00,00,10,     table     38,  4096,
2a2c: 20,00,66,06,     table     32,  1638,
2a30: 00,80,66,06,     table -32768,  1638,
2a34: 00,80,66,06,     table -32768,  1638,
2a38: 00,80,66,06,     table -32768,  1638,    ## Cold 

 ## ISC Pulsewidth adjust ?  has ACC and NDS before lookup ? 
# is this some type of 'slope' or 'lag' for magnetic valve ?? (time reqd -> PW time) 
# OUTPUT represents 0-32768 = 0 - 6.25mS


   IDLE_LU:
2a3c: ff,ff,00,80,     table  65535, 32768,
2a40: 33,73,00,80,     table  29491, 32768,
2a44: 66,66,3d,6a,     table  26214, 27197,
2a48: 9a,59,0a,57,     table  22938, 22282,
2a4c: cd,4c,5c,4f,     table  19661, 20316,
2a50: 00,40,66,46,     table  16384, 18022,
2a54: 33,33,b8,3e,     table  13107, 16056,
2a58: 66,26,c3,35,     table   9830, 13763,
2a5c: 9a,19,a4,30,     table   6554, 12452,
2a60: 00,00,00,00,     table      0,     0,

   RPM_LU3:
2a64: ff,ff,33,33,     table  65535, 13107,
2a68: 58,16,33,33,     table   5720, 13107,
2a6c: 30,11,3d,2a,     table   4400, 10813,
2a70: 00,00,3d,2a,     table      0, 10813,
2a74: 00,00,3d,2a,     table      0, 10813,
2a78: 00,00,3d,2a,     table      0, 10813, 

 ECT current and ECT start is input param, and appears output linked with ISC somehow ?

   ECT_LU5:
2a7c: ff,7f,29,1c,     table  32767,  7209,    ## Hot
2a80: 28,00,29,1c,     table     40,  7209,
2a84: 1e,00,00,20,     table     30,  8192,
2a88: f6,ff,cd,4c,     table    -10, 19661,
2a8c: f1,ff,33,73,     table    -15, 29491,
2a90: 00,80,33,73,     table -32768, 29491,    ## Cold

   EGR_LU3:
2a94: 7f,40,80,40,     table  16511, 16512,    ## reference at skipped code 3f32
2a98: 80,40,80,40,     table  16512, 16512,
2a9c: 80,40,7f,40,     table  16512, 16511,
2aa0: 80,40,80,40,     table  16512, 16512,
2aa4: 80,40,80,40,     table  16512, 16512,

   EGR_LU2:
2aa8: ff,ff,00,07,     table  65535,  1792,    ## reference at skipped code 3f4c
2aac: c0,5d,00,07,     table  24000,  1792,
2ab0: f0,0a,00,00,     table   2800,     0,
2ab4: 00,00,00,00,     table      0,     0,
2ab8: 00,00,00,00,     table      0,     0,

   EGR_LU1:
2abc: ff,ff,00,07,     table  65535,  1792,    ## reference at skipped code 3f6e
2ac0: d7,12,00,07,     table   4823,  1792,
2ac4: 00,00,00,00,     table      0,     0,
2ac8: 00,00,00,00,     table      0,     0,
2acc: 00,00,00,00,     table      0,     0, 

 ## Scale Timer 0 linear, in mSecs ##

   SCALE_TM0_5:
2ad0: ff,ff,00,05,     table  65535,  1280,
2ad4: 98,3a,00,05,     table  15000,  1280,
2ad8: 00,00,00,00,     table      0,     0, 

 ## altitude compensation (from BAP) max is 44800 (175Hz), min 30720 (120Hz) 
# Book indicates range 90-170 Hz typical atmo = 160Hz

   BAP_Comp:
2adc: ff,ff,f8,00,     table  65535,   248,    ## default is 239, = 159 Hz
2ae0: 5a,a2,f8,00,     table  41562,   248,    ## 162.7 Hz
2ae4: 46,8a,b8,00,     table  35398,   184,    ## 138.3 Hz
2ae8: cc,74,78,00,     table  29900,   120,    ## 116.8 Hz
2aec: 00,00,78,00,     table      0,   120, 

 ## RPM lookup for Fuel enrich ? used as multiplier  ###

   RPM_LU_Enrich:
2af0: ff,ff,50,00,     table  65535,    80,
2af4: d0,07,50,00,     table   2000,    80,
2af8: 40,06,60,00,     table   1600,    96,
2afc: b0,04,80,00,     table   1200,   128,
2b00: 00,00,80,00,     table      0,   128, 

 # used in ISC calculation.... with timer limit 
# and subtracted from IDLE<ECT table and is probably RPM ?

   ECT_LU3:
2b04: ff,7f,20,03,     table  32767,   800,  ## Hot
2b08: 0a,00,20,03,     table     10,   800,
2b0c: ec,ff,40,06,     table    -20,  1600,
2b10: 00,80,40,06,     table -32768,  1600,
2b14: 00,80,40,06,     table -32768,  1600,
2b18: 00,80,40,06,     table -32768,  1600,  ## Cold 

############################################# 
# Actual output routine - called only from HS_OUT routine 
# Rb8 time reqd 
# R3e Event state and channel 
# R3a Event time reqd (from now) 
# auto delay to 200uS from now if less than 200uS left. 
# set carry if delay, clear otherwise 
#############################################

   Do_OUT:
2b1c: de,04,           jlt   2b22             if (0 < 0) goto 2b22;    ## Actually R3a < 0 
2b1e: dd,04,           jv    2b24             if (overflow) goto Out_Now;
2b20: 20,15,           sjmp  2b37             goto Out_Dly;

2b22: dd,13,           jv    2b37             if (!overflow)  {
   Out_Now:
2b24: fa,              di                     
2b25: ff,              nop                    
2b26: 03,3a,           negw  R3a              R3a = -R3a;    ## check at least 200uS to go
2b28: 89,2a,00,3a,     cmpw  R3a,2a           
2b2c: d3,09,           jnc   2b37             if ((uns) R3a >= 2a)  {    ## delay if not
2b2e: a0,b8,0e,        ldw   Re,Rb8           HSIO_TIME = Rb8;
2b31: b0,3e,0d,        ldb   Rd,R3e           HSIO_DATA = R3e;
2b34: f8,              clc                    clear carry
2b35: 20,0e,           sjmp  2b45             goto Exit;  }  }

   Out_Dly:
2b37: fa,              di                     disable ints
2b38: ff,              nop                    
2b39: 45,2a,00,06,b8,  ad3w  Rb8,R6,2a        Rb8 = IO_TIMER + 2a;    ## delay to 200 uS from now
2b3e: a0,b8,0e,        ldw   Re,Rb8           HSIO_TIME = Rb8;
2b41: b0,3e,0d,        ldb   Rd,R3e           HSIO_DATA = R3e;
2b44: f9,              stc                    set carry
   Exit:
2b45: fb,              ei                     enable ints
2b46: f0,              ret                    return
 
####################### 
#  is this trip computer data ? 
#  R32 in = Inject time length 
#  15c = Total Inject time ? 
######################

   Inj_Trip:
2b47: 4d,74,cb,50,38,  ml3w  R38,R50,cb74     R38 = (long) Vss_Comp * cb74;
2b4c: 68,3a,32,        sb2w  R32,R3a          R32 -= R3a;    ## remove Batt Vss comp ?
2b4f: 67,01,5c,01,32,  ad2w  R32,[15c]        R32 += STO_Val;
2b54: a3,01,5e,01,34,  ldw   R34,[15e]        R34 = STO_ValH;
2b59: a4,00,34,        adcw  R34,0            R34 = R34 + 0; (carry)
2b5c: c3,01,5e,01,34,  stw   R34,[15e]        STO_ValH = R34;
2b61: c3,01,5c,01,32,  stw   R32,[15c]        STO_Val = R32;    ## Total Inject Time ?
2b66: f0,              ret                    return

   Do_STO_ctd:
2b67: a0,76,34,        ldw   R34,R76          R34 = STO_PULSEWD;
2b6a: a1,78,00,3c,     ldw   R3c,78           R3c = 78;    ## R78 LST_STO_EVENT
2b6e: b1,c0,b2,        ldb   Rb2,c0           Rb2 = c0;    # O/P time = R34+[R78] single event
2b71: b1,39,ba,        ldb   Rba,39           Rba = 39;
2b74: 32,b3,03,        jnb   B2,Rb3,2b7a      if (STO_state)  {
2b77: b1,29,ba,        ldb   Rba,29           Rba = 29;  }    ## flip STO state + interrupt
2b7a: ef,18,f8,        call  2395             HS_OUT();
2b7d: 38,b2,09,        jb    B0,Rb2,2b89      if (!HSO_BUSY)  {
2b80: a0,30,78,        ldw   R78,R30          STO_Out_Time = R30;
2b83: 71,bf,b4,        an2b  Rb4,bf           STOrqd = 0; 
2b86: 95,04,b3,        xorb  Rb3,4            flags7 = flags7 ^ 4;  }    ## keep STO state (flip is above)
2b89: f0,              ret                    return

   Do_STO2:
2b8a: 33,5a,08,        jnb   B3,R5a,2b95      if (!STO2_ON_RQD) goto 2b95;
2b8d: 3e,b3,16,        jb    B6,Rb3,2ba6      if (!STO2_state)  {
2b90: b1,19,ba,        ldb   Rba,19           Rba = 19;
2b93: 20,06,           sjmp  2b9b             goto 2b9b;

2b95: 36,b3,0e,        jnb   B6,Rb3,2ba6      if (STO2_state)  {
2b98: b1,09,ba,        ldb   Rba,9            Rba = 9;
2b9b: 11,b2,           clrb  Rb2              Rb2 = 0;    # STO off - immediate
2b9d: ef,f5,f7,        call  2395             HS_OUT();
2ba0: 38,b2,03,        jb    B0,Rb2,2ba6      if (!HSO_BUSY)  {
2ba3: 95,40,b3,        xorb  Rb3,40           flags7 = flags7 ^ 40;  }  }  }    ## keep STO2 state (flip is above)
2ba6: f0,              ret                    return

   Do_TASKS:
2ba7: 65,02,00,98,     ad2w  R98,2            TaskNum += 2;
2bab: 89,32,00,98,     cmpw  R98,32           
2baf: d3,02,           jnc   2bb3             if ((uns) TaskNum >= 32)  {
2bb1: 01,98,           clrw  R98              TaskNum = 0;  }
2bb3: cb,99,9a,3f,     pushw [R98+3f9a]       push ([TaskNum+TaskList]);
2bb7: f0,              ret                    return
   
#  Master return for a debug breakpoint, or a 'case' type return
   MON_EXIT:
2bb8: e7,b5,f5,        jump  2170             goto 2170;
 

####################### 
#  Do_ISC  
#  Calc indicates R30 (PW len) calibrated in similar way to 
#  inject time where 0-32767 = 0 - 6.25mS ? 
#  then subtracted from fixed 12.5 mS to get 1-50% duty cycle ? 
######################

   Do_ISC:
2bbb: 34,b3,16,        jnb   B4,Rb3,2bd4      if (!EGR_flag) goto 2bd4;
2bbe: 35,b3,66,        jnb   B5,Rb3,2c27      if (ISC_state)  {
2bc1: 11,b2,           clrb  Rb2              Rb2 = 0;
2bc3: b1,08,ba,        ldb   Rba,8            Rba = 8;    # IDL off - immediate
2bc6: ef,cc,f7,        call  2395             HS_OUT();
2bc9: 38,b2,5b,        jb    B0,Rb2,2c27      if (!HSO_BUSY)  {
2bcc: a0,30,2e,        ldw   R2e,R30          Last_ISC_Time = R30;
2bcf: 71,df,b3,        an2b  Rb3,df           ISC_state = 0; 
2bd2: 20,53,           sjmp  2c27             goto endfunc;

2bd4: a3,01,30,01,30,  ldw   R30,[130]        R30 = Idle_PW_len;
2bd9: 89,00,80,30,     cmpw  R30,8000         
2bdd: d1,04,           jleu  2be3             if ((uns) R30 > 8000 )  {
2bdf: a1,00,80,30,     ldw   R30,8000         R30 = 8000;  }
2be3: 89,48,01,30,     cmpw  R30,148          
2be7: db,04,           jc    2bed             if ((uns) R30 < TPS_Interval)  {
2be9: a1,48,01,30,     ldw   R30,148          R30 = TPS_Interval;  }    ##  force 328 <= R30 <= 32768 
2bed: a3,01,66,24,ba,  ldw   Rba,[2466]       Rba = 1302;
2bf2: 09,01,ba,        shlw  Rba,1            Rba = Rba << 1;    ##  1302*2*4.8uS = 12.5mS
2bf5: 6c,ba,30,        ml2w  R30,Rba          R30 *= Rba;
2bf8: a0,32,34,        ldw   R34,R32          R34 = R32;    ## R34 = TPS_interval*12.5ms/65536 ??
2bfb: a3,01,66,24,30,  ldw   R30,[2466]       R30 = 1302;
2c00: 48,32,30,36,     sb3w  R36,R30,R32      R36 = R30 - R32;
2c04: db,05,           jc    2c0b             if ((uns) R30 < R32)  {
2c06: a3,01,66,24,36,  ldw   R36,[2466]       R36 = 1302;  }
2c0b: a1,2e,00,3c,     ldw   R3c,2e           R3c = 2e;    ## R2e = Last_ISC_Time
2c0f: b1,80,b2,        ldb   Rb2,80           Rb2 = 80;
2c12: b1,08,ba,        ldb   Rba,8            Rba = 8;
2c15: b1,38,bb,        ldb   Rbb,38           Rbb = 38;    # 2 events, off, on + interrupt 
2c18: ef,7a,f7,        call  2395             HS_OUT();
2c1b: 38,b2,09,        jb    B0,Rb2,2c27      if (!HSO_BUSY)  {
2c1e: a0,32,2e,        ldw   R2e,R32          Last_ISC_Time = R32;
2c21: 71,7f,b4,        an2b  Rb4,7f           ISCrqd = 0; 
2c24: 71,df,b3,        an2b  Rb3,df           ISC_state = 0;   }  }  }
   endfunc:
2c27: f0,              ret                    
 
 # next func probably EGR  (skipped in this ROM...)
   Do_EGR:
2c28: 9b,01,58,24,00,  cmpb  0,[2458]         
2c2d: df,70,           je    2c9f             if (0 != EGR_Fitted)  {
2c2f: 8b,01,42,01,06,  cmpw  R6,[142]         
2c34: de,04,           jlt   2c3a             if (IO_TIMER < EGR_tim) goto 2c3a;
2c36: dd,67,           jv    2c9f             if (overflow) goto endfunc;
2c38: 20,02,           sjmp  2c3c             goto 2c3c;

2c3a: d5,63,           jnv   2c9f             if (overflow)  {
2c3c: a3,01,40,01,36,  ldw   R36,[140]        R36 = EGR_Val;
2c41: 4d,8c,20,36,30,  ml3w  R30,R36,208c     R30 = (long) R36 * 208c;   ## 8332 *4.8uS = 40 mSecs ?
2c46: 3b,b3,23,        jb    B3,Rb3,2c6c      if (EGR_State) goto 2c6c;
2c49: 8b,01,5c,24,36,  cmpw  R36,[245c]       
2c4e: d9,07,           jgtu  2c57             if ((uns) R36 <= [245c])  {
2c50: c3,01,42,01,06,  stw   R6,[142]         EGR_tim = IO_TIMER;
2c55: 20,48,           sjmp  2c9f             goto endfunc;  }

2c57: 69,23,08,32,     sb2w  R32,823          R32 -= 823;
2c5b: 03,32,           negw  R32              R32 = -R32;
2c5d: b1,10,ba,        ldb   Rba,10           Rba = 10;
2c60: 9b,01,78,24,00,  cmpb  0,[2478]         
2c65: df,20,           je    2c87             if (0 != [2478])  {
2c67: b1,11,ba,        ldb   Rba,11           Rba = 11;
2c6a: 20,1b,           sjmp  2c87             goto 2c87;

2c6c: 8b,01,5e,24,36,  cmpw  R36,[245e]       
2c71: d3,07,           jnc   2c7a             if ((uns) R36 >= [245e])  {
2c73: c3,01,42,01,06,  stw   R6,[142]         EGR_tim = IO_TIMER;
2c78: 20,25,           sjmp  2c9f             goto endfunc;  }

2c7a: b1,00,ba,        ldb   Rba,0            Rba = 0;
2c7d: 9b,01,78,24,00,  cmpb  0,[2478]         
2c82: df,03,           je    2c87             if (0 != [2478])  {
2c84: b1,01,ba,        ldb   Rba,1            Rba = 1;  }  }
2c87: a1,42,01,3c,     ldw   R3c,142          R3c = EGR_tim;
2c8b: a0,32,34,        ldw   R34,R32          R34 = R32;
2c8e: b1,c0,b2,        ldb   Rb2,c0           Rb2 = c0;
2c91: ef,01,f7,        call  2395             HS_OUT();
2c94: 38,b2,08,        jb    B0,Rb2,2c9f      if (!HSO_BUSY)  {
2c97: c3,01,42,01,30,  stw   R30,[142]        EGR_tim = R30;
2c9c: 95,08,b3,        xorb  Rb3,8            flags7 = flags7 ^ 8;  }  }  }    ## flip B3 Flags7 - EGR_state ?
   endfunc:
2c9f: f0,              ret                    return
 
 Timer overflow occurs every 0.31 secs (4.8 uS * 65536)

   I_Timer_ovf:
2ca0: f2,              pushp                  push(flags);
2ca1: 07,12,           incw  R12              R12++;    ## R12 not used anywhere else?
2ca3: d7,03,           jne   2ca8             if (0 == R12)  {
2ca5: 91,01,b5,        orb   Rb5,1            ITOVFLoop = 1;   }    ## only used here (set after 343.6 mins ?? )
2ca8: 17,55,           incb  R55              R55++;    ## Fuel pump timeout (3 ticks, 1 sec, see 39c2) 
2caa: d7,02,           jne   2cae             if (0 == R55)  {
2cac: 15,55,           decb  R55              R55--;  }
2cae: fa,              di                     disable ints
2caf: ff,              nop                    
2cb0: f3,              popp                   pop(flags);
2cb1: f1,              retei                  return

   I_Dummy:
2cb2: f1,              retei                  return

   I_HSin:
2cb3: f2,              pushp                  push(flags);
2cb4: fa,              di                     disable ints
2cb5: ff,              nop                    
2cb6: a0,0e,4c,        ldw   R4c,Re           R4c = HSIO_TIME;
2cb9: b0,0d,a8,        ldb   Ra8,Rd           THIS_HSI = HSIO_DATA;
2cbc: b0,a8,4b,        ldb   R4b,Ra8          R4b = THIS_HSI;
2cbf: fb,              ei                     enable ints
2cc0: 94,54,a8,        xorb  Ra8,R54          THIS_HSI = THIS_HSI ^ PREV_HSI;    ## now shows only state changes
2cc3: b0,4b,54,        ldb   R54,R4b          PREV_HSI = R4b;    ## PREV_HSI = THIS HSI before compare ...
   Next_hsi:
2cc6: 38,a8,3b,        jb    B0,Ra8,2d04      if (B0_THIS_HSI) goto PIP_INTH;    ## PIP
2cc9: 3a,a8,19,        jb    B2,Ra8,2ce5      if (B2_THIS_HSI) goto BAP_INTH;    ## BAP ?
2ccc: 3b,a8,11,        jb    B3,Ra8,2ce0      if (B3_THIS_HSI) goto IGNORE_STI;    ## Ignore STI Here - see main loop
2ccf: 3c,a8,28,        jb    B4,Ra8,2cfa      if (B4_THIS_HSI) goto IGNORE_B4;    ## Ignore 
2cd2: 3d,a8,2a,        jb    B5,Ra8,2cff      if (B5_THIS_HSI) goto IGNORE_IDL;    ## Ignore IDL_ADJ here see main loop
2cd5: 11,a8,           clrb  Ra8              THIS_HSI = 0;
   NEXT_INT:
2cd7: 99,00,a8,        cmpb  Ra8,0            
2cda: d7,ea,           jne   2cc6             if (THIS_HSI != 0) goto Next_hsi;
2cdc: fa,              di                     disable ints
2cdd: ff,              nop                    
2cde: f3,              popp                   pop(flags);
2cdf: f1,              retei                  return

   IGNORE_STI:
2ce0: 71,35,a8,        an2b  Ra8,35           B1_THIS_HSI = 0; B3_THIS_HSI = 0; B6_THIS_HSI = 0; B7_THIS_HSI = 0; 
2ce3: 27,f2,           sjmp  2cd7             goto NEXT_INT;

   BAP_INTH:
2ce5: 4b,01,52,01,4c,4a, sb3w  R4a,R4c,[152]    R4a = R4c - Last_BAP;    ## note no check of high or low, so int = 1/2 cycle of freq
2ceb: c3,01,52,01,4c,  stw   R4c,[152]        Last_BAP = R4c;
2cf0: c3,01,54,01,4a,  stw   R4a,[154]        BAP_interval = R4a;
2cf5: 71,39,a8,        an2b  Ra8,39           B1_THIS_HSI = 0; B2_THIS_HSI = 0; B6_THIS_HSI = 0; B7_THIS_HSI = 0; 
2cf8: 27,dd,           sjmp  2cd7             goto NEXT_INT;

   IGNORE_B4:
2cfa: 71,2d,a8,        an2b  Ra8,2d           B1_THIS_HSI = 0; B4_THIS_HSI = 0; B6_THIS_HSI = 0; B7_THIS_HSI = 0; 
2cfd: 27,d8,           sjmp  2cd7             goto NEXT_INT;

   IGNORE_IDL:
2cff: 71,1d,a8,        an2b  Ra8,1d           B1_THIS_HSI = 0; B5_THIS_HSI = 0; B6_THIS_HSI = 0; B7_THIS_HSI = 0; 
2d02: 27,d3,           sjmp  2cd7             goto NEXT_INT;

   PIP_INTH:
2d04: 05,4c,           decw  R4c              R4c--;
2d06: 05,4c,           decw  R4c              R4c--;                     ## Subtract propogation delay
2d08: 38,4b,23,        jb    B0,R4b,2d2e      if (!B0_R4b)  {           ## SPOUT HIGH or LOW ?
2d0b: 71,df,a9,        an2b  Ra9,df           PIP_State = 0;                    ## SPOUT LOW from here
2d0e: 48,40,4c,4a,     sb3w  R4a,R4c,R40      R4a = R4c - Last_PIP_High;
2d12: 89,a0,00,4a,     cmpw  R4a,a0               ## <= less than 768uS - ignore low event
2d16: db,05,           jc    2d1d             if ((uns) R4a < a0)  {
2d18: 91,01,54,        orb   R54,1            B0_PREV_HSI = 1;     ## set PIP high, wait for true Low event
2d1b: 20,89,           sjmp  2da6             goto PIP_0_XT;  }
    ## LOW event processing from here
2d1d: a0,4c,ee,        ldw   Ree,R4c          Last_PIP_Low = R4c;
2d20: 3d,ae,06,        jb    B5,Rae,2d29      if (!Run_Timer0)  {
2d23: a0,1e,46,        ldw   R46,R1e          Last_PIP_HI_PW = PIP_High_PW;  ## Not if TMR0 running ?? why - startup ??
2d26: a0,4a,1e,        ldw   R1e,R4a          PIP_High_PW = R4a;  }
2d29: 71,df,ae,        an2b  Rae,df           Run_Timer0 = 0; 
2d2c: 20,37,           sjmp  2d65             goto 2d65;  }
 
         ## HIGH processing from here
2d2e: 48,40,4c,4a,     sb3w  R4a,R4c,R40      R4a = R4c - Last_PIP_High;
2d32: 89,40,01,4a,     cmpw  R4a,140             ## <= 1.536mS (>12K rpm)- Ignore event, reset to Low state 
2d36: db,05,           jc    2d3d             if ((uns) R4a < EGR_Val)  {
2d38: 71,3c,54,        an2b  R54,3c           B0_PREV_HSI = 0; B1_PREV_HSI = 0; B6_PREV_HSI = 0; B7_PREV_HSI = 0; 
2d3b: 20,69,           sjmp  2da6             goto PIP_0_XT;  }

2d3d: a0,4c,40,        ldw   R40,R4c          Last_PIP_High = R4c;   ## REAL High event
2d40: 3e,ae,08,        jb    B6,Rae,2d4b      if (!First_PIP)  {
2d43: c3,01,28,01,44,  stw   R44,[128]        Last_PIP_Intvl = PIP_Interval;
2d48: a0,4a,44,        ldw   R44,R4a          PIP_Interval = R4a;  }
2d4b: 71,bf,ae,        an2b  Rae,bf           First_PIP = 0; 
2d4e: 91,20,a9,        orb   Ra9,20           PIP_State = 1; 
2d51: 91,c0,b5,        orb   Rb5,c0           NEW_PIP_INTVL = 1; NEW_RPM = 1; 
2d54: 17,48,           incb  R48              Cyl_no++;
2d56: 99,01,48,        cmpb  R48,1            
2d59: d7,03,           jne   2d5e             if (Cyl_no == 1)  {
2d5b: 91,03,b4,        orb   Rb4,3            Inj0rqd = 1; Inj1rqd = 1;   }   ## only place set - implies SYNC injection ?
2d5e: 99,03,48,        cmpb  R48,3                                     ## trigger BOTH banks every 3 sparks
2d61: d7,02,           jne   2d65             if (Cyl_no == 3)  {
2d63: 11,48,           clrb  R48              Cyl_no = 0;  }
2d65: 11,55,           clrb  R55              R55 = 0;    ## Keep fuel pump running
2d67: 91,04,b4,        orb   Rb4,4            SPOUTrqd = 1; 
2d6a: 35,1a,0b,        jnb   B5,R1a,2d78      if (!IgnImmed2) goto 2d78;
2d6d: 3e,1a,06,        jb    B6,R1a,2d76      if (!Set_10_BTDC)  {
2d70: 71,df,1a,        an2b  R1a,df           IgnImmed2 = 0; 
2d73: 91,10,1a,        orb   R1a,10           IgnImmed1 = 1;   }
2d76: 20,2e,           sjmp  2da6             goto PIP_0_XT;

2d78: 36,1a,05,        jnb   B6,R1a,2d80      if (Set_10_BTDC)  {
2d7b: 91,30,1a,        orb   R1a,30           IgnImmed1 = 1; IgnImmed2 = 1; 
2d7e: 20,26,           sjmp  2da6             goto PIP_0_XT;  }

2d80: 3c,1a,20,        jb    B4,R1a,2da3      if (IgnImmed1) goto Imm1_0_XT;
2d83: 3d,a9,10,        jb    B5,Ra9,2d96      if (PIP_State) goto 2d96;
2d86: 3b,a9,05,        jb    B3,Ra9,2d8e      if (Over_1k_rpm) goto 2d8e;
2d89: 32,a9,1f,        jnb   B2,Ra9,2dab      if (!Ign_Delay_Cx) goto SPOUTr_0_XT;
2d8c: 20,18,           sjmp  2da6             goto PIP_0_XT;

2d8e: 3a,a9,15,        jb    B2,Ra9,2da6      if (Ign_Delay_Cx) goto PIP_0_XT;
2d91: 91,04,a9,        orb   Ra9,4            Ign_Delay_Cx = 1; 
2d94: 20,15,           sjmp  2dab             goto SPOUTr_0_XT;

2d96: 3b,a9,02,        jb    B3,Ra9,2d9b      if (Over_1k_rpm) goto 2d9b;
2d99: 20,0b,           sjmp  2da6             goto PIP_0_XT;

2d9b: 3a,a9,0d,        jb    B2,Ra9,2dab      if (!Ign_Delay_Cx)  {
2d9e: 91,04,a9,        orb   Ra9,4            Ign_Delay_Cx = 1; 
2da1: 20,08,           sjmp  2dab             goto SPOUTr_0_XT;

   Imm1_0_XT:
2da3: 71,ef,1a,        an2b  R1a,ef           IgnImmed1 = 0; 
   PIP_0_XT:
2da6: 71,3c,a8,        an2b  Ra8,3c           B0_THIS_HSI = 0; B1_THIS_HSI = 0; B6_THIS_HSI = 0; B7_THIS_HSI = 0; 
2da9: 27,2c,           sjmp  2cd7             goto NEXT_INT;  }

   SPOUTr_0_XT:
2dab: 71,fb,b4,        an2b  Rb4,fb           SPOUTrqd = 0; 
2dae: 27,f6,           sjmp  2da6             goto PIP_0_XT;

   I_HSout:
2db0: f2,              pushp                  
2db1: 3e,b4,0e,        jb    B6,Rb4,2dc2      if (!STOrqd)  {
2db4: 88,78,06,        cmpw  R6,R78           
2db7: de,04,           jlt   2dbd             if (IO_TIMER < STO_Out_Time) goto 2dbd;
2db9: dd,07,           jv    2dc2             if (overflow) goto 2dc2;
2dbb: 20,02,           sjmp  2dbf             goto 2dbf;

2dbd: d5,03,           jnv   2dc2             if (overflow)  {
2dbf: 91,40,b4,        orb   Rb4,40           STOrqd = 1;   }  }
2dc2: 3f,b4,11,        jb    B7,Rb4,2dd6      if (!ISCrqd)  {
2dc5: 88,2e,06,        cmpw  R6,R2e           
2dc8: de,04,           jlt   2dce             if (IO_TIMER < Last_ISC_Time) goto 2dce;
2dca: d5,04,           jnv   2dd0             if (!overflow) goto 2dd0;
2dcc: 20,08,           sjmp  2dd6             goto 2dd6;

2dce: d5,06,           jnv   2dd6             if (overflow)  {
2dd0: 91,20,b3,        orb   Rb3,20           ISC_state = 1; 
2dd3: 91,80,b4,        orb   Rb4,80           ISCrqd = 1;   }  }
2dd6: fa,              di                     
2dd7: ff,              nop                    
2dd8: f3,              popp                   
2dd9: f1,              retei                  

   IGN_calc:
2dda: a0,62,e8,        ldw   Re8,R62          VAF1_avg2 = VAF1_avg;
2ddd: b0,1d,1c,        ldb   R1c,R1d          IGN_ADVANCE = R1d;
2de0: a0,42,58,        ldw   R58,R42          IGN_DELAY = R42;
2de3: 37,1b,02,        jnb   B7,R1b,2de8      if (B7_flagsw5)  {
2de6: 28,0e,           scall 2df6             IGN_Base_clc();  }
2de8: e7,cd,fd,        jump  2bb8             goto MON_EXIT;

   IGN_clc3:
2deb: 28,9f,           scall 2e8c             IGN_Temp_CLC();
2ded: b0,1c,1d,        ldb   R1d,R1c          R1d = IGN_ADVANCE;
2df0: a0,58,42,        ldw   R42,R58          R42 = IGN_DELAY;
2df3: e7,c2,fd,        jump  2bb8             goto MON_EXIT;
 

############################################## 
# Base Ignition calculation 
# Including interpolation between HOT and COLD Ign tables 
# via ACT table to give 3D function, and default if sensors  
# broken (or timer still active ?) 
# Effectively interpolate calculation is 
# ((ADV_COLD*ACT) + ADV_HOT*(127-ACT))/128; 
# where ACT is 0 to 128 
# gives 3D lookup by RPM, VAF, ACT parameters 
# If flag set, fix Advance at 10 degrees and inhibit next  
# subroutine from running (for cranking ?) 
# 10 degrees ? (0x28 = 40) is this extra to 10 BTDC physical ? 
###############################################

   IGN_Base_clc:
2df6: 36,1a,04,        jnb   B6,R1a,2dfd      if (Set_10_BTDC)  {
2df9: b1,28,1c,        ldb   R1c,28           IGN_ADVANCE = 28;
2dfc: f0,              ret                    return  }

2dfd: a1,58,28,32,     ldw   R32,2858         R32 = RPM_SCALE_10;
2e01: a0,70,34,        ldw   R34,R70          R34 = RPMx4;
2e04: ef,b5,04,        call  32bc             UWFuncLu();
2e07: a0,38,6a,        ldw   R6a,R38          R6a = R38;
2e0a: a1,74,28,32,     ldw   R32,2874         R32 = VAF_SCALE_10;
2e0e: a0,e8,34,        ldw   R34,Re8          R34 = VAF1_avg2;
2e11: ef,a8,04,        call  32bc             UWFuncLu();
2e14: a0,38,6c,        ldw   R6c,R38          R6c = R38;
2e17: a0,6a,30,        ldw   R30,R6a          R30 = R6a;
2e1a: a0,6c,32,        ldw   R32,R6c          R32 = R6c;
2e1d: a1,0b,00,34,     ldw   R34,b            R34 = b;
2e21: 9b,01,35,24,27,  cmpb  R27,[2435]       
2e26: d2,22,           jgt   2e4a             if (ACT_start <= 18)  {  # ACT dft = 10
2e28: 9b,01,36,24,27,  cmpb  R27,[2436]       
2e2d: da,1b,           jle   2e4a             if (ACT_start > -20)  {
2e2f: 9b,01,35,24,9f,  cmpb  R9f,[2435]       
2e34: d2,14,           jgt   2e4a             if (ECT_start <= 18)  {  # ECT DFT = 50
2e36: 9b,01,36,24,9f,  cmpb  R9f,[2436]       
2e3b: da,0d,           jle   2e4a             if (ECT_start > -20)  {
2e3d: 8b,01,3c,24,ea,  cmpw  Rea,[243c]       
2e42: d9,06,           jgtu  2e4a             if ((uns) T2WSU <= 650mS)  {
2e44: a1,9b,26,38,     ldw   R38,269b         R38 = IGN_ADV_COLD;
2e48: 20,04,           sjmp  2e4e             goto 2e4e;  }  }  }  }  }

2e4a: a1,79,25,38,     ldw   R38,2579         R38 = IGN_ADV_DFLT;
2e4e: ef,26,04,        call  3277             TabLookup();
2e51: ac,3b,3c,        ldzbw R3c,R3b          R3c = (uns) R3b;
2e54: a1,b0,28,32,     ldw   R32,28b0         R32 = ACT_Ign_Interp;
2e58: bc,73,34,        ldsbw R34,R73          R34 = (int) ACT_val;
2e5b: ef,61,04,        call  32bf             SWFuncLu();    ## tfr ans in R38  (0 to 128)
2e5e: ad,7f,b8,        ldzbw Rb8,7f           Rb8 = (uns) 7f;
2e61: 68,38,b8,        sb2w  Rb8,R38          Rb8 -= R38;    ## Rb8 = 127 - R38; ('reverse' of R38 for interpolate)
2e64: 28,d7,           scall 2f3d             Scale_R3c();
2e66: a0,3c,ba,        ldw   Rba,R3c          Rba = R3c;    ## Rba = ADV_COLD *(ACT_Ign_Interp)/128;
2e69: a0,6a,30,        ldw   R30,R6a          R30 = R6a;    ## R6a is scaled RPM
2e6c: a0,6c,32,        ldw   R32,R6c          R32 = R6c;    ## R6c is scaled VAF
2e6f: a1,0b,00,34,     ldw   R34,b            R34 = b;
2e73: a1,f2,25,38,     ldw   R38,25f2         R38 = IGN_ADV_HOT;
2e77: ef,fd,03,        call  3277             TabLookup();
2e7a: ac,3b,38,        ldzbw R38,R3b          R38 = (uns) R3b;
2e7d: a0,b8,3c,        ldw   R3c,Rb8          R3c = Rb8;
2e80: 28,bb,           scall 2f3d             Scale_R3c();    ## R3c = ADV_HOT *(127 - ACT_Ign_Interp)/128;
2e82: 64,3c,ba,        ad2w  Rba,R3c          Rba += R3c;    ## interpolated result
2e85: a0,ba,f2,        ldw   Rf2,Rba          Rf2 = Rba;    ## Result to next subroutine
2e88: 91,01,b3,        orb   Rb3,1            Next_OK = 1;     ## OK flag for next subroutine ....
2e8b: f0,              ret                    
 

########################################################## 
 # Flag Ign_Clc_2 set every time ISC_PW_Calc func called (Tasklist only) 
 # and cleared only if RPM_F0 flag set AND RPM < 1430 AND Timer2 > 3 secs 
##################################################
   IGN_Temp_CLC:
2e8c: 38,b3,02,        jb    B0,Rb3,2e91      if (Next_OK) goto 2e91;    ## Need OK from previous subroutine 
2e8f: 20,ab,           sjmp  2f3c             goto endfunc;

2e91: 71,fe,b3,        an2b  Rb3,fe           Next_OK = 0; 
2e94: a0,f2,ba,        ldw   Rba,Rf2          Rba = Rf2;    ## from previous subroutine, first calc of ign
2e97: a1,84,28,32,     ldw   R32,2884         R32 = ECT_SCALE_7;
2e9b: b0,72,35,        ldb   R35,R72          R35 = ECT_val;
2e9e: 11,34,           clrb  R34              R34 = 0;
2ea0: ef,1c,04,        call  32bf             SWFuncLu();
2ea3: a0,38,6a,        ldw   R6a,R38          R6a = R38;
2ea6: a1,a0,28,32,     ldw   R32,28a0         R32 = VAF_SCALE_5;
2eaa: a0,e8,34,        ldw   R34,Re8          R34 = VAF1_avg2;
2ead: ef,0c,04,        call  32bc             UWFuncLu();
2eb0: a0,38,6c,        ldw   R6c,R38          R6c = R38;
2eb3: a0,6a,30,        ldw   R30,R6a          R30 = R6a;
2eb6: a0,6c,32,        ldw   R32,R6c          R32 = R6c;
2eb9: a1,08,00,34,     ldw   R34,8            R34 = 8;
2ebd: a1,6b,26,38,     ldw   R38,266b         R38 = VAFxECT_IGN;
2ec1: ef,b3,03,        call  3277             TabLookup();
2ec4: ac,3b,3c,        ldzbw R3c,R3b          R3c = (uns) R3b;
2ec7: 3d,b5,10,        jb    B5,Rb5,2eda      if (Ign_Clc_2) goto 2eda;
2eca: 47,01,94,24,3c,ba, ad3w  Rba,R3c,[2494]   Rba = R3c + IGN_48;    ## Replace calc if flag not set, base + alt. advance
2ed0: 31,b5,26,        jnb   B1,Rb5,2ef9      if (Add_NDS_Dly)  {
2ed3: 67,01,ac,24,ba,  ad2w  Rba,[24ac]       Rba += IGN_NDS1_inc;    ## and add more for NDS if reqd.
2ed8: 20,1f,           sjmp  2ef9             goto 2ef9;

2eda: 64,ba,3c,        ad2w  R3c,Rba          R3c += Rba;    ## Flag set, add to original calc.
2edd: af,01,34,24,38,  ldzbw R38,[2434]       R38 = (uns) -128;
2ee2: 28,59,           scall 2f3d             Scale_R3c();
2ee4: 47,01,2e,24,3c,ba, ad3w  Rba,R3c,[242e]   Rba = R3c + 0;
2eea: 33,2c,0c,        jnb   B3,R2c,2ef9      if (Add<2500_IGN_dly)  {
2eed: 8b,01,30,24,70,  cmpw  R70,[2430]       
2ef2: d1,05,           jleu  2ef9             if ((uns) RPMx4 > RPM_2500 )  {
2ef4: 67,01,68,24,ba,  ad2w  Rba,[2468]       Rba += 0;  }  }  } 

2ef9: bc,7c,30,        ldsbw R30,R7c          R30 = (int) OCT_ADJ_DLY;
2efc: 64,30,ba,        ad2w  Rba,R30          Rba += R30;    ## then add Oct Adjust
2eff: 3f,bb,0c,        jb    B7,Rbb,2f0e      if (B7_Rbb) goto 2f0e;
2f02: 99,00,bb,        cmpb  Rbb,0            
2f05: d7,13,           jne   2f1a             if (Rbb != 0) goto 2f1a;
2f07: 9b,01,32,24,ba,  cmpb  Rba,[2432]       
2f0c: d9,05,           jgtu  2f13             if ((uns) Rba <= 0)  {
2f0e: b3,01,32,24,ba,  ldb   Rba,[2432]       Rba = 0;  }
2f13: 9b,01,33,24,ba,  cmpb  Rba,[2433]       
2f18: d3,05,           jnc   2f1f             if ((uns) Rba >= 0)  {
2f1a: b3,01,33,24,ba,  ldb   Rba,[2433]       Rba = 0;  }
2f1f: b1,18,30,        ldb   R30,18           R30 = 18;
2f22: 58,1c,ba,38,     sb3b  R38,Rba,R1c      R38 = Rba - IGN_ADVANCE;    ## is this an additional RETARD calc ? looks so
2f26: 37,38,04,        jnb   B7,R38,2f2d      if (B7_R38)  {
2f29: 13,30,           negb  R30              R30 = -R30;
2f2b: 13,38,           negb  R38              R38 = -R38;  }
2f2d: 99,18,38,        cmpb  R38,18           
2f30: d1,04,           jleu  2f36             if ((uns) R38 > 18 )  {
2f32: 54,30,1c,ba,     ad3b  Rba,R1c,R30      Rba = IGN_ADVANCE + R30;  }
2f36: b0,ba,1c,        ldb   R1c,Rba          IGN_ADVANCE = Rba;
2f39: ef,09,00,        call  2f45             Calc_Ign_Wait();
   endfunc:
2f3c: f0,              ret                    return
 
########################## 
# Scale R3c      R3c = R3c * (R38/128) 
# so R38 defines 128ths of R3c (signed) 
##########################
   Scale_R3c:
2f3d: fe,              smul                   
2f3e: 6c,38,3c,        ml2w  R3c,R38          R3c *= R38;
2f41: 0c,07,3c,        shrdw R3c,7            R3c = (long) R3c >> 7; (log)
2f44: f0,              ret                    return
 
########################## 
# Returns with Ignition DELAY in degrees, where 
# IGN_DELAY = (480 + 40 - IGN_ADV_Reqd)/960; 
# which is HALF degrees (stops overflow ?) 
##########################
   Calc_Ign_Wait:
2f45: a1,03,00,32,     ldw   R32,3            R32 = 3;
2f49: 01,36,           clrw  R36              R36 = 0;
2f4b: a1,a0,05,34,     ldw   R34,5a0          R34 = 5a0;    ## 5a0 = 1440 = 360*4 ??
2f4f: 8c,32,34,        divw  R34,R32          R34 = R34 / R32;    ## R34 = 480 (120 deg*4 ?)
2f52: 45,28,00,34,36,  ad3w  R36,R34,28       R36 = R34 + 28;     ## R36 = 520 (120 +10 deg ?)
2f57: ac,1c,38,        ldzbw R38,R1c          R38 = (uns) IGN_ADVANCE;
2f5a: 48,38,36,32,     sb3w  R32,R36,R38      R32 = R36 - R38;    ## R32 = 520 - IGN_ADV ?
2f5e: 01,30,           clrw  R30              R30 = 0;
2f60: 09,01,34,        shlw  R34,1            R34 = R34 << 1;
2f63: 8c,34,30,        divw  R30,R34          R30 = R30 / R34;    ## R30 = (520-IGN_ADV)/960;
2f66: dd,32,           jv    2f9a             if (overflow) goto 2f9a;
2f68: a0,30,58,        ldw   R58,R30          IGN_DELAY = R30;
2f6b: 91,02,a9,        orb   Ra9,2            Recalc_IgnWait = 1; 
2f6e: 33,a9,2a,        jnb   B3,Ra9,2f9b      if (Over_1k_rpm)  {
2f71: 71,fd,a9,        an2b  Ra9,fd           Recalc_IgnWait = 0; 
2f74: 89,00,80,30,     cmpw  R30,8000         
2f78: d3,0f,           jnc   2f89             if ((uns) R30 >= 8000)  {
2f7a: 49,00,80,30,32,  sb3w  R32,R30,8000     R32 = R30 - 8000;
2f7f: 09,01,32,        shlw  R32,1            R32 = R32 << 1;
2f82: 45,00,80,32,58,  ad3w  R58,R32,8000     IGN_DELAY = R32 + 8000;
2f87: 20,12,           sjmp  2f9b             goto endfunc;  }

2f89: a1,00,80,32,     ldw   R32,8000         R32 = 8000;
2f8d: 48,30,32,34,     sb3w  R34,R32,R30      R34 = R32 - R30;
2f91: 09,01,34,        shlw  R34,1            R34 = R34 << 1;
2f94: 48,34,32,58,     sb3w  R58,R32,R34      IGN_DELAY = R32 - R34;
2f98: 20,01,           sjmp  2f9b             goto endfunc;

2f9a: ff,              nop                      }
   endfunc:
2f9b: f0,              ret                    return
 
############################# 
# function lookup with interpolate 
# Signed and Unsigned Byte 
# R32 = lookup table 
# R34 = value in 
# R38 = value out (Byte) 
#############################
   UBFuncLu:
2f9c: 91,02,f6,        orb   Rf6,2            UNS_COMP = 1; 
   SBFuncLu:
2f9f: 9b,32,02,34,     cmpb  R34,[R32+2]      
2fa3: 31,f6,04,        jnb   B1,Rf6,2faa      if (!UNS_COMP) goto 2faa;
2fa6: db,0a,           jc    2fb2             if ((uns) R34 >= [R32+2]) goto 2fb2;
2fa8: 20,02,           sjmp  2fac             goto 2fac;

2faa: d6,06,           jge   2fb2             if (R34 < [R32+2])  {
2fac: 65,02,00,32,     ad2w  R32,2            R32 += 2;
2fb0: 27,ed,           sjmp  2f9f             goto SBFuncLu;  }

2fb2: b2,33,36,        ldb   R36,[R32++]      R36 = [R32++];
2fb5: b2,33,38,        ldb   R38,[R32++]      R38 = [R32++];
2fb8: 7a,32,36,        sb2b  R36,[R32]        R36 -= [R32];
2fbb: 7a,33,34,        sb2b  R34,[R32++]      R34 -= [R32++];
2fbe: 7a,32,38,        sb2b  R38,[R32]        R38 -= [R32];
2fc1: 31,f6,04,        jnb   B1,Rf6,2fc8      if (!UNS_COMP) goto 2fc8;
2fc4: db,09,           jc    2fcf             if ((uns) R38 >= [R32]) goto 2fcf;
2fc6: 20,02,           sjmp  2fca             goto 2fca;

2fc8: d6,05,           jge   2fcf             if (R38 < [R32])  {
2fca: 91,01,f6,        orb   Rf6,1            NEG_FLAG = 1; 
2fcd: 13,38,           negb  R38              R38 = -R38;  }
2fcf: 7c,34,38,        ml2b  R38,R34          R38 = R38 * (word)R34;
2fd2: 9c,36,38,        divb  R38,R36          R38 = R38 / (word)R36
2fd5: 30,f6,02,        jnb   B0,Rf6,2fda      if (NEG_FLAG)  {
2fd8: 13,38,           negb  R38              R38 = -R38;  }
2fda: 76,32,38,        ad2b  R38,[R32]        R38 += [R32];
2fdd: 71,fc,f6,        an2b  Rf6,fc           NEG_FLAG = 0; UNS_COMP = 0; 
2fe0: f0,              ret                    
 
########################### 
# Digital Filter - Signed or Unsigned  
# R32 - Original Value 
# R34 - New value 
# R36 - Multiplier => sensitivity ? 
# R3e - Filter out 
# R3c = R32 + (( R34 - R32) * R36)/65536 
# NB  Unsigned Filter not used in this binary 
###############################
   Sfilter:
2fe1: b1,02,ba,        ldb   Rba,2            Rba = 2;
2fe4: 20,02,           sjmp  2fe8             goto 2fe8;

   Ufilter:
2fe6: 11,ba,           clrb  Rba              Rba = 0;
2fe8: 48,32,34,3c,     sb3w  R3c,R34,R32      R3c = R34 - R32;    ## R3c =  difference in values
2fec: 31,ba,04,        jnb   B1,Rba,2ff3      if (!B1_Rba) goto 2ff3;
2fef: db,09,           jc    2ffa             if ((uns) R34 >= R32) goto 2ffa;
2ff1: 20,02,           sjmp  2ff5             goto 2ff5;

2ff3: d6,05,           jge   2ffa             if (R34 < R32)  {
2ff5: 91,01,ba,        orb   Rba,1            B0_Rba = 1;     ## +ve or -ve marker
2ff8: 03,3c,           negw  R3c              R3c = -R3c;  }
2ffa: 89,01,00,3c,     cmpw  R3c,1            
2ffe: d9,05,           jgtu  3005             if ((uns) R3c <= 1)  {
3000: a0,32,3e,        ldw   R3e,R32          R3e = R32;    ## No change in value - return
3003: 20,11,           sjmp  3016             goto 3016;  }

3005: 6c,36,3c,        ml2w  R3c,R36          R3c *= R36;    ## R3c = (( R34 - R32) * R36)
3008: 03,3e,           negw  R3e              R3e = -R3e;
300a: d7,02,           jne   300e             if (0 == R3e)  {
300c: 05,3e,           decw  R3e              R3e--;  }    ## if top of Dword zero, make -1
300e: 38,ba,02,        jb    B0,Rba,3013      if (!B0_Rba)  {
3011: 03,3e,           negw  R3e              R3e = -R3e;  }
3013: 64,32,3e,        ad2w  R3e,R32          R3e += R32;    ## R3e is R3c/65536 ....
3016: f0,              ret                    return
 

############################################ 
# Process other sensors, ACT,ECT,Oct Adjust,ACC,NDS 
# Average first 10 readings of ACT and ECT and assign to 
# 'start' values.  
#############################################
   Do_Sensors:
3017: a1,6c,29,32,     ldw   R32,296c         R32 = ACT_TFR;
301b: a0,90,34,        ldw   R34,R90          R34 = ACT_raw;
301e: 08,01,34,        shrw  R34,1            R34 = R34 >> 1; (log)
3021: ef,9b,02,        call  32bf             SWFuncLu();
3024: 45,80,00,38,3a,  ad3w  R3a,R38,80       R3a = R38 + 80;   ## what does this do ? data in top byte....??
3029: b0,3b,73,        ldb   R73,R3b          ACT_val = R3b;
302c: 99,0a,7b,        cmpb  R7b,a            
302f: db,08,           jc    3039             if ((uns) R7b < a)  {
3031: fe,              smul                   
3032: 6d,9a,19,38,     ml2w  R38,199a         R38 *= 199a;    ## ACT_OrigLU * 6554  [=> 65536/10] 
3036: 64,3a,26,        ad2w  R26,R3a          R26 += R3a;  }    ## ACT_start = ACT_start + ACT_OrigLU/10; 
3039: a1,18,29,32,     ldw   R32,2918         R32 = ECT_TFR;
303d: a0,8e,34,        ldw   R34,R8e          R34 = ECT_raw;
3040: 08,01,34,        shrw  R34,1            R34 = R34 >> 1; (log)
3043: ef,79,02,        call  32bf             SWFuncLu();
3046: 45,80,00,38,3a,  ad3w  R3a,R38,80       R3a = R38 + 80;    ## same trick as ACT ?
304b: b0,3b,72,        ldb   R72,R3b          ECT_val = R3b;
304e: 99,0a,7b,        cmpb  R7b,a                ## R7b 10 times ???
3051: db,27,           jc    307a             if ((uns) R7b < a)  {
3053: fe,              smul                   
3054: 6d,9a,19,38,     ml2w  R38,199a         R38 *= 199a;
3058: 64,3a,9e,        ad2w  R9e,R3a          R9e += R3a;    ## ECT_start = ECT_start + ECT_OrigLU/10; 
305b: a1,7c,2a,32,     ldw   R32,2a7c         R32 = ECT_LU5;
305f: bc,9f,34,        ldsbw R34,R9f          R34 = (int) ECT_start;
3062: ef,5a,02,        call  32bf             SWFuncLu();
3065: c3,01,3c,01,38,  stw   R38,[13c]        ISC_Val1 = R38;
306a: a1,00,19,38,     ldw   R38,1900         R38 = 1900;    ## ISC & 1600 rpm Idle for START ??
306e: c3,01,32,01,38,  stw   R38,[132]        M_IDL_SPD = R38;
3073: c3,01,66,01,8a,  stw   R8a,[166]        OCT_flt = OCT_raw;
3078: 17,7b,           incb  R7b              R7b++;  }
307a: 34,18,08,        jnb   B4,R18,3085      if (ACTFail)  {
307d: b3,01,38,24,73,  ldb   R73,[2438]       ACT_val = ACTdflt_10;
3082: b0,73,27,        ldb   R27,R73          ACT_start = ACT_val;  }    ## assigned above also.
3085: 33,18,08,        jnb   B3,R18,3090      if (ECTFail)  {
3088: b3,01,37,24,72,  ldb   R72,[2437]       ECT_val = ECTdflt_50;
308d: b0,72,9f,        ldb   R9f,R72          ECT_start = ECT_val;  }    ## assigned above also.
3090: a3,01,66,01,32,  ldw   R32,[166]        R32 = OCT_flt;
3095: a0,8a,34,        ldw   R34,R8a          R34 = OCT_raw;
3098: a1,05,05,36,     ldw   R36,505          R36 = 505;    ## => 2% of change ?
309c: 2f,43,           scall 2fe1             Sfilter();
309e: c3,01,66,01,3e,  stw   R3e,[166]        OCT_flt = R3e;
30a3: 8b,01,b0,24,3e,  cmpw  R3e,[24b0]       
30a8: d3,07,           jnc   30b1             if ((uns) R3e >= 3.845v)  {
30aa: b3,01,74,24,7c,  ldb   R7c,[2474]       OCT_ADJ_DLY = 0;    ## no Octane Adjust
30af: 20,21,           sjmp  30d2             goto 30d2;  }

30b1: 8b,01,b2,24,3e,  cmpw  R3e,[24b2]       
30b6: d3,07,           jnc   30bf             if ((uns) R3e >= 1.92v)  {
30b8: b3,01,75,24,7c,  ldb   R7c,[2475]       OCT_ADJ_DLY = -12;    ## 3 degrees retard
30bd: 20,13,           sjmp  30d2             goto 30d2;  }

30bf: 8b,01,b4,24,3e,  cmpw  R3e,[24b4]       
30c4: d3,07,           jnc   30cd             if ((uns) R3e >= 0v)  {
30c6: b3,01,76,24,7c,  ldb   R7c,[2476]       OCT_ADJ_DLY = -24;    ## 6 degrees retard
30cb: 20,05,           sjmp  30d2             goto 30d2;  }

30cd: b3,01,77,24,7c,  ldb   R7c,[2477]       OCT_ADJ_DLY = -24;    ## 6 degrees retard (catchall)
30d2: 71,f1,b5,        an2b  Rb5,f1           Add_NDS_Dly = 0; NDS_2F = 0; ACC_F = 0; 
30d5: 89,00,80,82,     cmpw  R82,8000             ## 2.56V
30d9: d3,03,           jnc   30de             if ((uns) ACC_raw >= 8000)  {
30db: 91,08,b5,        orb   Rb5,8            ACC_F = 1;   }
30de: 89,40,d0,92,     cmpw  R92,d040             ## 4.165v
30e2: d3,05,           jnc   30e9             if ((uns) NDS_raw >= d040)  {
30e4: 91,04,b5,        orb   Rb5,4            NDS_2F = 1; 
30e7: 20,14,           sjmp  30fd             goto 30fd;  }

30e9: 89,00,8a,92,     cmpw  R92,8a00             ## 2.76v
30ed: db,0e,           jc    30fd             if ((uns) NDS_raw < 8a00)  {
30ef: 89,40,5e,92,     cmpw  R92,5e40             ## 1.885v
30f3: d3,05,           jnc   30fa             if ((uns) NDS_raw >= 5e40)  {
30f5: 91,06,b5,        orb   Rb5,6            Add_NDS_Dly = 1; NDS_2F = 1; 
30f8: 20,03,           sjmp  30fd             goto 30fd;  }

30fa: 91,02,b5,        orb   Rb5,2            Add_NDS_Dly = 1;   }
30fd: b3,01,4c,24,32,  ldb   R32,[244c]       R32 = FLGS(B3,B0);
3102: 3c,32,03,        jb    B4,R32,3108      if (!B4_R32)  {
3105: 71,fb,b5,        an2b  Rb5,fb           NDS_2F = 0;   }
3108: a1,18,28,32,     ldw   R32,2818         R32 = ECT_LU_Time;
310c: bc,9f,34,        ldsbw R34,R9f          R34 = (int) ECT_start;
310f: ef,ad,01,        call  32bf             SWFuncLu();
3112: a0,38,24,        ldw   R24,R38          ECT_StartLUTmr = R38;
3115: a1,c0,28,32,     ldw   R32,28c0         R32 = Vss_TFR;
3119: a0,80,34,        ldw   R34,R80          R34 = Vss_raw;
311c: ef,9d,01,        call  32bc             UWFuncLu();
311f: a0,38,52,        ldw   R52,R38          Vss_val = R38;
3122: e7,93,fa,        jump  2bb8             goto MON_EXIT;

   VAF_flow_calc:
3125: a3,01,54,01,34,  ldw   R34,[154]        R34 = BAP_interval;
312a: a1,96,01,32,     ldw   R32,196          R32 = 196;
312e: a1,aa,e6,30,     ldw   R30,e6aa         R30 = e6aa;    ## = 26,666,666
3132: 8c,34,30,        divw  R30,R34          R30 = R30 / R34;
3135: c3,01,56,01,30,  stw   R30,[156]        BAP_freq = R30;  ## BAP Frequency = BAP_interval/26,666,666
313a: a0,30,34,        ldw   R34,R30          R34 = R30;
313d: a1,dc,2a,32,     ldw   R32,2adc         R32 = BAP_Comp;
3141: ef,78,01,        call  32bc             UWFuncLu();
3144: 36,18,05,        jnb   B6,R18,314c      if (BAPFail)  {
3147: b3,01,0c,24,38,  ldb   R38,[240c]       R38 = BAP_dft_239;  }     # = 239
314c: c7,01,58,01,38,  stb   R38,[158]        BAP_Vx = R38;
3151: b0,38,37,        ldb   R37,R38          R37 = R38;
3154: 11,36,           clrb  R36              R36 = 0;     # R36 = BAP_TFR * 256;
3156: 08,03,36,        shrw  R36,3            R36 = R36 >> 3; (log)
3159: 01,34,           clrw  R34              R34 = 0;     # R34 (long) = BAP_TFR*32;
315b: b0,73,31,        ldb   R31,R73          R31 = ACT_val;
315e: 1a,01,31,        asrb  R31,1            R31 = R31 >> 1 (arith)
3161: 75,44,31,        ad2b  R31,44           R31 += 44;
3164: 11,30,           clrb  R30              R30 = 0;     # R30 (long) = ACT_val/2 + 68;
3166: 8c,30,34,        divw  R34,R30          R34 = R34 / R30;     # R34 = (BAP_TFR*32) / ((ACT_val/2)+68);
3169: a1,c0,29,32,     ldw   R32,29c0         R32 = AirFlow_temp;     # R34 = 100 when defaults used
316d: ef,4c,01,        call  32bc             UWFuncLu();
3170: 6f,01,2c,24,38,  ml2w  R38,[242c]       R38 *= 15456;     # R38 = 1781 from lookup table when R34 = 100
3175: a0,3a,3e,        ldw   R3e,R3a          R3e = R3a;     # R3e = func(R34) /4.24 (= 420 when R34 = 100)
3178: 35,18,0f,        jnb   B5,R18,318a      if (!VAF2Fail) goto 318a;
317b: 31,18,07,        jnb   B1,R18,3185      if (VAF1Fail)  {
317e: a3,01,3a,24,34,  ldw   R34,[243a]       R34 = VAFdflt_22400;
3183: 20,08,           sjmp  318d             goto 318d;  }

3185: a0,7e,34,        ldw   R34,R7e          R34 = VAF1_raw;
3188: 20,03,           sjmp  318d             goto 318d;

318a: a0,96,34,        ldw   R34,R96          R34 = VAF2_raw;
318d: 28,20,           scall 31af             VAF_Flow();
318f: a0,3a,9a,        ldw   R9a,R3a          VAF2_flow = R3a;
3192: 31,18,0f,        jnb   B1,R18,31a4      if (!VAF1Fail) goto 31a4;
3195: 35,18,07,        jnb   B5,R18,319f      if (VAF2Fail)  {
3198: a3,01,3a,24,34,  ldw   R34,[243a]       R34 = VAFdflt_22400;
319d: 20,08,           sjmp  31a7             goto 31a7;  }

319f: a0,96,34,        ldw   R34,R96          R34 = VAF2_raw;
31a2: 20,03,           sjmp  31a7             goto 31a7;

31a4: a0,7e,34,        ldw   R34,R7e          R34 = VAF1_raw;
31a7: 28,06,           scall 31af             VAF_Flow();
31a9: a0,3a,9c,        ldw   R9c,R3a          VAF1_flow = R3a;
31ac: e7,09,fa,        jump  2bb8             goto MON_EXIT;

   VAF_Flow:
31af: a1,cc,28,32,     ldw   R32,28cc         R32 = VAF_TFR;
31b3: ef,06,01,        call  32bc             UWFuncLu();
31b6: 6c,3e,38,        ml2w  R38,R3e          R38 *= R3e;     # transfer * compensation;
31b9: 99,20,3b,        cmpb  R3b,20           
31bc: d3,07,           jnc   31c5             if ((uns) R3b >= 20)  {
31be: a1,ff,ff,3a,     ldw   R3a,ffff         R3a = ffff;
31c2: 91,01,69,        orb   R69,1            DBG_VAF = 1;   }
31c5: 0d,03,38,        shldw R38,3            R38 = (long) R38 << 3;     # R3a = (transfer * compensation)/8192;
31c8: f0,              ret                    return

   TPS_calc:
31c9: 32,18,09,        jnb   B2,R18,31d5      if (TPSFail)  {
31cc: a1,00,80,c8,     ldw   Rc8,8000         TPS_prev = 8000;
31d0: a0,c8,ec,        ldw   Rec,Rc8          TPS_val = TPS_prev;
31d3: 20,36,           sjmp  320b             goto 320b;  }

31d5: a0,ec,32,        ldw   R32,Rec          R32 = TPS_val;
31d8: a0,8c,34,        ldw   R34,R8c          R34 = TPS_raw;
31db: a1,31,0c,36,     ldw   R36,c31          R36 = c31;     # => 4.7% of change ?
31df: ef,ff,fd,        call  2fe1             Sfilter();
31e2: a0,3e,ec,        ldw   Rec,R3e          TPS_val = R3e;
31e5: 88,c8,ec,        cmpw  Rec,Rc8          
31e8: db,03,           jc    31ed             if ((uns) TPS_val < TPS_prev)  {
31ea: a0,ec,c8,        ldw   Rc8,Rec          TPS_prev = TPS_val;  }
31ed: 48,c8,8c,aa,     sb3w  Raa,R8c,Rc8      TPS_delta = TPS_raw - TPS_prev;
31f1: d9,02,           jgtu  31f5             if ((uns) TPS_raw <= TPS_prev)  {
31f3: 01,aa,           clrw  Raa              TPS_delta = 0;  }
31f5: 8b,01,48,24,aa,  cmpw  Raa,[2448]       
31fa: d9,08,           jgtu  3204             if ((uns) TPS_delta <= TPS_TRG_832)  {
31fc: 91,03,20,        orb   R20,3            TPS_F0 = 1; TPS_F1 = 1; 
31ff: 71,fb,20,        an2b  R20,fb           TPS_BIG_DELTA = 0; 
3202: 20,12,           sjmp  3216             goto 3216;  }

3204: 8b,01,4a,24,aa,  cmpw  Raa,[244a]       
3209: d9,05,           jgtu  3210             if ((uns) TPS_delta <= TPS_TRG_41600)  {
320b: 71,f8,20,        an2b  R20,f8           TPS_F0 = 0; TPS_F1 = 0; TPS_BIG_DELTA = 0; 
320e: 20,06,           sjmp  3216             goto 3216;  }

3210: 91,04,20,        orb   R20,4            TPS_BIG_DELTA = 1; 
3213: 71,fc,20,        an2b  R20,fc           TPS_F0 = 0; TPS_F1 = 0; 
3216: a0,06,30,        ldw   R30,R6           R30 = IO_TIMER;
3219: a3,01,46,01,32,  ldw   R32,[146]        R32 = TPS_Last_Time;
321e: 68,32,30,        sb2w  R30,R32          R30 -= R32;
3221: c3,01,48,01,30,  stw   R30,[148]        TPS_Interval = R30;
3226: c3,01,46,01,06,  stw   R6,[146]         TPS_Last_Time = IO_TIMER;
322b: e7,8a,f9,        jump  2bb8             goto MON_EXIT;
 
############################# 
# Main RPM Calculation 
#############################
   RPM_calc:
322e: 37,b5,1d,        jnb   B7,Rb5,324e      if (NEW_RPM)  {
3231: a1,fe,00,36,     ldw   R36,fe           R36 = fe;
3235: a1,2a,50,34,     ldw   R34,502a         R34 = 502a;     # 16666666 / elapsed time is RPM/4 on 6 cyl
3239: 8c,44,34,        divw  R34,R44          R34 = R34 / PIP_Interval;
323c: a0,34,70,        ldw   R70,R34          RPMx4 = R34;
323f: 71,7f,b5,        an2b  Rb5,7f           NEW_RPM = 0; 
3242: a0,5c,32,        ldw   R32,R5c          R32 = RPM_flt2;
3245: a1,09,03,36,     ldw   R36,309          R36 = 309;     # 309 => 1.1% of change ?
3249: 2d,96,           scall 2fe1             Sfilter();
324b: a0,3e,5c,        ldw   R5c,R3e          RPM_flt2 = R3e;  }
324e: 3a,5a,02,        jb    B2,R5a,3253      if (!PUMP_ON_RQD)  {
3251: 01,70,           clrw  R70              RPMx4 = 0;  }
3253: 33,a9,14,        jnb   B3,Ra9,326a      if (!Over_1k_rpm) goto 326a;
3256: a3,01,44,24,32,  ldw   R32,[2444]       R32 = RPM_1000;
325b: 67,01,46,24,32,  ad2w  R32,[2446]       R32 += RPM_50;    ## clear flag at 1050 downwards (50 rpm hysteresis)
3260: 88,32,5c,        cmpw  R5c,R32          
3263: d3,0f,           jnc   3274             if ((uns) RPM_flt2 >= R32)  {
3265: 71,f7,a9,        an2b  Ra9,f7           Over_1k_rpm = 0; 
3268: 20,0a,           sjmp  3274             goto 3274;

326a: 8b,01,44,24,5c,  cmpw  R5c,[2444]           ## set flag at 1000 upwards
326f: db,03,           jc    3274             if ((uns) RPM_flt2 < RPM_1000)  {
3271: 91,08,a9,        orb   Ra9,8            Over_1k_rpm = 1;   }  }
3274: e7,41,f9,        jump  2bb8             goto MON_EXIT;
 

############################ 
# table lookup proc (byte)  
# R38 = Table Address              
# R30(31) = X value in (cols, across) (after lookup) 
# R32(33) = Y value in (rows, down) (after lookup) 
# R34 = table size  (columns + 1 -> multiplier for R33) 
# R3b = returned value  (R3a flags ?) 
##################
   TabLookup:
3277: 5c,33,34,36,     ml3b  R36,R34,R33      R36 = R34 * R33;
327b: 74,31,36,        ad2b  R36,R31          R36 += R31;
327e: d3,02,           jnc   3282             if ((uns) R36 >= R31)  {
3280: 17,37,           incb  R37              R37++;  }
3282: 64,36,38,        ad2w  R38,R36          R38 += R36;
3285: b2,39,31,        ldb   R31,[R38++]      R31 = [R38++];
3288: b2,38,33,        ldb   R33,[R38]        R33 = [R38];
328b: 28,1c,           scall 32a9             TabInterp();
328d: 64,34,38,        ad2w  R38,R34          R38 += R34;
3290: b2,38,33,        ldb   R33,[R38]        R33 = [R38];
3293: 05,38,           decw  R38              R38--;
3295: b2,38,31,        ldb   R31,[R38]        R31 = [R38];
3298: b0,3b,34,        ldb   R34,R3b          R34 = R3b;
329b: 28,0c,           scall 32a9             TabInterp();
329d: b0,3b,33,        ldb   R33,R3b          R33 = R3b;
32a0: b0,34,31,        ldb   R31,R34          R31 = R34;
32a3: b0,32,30,        ldb   R30,R32          R30 = R32;
32a6: 28,01,           scall 32a9             TabInterp();
32a8: f0,              ret                    return
 
 ## two way table interpolate ?? #####
   TabInterp:
32a9: 5c,33,30,3a,     ml3b  R3a,R30,R33      R3a = R30 * R33;
32ad: 5c,31,30,36,     ml3b  R36,R30,R31      R36 = R30 * R31;
32b1: 68,36,3a,        sb2w  R3a,R36          R3a -= R36;
32b4: 74,31,3b,        ad2b  R3b,R31          R3b += R31;
32b7: 65,80,00,3a,     ad2w  R3a,80           R3a += 80;
32bb: f0,              ret                    return
 
############################# 
 function lookup with linear interpolate 
 Signed and Unsigned Word 
 R32 = lookup table 
 R34 = value in  (Vin) 
 R38 = value out (Vout) (Word) 
 (LU = lookup) 
#############################
   UWFuncLu:
32bc: 91,02,f6,        orb   Rf6,2            UNS_COMP = 1;      ## set unsigned compare
   SWFuncLu:
32bf: 8b,32,04,34,     cmpw  R34,[R32+4]           ## compare IN to next table row
32c3: 31,f6,04,        jnb   B1,Rf6,32ca      if (!UNS_COMP) goto 32ca;     ## jump if signed compare
32c6: db,0a,           jc    32d2             if ((uns) R34 >= [R32+4]) goto 32d2;     ## do unsigned compare
32c8: 20,02,           sjmp  32cc             goto 32cc;

32ca: d6,06,           jge   32d2             if (R34 < [R32+4])  {     ## do signed compare
32cc: 65,04,00,32,     ad2w  R32,4            R32 += 4;     ## skip to next table row
32d0: 27,ed,           sjmp  32bf             goto SWFuncLu;  }

32d2: a2,33,36,        ldw   R36,[R32++]      R36 = [R32++];     ## R36 = high VOUT value
32d5: a2,33,38,        ldw   R38,[R32++]      R38 = [R32++];     ## R38 = low  (next)LU value (R34>Vin>R38)
32d8: 6a,32,36,        sb2w  R36,[R32]        R36 -= [R32];     ## R36 = LU gap (between rows)
32db: 6a,33,34,        sb2w  R34,[R32++]      R34 -= [R32++];     ## R34 = Vin_Delta (VIN - low LU)
32de: 6a,32,38,        sb2w  R38,[R32]        R38 -= [R32];     ## R38 = Vout gap (between rows) 
32e1: 31,f6,04,        jnb   B1,Rf6,32e8      if (!UNS_COMP) goto 32e8;     ## Is this Signed lookup ??
32e4: db,09,           jc    32ef             if ((uns) R38 >= [R32]) goto 32ef;     ## VOUT increment is Y +ve or unsigned lookup
32e6: 20,02,           sjmp  32ea             goto 32ea;

32e8: d6,05,           jge   32ef             if (R38 < [R32])  {
32ea: 91,01,f6,        orb   Rf6,1            NEG_FLAG = 1;      ## remember negative LU for later ...
32ed: 03,38,           negw  R38              R38 = -R38;  }
32ef: 6c,34,38,        ml2w  R38,R34          R38 *= R34;
32f2: 8c,36,38,        divw  R38,R36          R38 = R38 / R36;     ## R38 = (Vout_gap*VIN_delta)/LU_gap = Vout_Delta
32f5: 30,f6,02,        jnb   B0,Rf6,32fa      if (NEG_FLAG)  {
32f8: 03,38,           negw  R38              R38 = -R38;  }
32fa: 66,32,38,        ad2w  R38,[R32]        R38 += [R32];     ## R38 = Vout_delta+lower_LU;
32fd: 71,fc,f6,        an2b  Rf6,fc           NEG_FLAG = 0; UNS_COMP = 0; 
3300: f0,              ret                    
 

 #################################### 
 # suspect this calculates rate of change & average 
 # for PIP intervals (last and this) to give improved 
 # time resolution for next SPOUT. 
 # 
 # SPOUT = (120 + fixed - Advance)/120 - (ThisPIP + lastPIP)/lastPIP ? 
 # Rac fed in ?? 
 # 
 #####################################
   IGN_clc2:
3301: 3e,b5,02,        jb    B6,Rb5,3306      if (NEW_PIP_INTVL) goto 3306;
3304: 20,eb,           sjmp  33f1             goto endfunc;

3306: fa,              di                     
3307: ff,              nop                    
3308: a0,44,ba,        ldw   Rba,R44          Rba = PIP_Interval;
330b: a3,01,28,01,b8,  ldw   Rb8,[128]        Rb8 = Last_PIP_Intvl;
3310: a0,46,3e,        ldw   R3e,R46          R3e = Last_PIP_HI_PW;
3313: a0,1e,3c,        ldw   R3c,R1e          R3c = PIP_High_PW;
3316: fb,              ei                     
3317: 71,bf,b5,        an2b  Rb5,bf           NEW_PIP_INTVL = 0; 
331a: 48,b8,ba,36,     sb3w  R36,Rba,Rb8      R36 = Rba - Rb8;   # Difference in PIP intervals
331e: db,02,           jc    3322             if ((uns) Rba < Rb8)  {
3320: 03,36,           negw  R36              R36 = -R36;  }   # get absolute difference
3322: 4c,ac,ba,30,     ml3w  R30,Rba,Rac      R30 = (long) Rba * Rac;   # First time Rac used here - must start at zero
3326: 88,32,36,        cmpw  R36,R32          
3329: d1,02,           jleu  332d             if ((uns) R36 <= R32) goto 332d;
332b: 20,b4,           sjmp  33e1             goto 33e1;

332d: 01,34,           clrw  R34              R34 = 0;
332f: 8c,ba,34,        divw  R34,Rba          R34 = R34 / Rba;
3332: d5,02,           jnv   3336             if (!overflow) goto 3336;
3334: 20,bb,           sjmp  33f1             goto endfunc;

3336: a0,34,30,        ldw   R30,R34          R30 = R34;
3339: 6c,3c,30,        ml2w  R30,R3c          R30 *= R3c;
333c: 48,3e,3c,30,     sb3w  R30,R3c,R3e      R30 = R3c - R3e;
3340: db,02,           jc    3344             if ((uns) R3c < R3e)  {
3342: 03,30,           negw  R30              R30 = -R30;  }
3344: 4d,99,19,ac,38,  ml3w  R38,Rac,1999     R38 = (long) Rac * 1999;   # = 6553 
3349: a0,3a,36,        ldw   R36,R3a          R36 = R3a;
334c: 89,41,00,34,     cmpw  R34,41           
3350: d3,70,           jnc   33c2             if ((uns) R34 < 41) goto 33c2;
3352: 08,01,3a,        shrw  R3a,1            R3a = R3a >> 1; (log)
3355: a1,00,80,38,     ldw   R38,8000         R38 = 8000;
3359: 68,3a,38,        sb2w  R38,R3a          R38 -= R3a;
335c: db,02,           jc    3360             if ((uns) R38 >= R3a) goto 3360;
335e: 20,91,           sjmp  33f1             goto endfunc;

3360: 6c,32,38,        ml2w  R38,R32          R38 *= R32;
3363: 0d,01,38,        shldw R38,1            R38 = (long) R38 << 1;
3366: 88,3a,30,        cmpw  R30,R3a          
3369: d3,76,           jnc   33e1             if ((uns) R30 < R3a) goto 33e1;
336b: 08,01,36,        shrw  R36,1            R36 = R36 >> 1; (log)
336e: 65,00,80,36,     ad2w  R36,8000         R36 += 8000;
3372: db,7d,           jc    33f1             if ((uns) R36 < 8000)  {
3374: 4c,32,36,38,     ml3w  R38,R36,R32      R38 = (long) R36 * R32;
3378: 0d,01,38,        shldw R38,1            R38 = (long) R38 << 1;
337b: 88,3a,30,        cmpw  R30,R3a          
337e: d9,61,           jgtu  33e1             if ((uns) R30 > R3a ) goto 33e1;
3380: 44,b8,ba,36,     ad3w  R36,Rba,Rb8      R36 = Rba + Rb8;
3384: dd,6b,           jv    33f1             if (overflow) goto endfunc;
3386: 01,34,           clrw  R34              R34 = 0;
3388: 44,3e,3c,30,     ad3w  R30,R3c,R3e      R30 = R3c + R3e;
338c: dd,63,           jv    33f1             if (overflow) goto endfunc;
338e: 0c,02,34,        shrdw R34,2            R34 = (long) R34 >> 2; (log)
3391: 8c,30,34,        divw  R34,R30          R34 = R34 / R30;
3394: dd,5b,           jv    33f1             if (overflow) goto endfunc;
3396: a0,f0,32,        ldw   R32,Rf0          R32 = IGN_ELAPSE;
3399: a3,01,42,24,36,  ldw   R36,[2442]       R36 = [2442];     ## => 12.5% of change ?
339e: ef,40,fc,        call  2fe1             Sfilter();
33a1: a0,3e,f0,        ldw   Rf0,R3e          IGN_ELAPSE = R3e;
33a4: 89,33,73,f0,     cmpw  Rf0,7333         
33a8: db,04,           jc    33ae             if ((uns) IGN_ELAPSE < 7333)  {
33aa: a1,33,73,f0,     ldw   Rf0,7333         IGN_ELAPSE = 7333;  }     ##  7333 = 29491 ? /4.8 = 6144 ?
33ae: 89,cc,8c,f0,     cmpw  Rf0,8ccc         
33b2: d1,04,           jleu  33b8             if ((uns) IGN_ELAPSE > 8ccc )  {
33b4: a1,cc,8c,f0,     ldw   Rf0,8ccc         IGN_ELAPSE = 8ccc;  }     ##  8ccc = -29492 ?
33b8: 69,47,01,ac,     sb2w  Rac,147          Rac -= 147;
33bc: d6,02,           jge   33c0             if (Rac < 147)  {
33be: 01,ac,           clrw  Rac              Rac = 0;  }
33c0: 20,2f,           sjmp  33f1             goto endfunc;

33c2: a0,30,34,        ldw   R34,R30          R34 = R30;
33c5: 08,01,36,        shrw  R36,1            R36 = R36 >> 1; (log)
33c8: 65,00,80,36,     ad2w  R36,8000         R36 += 8000;
33cc: dd,23,           jv    33f1             if (overflow) goto endfunc;
33ce: a0,36,38,        ldw   R38,R36          R38 = R36;
33d1: 4d,41,00,3c,30,  ml3w  R30,R3c,41       R30 = (long) R3c * 41;
33d6: 6c,32,38,        ml2w  R38,R32          R38 *= R32;
33d9: 0d,01,38,        shldw R38,1            R38 = (long) R38 << 1;
33dc: 88,3a,34,        cmpw  R34,R3a          
33df: d1,9f,           jleu  3380             if ((uns) R34 <= R3a) goto 3380;
33e1: 65,cc,0c,ac,     ad2w  Rac,ccc          Rac += ccc;     ## ccc = 3276 ??  
33e5: dd,06,           jv    33ed             if (overflow) goto 33ed;
33e7: 89,00,80,ac,     cmpw  Rac,8000         
33eb: d3,04,           jnc   33f1             if ((uns) Rac >= 8000)  {
33ed: a1,00,80,ac,     ldw   Rac,8000         Rac = 8000;  }  }
   endfunc:
33f1: e7,c4,f7,        jump  2bb8             goto MON_EXIT;

   VAF_join_clc:
33f4: b3,01,4c,24,30,  ldb   R30,[244c]       R30 = FLGS(B3,B0);
33f9: a1,00,40,22,     ldw   R22,4000         R22 = 4000;
33fd: a0,9c,38,        ldw   R38,R9c          R38 = VAF1_flow;
3400: 6f,01,06,24,38,  ml2w  R38,[2406]       R38 *= VAF_SCALE_32768;
3405: 67,01,0a,24,3a,  ad2w  R3a,[240a]       R3a += VAF_TRIM2_0;
340a: 47,01,08,24,3a,3e, ad3w  R3e,R3a,[2408]   R3e = R3a + VAF_TRIM_0;     ## R3e = VAF_flow/2 ;
3410: 37,3f,05,        jnb   B7,R3f,3418      if (No_Enrich)  {
3413: 01,3e,           clrw  R3e              R3e = 0;
3415: 91,01,69,        orb   R69,1            DBG_VAF = 1;   }
3418: c3,01,2a,01,3e,  stw   R3e,[12a]        DBG_Flow = R3e;
341d: 28,4d,           scall 346c             VAF_clc1();
341f: a0,3c,64,        ldw   R64,R3c          VAF2_avg = R3c;
3422: 28,7d,           scall 34a1             VAF_clc2();
3424: a0,3c,d0,        ldw   Rd0,R3c          Inj1VAF = R3c;
3427: a0,9a,38,        ldw   R38,R9a          R38 = VAF2_flow;
342a: 6f,01,00,24,38,  ml2w  R38,[2400]       R38 *= VAF_SCALE_32768;
342f: 67,01,04,24,3a,  ad2w  R3a,[2404]       R3a += VAF_TRIM2_0;
3434: 47,01,02,24,3a,3e, ad3w  R3e,R3a,[2402]   R3e = R3a + VAF_TRIM_0;
343a: 37,3f,05,        jnb   B7,R3f,3442      if (No_Enrich)  {
343d: 01,3e,           clrw  R3e              R3e = 0;
343f: 91,01,69,        orb   R69,1            DBG_VAF = 1;   }
3442: a0,3e,74,        ldw   R74,R3e          R74 = R3e;
3445: 28,25,           scall 346c             VAF_clc1();
3447: a0,3c,62,        ldw   R62,R3c          VAF1_avg = R3c;
344a: 33,30,17,        jnb   B3,R30,3464      if (B3_R30)  {
344d: 9b,01,6a,24,00,  cmpb  0,[246a]         
3452: df,03,           je    3457             if (0 == 1) goto 3457;
3454: 3f,1a,0d,        jb    B7,R1a,3464      if (!450to600rpmF)  {
3457: 44,62,64,3c,     ad3w  R3c,R64,R62      R3c = VAF2_avg + VAF1_avg;
345b: 08,01,3c,        shrw  R3c,1            R3c = R3c >> 1; (log)
345e: a0,3c,62,        ldw   R62,R3c          VAF1_avg = R3c;
3461: a0,3c,64,        ldw   R64,R3c          VAF2_avg = R3c;  }  }
3464: 28,3b,           scall 34a1             VAF_clc2();
3466: a0,3c,ce,        ldw   Rce,R3c          Inj0VAF = R3c;
3469: e7,4c,f7,        jump  2bb8             goto MON_EXIT;
 
 ##################### 
 # R3e = VAF_flow ? 
 # answer in R3c, limited scale 
 ######################


   VAF_clc1:
346c: 01,3c,           clrw  R3c              R3c = 0;
346e: 8c,70,3c,        divw  R3c,R70          R3c = R3c / RPMx4;     ## R3e/RPMx4 ....
3471: dd,16,           jv    3489             if (overflow) goto 3489;
3473: 01,3e,           clrw  R3e              R3e = 0;
3475: 3a,30,06,        jb    B2,R30,347e      if (!B2_R30)  {     ## Never true
3478: 8d,06,00,3c,     divw  R3c,6            R3c = R3c / 6;     ## flow per 6 cyl (sync ?)
347c: 20,04,           sjmp  3482             goto 3482;  }

347e: 8d,0c,00,3c,     divw  R3c,c            R3c = R3c / c;     ## 12 cyl split? - Not Used in this binary
3482: 8b,01,20,24,3c,  cmpw  R3c,[2420]       
3487: d1,08,           jleu  3491             if ((uns) R3c > 5872 )  {
3489: a3,01,20,24,3c,  ldw   R3c,[2420]       R3c = 5872;
348e: 91,01,69,        orb   R69,1            DBG_VAF = 1;   }
3491: 33,2c,0c,        jnb   B3,R2c,34a0      if (Add<2500_IGN_dly)  {
3494: 8b,01,22,24,3c,  cmpw  R3c,[2422]       
3499: db,05,           jc    34a0             if ((uns) R3c < 2097)  {
349b: a3,01,22,24,3c,  ldw   R3c,[2422]       R3c = 2097;  }  }
34a0: f0,              ret                    return
 
 ###################### 
 # returns par for injection time calc 
 # R3c in AND out 
 # where IN is VAFPAR and out is INJPAR 
 # ANS = (IN * 2238)/(INJSIZE?/4) 
 # INJPAR = (VAFPAR * 2238)/(INJSIZE?/4) 
 ######################


   VAF_clc2:
34a1: 6d,be,08,3c,     ml2w  R3c,8be          R3c *= 8be;     ## 8be = 2238 ??
34a5: a3,01,1e,24,34,  ldw   R34,[241e]       R34 = INJSZ(25166);
34aa: 6c,22,34,        ml2w  R34,R22          R34 *= R22;     ## R22 = 0x4000 (16384)
34ad: a0,36,34,        ldw   R34,R36          R34 = R36;     ## R34 = R34/4 effectively ?
34b0: 8c,34,3c,        divw  R3c,R34          R3c = R3c / R34;
34b3: d5,08,           jnv   34bd             if (overflow)  {
34b5: a3,01,a4,24,3c,  ldw   R3c,[24a4]       R3c = 32768;
34ba: 91,01,69,        orb   R69,1            DBG_VAF = 1;   }
34bd: f0,              ret                    

   RPM_calc_1:
34be: b3,01,29,24,34,  ldb   R34,[2429]       R34 = 0;
34c3: 99,00,34,        cmpb  R34,0            
34c6: df,2f,           je    34f7             if (R34 != 0)  {     ## always TRUE 

    ################## code ignored to 34f5 #################
34c8: 11,2c,           clrb  R2c              RPM_flags = 0;
34ca: 3f,34,05,        jb    B7,R34,34d2      if (!B7_R34)  {
34cd: 71,3f,1a,        an2b  R1a,3f           Set_10_BTDC = 0; 450to600rpmF = 0; 
34d0: 20,15,           sjmp  34e7             goto 34e7;  }

34d2: 3f,1a,0c,        jb    B7,R1a,34e1      if (!450to600rpmF)  {
34d5: 8b,01,6c,24,c0,  cmpw  Rc0,[246c]       
34da: d3,05,           jnc   34e1             if ((uns) T0WmSU >= 12sec_TMR0)  {
34dc: a3,01,6c,24,c0,  ldw   Rc0,[246c]       T0WmSU = 12sec_TMR0;  }  }
34e1: 91,80,1a,        orb   R1a,80           450to600rpmF = 1; 
34e4: 71,bf,1a,        an2b  R1a,bf           Set_10_BTDC = 0; 
34e7: 36,34,05,        jnb   B6,R34,34ef      if (B6_R34)  {
34ea: 91,40,1a,        orb   R1a,40           Set_10_BTDC = 1; 
34ed: 20,a8,           sjmp  3597             goto 3597;  }

34ef: b0,34,2c,        ldb   R2c,R34          RPM_flags = R34;
34f2: 71,3f,2c,        an2b  R2c,3f           RPM_F6 = 0; RPM_F7 = 0; 
34f5: 20,a0,           sjmp  3597             goto 3597;  }
     ################### end of ignored block #################


34f7: a3,01,10,24,30,  ldw   R30,[2410]       R30 = RPM_450;
34fc: 37,1a,0c,        jnb   B7,R1a,350b      if (!450to600rpmF) goto 350b;
34ff: 67,01,ae,24,30,  ad2w  R30,[24ae]       R30 += RPM_50;
3504: 88,30,70,        cmpw  R70,R30          
3507: d9,24,           jgtu  352d             if ((uns) RPMx4 > R30 ) goto 352d;
3509: 20,8c,           sjmp  3597             goto 3597;

350b: 36,1a,29,        jnb   B6,R1a,3537      if (!Set_10_BTDC) goto 3537;   ## 450to600 flag not set if gets here
350e: 88,30,70,        cmpw  R70,R30          
3511: d9,13,           jgtu  3526             if ((uns) RPMx4 > R30 ) goto 3526;
3513: 91,c0,1a,        orb   R1a,c0           Set_10_BTDC = 1; 450to600rpmF = 1; 
3516: 11,2c,           clrb  R2c              RPM_flags = 0;
3518: 8b,01,6c,24,c0,  cmpw  Rc0,[246c]       
351d: d3,78,           jnc   3597             if ((uns) T0WmSU >= 12sec_TMR0)  {
351f: a3,01,6c,24,c0,  ldw   Rc0,[246c]       T0WmSU = 12sec_TMR0;
3524: 20,71,           sjmp  3597             goto 3597;

3526: 8b,01,12,24,70,  cmpw  R70,[2412]       
352b: d9,11,           jgtu  353e             if ((uns) RPMx4 <= RPM_600)  {
352d: 71,7f,1a,        an2b  R1a,7f           450to600rpmF = 0; 
3530: 91,40,1a,        orb   R1a,40           Set_10_BTDC = 1; 
3533: 11,2c,           clrb  R2c              RPM_flags = 0;
3535: 20,60,           sjmp  3597             goto 3597;

3537: 8b,01,14,24,70,  cmpw  R70,[2414]       
353c: d3,ef,           jnc   352d             if ((uns) RPMx4 < RPM_505) goto 352d;  }
353e: 71,3f,1a,        an2b  R1a,3f           Set_10_BTDC = 0; 450to600rpmF = 0; 
3541: 9b,01,28,24,9f,  cmpb  R9f,[2428]       
3546: d6,0a,           jge   3552             if (ECT_start < 40)  {
3548: 88,24,ea,        cmpw  Rea,R24          
354b: db,05,           jc    3552             if ((uns) T2WSU < ECT_StartLUTmr)  {
354d: b1,01,2c,        ldb   R2c,1            RPM_flags = 1;
3550: 20,45,           sjmp  3597             goto 3597;  }  }

3552: 30,20,37,        jnb   B0,R20,358c      if (!TPS_F0) goto 358c;
3555: 3a,2c,07,        jb    B2,R2c,355f      if (RPM_F2) goto 355f;
3558: 8b,01,16,24,70,  cmpw  R70,[2416]       
355d: db,11,           jc    3570             if ((uns) RPMx4 >= RPM_1500) goto 3570;
355f: 8b,01,18,24,70,  cmpw  R70,[2418]       
3564: db,26,           jc    358c             if ((uns) RPMx4 >= RPM_1800) goto 358c;
3566: 31,2c,02,        jnb   B1,R2c,356b      if (Inj_Inhibit)  {
3569: 01,4e,           clrw  R4e              T7WmSU = 0;  }
356b: b1,04,2c,        ldb   R2c,4            RPM_flags = 4;   ## B2 RPM_flags set
356e: 20,27,           sjmp  3597             goto 3597;

3570: 9b,01,1a,24,9f,  cmpb  R9f,[241a]       
3575: d2,10,           jgt   3587             if (ECT_start <= 127)  {
3577: 9b,01,1b,24,9f,  cmpb  R9f,[241b]       
357c: da,09,           jle   3587             if (ECT_start > -20)  {
357e: 8b,01,1c,24,ea,  cmpw  Rea,[241c]       
3583: d9,02,           jgtu  3587             if ((uns) T2WSU > 0 ) goto 3587;
3585: 27,d8,           sjmp  355f             goto 355f;  }  }

3587: b1,02,2c,        ldb   R2c,2            RPM_flags = 2;     ## RPM_F2 = 1 others cleared
358a: 20,0b,           sjmp  3597             goto 3597;

358c: 32,20,05,        jnb   B2,R20,3594      if (TPS_BIG_DELTA)  {
358f: b1,08,2c,        ldb   R2c,8            RPM_flags = 8;     ## RPM_F4 = 1 others cleared
3592: 20,03,           sjmp  3597             goto 3597;  }

3594: b1,10,2c,        ldb   R2c,10           RPM_flags = 10;  }     ## RPM_F5 = 1 others cleared
3597: 01,30,           clrw  R30              R30 = 0;
3599: 51,c0,1a,30,     an3b  R30,R1a,c0       SPOUT_delay_off = 0; SPOUT_Delay_on = 0; SPOUT_state = 0; Ignore_IgnImm = 0; IgnImmed1 = 0; IgnImmed2 = 0; 
359d: 90,2c,30,        orb   R30,R2c          R30 |= RPM_flags;
35a0: 32,5a,04,        jnb   B2,R5a,35a7      if (PUMP_ON_RQD)  {
35a3: 81,00,01,30,     orw   R30,100          B8_R30 = 1;   }
35a7: 88,00,18,        cmpw  R18,0            
35aa: df,04,           je    35b0             if (R18 != 0)  {
35ac: 81,00,02,30,     orw   R30,200          B9_R30 = 1;   }
35b0: c3,01,5a,01,30,  stw   R30,[15a]        DBG_SP = R30;     ## is this changed flags for debug ?
35b5: e7,00,f6,        jump  2bb8             goto MON_EXIT;

   Air_Flow_clc:
35b8: a1,9c,27,32,     ldw   R32,279c         R32 = Vss_LU;
35bc: a0,52,34,        ldw   R34,R52          R34 = Vss_val;
35bf: ef,fa,fc,        call  32bc             UWFuncLu();
35c2: a0,38,50,        ldw   R50,R38          Vss_Comp = R38;    ## Vss_comp set only here
35c5: a1,38,28,32,     ldw   R32,2838         R32 = ECT_SCALE_11;
35c9: b0,72,35,        ldb   R35,R72          R35 = ECT_val;
35cc: 11,34,           clrb  R34              R34 = 0;
35ce: ef,ee,fc,        call  32bf             SWFuncLu();
35d1: a0,38,6a,        ldw   R6a,R38          R6a = R38;    ## R6a scaled ECT 0 - 11
35d4: a1,31,25,ba,     ldw   Rba,2531         Rba = VAFxECT_INJ;
35d8: a0,62,34,        ldw   R34,R62          R34 = VAF1_avg;
35db: ef,a7,01,        call  3785             VAFECTLu();
35de: a0,3a,6e,        ldw   R6e,R3a          Inj0VafEct = R3a;
35e1: a1,31,25,ba,     ldw   Rba,2531         Rba = VAFxECT_INJ;
35e5: a0,64,34,        ldw   R34,R64          R34 = VAF2_avg;
35e8: ef,9a,01,        call  3785             VAFECTLu();
35eb: a0,3a,a0,        ldw   Ra0,R3a          Inj1VafEct = R3a;
35ee: a1,00,40,a2,     ldw   Ra2,4000         Flow_par? = 4000;
35f2: 3f,1a,49,        jb    B7,R1a,363e      if (!450to600rpmF)  {
35f5: a1,cc,27,32,     ldw   R32,27cc         R32 = ECT_LU8;
35f9: b0,72,34,        ldb   R34,R72          R34 = ECT_val;
35fc: ef,a0,f9,        call  2f9f             SBFuncLu();
35ff: ac,38,a4,        ldzbw Ra4,R38          Ra4 = (uns) R38;
3602: 88,ea,a4,        cmpw  Ra4,Rea          
3605: d1,37,           jleu  363e             if ((uns) Ra4 > T2WSU )  {
3607: a1,b4,27,32,     ldw   R32,27b4         R32 = ECT_LU7;
360b: b0,72,34,        ldb   R34,R72          R34 = ECT_val;
360e: ef,8e,f9,        call  2f9f             SBFuncLu();
3611: ac,38,3a,        ldzbw R3a,R38          R3a = (uns) R38;
3614: 09,01,3a,        shlw  R3a,1            R3a = R3a << 1;
3617: 4c,ea,3a,34,     ml3w  R34,R3a,Rea      R34 = (long) R3a * T2WSU;
361b: 8c,a4,34,        divw  R34,Ra4          R34 = R34 / Ra4;
361e: d5,05,           jnv   3625             if (overflow)  {
3620: 91,08,69,        orb   R69,8            Flow_OVF = 1; 
3623: 20,19,           sjmp  363e             goto 363e;  }

3625: 09,07,3a,        shlw  R3a,7            R3a = R3a << 7;
3628: 65,00,40,3a,     ad2w  R3a,4000         R3a += 4000;
362c: db,09,           jc    3637             if ((uns) R3a >= 4000) goto 3637;
362e: 09,07,34,        shlw  R34,7            R34 = R34 << 7;
3631: 48,34,3a,a2,     sb3w  Ra2,R3a,R34      Flow_par? = R3a - R34;     ## Ra2 then used in InjCalc  (38ba)
3635: db,07,           jc    363e             if ((uns) R3a < R34)  {
3637: a1,00,40,a2,     ldw   Ra2,4000         Flow_par? = 4000;
363b: 91,08,69,        orb   R69,8            Flow_OVF = 1;   }  }  }
363e: e7,77,f5,        jump  2bb8             goto MON_EXIT;

   InjCalc3:
3641: b0,97,34,        ldb   R34,R97          R34 = VAF2_rawhb;
3644: 35,18,0b,        jnb   B5,R18,3652      if (VAF2Fail)  {
3647: b0,7f,34,        ldb   R34,R7f          R34 = VAF1_rawhb;
364a: 31,18,05,        jnb   B1,R18,3652      if (VAF1Fail)  {
364d: b3,01,3b,24,34,  ldb   R34,[243b]       R34 = [243b];  }  }
3652: 29,7c,           scall 37d0             InjCalcLimp();
3654: c3,01,60,01,38,  stw   R38,[160]        Inj_Par_Limp = R38;
3659: a0,3c,a6,        ldw   Ra6,R3c          VAF0_accel = R3c;
365c: b0,7f,34,        ldb   R34,R7f          R34 = VAF1_rawhb;
365f: 31,18,0b,        jnb   B1,R18,366d      if (VAF1Fail)  {
3662: b0,97,34,        ldb   R34,R97          R34 = VAF2_rawhb;
3665: 35,18,05,        jnb   B5,R18,366d      if (VAF2Fail)  {
3668: b3,01,3b,24,34,  ldb   R34,[243b]       R34 = [243b];  }  }
366d: 29,61,           scall 37d0             InjCalcLimp();
366f: c3,01,60,01,38,  stw   R38,[160]        Inj_Par_Limp = R38;
3674: a0,3c,bc,        ldw   Rbc,R3c          VAF1_accel = R3c;
3677: 3f,1a,06,        jb    B7,R1a,3680      if (!450to600rpmF)  {
367a: b1,10,da,        ldb   Rda,10           Inj0Par3 = 10;
367d: b1,10,db,        ldb   Rdb,10           Inj1Par3 = 10;  }
3680: e7,35,f5,        jump  2bb8             goto MON_EXIT;

   TPS_Accelp:
3683: 37,1a,08,        jnb   B7,R1a,368e      if (450to600rpmF)  {
3686: b1,80,dc,        ldb   Rdc,80           Inj0Aclenr = 80;
3689: b1,80,dd,        ldb   Rdd,80           Inj1Aclenr = 80;
368c: 20,43,           sjmp  36d1             goto 36d1;  }

368e: a0,e2,32,        ldw   R32,Re2          R32 = Re2;
3691: a0,aa,b8,        ldw   Rb8,Raa          Rb8 = TPS_delta;
3694: b0,dc,3e,        ldb   R3e,Rdc          R3e = Inj0Aclenr;
3697: a0,a6,3c,        ldw   R3c,Ra6          R3c = VAF0_accel;
369a: a0,de,30,        ldw   R30,Rde          R30 = T1WmSU;
369d: a0,ca,ba,        ldw   Rba,Rca          Rba = Rca;
36a0: 29,82,           scall 3824             Accel_pump();
36a2: 3f,3f,0c,        jb    B7,R3f,36b1      if (!No_Enrich)  {
36a5: b0,3e,dc,        ldb   Rdc,R3e          Inj0Aclenr = R3e;  # NOte 4 pars IN and OUT if bit not set
36a8: a0,aa,e2,        ldw   Re2,Raa          Re2 = TPS_delta;
36ab: a0,ba,ca,        ldw   Rca,Rba          Rca = Rba;
36ae: a0,30,de,        ldw   Rde,R30          T1WmSU = R30;  }
36b1: a0,e4,32,        ldw   R32,Re4          R32 = Re4;
36b4: b0,dd,3e,        ldb   R3e,Rdd          R3e = Inj1Aclenr;
36b7: a0,bc,3c,        ldw   R3c,Rbc          R3c = VAF1_accel;
36ba: a0,e0,30,        ldw   R30,Re0          R30 = T4WmSU;
36bd: a0,cc,ba,        ldw   Rba,Rcc          Rba = Rcc;
36c0: 29,62,           scall 3824             Accel_pump();
36c2: 3f,3f,0c,        jb    B7,R3f,36d1      if (!No_Enrich)  {
36c5: b0,3e,dd,        ldb   Rdd,R3e          Inj1Aclenr = R3e;
36c8: a0,aa,e4,        ldw   Re4,Raa          Re4 = TPS_delta;
36cb: a0,ba,cc,        ldw   Rcc,Rba          Rcc = Rba;
36ce: a0,30,e0,        ldw   Re0,R30          T4WmSU = R30;  }
36d1: e7,e4,f4,        jump  2bb8             goto MON_EXIT;

   InjBaseFuel:
36d4: a1,b8,24,3c,     ldw   R3c,24b8         R3c = Base_Fuel;
36d8: a0,62,30,        ldw   R30,R62          R30 = VAF1_avg;
36db: ef,c7,00,        call  37a5             BaseFuelLU();
36de: b0,3b,28,        ldb   R28,R3b          Inj0Base = R3b;
36e1: a1,b8,24,3c,     ldw   R3c,24b8         R3c = Base_Fuel;
36e5: a0,64,30,        ldw   R30,R64          R30 = VAF2_avg;
36e8: ef,ba,00,        call  37a5             BaseFuelLU();
36eb: b0,3b,29,        ldb   R29,R3b          Inj1Base = R3b;
36ee: e7,c7,f4,        jump  2bb8             goto MON_EXIT;
 
############################## 
# ? ? ? ? 
# R30 = 40 
# R30 -= 3e  ...  R30 = 2. 
# (timer7 * 2)/600 +3e   while timer7 < 600 
# otherwise set to 0x40 ...... 
##############################
   InjCalcTimer:
36f1: b1,40,30,        ldb   R30,40           R30 = 40;
36f4: 32,2c,1b,        jnb   B2,R2c,3712      if (RPM_F2)  {
36f7: 8b,01,60,24,4e,  cmpw  R4e,[2460]       
36fc: db,14,           jc    3712             if ((uns) T7WmSU < 600mS_TMR7)  {
36fe: 7b,01,62,24,30,  sb2b  R30,[2462]       R30 -= [2462];
3703: 11,31,           clrb  R31              R31 = 0;
3705: 6c,4e,30,        ml2w  R30,R4e          R30 *= T7WmSU;
3708: 8f,01,60,24,30,  divw  R30,[2460]       R30 = R30 / 600mS_TMR7;
370d: 77,01,62,24,30,  ad2b  R30,[2462]       R30 += [2462];  }  }
3712: c7,01,59,01,30,  stb   R30,[159]        Inj_Time_Par = R30;
3717: e7,9e,f4,        jump  2bb8             goto MON_EXIT;
 

###################################### 
#  Master Inject Time Calculation ? 
######################################

   InjectTime:
371a: a0,ce,32,        ldw   R32,Rce          R32 = Inj0VAF;
371d: b0,28,2b,        ldb   R2b,R28          R2b = Inj0Base;
3720: a0,6e,ba,        ldw   Rba,R6e          Rba = Inj0VafEct;
3723: b0,dc,3e,        ldb   R3e,Rdc          R3e = Inj0Aclenr;
3726: b0,da,b8,        ldb   Rb8,Rda          Rb8 = Inj0Par3;
3729: a3,01,60,01,38,  ldw   R38,[160]        R38 = Inj_Par_Limp;
372e: 29,8a,           scall 38ba             InjCalc1();
3730: c3,01,4a,01,30,  stw   R30,[14a]        DBG_Inj0Par = R30;     ## used only here (debug?)
3735: a0,3a,c6,        ldw   Rc6,R3a          Inj0Length = R3a;
3738: a0,d0,32,        ldw   R32,Rd0          R32 = Inj1VAF;
373b: b0,29,2b,        ldb   R2b,R29          R2b = Inj1Base;
373e: a0,a0,ba,        ldw   Rba,Ra0          Rba = Inj1VafEct;
3741: b0,dd,3e,        ldb   R3e,Rdd          R3e = Inj1Aclenr;
3744: b0,db,b8,        ldb   Rb8,Rdb          Rb8 = Inj1Par3;
3747: a3,01,60,01,38,  ldw   R38,[160]        R38 = Inj_Par_Limp;
374c: 29,6c,           scall 38ba             InjCalc1();
374e: c3,01,4c,01,30,  stw   R30,[14c]        DBG_Inj1Par = R30;     ## used only here  (debug?)
3753: a0,3a,d8,        ldw   Rd8,R3a          Inj1Length = R3a;
3756: b3,01,4c,24,30,  ldb   R30,[244c]       R30 = FLGS(B3,B0);
375b: 3a,30,05,        jb    B2,R30,3763      if (B2_R30) goto 3763;
375e: 3b,30,07,        jb    B3,R30,3768      if (B3_R30) goto 3768;
3761: 20,1f,           sjmp  3782             goto 3782;

3763: a0,c6,d8,        ldw   Rd8,Rc6          Inj1Length = Inj0Length;
3766: 20,1a,           sjmp  3782             goto 3782;

3768: 4d,74,cb,50,34,  ml3w  R34,R50,cb74     R34 = (long) Vss_Comp * cb74;
376d: 48,36,c6,30,     sb3w  R30,Rc6,R36      R30 = Inj0Length - R36;
3771: 6f,01,a0,24,30,  ml2w  R30,[24a0]       R30 *= 16384;
3776: 0d,02,30,        shldw R30,2            R30 = (long) R30 << 2;
3779: 67,01,a2,24,32,  ad2w  R32,[24a2]       R32 += 13;
377e: 44,32,36,d8,     ad3w  Rd8,R36,R32      Inj1Length = R36 + R32;
3782: e7,33,f4,        jump  2bb8             goto MON_EXIT;
 

###################################### 
#  Compensated VAF ? called against ECT (called 35db, 35e8) 
#  R6a is scaled ECT (0-11) 
#  Rba is lookup table (must be 11 rows ??) seems to be always 2531 
######################################

   VAFECTLu:
3785: a1,a0,28,32,     ldw   R32,28a0         R32 = VAF_SCALE_5;
3789: ef,30,fb,        call  32bc             UWFuncLu();
378c: a0,38,6c,        ldw   R6c,R38          R6c = R38;
378f: a0,6a,30,        ldw   R30,R6a          R30 = R6a;
3792: a0,6c,32,        ldw   R32,R6c          R32 = R6c;
3795: a1,0c,00,34,     ldw   R34,c            R34 = c;
3799: a0,ba,38,        ldw   R38,Rba          R38 = Rba;
379c: ef,d8,fa,        call  3277             TabLookup();
379f: 11,3a,           clrb  R3a              R3a = 0;
37a1: 09,01,3a,        shlw  R3a,1            R3a = R3a << 1;
37a4: f0,              ret                    return

   BaseFuelLU:
37a5: a1,58,28,32,     ldw   R32,2858         R32 = RPM_SCALE_10;
37a9: a0,70,34,        ldw   R34,R70          R34 = RPMx4;
37ac: ef,0d,fb,        call  32bc             UWFuncLu();
37af: a0,38,6a,        ldw   R6a,R38          R6a = R38;
37b2: a1,74,28,32,     ldw   R32,2874         R32 = VAF_SCALE_10;
37b6: a0,30,34,        ldw   R34,R30          R34 = R30;
37b9: ef,00,fb,        call  32bc             UWFuncLu();
37bc: a0,38,6c,        ldw   R6c,R38          R6c = R38;
37bf: a0,6a,30,        ldw   R30,R6a          R30 = R6a;
37c2: a0,6c,32,        ldw   R32,R6c          R32 = R6c;
37c5: a1,0b,00,34,     ldw   R34,b            R34 = b;
37c9: a0,3c,38,        ldw   R38,R3c          R38 = R3c;
37cc: ef,a8,fa,        call  3277             TabLookup();
37cf: f0,              ret                    return
 
 ################################# 
 # is this 'limp injection' calculation or is it Crank PW ? 
 # ANSWER in R38 is as Calc1 where 
 #   0-32768 maps to 0-125mS injection time 
 #   R38 in 3.8147 uS units (262 ~ 1 mS) 
 #################################

   InjCalcLimp:
37d0: a1,e4,27,32,     ldw   R32,27e4         R32 = VAF_LU_Inj;
37d4: ef,c5,f7,        call  2f9c             UBFuncLu();
37d7: ac,38,3c,        ldzbw R3c,R38          R3c = (uns) R38;
37da: 37,1a,46,        jnb   B7,R1a,3823      if (450to600rpmF)  {
37dd: a0,70,34,        ldw   R34,R70          R34 = RPMx4;     # Limp calc from here ?
37e0: a1,f0,2a,32,     ldw   R32,2af0         R32 = RPM_LU_Enrich;
37e4: ef,d5,fa,        call  32bc             UWFuncLu();
37e7: b0,38,b9,        ldb   Rb9,R38          Rb9 = R38;
37ea: a1,38,28,32,     ldw   R32,2838         R32 = ECT_SCALE_11;
37ee: b0,72,35,        ldb   R35,R72          R35 = ECT_val;
37f1: 11,34,           clrb  R34              R34 = 0;
37f3: ef,c9,fa,        call  32bf             SWFuncLu();
37f6: a0,38,3e,        ldw   R3e,R38          R3e = R38;
37f9: a1,d0,2a,32,     ldw   R32,2ad0         R32 = SCALE_TM0_5;
37fd: a0,c0,34,        ldw   R34,Rc0          R34 = T0WmSU;
3800: ef,b9,fa,        call  32bc             UWFuncLu();
3803: a0,38,32,        ldw   R32,R38          R32 = R38;
3806: a0,3e,30,        ldw   R30,R3e          R30 = R3e;
3809: a1,0c,00,34,     ldw   R34,c            R34 = c;
380d: a1,54,27,38,     ldw   R38,2754         R38 = Fuel_enrich;
3811: ef,63,fa,        call  3277             TabLookup();
3814: 5c,3b,b9,38,     ml3b  R38,Rb9,R3b      R38 = Rb9 * R3b;
3818: af,01,26,24,34,  ldzbw R34,[2426]       R34 = (uns) 83;
381d: 6c,34,38,        ml2w  R38,R34          R38 *= R34;
3820: 0c,05,38,        shrdw R38,5            R38 = (long) R38 >> 5; (log)  }
3823: f0,              ret                    return
 
 ################################# 
 # Accel Pump Enrichment ? 
 # Input Params -  
 #  R32 = Re2, Re4; (last TPS delta ?) 
 #  Rb8 = TPS_delta; 
 #  R3e = Inj0Aclenr, Inj1Aclenr; 
 #  R3c = Inj0_accel, Inj1Accel ?; 
 #  R30 = Timer1, Timer4 ; 
 #  Rba = Rca; 
 # Ouput Params - 
 #  B7 R3f     ? 
 #   R3e  is  Inj0Aclenr 
 #   TPS_Delta (Re2) modified ? 
 #################################
   Accel_pump:
3824: 11,3f,           clrb  R3f              R3f = 0;
3826: af,01,3f,24,38,  ldzbw R38,[243f]       R38 = (uns) TPS_TimTrip(30);
382b: 88,38,30,        cmpw  R30,R38           # timer >= 30 ?
382e: db,07,           jc    3837             if ((uns) R30 >= R38) goto 3837;
3830: 99,80,3e,        cmpb  R3e,80            # Aclenr > 80 ?
3833: d9,55,           jgtu  388a             if ((uns) R3e > 80 ) goto calc2;
3835: 20,7f,           sjmp  38b6             goto 38b6;

3837: 48,32,b8,38,     sb3w  R38,Rb8,R32      R38 = Rb8 - R32; # New TPS Delta ?
383b: db,02,           jc    383f             if ((uns) Rb8 < R32)  {
383d: 01,38,           clrw  R38              R38 = 0;  }
383f: a3,01,24,24,34,  ldw   R34,[2424]       R34 = 1280;
3844: 08,02,34,        shrw  R34,2            R34 = R34 >> 2; (log) # R34 = 1280/4 = 320 ?
3847: 88,34,38,        cmpw  R38,R34          
384a: d3,3e,           jnc   388a             if ((uns) R38 < R34) goto calc2; # R38 < 320 ? 
# calc 1
384c: a1,00,01,34,     ldw   R34,100          R34 = 100;
3850: 68,3c,34,        sb2w  R34,R3c          R34 -= R3c; # R34 = 100 - VAF_accel
3853: a1,02,28,32,     ldw   R32,2802         R32 = Accel_LU;
3857: ef,42,f7,        call  2f9c             UBFuncLu();
385a: b0,38,af,        ldb   Raf,R38          Raf = R38;
385d: a1,d8,27,32,     ldw   R32,27d8         R32 = ECT_Accel;
3861: b0,72,34,        ldb   R34,R72          R34 = ECT_val;
3864: ef,38,f7,        call  2f9f             SBFuncLu();
3867: 7c,af,38,        ml2b  R38,Raf          R38 = R38 * (word)Raf; # R38 = func(ECT)*func(VAF_Accel)
386a: 55,80,39,3e,     ad3b  R3e,R39,80       R3e = R39 + 80;
386e: db,3c,           jc    38ac             if ((uns) R39 >= 80) goto 38ac;
3870: 01,30,           clrw  R30              R30 = 0;
3872: 11,33,           clrb  R33              R33 = 0;
3874: b0,39,32,        ldb   R32,R39          R32 = R39;
3877: b3,01,3e,24,3b,  ldb   R3b,[243e]       R3b = [243e];
387c: 11,3a,           clrb  R3a              R3a = 0;
387e: 8c,3a,30,        divw  R30,R3a          R30 = R30 / R3a;
3881: dd,29,           jv    38ac             if (overflow) goto 38ac;
3883: a0,30,ba,        ldw   Rba,R30          Rba = R30;
3886: 01,30,           clrw  R30              R30 = 0;
3888: 20,2f,           sjmp  38b9             goto endfunc;

   calc2:
388a: 99,80,3e,        cmpb  R3e,80           
388d: d1,20,           jleu  38af             if ((uns) R3e > 80 )  {
388f: a0,30,3a,        ldw   R3a,R30          R3a = R30;
3892: 08,04,3a,        shrw  R3a,4            R3a = R3a >> 4; (log)
3895: af,01,3e,24,34,  ldzbw R34,[243e]       R34 = (uns) [243e];
389a: 68,3a,34,        sb2w  R34,R3a          R34 -= R3a;
389d: d1,10,           jleu  38af             if ((uns) R34 > R3a )  {
389f: 6c,ba,34,        ml2w  R34,Rba          R34 *= Rba;
38a2: dd,08,           jv    38ac             if (!overflow)  {
38a4: 55,80,35,3e,     ad3b  R3e,R35,80       R3e = R35 + 80;
38a8: db,02,           jc    38ac             if ((uns) R35 >= 80) goto 38ac;
38aa: 20,0d,           sjmp  38b9             goto endfunc;  }

38ac: 91,04,69,        orb   R69,4            ACCL_OVF = 1;   }  } # used only here - Overflow in Accel calc ?
38af: b1,80,3e,        ldb   R3e,80           R3e = 80;
38b2: 01,ba,           clrw  Rba              Rba = 0;
38b4: 20,03,           sjmp  38b9             goto endfunc;

38b6: 91,80,3f,        orb   R3f,80           No_Enrich = 1; 
   endfunc:
38b9: f0,              ret                    
 
 ################################# 
 # final Injection time returned from here in R3a 
 # in WDTimer ticks - and something in R30 for monitoring ? 
 # Inputs  
 # R32 = InjnVAF; 
 # R2b = InjnBase; 
 # Rba = InjnVafEct; 
 # R3e = InjnAclenr; 
 # Rb8 = InjnPar3;      Set to +16 if not start? 
 # R38 = Inj_Par;       Only used if flag set,  
 #    
 # ANSWERS  R3a = Injection Time in CPU Timer ticks of 4.8uS 
 # 
 #   NOTE - cb74 (=52084) ticks = 0.25 secs (250mS)  
 #   code at 393a, which defines that 
 #   R38 scaled as (uns) 0-32768 => 0-125mS 
 #    
 # R30 = (Flow*Temp_Comp/65536)*(Base_inj)/128)* 
 #   (Accel_enrich/128)*(Time_enrich/64)*(83/64); 
 # then - 
 # R3a = (R30*(VAF?/4096)+ Vss_comp)*52084/65536; 
 #    
 ##################################


   InjCalc1:
38ba: 3f,1a,6b,        jb    B7,R1a,3928      if (450to600rpmF) goto 3928;
38bd: 4c,ba,a2,38,     ml3w  R38,Ra2,Rba      R38 = (long) Flow_par? * Rba;
38c1: a0,3a,38,        ldw   R38,R3a          R38 = R3a;   ##  Flow x Temp comp? /65536
38c4: ac,2b,34,        ldzbw R34,R2b          R34 = (uns) R2b;
38c7: 6c,34,38,        ml2w  R38,R34          R38 *= R34;   ##  then x Base Inj ?
38ca: 0c,07,38,        shrdw R38,7            R38 = (long) R38 >> 7; (log)
38cd: ac,3e,34,        ldzbw R34,R3e          R34 = (uns) R3e;   ## Then accel enrich ?
38d0: 6c,34,38,        ml2w  R38,R34          R38 *= R34;
38d3: 0c,07,38,        shrdw R38,7            R38 = (long) R38 >> 7; (log)
38d6: af,01,59,01,34,  ldzbw R34,[159]        R34 = (uns) Inj_Time_Par;    ## min = 40
38db: 6c,34,38,        ml2w  R38,R34          R38 *= R34;   ## choke? Timer enrich ?
38de: 0c,06,38,        shrdw R38,6            R38 = (long) R38 >> 6; (log)
38e1: 88,00,3a,        cmpw  R3a,0            
38e4: d7,4c,           jne   3932             if (R3a != 0) goto 3932;
38e6: ac,b8,34,        ldzbw R34,Rb8          R34 = (uns) Rb8;   ## redundant as Rb8 = 16
38e9: 6c,34,38,        ml2w  R38,R34          R38 *= R34;
38ec: 0c,04,38,        shrdw R38,4            R38 = (long) R38 >> 4; (log)
38ef: 88,00,3a,        cmpw  R3a,0            
38f2: d7,3e,           jne   3932             if (R3a != 0) goto 3932;
38f4: 36,1a,10,        jnb   B6,R1a,3907      if (!Set_10_BTDC) goto 3907;
38f7: af,01,26,24,34,  ldzbw R34,[2426]       R34 = (uns) 83;
38fc: 6c,34,38,        ml2w  R38,R34          R38 *= R34;
38ff: 0c,06,38,        shrdw R38,6            R38 = (long) R38 >> 6; (log)   ## x 83/64  Um, why ?
3902: 88,00,3a,        cmpw  R3a,0            
3905: d7,2b,           jne   3932             if (R3a != 0) goto 3932;
3907: 33,2c,10,        jnb   B3,R2c,391a      if (!Add<2500_IGN_dly) goto 391a;
390a: af,01,27,24,34,  ldzbw R34,[2427]       R34 = (uns) -128;   ## redundant
390f: 6c,34,38,        ml2w  R38,R34          R38 *= R34;
3912: 0c,07,38,        shrdw R38,7            R38 = (long) R38 >> 7; (log)
3915: 88,00,3a,        cmpw  R3a,0            
3918: d7,18,           jne   3932             if (R3a != 0) goto 3932;
391a: a0,38,30,        ldw   R30,R38          R30 = R38;       ## R30 Answer HERE ??
391d: 6c,32,38,        ml2w  R38,R32          R38 *= R32;
3920: 0c,0c,38,        shrdw R38,c            R38 = (long) R38 >> c; (log)
3923: 88,00,3a,        cmpw  R3a,0            
3926: d7,0a,           jne   3932             if (R3a != 0) goto 3932;
3928: 64,50,38,        ad2w  R38,R50          R38 += Vss_Comp;
392b: 8b,01,a4,24,38,  cmpw  R38,[24a4]       
3930: d1,08,           jleu  393a             if ((uns) R38 > 32768 )  {
3932: a3,01,a4,24,38,  ldw   R38,[24a4]       R38 = 32768;    ## = 125mS max (32768/65536) * cb74
3937: 91,20,69,        orb   R69,20           InjC_OVF = 1;   } # Used only here - calc o/flow ?
393a: 6d,74,cb,38,     ml2w  R38,cb74         R38 *= cb74;    ## cb74 = 0.25 secs in ticks
393e: 37,1a,05,        jnb   B7,R1a,3946      if (!450to600rpmF) goto 3946;
3941: 32,20,02,        jnb   B2,R20,3946      if (TPS_BIG_DELTA)  {
3944: 01,3a,           clrw  R3a              R3a = 0;  }
3946: f0,              ret                    return

   STO_trip:
3947: 39,2c,0a,        jb    B1,R2c,3954      if (Inj_Inhibit) goto 3954;
394a: 98,00,15,        cmpb  R15,0            
394d: d7,05,           jne   3954             if (TESTREG != 0) goto 3954;
394f: 88,00,70,        cmpw  R70,0            
3952: d7,05,           jne   3959             if (RPMx4 == 0)  {
3954: 71,df,5a,        an2b  R5a,df           TRIP_RQD = 0; 
3957: 20,66,           sjmp  39bf             goto 39bf;  }

3959: a3,01,48,01,34,  ldw   R34,[148]        R34 = TPS_Interval;
395e: 67,01,62,01,34,  ad2w  R34,[162]        R34 += STO_V1;
3963: a3,01,64,01,36,  ldw   R36,[164]        R36 = STO_V2;
3968: a4,00,36,        adcw  R36,0            R36 = R36 + 0; (carry)
396b: a0,34,38,        ldw   R38,R34          R38 = R34;
396e: a0,36,3a,        ldw   R3a,R36          R3a = R36;
3971: 0c,03,38,        shrdw R38,3            R38 = (long) R38 >> 3; (log)
3974: 8b,01,a8,24,38,  cmpw  R38,[24a8]       
3979: d3,3a,           jnc   39b5             if ((uns) R38 >= 26000)  {
397b: a3,01,5c,01,30,  ldw   R30,[15c]        R30 = STO_Val;
3980: a3,01,5e,01,32,  ldw   R32,[15e]        R32 = STO_ValH;
3985: 8f,01,40,24,30,  divw  R30,[2440]       R30 = R30 / [2440];    ## or * 1.186 e -02 (weight of air ??)
398a: c3,01,5c,01,32,  stw   R32,[15c]        STO_Val = R32;
398f: c3,01,5e,01,00,  stw   0,[15e]          STO_ValH = 0;
3994: 8c,30,34,        divw  R34,R30          R34 = R34 / R30;
3997: a0,34,76,        ldw   R76,R34          STO_PULSEWD = R34;
399a: 89,69,01,76,     cmpw  R76,169          
399e: db,04,           jc    39a4             if ((uns) STO_PULSEWD < 169)  {
39a0: a1,69,01,76,     ldw   R76,169          STO_PULSEWD = 169;  }
39a4: 89,ff,7f,76,     cmpw  R76,7fff         
39a8: d1,04,           jleu  39ae             if ((uns) STO_PULSEWD > 7fff )  {
39aa: a1,ff,7f,76,     ldw   R76,7fff         STO_PULSEWD = 7fff;  }
39ae: 01,34,           clrw  R34              R34 = 0;
39b0: 01,36,           clrw  R36              R36 = 0;
39b2: 91,20,5a,        orb   R5a,20           TRIP_RQD = 1;   }
39b5: c3,01,62,01,34,  stw   R34,[162]        STO_V1 = R34;
39ba: c3,01,64,01,36,  stw   R36,[164]        STO_V2 = R36;
39bf: e7,f6,f1,        jump  2bb8             goto MON_EXIT;

   Fuel_Pump:
39c2: 91,04,5a,        orb   R5a,4            PUMP_ON_RQD = 1;     ## fuel pump on....
39c5: 99,03,55,        cmpb  R55,3            
39c8: d3,03,           jnc   39cd             if ((uns) R55 >= 3)  {
39ca: 71,fb,5a,        an2b  R5a,fb           PUMP_ON_RQD = 0;   }    ## fuel pump off...
39cd: e7,e8,f1,        jump  2bb8             goto MON_EXIT;

   sensor_chk:
39d0: 28,b7,           scall 3a89             sensor_check();
39d2: 99,02,2d,        cmpb  R2d,2            
39d5: d1,30,           jleu  3a07             if ((uns) T5BSU <= 2) goto 3a07;
39d7: 99,00,15,        cmpb  R15,0            
39da: d7,02,           jne   39de             if (TESTREG == 0)  {
39dc: 11,14,           clrb  R14              R14 = 0;  }
39de: 3a,5a,0e,        jb    B2,R5a,39ef      if (PUMP_ON_RQD) goto 39ef;
39e1: 34,5a,18,        jnb   B4,R5a,39fc      if (!STI_Required) goto 39fc;
39e4: 3a,15,26,        jb    B2,R15,3a0d      if (B2_TESTREG) goto 3a0d;    ## Test - Engine Stopped
39e7: 3b,15,10,        jb    B3,R15,39fa      if (B3_TESTREG) goto 39fa;
39ea: b1,04,15,        ldb   R15,4            TESTREG = 4;
39ed: 20,1e,           sjmp  3a0d             goto 3a0d;

39ef: 34,5a,15,        jnb   B4,R5a,3a07      if (!STI_Required) goto 3a07;
39f2: 3b,15,05,        jb    B3,R15,39fa      if (!B3_TESTREG)  {    ## Test - Engine Running
39f5: b1,08,15,        ldb   R15,8            TESTREG = 8;
39f8: 11,14,           clrb  R14              R14 = 0;  }
39fa: 21,7c,           sjmp  3b78             goto 3b78;

39fc: 39,15,64,        jb    B1,R15,3a63      if (!B1_TESTREG)  {
39ff: b1,02,15,        ldb   R15,2            TESTREG = 2;
3a02: 71,f7,5a,        an2b  R5a,f7           STO2_ON_RQD = 0; 
3a05: 20,5c,           sjmp  3a63             goto 3a63;

3a07: 11,15,           clrb  R15              TESTREG = 0;
3a09: 11,14,           clrb  R14              R14 = 0;
3a0b: 21,f9,           sjmp  3c06             goto 3c06;

3a0d: 99,08,67,        cmpb  R67,8            
3a10: de,03,           jlt   3a15             if (T3B8U >= 8)  {    ## Every second ?
3a12: 71,f7,5a,        an2b  R5a,f7           STO2_ON_RQD = 0;   }
3a15: 71,3f,20,        an2b  R20,3f           TPS_F6 = 0; TPS_F7 = 0; 
3a18: 3d,16,0e,        jb    B5,R16,3a29      if (B5_codeflags) goto 3a29;
3a1b: 89,00,32,96,     cmpw  R96,3200         
3a1f: d3,0b,           jnc   3a2c             if ((uns) VAF2_raw >= 3200)  {
3a21: 99,02,14,        cmpb  R14,2            
3a24: df,06,           je    3a2c             if (R14 != 2)  {
3a26: 91,40,20,        orb   R20,40           TPS_F6 = 1; 
3a29: b1,01,14,        ldb   R14,1            R14 = 1;  }  }
3a2c: 39,16,17,        jb    B1,R16,3a46      if (!B1_codeflags)  {
3a2f: 89,00,32,7e,     cmpw  R7e,3200         
3a33: d3,11,           jnc   3a46             if ((uns) VAF1_raw >= 3200)  {
3a35: 99,01,14,        cmpb  R14,1            
3a38: de,05,           jlt   3a3f             if (R14 >= 1)  {
3a3a: 91,80,20,        orb   R20,80           TPS_F7 = 1; 
3a3d: 20,07,           sjmp  3a46             goto 3a46;  }

3a3f: 81,80,00,16,     orw   R16,80           TPS_failx = 1; 
3a43: b1,02,14,        ldb   R14,2            R14 = 2;  }  }
3a46: b0,b5,30,        ldb   R30,Rb5          R30 = flags3;
3a49: 71,0e,30,        an2b  R30,e            B0_R30 = 0; B4_R30 = 0; B5_R30 = 0; B6_R30 = 0; B7_R30 = 0; 
3a4c: 98,20,68,        cmpb  R68,R20          
3a4f: d7,05,           jne   3a56             if (R68 != TPS_flagw) goto 3a56;
3a51: 98,30,f7,        cmpb  Rf7,R30          
3a54: df,05,           je    3a5b             if (Rf7 != R30)  {
3a56: 91,08,5a,        orb   R5a,8            STO2_ON_RQD = 1; 
3a59: 11,67,           clrb  R67              T3B8U = 0;  }
3a5b: b0,20,68,        ldb   R68,R20          R68 = TPS_flagw;
3a5e: b0,30,f7,        ldb   Rf7,R30          Rf7 = R30;
3a61: 21,a3,           sjmp  3c06             goto 3c06;  }

3a63: ac,14,30,        ldzbw R30,R14          R30 = (uns) R14;
3a66: b3,31,84,3a,32,  ldb   R32,[R30+3a84]   R32 = [R30+3a84];
3a6b: 71,07,20,        an2b  R20,7            B3_TPS_flagw = 0; B4_TPS_flagw = 0; B5_TPS_flagw = 0; TPS_F6 = 0; TPS_F7 = 0; 
3a6e: 98,20,32,        cmpb  R32,R20          
3a71: d7,0f,           jne   3a82             if (R32 == TPS_flagw)  {
3a73: 17,14,           incb  R14              R14++;
3a75: 99,04,14,        cmpb  R14,4            
3a78: da,08,           jle   3a82             if (R14 > 4)  {
3a7a: 88,00,16,        cmpw  R16,0            
3a7d: d7,03,           jne   3a82             if (codeflags == 0)  {
3a7f: 91,08,5a,        orb   R5a,8            STO2_ON_RQD = 1;   }  }  }
3a82: 21,82,           sjmp  3c06             goto 3c06;


3a84: 03,00,04,00,03,  table    3,   0,   4,   0,   3,    ## mapped in sequence against R20 (TPS flags ??)

   sensor_check:
3a89: b1,01,66,        ldb   R66,1            R66 = 1;
3a8c: a1,01,00,38,     ldw   R38,1            R38 = 1;
3a90: ac,66,3a,        ldzbw R3a,R66          R3a = (uns) R66;
3a93: 09,01,3a,        shlw  R3a,1            R3a = R3a << 1;    ## times 2 for word offset
3a96: a0,18,36,        ldw   R36,R18          R36 = R18;
3a99: 0c,38,34,        shrdw R34,R38          R34 = (long) R34 >> R38; (log)
3a9c: a3,3a,7c,30,     ldw   R30,[R3a+7c]     R30 = [R3a+7c];    ## Each sensor (raw value)
3aa0: cb,3b,a4,3a,     pushw [R3a+3aa4]       push ([R3a+3aa4]);
3aa4: f0,              ret                    return


3aa5: ff,              ??    -1,
3aa6: c2,3a,           vect  3ac2,             VAF_Check();
3aa8: 6e,3b,           vect  3b6e,             Loop_chk1();
3aaa: 6e,3b,           vect  3b6e,             Loop_chk1();
3aac: 6e,3b,           vect  3b6e,             Loop_chk1();
3aae: 6e,3b,           vect  3b6e,             Loop_chk1();
3ab0: 6e,3b,           vect  3b6e,             Loop_chk1();
3ab2: 6e,3b,           vect  3b6e,             Loop_chk1();
3ab4: d2,3a,           vect  3ad2,             TPS_Check();
3ab6: e2,3a,           vect  3ae2,             ECT_Check();
3ab8: f2,3a,           vect  3af2,             ACT_Check();
3aba: 6e,3b,           vect  3b6e,             Loop_chk1();
3abc: 6e,3b,           vect  3b6e,             Loop_chk1();
3abe: c2,3a,           vect  3ac2,             VAF_Check();
3ac0: 02,3b,           vect  3b02,             BAP_Check();

   VAF_Check:
3ac2: 8b,01,90,24,30,  cmpw  R30,[2490]       
3ac7: d9,75,           jgtu  3b3e             if ((uns) R30 > VAFMAX(5v) ) goto Sensor_fail;
3ac9: 8b,01,92,24,30,  cmpw  R30,[2492]       
3ace: d3,6e,           jnc   3b3e             if ((uns) R30 < VAFMIN(0.2)) goto Sensor_fail;
3ad0: 20,43,           sjmp  3b15             goto Sensor_pass;

   TPS_Check:
3ad2: 8b,01,84,24,30,  cmpw  R30,[2484]       
3ad7: d9,65,           jgtu  3b3e             if ((uns) R30 > TPS_MAX(5v) ) goto Sensor_fail;
3ad9: 8b,01,86,24,30,  cmpw  R30,[2486]       
3ade: d3,5e,           jnc   3b3e             if ((uns) R30 < TPS_MIN(0.125)) goto Sensor_fail;
3ae0: 20,33,           sjmp  3b15             goto Sensor_pass;

   ECT_Check:
3ae2: 8b,01,88,24,30,  cmpw  R30,[2488]       
3ae7: d9,55,           jgtu  3b3e             if ((uns) R30 > ECT_MAX(4.6) ) goto Sensor_fail;
3ae9: 8b,01,8a,24,30,  cmpw  R30,[248a]       
3aee: d3,4e,           jnc   3b3e             if ((uns) R30 < ECT_MIN(0.15)) goto Sensor_fail;
3af0: 20,23,           sjmp  3b15             goto Sensor_pass;

   ACT_Check:
3af2: 8b,01,8c,24,30,  cmpw  R30,[248c]       
3af7: d9,45,           jgtu  3b3e             if ((uns) R30 > ACT_MAX(4.6) ) goto Sensor_fail;
3af9: 8b,01,8e,24,30,  cmpw  R30,[248e]       
3afe: d3,3e,           jnc   3b3e             if ((uns) R30 < ACT_MIN(0.26)) goto Sensor_fail;
3b00: 20,13,           sjmp  3b15             goto Sensor_pass;

   BAP_Check:
3b02: a3,01,56,01,30,  ldw   R30,[156]        R30 = BAP_freq;
3b07: 8b,01,70,24,30,  cmpw  R30,[2470]       
3b0c: d9,30,           jgtu  3b3e             if ((uns) R30 > BAP_MAX ) goto Sensor_fail;
3b0e: 8b,01,72,24,30,  cmpw  R30,[2472]       
3b13: d3,29,           jnc   3b3e             if ((uns) R30 < BAP_MIN) goto Sensor_fail;
   Sensor_pass:
3b15: 39,15,0d,        jb    B1,R15,3b25      if (B1_TESTREG) goto 3b25;
3b18: 3a,15,0a,        jb    B2,R15,3b25      if (B2_TESTREG) goto 3b25;
3b1b: 38,36,09,        jb    B0,R36,3b27      if (!B0_R36)  {
3b1e: 11,ba,           clrb  Rba              Rba = 0;
3b20: c7,39,f7,00,ba,  stb   Rba,[R38+f7]     [R38+f7] = Rba;
3b25: 20,45,           sjmp  3b6c             goto Loop_chk;  }

3b27: b3,39,f7,00,32,  ldb   R32,[R38+f7]     R32 = [R38+f7];
3b2c: 9b,01,2a,24,32,  cmpb  R32,[242a]       
3b31: d3,39,           jnc   3b6c             if ((uns) R32 >= 1)  {
3b33: 71,fe,36,        an2b  R36,fe           B0_R36 = 0; 
3b36: 0d,38,34,        shldw R34,R38          R34 = (long) R34 << R38;
3b39: a0,36,18,        ldw   R18,R36          R18 = R36;
3b3c: 20,2e,           sjmp  3b6c             goto Loop_chk;

   Sensor_fail:
3b3e: 39,15,1b,        jb    B1,R15,3b5c      if (B1_TESTREG) goto 3b5c;
3b41: 3a,15,18,        jb    B2,R15,3b5c      if (B2_TESTREG) goto 3b5c;
3b44: 30,36,09,        jnb   B0,R36,3b50      if (B0_R36)  {
3b47: 11,ba,           clrb  Rba              Rba = 0;
3b49: c7,39,f7,00,ba,  stb   Rba,[R38+f7]     [R38+f7] = Rba;
3b4e: 20,1c,           sjmp  3b6c             goto Loop_chk;  }

3b50: b3,39,f7,00,32,  ldb   R32,[R38+f7]     R32 = [R38+f7];
3b55: 9b,01,2b,24,32,  cmpb  R32,[242b]       
3b5a: d3,10,           jnc   3b6c             if ((uns) R32 >= 1)  {
3b5c: 91,01,36,        orb   R36,1            B0_R36 = 1; 
3b5f: 0d,38,34,        shldw R34,R38          R34 = (long) R34 << R38;
3b62: a0,36,18,        ldw   R18,R36          R18 = R36;
3b65: 80,36,16,        orw   R16,R36          codeflags |= R36;
3b68: 61,bf,ff,16,     an2w  R16,ffbf         BAP_failx = 0;   }  } # stop BAP error ?
   Loop_chk:
3b6c: 07,38,           incw  R38              R38++;
   Loop_chk1:
3b6e: 17,66,           incb  R66              R66++;
3b70: 99,0e,66,        cmpb  R66,e            
3b73: d9,02,           jgtu  3b77             if ((uns) R66 > e ) goto 3b77;
3b75: 27,19,           sjmp  3a90             goto 3a90;

3b77: f0,              ret                    return

3b78: 99,00,14,        cmpb  R14,0            
3b7b: d7,10,           jne   3b8d             if (R14 != 0) goto 3b8d;
3b7d: 3d,5a,0b,        jb    B5,R5a,3b8b      if (TRIP_RQD) goto 3b8b;
3b80: 36,b4,08,        jnb   B6,Rb4,3b8b      if (STOrqd)  {
3b83: 91,08,5a,        orb   R5a,8            STO2_ON_RQD = 1; 
3b86: 11,67,           clrb  R67              T3B8U = 0;
3b88: b1,ff,14,        ldb   R14,ff           R14 = ff;  }
3b8b: 20,79,           sjmp  3c06             goto 3c06;

3b8d: 99,ff,14,        cmpb  R14,ff           
3b90: d7,0f,           jne   3ba1             if (R14 != ff) goto 3ba1;
3b92: 99,28,67,        cmpb  R67,28           
3b95: de,6f,           jlt   3c06             if (T3B8U >= 28)  {
3b97: 71,f7,5a,        an2b  R5a,f7           STO2_ON_RQD = 0; 
3b9a: 11,67,           clrb  R67              T3B8U = 0;
3b9c: b1,01,14,        ldb   R14,1            R14 = 1;
3b9f: 20,65,           sjmp  3c06             goto 3c06;

3ba1: b0,67,31,        ldb   R31,R67          R31 = T3B8U;
3ba4: 08,04,30,        shrw  R30,4            R30 = R30 >> 4; (log)
3ba7: 3f,30,05,        jb    B7,R30,3baf      if (!B7_R30)  {
3baa: 71,f7,5a,        an2b  R5a,f7           STO2_ON_RQD = 0; 
3bad: 20,57,           sjmp  3c06             goto 3c06;  }

3baf: 99,10,31,        cmpb  R31,10           
3bb2: de,0f,           jlt   3bc3             if (R31 < 10) goto 3bc3;
3bb4: 11,67,           clrb  R67              T3B8U = 0;
3bb6: 88,00,16,        cmpw  R16,0            
3bb9: d7,04,           jne   3bbf             if (codeflags == 0)  {
3bbb: 11,14,           clrb  R14              R14 = 0;
3bbd: 20,47,           sjmp  3c06             goto 3c06;  }

3bbf: 17,14,           incb  R14              R14++;
3bc1: 20,43,           sjmp  3c06             goto 3c06;

3bc3: 88,00,16,        cmpw  R16,0            
3bc6: d7,07,           jne   3bcf             if (codeflags == 0)  {
3bc8: a3,01,0a,3c,34,  ldw   R34,[3c0a]       R34 = [3c0a];  # code 11 - all OK
3bcd: 20,1f,           sjmp  3bee             goto 3bee;  }

3bcf: a0,16,32,        ldw   R32,R16          R32 = codeflags;
3bd2: 08,14,32,        shrw  R32,R14          R32 = R32 >> R14; (log)
3bd5: 38,32,0b,        jb    B0,R32,3be3      if (B0_R32) goto 3be3;
3bd8: 17,14,           incb  R14              R14++;
3bda: 99,10,14,        cmpb  R14,10           
3bdd: da,f0,           jle   3bcf             if (R14 <= 10) goto 3bcf;
3bdf: 11,14,           clrb  R14              R14 = 0;
3be1: 20,23,           sjmp  3c06             goto 3c06;

3be3: ac,14,38,        ldzbw R38,R14          R38 = (uns) R14;
3be6: 09,01,38,        shlw  R38,1            R38 = R38 << 1;  # times 2 for word offset 
3be9: a3,39,0a,3c,34,  ldw   R34,[R38+3c0a]   R34 = [R38+3c0a];
3bee: 01,36,           clrw  R36              R36 = 0;
3bf0: 0d,31,34,        shldw R34,R31          R34 = (long) R34 << R31;
3bf3: 3f,35,05,        jb    B7,R35,3bfb      if (!B7_R35)  {
3bf6: 71,f7,5a,        an2b  R5a,f7           STO2_ON_RQD = 0; 
3bf9: 20,03,           sjmp  3bfe             goto 3bfe;  }

3bfb: 91,08,5a,        orb   R5a,8            STO2_ON_RQD = 1; 
3bfe: 0c,03,34,        shrdw R34,3            R34 = (long) R34 >> 3; (log)
3c01: 88,00,34,        cmpw  R34,0            
3c04: df,ae,           je    3bb4             if (R34 == 0) goto 3bb4;  }
3c06: e7,af,ef,        jump  2bb8             goto MON_EXIT;


3c09: ff,              fill     
# error codes by bit position ?   
 if in order -> OK, VAF1,TPS,ECT,ACT,VAF2,BAP,?,RAM,ROM, ? ,

3c0a: 00,48,00,66,80,4f,00,4e, table  18432, 26112, 20352, 19968,    ##  11 , 22 , 15 , 13 
3c12: 00,4f,00,4c,c0,67,00,67, table  20224, 19456, 26560, 26368,    ##  14 , 12 , 25 , 23   ten codes (R14 at 3bdd)
3c1a: 00,72,00,73,91,20,b5,3a, table  29184, 29440,  8337, 15029,    ##  31 , 32 , [10111], [311211]  and two unused codes 

   ISC_pw_calc:
3c1e: 91,20,b5,        orb   Rb5,20           Ign_Clc_2 = 1; 
3c21: 3a,5a,05,        jb    B2,R5a,3c29      if (!PUMP_ON_RQD)  {
3c24: a0,00,38,        ldw   R38,0            R38 = 0;    ## No ISC required
3c27: 21,c1,           sjmp  3dea             goto endfunc;  }

3c29: a0,be,32,        ldw   R32,Rbe          R32 = RPM_flt;
3c2c: a0,70,34,        ldw   R34,R70          R34 = RPMx4;
3c2f: a3,01,4e,24,36,  ldw   R36,[244e]       R36 = RPM_sens;    ## 100% of change ?
3c34: ef,aa,f3,        call  2fe1             Sfilter();
3c37: a0,3e,be,        ldw   Rbe,R3e          RPM_flt = R3e;
3c3a: 01,38,           clrw  R38              R38 = 0;
3c3c: b3,01,52,24,30,  ldb   R30,[2452]       R30 = [2452];
3c41: 99,01,30,        cmpb  R30,1            
3c44: d7,07,           jne   3c4d             if (R30 == 1)  {
3c46: b3,01,53,24,39,  ldb   R39,[2453]       R39 = [2453];    ## Fixed ISC pulswidth ?
3c4b: 21,9d,           sjmp  3dea             goto endfunc;  }

3c4d: 01,b8,           clrw  Rb8              Rb8 = 0;    ## start of true calc
3c4f: 34,5a,0f,        jnb   B4,R5a,3c61      if (!STI_Required) goto 3c61;
3c52: af,01,9a,24,32,  ldzbw R32,[249a]       R32 = (uns) 32_secs_T2;
3c57: 67,01,7a,24,32,  ad2w  R32,[247a]       R32 += 3_secs_T2;
3c5c: 88,32,ea,        cmpw  Rea,R32          
3c5f: d1,05,           jleu  3c66             if ((uns) T2WSU <= R32) goto 3c66;
3c61: 99,02,30,        cmpb  R30,2                ## end of STI processing
3c64: d7,07,           jne   3c6d             if (R30 != 2) goto 3c6d;
3c66: 3a,ea,04,        jb    B2,Rea,3c6d      if (!B2_T2WSU)  {
3c69: a1,20,03,b8,     ldw   Rb8,320          Rb8 = 320;  }    ## extra ISC time, [2452] or timer < 4 secs
3c6d: a3,01,3c,01,3e,  ldw   R3e,[13c]        R3e = ISC_Val1;
3c72: a3,01,3a,01,3c,  ldw   R3c,[13a]        R3c = ISC_Val2;
3c77: a1,7c,2a,32,     ldw   R32,2a7c         R32 = ECT_LU5;
3c7b: bc,72,34,        ldsbw R34,R72          R34 = (int) ECT_val;
3c7e: ef,3e,f6,        call  32bf             SWFuncLu();
3c81: a0,38,ba,        ldw   Rba,R38          Rba = R38;
3c84: 37,1a,0a,        jnb   B7,R1a,3c91      if (450to600rpmF)  {
3c87: b3,01,51,24,39,  ldb   R39,[2451]       R39 = [2451];
3c8c: 71,bf,5a,        an2b  R5a,bf           LU3?_rqd = 0; 
3c8f: 21,59,           sjmp  3dea             goto endfunc;  }

3c91: 36,1a,0a,        jnb   B6,R1a,3c9e      if (Set_10_BTDC)  {
3c94: b3,01,50,24,39,  ldb   R39,[2450]       R39 = [2450];
3c99: 71,bf,5a,        an2b  R5a,bf           LU3?_rqd = 0; 
3c9c: 21,4c,           sjmp  3dea             goto endfunc;  }

3c9e: 31,2c,1b,        jnb   B1,R2c,3cbc      if (!Inj_Inhibit) goto 3cbc;
3ca1: 3e,5a,0a,        jb    B6,R5a,3cae      if (LU3?_rqd) goto 3cae;
3ca4: 3f,5a,38,        jb    B7,R5a,3cdf      if (???_rqd1) goto 3cdf;
3ca7: 01,f4,           clrw  Rf4              T8WmSU = 0;
3ca9: 91,80,5a,        orb   R5a,80           ???_rqd1 = 1; 
3cac: 20,31,           sjmp  3cdf             goto 3cdf;

3cae: 01,f4,           clrw  Rf4              T8WmSU = 0;
3cb0: a0,be,34,        ldw   R34,Rbe          R34 = RPM_flt;
3cb3: a1,64,2a,32,     ldw   R32,2a64         R32 = RPM_LU3;
3cb7: ef,02,f6,        call  32bc             UWFuncLu();
3cba: 21,2e,           sjmp  3dea             goto endfunc;

3cbc: 32,18,05,        jnb   B2,R18,3cc4      if (TPSFail)  {
3cbf: a0,ba,3e,        ldw   R3e,Rba          R3e = Rba;
3cc2: 20,f6,           sjmp  3dba             goto 3dba;  }

3cc4: 30,20,0c,        jnb   B0,R20,3cd3      if (!TPS_F0) goto 3cd3;
3cc7: 38,2c,0e,        jb    B0,R2c,3cd8      if (RPM_F0) goto 3cd8;
3cca: 8b,01,b6,24,70,  cmpw  R70,[24b6]       
3ccf: db,d0,           jc    3ca1             if ((uns) RPMx4 >= RPM_1200) goto 3ca1;
3cd1: 20,0c,           sjmp  3cdf             goto 3cdf;

3cd3: 91,40,5a,        orb   R5a,40           LU3?_rqd = 1; 
3cd6: 20,e2,           sjmp  3dba             goto 3dba;

3cd8: 8b,01,56,24,70,  cmpw  R70,[2456]       
3cdd: db,c2,           jc    3ca1             if ((uns) RPMx4 >= RPM_1430) goto 3ca1;
3cdf: 8b,01,7a,24,ea,  cmpw  Rea,[247a]       
3ce4: db,05,           jc    3ceb             if ((uns) T2WSU < 3_secs_T2)  {
3ce6: a0,ba,3e,        ldw   R3e,Rba          R3e = Rba;
3ce9: 20,cf,           sjmp  3dba             goto 3dba;  }

3ceb: 71,df,b5,        an2b  Rb5,df           Ign_Clc_2 = 0; 
3cee: 71,bf,5a,        an2b  R5a,bf           LU3?_rqd = 0; 
3cf1: a3,01,54,24,34,  ldw   R34,[2454]       R34 = [2454];
3cf6: 88,e6,34,        cmpw  R34,Re6          
3cf9: d1,02,           jleu  3cfd             if ((uns) R34 <= T6WmSU) goto 3cfd;
3cfb: 20,f2,           sjmp  3def             goto 3def;

3cfd: 01,e6,           clrw  Re6              T6WmSU = 0;
3cff: a1,e8,29,32,     ldw   R32,29e8         R32 = IDLE_ECT;
3d03: bc,72,34,        ldsbw R34,R72          R34 = (int) ECT_val;
3d06: ef,b6,f5,        call  32bf             SWFuncLu();
3d09: 64,38,b8,        ad2w  Rb8,R38          Rb8 += R38;
3d0c: 32,b5,11,        jnb   B2,Rb5,3d20      if (!NDS_2F) goto 3d20;
3d0f: 3c,b5,05,        jb    B4,Rb5,3d17      if (!Flags3_F4)  {
3d12: 91,10,b5,        orb   Rb5,10           Flags3_F4 = 1; 
3d15: 01,fe,           clrw  Rfe              T9WmSU = 0;  }
3d17: 8b,01,9c,24,fe,  cmpw  Rfe,[249c]       
3d1c: d3,1e,           jnc   3d3c             if ((uns) T9WmSU < [249c]) goto 3d3c;
3d1e: 20,0f,           sjmp  3d2f             goto 3d2f;

3d20: 34,b5,05,        jnb   B4,Rb5,3d28      if (Flags3_F4)  {
3d23: 71,ef,b5,        an2b  Rb5,ef           Flags3_F4 = 0; 
3d26: 01,fe,           clrw  Rfe              T9WmSU = 0;  }
3d28: 8b,01,9e,24,fe,  cmpw  Rfe,[249e]       
3d2d: d9,0d,           jgtu  3d3c             if ((uns) T9WmSU <= [249e])  {
3d2f: bc,72,34,        ldsbw R34,R72          R34 = (int) ECT_val;
3d32: a1,04,2b,32,     ldw   R32,2b04         R32 = ECT_LU3;
3d36: ef,86,f5,        call  32bf             SWFuncLu();
3d39: 68,38,b8,        sb2w  Rb8,R38          Rb8 -= R38;  }
3d3c: 35,b7,05,        jnb   B5,Rb7,3d44      if (Idle_Adjust)  {
3d3f: 67,01,a6,24,b8,  ad2w  Rb8,[24a6]       Rb8 += 300;  }      ##  add 75 rpm - Idle Speed Adjust
3d44: c3,01,32,01,b8,  stw   Rb8,[132]        M_IDL_SPD = Rb8;
3d49: 48,b8,be,34,     sb3w  R34,Rbe,Rb8      R34 = RPM_flt - Rb8;
3d4d: c3,01,34,01,34,  stw   R34,[134]        M_IDL_GAP = R34;
3d52: 3f,35,0c,        jb    B7,R35,3d61      if (!B7_R35)  {
3d55: 8b,01,82,24,f4,  cmpw  Rf4,[2482]       
3d5a: d9,05,           jgtu  3d61             if ((uns) T8WmSU <= [2482])  {
3d5c: a0,ba,3e,        ldw   R3e,Rba          R3e = Rba;
3d5f: 20,59,           sjmp  3dba             goto 3dba;  }  }

3d61: 71,7f,5a,        an2b  R5a,7f           ???_rqd1 = 0; 
3d64: a1,fc,29,32,     ldw   R32,29fc         R32 = ISC_PWxRPM;
3d68: ef,54,f5,        call  32bf             SWFuncLu();
3d6b: c3,01,36,01,38,  stw   R38,[136]        ISC_val3 = R38;
3d70: bc,72,34,        ldsbw R34,R72          R34 = (int) ECT_val;
3d73: a1,24,2a,32,     ldw   R32,2a24         R32 = ECT_LU2;
3d77: ef,45,f5,        call  32bf             SWFuncLu();
3d7a: c3,01,38,01,38,  stw   R38,[138]        DBG_ISC_V5 = R38;
3d7f: 31,b5,08,        jnb   B1,Rb5,3d8a      if (Add_NDS_Dly)  {
3d82: 6f,01,aa,24,38,  ml2w  R38,[24aa]       R38 *= 128;
3d87: 0c,07,38,        shrdw R38,7            R38 = (long) R38 >> 7; (log)  }
3d8a: a3,01,36,01,32,  ldw   R32,[136]        R32 = ISC_val3;
3d8f: 3f,33,17,        jb    B7,R33,3da9      if (B7_R33) goto 3da9;
3d92: 6c,32,38,        ml2w  R38,R32          R38 *= R32;
3d95: 64,38,3c,        ad2w  R3c,R38          R3c += R38;
3d98: a4,3a,3e,        adcw  R3e,R3a          R3e = R3e + R3a; (carry)
3d9b: 89,00,80,3e,     cmpw  R3e,8000         
3d9f: d3,19,           jnc   3dba             if ((uns) R3e >= 8000)  {
3da1: a1,00,80,3e,     ldw   R3e,8000         R3e = 8000;
3da5: 01,3c,           clrw  R3c              R3c = 0;
3da7: 20,11,           sjmp  3dba             goto 3dba;

3da9: 03,32,           negw  R32              R32 = -R32;
3dab: 6c,32,38,        ml2w  R38,R32          R38 *= R32;
3dae: 68,38,3c,        sb2w  R3c,R38          R3c -= R38;
3db1: a8,3a,3e,        sbbw  R3e,R3a          R3e = R3e - R3a; (borrow)
3db4: db,04,           jc    3dba             if ((uns) R3e < R3a)  {
3db6: 01,3c,           clrw  R3c              R3c = 0;
3db8: 01,3e,           clrw  R3e              R3e = 0;  }  }
3dba: 8b,01,7c,24,3e,  cmpw  R3e,[247c]       
3dbf: d9,05,           jgtu  3dc6             if ((uns) R3e <= ISC_C_MAX)  {
3dc1: a3,01,7c,24,3e,  ldw   R3e,[247c]       R3e = ISC_C_MAX;  }
3dc6: c3,01,3c,01,3e,  stw   R3e,[13c]        ISC_Val1 = R3e;
3dcb: c3,01,3a,01,3c,  stw   R3c,[13a]        ISC_Val2 = R3c;
3dd0: a0,3e,34,        ldw   R34,R3e          R34 = R3e;
3dd3: 33,b5,05,        jnb   B3,Rb5,3ddb      if (ACC_F)  {
3dd6: 67,01,7e,24,34,  ad2w  R34,[247e]       R34 += ISC_ACC_inc;  }
3ddb: 31,b5,05,        jnb   B1,Rb5,3de3      if (Add_NDS_Dly)  {
3dde: 67,01,80,24,34,  ad2w  R34,[2480]       R34 += ISC_NDS_inc;  }
3de3: a1,3c,2a,32,     ldw   R32,2a3c         R32 = IDLE_LU;
3de7: ef,d2,f4,        call  32bc             UWFuncLu();
   endfunc:
3dea: c3,01,30,01,38,  stw   R38,[130]        Idle_PW_len = R38;
3def: e7,c6,ed,        jump  2bb8             goto MON_EXIT;

   Timer_Update:
3df2: 3f,1a,05,        jb    B7,R1a,3dfa      if (!450to600rpmF)  {
3df5: 91,02,ae,        orb   Rae,2            Stop_Timer2 = 1;    ## Stop Timer2 ?
3df8: 20,05,           sjmp  3dff             goto 3dff;  }

3dfa: 71,fd,ae,        an2b  Rae,fd           Stop_Timer2 = 0;    ## Reset and start Timer2
3dfd: 01,ea,           clrw  Rea              T2WSU = 0;
3dff: ef,28,00,        call  3e2a             Upd_Timers();
3e02: e7,b3,ed,        jump  2bb8             goto MON_EXIT;
 

 ####################################### 
 #  Timers list and Update function    # 
 ####################################### 
 # 
 # Timer0 is some kind of 12 second startup/crank/enrich ?  
 #######################################
 
# List Structure -> Flags, Register pointer [plus Flags2, Reg pointer2 if B0 set] 
# Flags   (set, unset)  
#   B0 four byte        , two byte entry 
#   B1 word register    , byte register 
#   B2 count down       , up   (auto stop at zero if count down) 
#   B3 stop,run if mask of flags2 & Reg2 zero   ** 4 entry only ** 
#         (so specifies stop/run flag(s) for timer) 
#   B5 count in mSecs     (true elapsed mSecs not just increment) 
#   B6 count in 1/8ths sec   (true 1/8ths) 
#   B7 count in 1 sec        (true secs)

   Timer_List:
3e05: 22,de,22,e0,     table   34, 222,  34, 224,  # Timer1 (Rde),  Timer4 (Re0)        both WORD, mSecs count UP 
3e09: 83,ea,02,ae,     table  131, 234,   2, 174,  # Timer2 (Rea) WORD secs counts UP.   IGNORE B1 Rae ??
3e0d: 40,67,80,2d,     table   64, 103, 128,  45,  # Timer3 (R67) BYTE 8ths counts UP, Timer5 (R2d) BYTE secs counts UP
3e11: 80,f8,80,f9,     table  128, 248, 128, 249,  # Dummy (BYTE secs up) not used?
3e15: 80,fa,80,fb,     table  128, 250, 128, 251,  # Dummy      "
3e19: 80,fc,80,fd,     table  128, 252, 128, 253,  # Dummy      " 
3e1d: 22,e6,22,4e,     table   34, 230,  34,  78,  # Timer6 (Re6), Timer7 (R4e) both WORD, mSecs count UP
3e21: 22,f4,22,fe,     table   34, 244,  34, 254,  # Timer8 (Rf4), Timer9 (Rfe) both WORD, mSecs count UP
3e25: 2b,c0,20,ae,     table   43, 192,  32, 174,  # Timer0 (Rc0) WORD mSecs, UP, run while B5 Rae set

3e29: 00,              byte  +0,  #  end of list 

 ## at 3e3c below, R38 =(R38*256)/d055 is number of mSecs elapsed  
 # for 4.8uS timer => 208.33 ticks per mS

   Upd_Timers:
3e2a: a1,05,3e,30,     ldw   R30,3e05         R30 = Timer_List;
3e2e: a0,06,36,        ldw   R36,R6           R36 = IO_TIMER;
3e31: 4b,01,44,01,36,38, sb3w  R38,R36,[144]    R38 = R36 - Last_Tms;
3e37: 01,3a,           clrw  R3a              R3a = 0;
3e39: 0d,08,38,        shldw R38,8            R38 = (long) R38 << 8;
3e3c: 8d,55,d0,38,     divw  R38,d055         R38 = R38 / d055;
3e40: 89,00,00,38,     cmpw  R38,0            
3e44: d7,02,           jne   3e48             if (R38 != 0) goto 3e48;    ## return if no (int) mSec difference
3e46: 20,88,           sjmp  3ed0             goto 3ed0;

3e48: 65,80,00,3a,     ad2w  R3a,80           R3a += 80;    ## set carry flag after shift 
3e4c: 08,08,3a,        shrw  R3a,8            R3a = R3a >> 8; (log)
3e4f: 48,3a,36,b8,     sb3w  Rb8,R36,R3a      Rb8 = R36 - R3a;
3e53: c3,01,44,01,b8,  stw   Rb8,[144]        Last_Tms = Rb8;
3e58: b1,20,3e,        ldb   R3e,20           R3e = 20;    ## B5 R3e = 1;    new mSec ?
3e5b: 74,38,21,        ad2b  R21,R38          mS_Count += R38;
3e5e: 59,7d,21,3f,     sb3b  R3f,R21,7d       R3f = mS_Count - 7d;
3e62: d3,0f,           jnc   3e73             if ((uns) mS_Count >= 7d)  {
3e64: b0,3f,21,        ldb   R21,R3f          mS_Count = R3f;    ## cycle mS count around 0-125 mSecs i.e. 1/8ths sec 
3e67: 91,40,3e,        orb   R3e,40           B6_R3e = 1;     ## New 8th sec ?
3e6a: e0,2a,06,        djnz  R2a,3e73         if ((8ths_sec--) != 0) goto Next_item;
3e6d: 91,80,3e,        orb   R3e,80           B7_R3e = 1;     ## new Sec ?
3e70: b1,08,2a,        ldb   R2a,8            8ths_sec = 8;  }  }
   Next_item:
3e73: b2,31,3c,        ldb   R3c,[R30++]      R3c = [R30++];    ## get next entry (flags)
3e76: 99,00,3c,        cmpb  R3c,0            
3e79: df,55,           je    3ed0             if (R3c == 0) goto 3ed0;    ## end of list, return
3e7b: ae,31,32,        ldzbw R32,[R30++]      R32 = (uns) [R30++];    ## reg pointer
3e7e: 30,3c,12,        jnb   B0,R3c,3e93      if (!B0_R3c) goto 3e93;    ## 2 or 4 entry item ?
3e81: b2,31,3d,        ldb   R3d,[R30++]      R3d = [R30++];
3e84: ae,31,34,        ldzbw R34,[R30++]      R34 = (uns) [R30++];
3e87: 72,34,3d,        an2b  R3d,[R34]        R3d &= [R34];
3e8a: 33,3c,04,        jnb   B3,R3c,3e91      if (!B3_R3c) goto 3e91;    ## STOP if bits o/lap ?
3e8d: df,04,           je    3e93             if (R3d == [R34]) goto 3e93;    ## STOP if no bits o/lap ?
3e8f: 27,e2,           sjmp  3e73             goto Next_item;

3e91: df,e0,           je    3e73             if (R3d == [R34]) goto Next_item;
3e93: 50,3c,3e,00,     an3b  0,R3e,R3c        0 = R3e & R3c;
3e97: df,da,           je    3e73             if (R3e == R3c) goto Next_item;  ## no bits overlap, = 0
3e99: 31,3c,05,        jnb   B1,R3c,3ea1      if (B1_R3c)  {    ## Update type - word/byte
3e9c: a2,32,36,        ldw   R36,[R32]        R36 = [R32];
3e9f: 20,03,           sjmp  3ea4             goto 3ea4;  }

3ea1: be,32,36,        ldsbw R36,[R32]        R36 = (int) [R32];
3ea4: 32,3c,04,        jnb   B2,R3c,3eab      if (!B2_R3c) goto 3eab;    # Up/Down (set)
3ea7: 03,36,           negw  R36              R36 = -R36;
3ea9: df,18,           je    3ec3             if (0 == R36) goto Save_T;    # STOP if down and zero
3eab: 3d,3c,04,        jb    B5,R3c,3eb2      if (!B5_R3c)  {
3eae: 07,36,           incw  R36              R36++;
3eb0: 20,03,           sjmp  3eb5             goto 3eb5;  }

3eb2: 64,38,36,        ad2w  R36,R38          R36 += R38;    ## add true mS elapsed. 
3eb5: d3,07,           jnc   3ebe             if ((uns) R36 < R38) goto 3ebe;
3eb7: 01,36,           clrw  R36              R36 = 0;
3eb9: 3a,3c,07,        jb    B2,R3c,3ec3      if (!B2_R3c)  {
3ebc: 05,36,           decw  R36              R36--;
3ebe: 32,3c,02,        jnb   B2,R3c,3ec3      if (B2_R3c)  {
3ec1: 03,36,           negw  R36              R36 = -R36;  }  }
   Save_T:
3ec3: 31,3c,05,        jnb   B1,R3c,3ecb      if (B1_R3c)  {    ## save timer - word/byte
3ec6: c2,32,36,        stw   R36,[R32]        [R32] = R36;
3ec9: 27,a8,           sjmp  3e73             goto Next_item;  }

3ecb: c6,32,36,        stb   R36,[R32]        [R32] = R36;
3ece: 27,a3,           sjmp  3e73             goto Next_item;

3ed0: e7,e5,ec,        jump  2bb8             goto MON_EXIT;

   CAL_CON:
3ed3: f2,              pushp                  push(flags);
3ed4: a3,01,00,0d,30,  ldw   R30,[d00]        R30 = [d00];
3ed9: 99,2a,31,        cmpb  R31,2a           
3edc: df,0a,           je    3ee8             if (R31 != 2a)  {
3ede: a1,5a,00,30,     ldw   R30,5a           R30 = 5a;
3ee2: 05,30,           decw  R30              R30--;
3ee4: d2,fc,           jgt   3ee2             if (0 > R30) goto 3ee2;    ## Delay loop ?
3ee6: 20,03,           sjmp  3eeb             goto 3eeb;  }

3ee8: ef,15,91,        call  d000             d000();
3eeb: fa,              di                     disable ints
3eec: ff,              nop                    
3eed: f3,              popp                   pop(flags);
3eee: e7,c7,ec,        jump  2bb8             goto MON_EXIT;

   EGR_Func:
3ef1: b3,01,58,24,ba,  ldb   Rba,[2458]       Rba = EGR_Fitted;
3ef6: 99,00,ba,        cmpb  Rba,0            
3ef9: df,70,           je    3f6b             if (Rba != 0)  {
3efb: 99,01,ba,        cmpb  Rba,1            
3efe: df,29,           je    3f29             if (Rba != 1)  {

3f00: d8,0f,a0,0c,00,44, ??    b 216, 15,160, 12,  0, 68, h  fd8, ca0,4400, d  4056, 3232,17408,
3f06: 00,10,06,54,00,24, ??    b   0, 16,  6, 84,  0, 36, h 1000,5406,2400, d  4096,21510, 9216,
3f0c: 32,88,32,ea,d1,1c, ??    b  50,136, 50,234,209, 28, h 8832,ea32,1cd1, d -30670,-5582, 7377,
3f12: af,01,9b,24,30,64, ??    b 175,  1,155, 36, 48,100, h  1af,249b,6430, d   431, 9371,25648,
3f18: 30,32,88,32,ea,d9, ??    b  48, 50,136, 50,234,217, h 3230,3288,d9ea, d 12848,12936,-9750,
3f1e: 0f,a3,01,96,24,ba, ??    b  15,163,  1,150, 36,186, h a30f,9601,ba24, d -23793,-27135,-17884,
3f24: 39,ea,3f,a3,01,  ??    b  57,234, 63,163,  1, h ea39,a33f, d -5575,-23745,
3f28: 01,              ??    b   1,

3f29: 98,24,ba,        cmpb  Rba,R24          
3f2c: 20,38,           sjmp  3f66             goto 3f66;

3f2e: b0,72,34,        ldb   R34,R72          R34 = ECT_val;
3f31: a1,94,2a,32,     ldw   R32,2a94         R32 = EGR_LU3;
3f35: ef,67,f0,        call  2f9f             SBFuncLu();
3f38: b0,38,b8,        ldb   Rb8,R38          Rb8 = R38;
3f3b: b0,73,34,        ldb   R34,R73          R34 = ACT_val;
3f3e: a1,9e,2a,32,     ldw   R32,2a9e         R32 = 2a9e;
3f42: ef,5a,f0,        call  2f9f             SBFuncLu();
3f45: 7c,38,b8,        ml2b  Rb8,R38          Rb8 = Rb8 * (word)R38;
3f48: a0,70,34,        ldw   R34,R70          R34 = RPMx4;
3f4b: a1,a8,2a,32,     ldw   R32,2aa8         R32 = EGR_LU2;
3f4f: ef,6a,f3,        call  32bc             UWFuncLu();
3f52: a0,38,ba,        ldw   Rba,R38          Rba = R38;
3f55: a0,62,34,        ldw   R34,R62          R34 = VAF1_avg;
3f58: 28,14,           scall 3f6e             UNKFUNC1();
3f5a: c3,01,40,01,32,  stw   R32,[140]        EGR_Val = R32;
3f5f: 20,0a,           sjmp  3f6b             goto 3f6b;


3f61: a3,              ??    b 163,
3f62: 01,5a,24,ba,     ??    b   1, 90, 36,186, h 5a01,ba24, d 23041,-17884,

3f66: c3,01,40,01,ba,  stw   Rba,[140]        EGR_Val = Rba;  }
3f6b: e7,4a,ec,        jump  2bb8             goto MON_EXIT;

   UNKFUNC1:
3f6e: a1,bc,2a,32,     ldw   R32,2abc         R32 = EGR_LU1;
3f72: ef,47,f3,        call  32bc             UWFuncLu();
3f75: a0,38,32,        ldw   R32,R38          R32 = R38;
3f78: a0,ba,30,        ldw   R30,Rba          R30 = Rba;
3f7b: a1,08,00,34,     ldw   R34,8            R34 = 8;
3f7f: a1,14,27,38,     ldw   R38,2714         R38 = EGR_LU6;
3f83: ef,f1,f2,        call  3277             TabLookup();
3f86: 11,3a,           clrb  R3a              R3a = 0;
3f88: 4c,3a,b8,30,     ml3w  R30,Rb8,R3a      R30 = (long) Rb8 * R3a;
3f8c: 0d,04,30,        shldw R30,4            R30 = (long) R30 << 4;
3f8f: 89,00,40,32,     cmpw  R32,4000         
3f93: d1,04,           jleu  3f99             if ((uns) R32 > 4000 )  {
3f95: a1,00,40,32,     ldw   R32,4000         R32 = 4000;  }
3f99: f0,              ret                    return


   TaskList:
3f9a: d3,3e,           vect  3ed3,             CAL_CON();
3f9c: 17,30,           vect  3017,             Do_Sensors();
3f9e: 25,31,           vect  3125,             VAF_flow_calc();
3fa0: c9,31,           vect  31c9,             TPS_calc();
3fa2: 2e,32,           vect  322e,             RPM_calc();
3fa4: f2,3d,           vect  3df2,             Timer_Update();
3fa6: f4,33,           vect  33f4,             VAF_join_clc();
3fa8: b8,35,           vect  35b8,             Air_Flow_clc();
3faa: 41,36,           vect  3641,             InjCalc3();
3fac: 83,36,           vect  3683,             TPS_Accelp();
3fae: d4,36,           vect  36d4,             InjBaseFuel();
3fb0: f1,36,           vect  36f1,             InjCalcTimer();
3fb2: f2,3d,           vect  3df2,             Timer_Update();
3fb4: 1a,37,           vect  371a,             InjectTime();
3fb6: 47,39,           vect  3947,             STO_trip();
3fb8: da,2d,           vect  2dda,             IGN_calc();
3fba: eb,2d,           vect  2deb,             IGN_clc3();
3fbc: be,34,           vect  34be,             RPM_calc_1();
3fbe: f2,3d,           vect  3df2,             Timer_Update();
3fc0: c2,39,           vect  39c2,             Fuel_Pump();
3fc2: 01,33,           vect  3301,             IGN_clc2();
3fc4: d0,39,           vect  39d0,             sensor_chk();
3fc6: 1e,3c,           vect  3c1e,             ISC_pw_calc();
3fc8: f1,3e,           vect  3ef1,             EGR_Func();
3fca: f2,3d,           vect  3df2,             Timer_Update();

3fcc: ff,ff,ff,ff,ff,ff, fill  
3fd2: ff,ff,ff,ff,ff,ff, fill  
3fd8: ff,ff,ff,ff,ff,ff, fill  
3fde: ff,ff,ff,ff,ff,ff, fill  
3fe4: ff,ff,ff,ff,ff,ff, fill  
3fea: ff,ff,ff,ff,ff,ff, fill  
3ff0: ff,ff,ff,ff,ff,ff, fill  
3ff6: ff,ff,ff,ff,ff,ff, fill  
3ffc: ff,ff,ff,ff,     fill