<назад

Мозг VM100

Отправлено 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 

Это ревизия старая

; PIP -  HSI.0 
;        HSI.1
;        HSI.2 
;        HSI.3 
;        HSI.5
;        HSI.5 
;        HSI.6 
;        HSI.7
;        HSO.0 
;	 HSO.1
;        HSO.2
;        HSO.3
;        HSO.4 
; SPOUT  HSO.5 
;        HSO.6
;        HSO.7 
;        HSO.8
;        HSO.9 
;        LSO.0 
;	 LSO.1
;        LSO.2
;        LSO.3
;        LSO.4 
;        LSO.5 
;        LSO.6
;        LSO.7 
;        BI.0
;        BI.1 
; ADC - 13 RAM 512 
; ECT    ADC_8 
; ACT    ADC_9 
;
;
;
;
;
;
;
2000                      org   $2000
0000                Zero                              equ   $0000
0002                Low_Speed_Output                  equ   $0002
0003                BiDirect_Port                     equ   $0003
0004                AD_Lo                             equ   $0004
0004                Watchdog_Timer                    equ   $0004
0005                AD_Hi                             equ   $0005
0005                AD_Command                        equ   $0005
0006                Master_IO_Timer_Lo                equ   $0006
0007                Master_IO_Timer_Hi                equ   $0007
0008                Interrupt_Mask                    equ   $0008
0009                Interrupt_Pending                 equ   $0009
000A                IO_Status                         equ   $000A
000B                HSI_Sample                        equ   $000B
000C                HSI_Data_Mask                     equ   $000C
000D                HSI_Data_Hold                     equ   $000D
000E                HSI_Time_Hold                     equ   $000E
0010                Stack_Ptr                         equ   $0010
2000                Reset_Addr
2000  2030                sjmp  L2032
2002  FF                  nop
2003  FF                  nop
2004  FF                  nop
2005  FF                  nop
2006  FF                  nop
2007  FF                  nop
2008  FF                  nop
2009  FF                  nop
200A  0584                dec   REG_84
200C                SMP_Base_Addr
200C  0040                skip  REG_40
200E                Calib_Exec_Time
200E  5D0004D0            mulub REG_D0,AD_Lo,#$00
2012  C72A                word  $2AC7                       	;Master I/O Timer Overflow Interrupt
2014  D92A                word  $2AD9                       	;A/D End of Conversion Interrupt
2016  3C2C                word  $2C3C                       	;HSI Port Input Data Available
2018  D92A                word  $2AD9                       	;External Interrupt Vector
201A  562D                word  $2D56                       	;HSO Port Output Interrupt #1
201C  D92A                word  $2AD9                       	;HSI #1 Interrupt Vector
201E  C02A                word  $2AC0                       	;HSI #0 Interrupt Vector
2020                Num_levels
2020  0020                word  $2000				; Start ROM
2022                Calib_ptrs
2022  FF27                word  $27FF				
2024  0028                word  $2800
2026  FF2F                word  $2FFF
2028  0030                word  $3000
202A  FF37                word  $37FF
202C  0038                word  $3800
202E  FF3F                word  $3FFF				; End address ROM
2030  0000                word  Zero
                    ;************************************************************
                    ;*  Initialize System
                    ;************************************************************
2032  FA            L2032 di
2033  FF                  nop
2034  1114                clrb  REG_14
2036  1102                clrb  LSO				;
2038  A3012020            ld    REG_30,$2020[Zero]		; START ROM
      30
203D  A3012E20            ld    REG_32,$202E[Zero]		; END address
      32
2042  0134                clr   REG_34				; REG_34  = 0;
2044  954002        L2044 xorb  LSO,#$40			; LSO.6 = !LSO.6
2047  FF                  nop
2048  FF                  nop
2049  1105                clrb  Watchdog_Timer			;
204B  954002              xorb  LSOutput,#$40			; LSO.6 = !LSO.6
204E  663134              add   REG_34,[REG_30]+		; REG_34 += [REG_30++]
2051  883230              cmp   REG_30,REG_32
2054  DAEE                jle   L2044				; if ( REG_30 < REG_32 ) GOTO L2044
2056  880034              cmp   REG_34,Zero			; ? Действительно 0 или REG_0 ?		// подсчёт контрольной суммы РОМ
2059  DF03                je    L205E
205B  918014              orb   REG_14,#$80			; REG_14.7 = 1				// Если контрольная сумма РОМ  <> 0 - ошибка 
205E  B1FF08        L205E ldb   Interrupt_Mask,#$FF		
2061  B15512              ldb   REG_12,#$55			; REG_12 = $55
2064  A1690116      L2064 ld    REG_16,#$0169			; REG_16 = $0169
2068  3F0803              jbs   Interrupt_Mask,BIT_07,L206E	; if (IM.7) GOTO L206E
206B  B1AA12              ldb   REG_12,#$AA			; REG_12 = $AA
206E  0516          L206E dec   REG_16				; REG_16--
2070  DF19                je    L208B				; if ( REG_16 == 0 ) GOTO L208B
2072  954002              xorb  LSO,#$40			; LSO.6 = !LSO.6
2075  FF                  nop
2076  FF                  nop
2077  1105                clrb  Watchdog_Timer
2079  954002              xorb  LSO,#$40			; LSO.6 = !LSO.6
207C  C7161712            stb   REG_12,$17[REG_16]		; [REG_16 + $17] = REG_12		// Тестирование регистров/озу на правильность записи $55 $AA
2080  9B161712            cmpb  REG_12,$17[REG_16]
2084  DFE8                je    L206E
2086  914014              orb   REG_14,#$40			; REG_14.6 = 1				// Ошибка в ОЗУ
2089  2007                sjmp  L2092				
208B  1708          L208B incb  Interrupt_Mask			; просто организация цикла для проверок ОЗУ 
208D  DFD5                je    L2064				; 
208F  71BF14              andb  REG_14,#$BF			; REG_14.6 = 0 				// ОЗУ нормально
2092  0130          L2092 clr   REG_30				; REG_30 = 0
2094  C23100        L2094 st    Zero,[REG_30]+			; [REG_30+] = 0				// Очистка ОЗУ
2097  89140030            cmp   REG_30,#$0014
209B  DF06                je    L20A3
209D  89300030            cmp   REG_30,#$0030			; кроме регистра REG_30
20A1  D704                jne   L20A7
20A3  65020030      L20A3 add   REG_30,#$0002			; кроме регистра REG_14 
20A7  89000230      L20A7 cmp   REG_30,#$0200
20AB  D7E7                jne   L2094				; 
20AD  A1000370            ld    REG_70,#$0300			; REG_70 = 768
20B1  B10303              ldb   BI,#$03				; BI.0 = BI.1 = 1;
20B4  B1AA08              ldb   Interrupt_Mask,#$AA		; ??
20B7  B10F0D              ldb   HSI_Data_Hold,#$0F		; ??
20BA  A1B2000E            ld    HSI_Time_Hold,#$00B2		; ??
20BE  A11A0110            ld    Stack_Ptr,#$011A		; Стек 					// Инициализация основных данных
20C2  B1C01A              ldb   REG_1A,#$C0			; REG_1A.7 = REG_1A.6 = 1		// DO_INJECTION ....
20C5  B10825              ldb   REG_25,#$08			; REG_25  = $08				// ???
20C8  A12A009C            ld    REG_9C,#$002A			; REG_9C  = $002A 			// TSK num addr last in list
20CC  A301BE24            ld    REG_9A,$24BE[Zero]		; REG_9A  = $3200
      9A
20D1  A09AD8              ld    REG_D8,REG_9A			; REG_D8  = REG_9A
20D4  B160AB              ldb   REG_AB,#$60			; bREG_AB = $60
20D7  A1FFFF5C            ld    REG_5C,#$FFFF			; REG_5C  = $FFFF
20DB  A05C28              ld    REG_28,REG_5C			; REG_28  = $FFFF
20DE  B1B0B2              ldb   REG_B2,#$B0			; REG_B2.7 REG_B2.5 REG_B2.4   = 1 DO_ISC(), DO_STO() DO_EGR() ?
20E1  B1050C              ldb   HSI_Data_Mask,#$05		; ??
20E4  1115                clrb  REG_15				; REG_15 = 0
20E6  1105                clrb  Watchdog_Timer
20E8  1105                clrb  Watchdog_Timer
20EA  FB                  ei
                    ;************************************************************
                    ;*  Main Loop
20EB  C9EB20              push  #$20EB			    	; sp[] = this
20EE  9900B2              cmpb  REG_B2,#$00		    	; if (REG_B2 == $00 )
20F1  DF02                je    L20F5                       	;  Goto L20F5
20F3  28D8                scall L21CD                       	; Do_Outputs() ;
20F5  990157        L20F5 cmpb  REG_57,#$01                 	; if (REG_57 != $01 ) 
20F8  D702                jne   L20FC		           	;  Goto L20FC 		
20FA  2082                sjmp  L217E                       	; Goto RunTasks ;
20FC  990457        L20FC cmpb  REG_57,#$04			; if (REG_57 > $04 )		
20FF  D103                jnh   L2104				;  Goto L2104 
2101  9102B5              orb   REG_B5,#$02                 	; REG_B5 |= $02; 
2104  B10257        L2104 ldb   REG_57,#$02                 	; REG_57 = $02; 
2107  31B502              jbc   REG_B5,BIT_01,L210C         	; if ( !REG_B5.1 ) GOTO L210C
210A  2726                sjmp  L2032			    	; GOTO initialize 
210C  8900009C      L210C cmp   REG_9C,#$0000               	; if ( REG_9C != 0 )
2110  D702                jne   L2114			    	;  GOTO L2114
2112  201A                sjmp  L212E			    	; GOTO L212E
							    
2114  45420354      L2114 add   REG_30,REG_54,#$0342       	; REG_30 = REG54+$0342 
      30
2119  883006              cmp   Master_IO_Timer_Lo,REG_30   	; if ( IO_Timer < REG_30 )
211C  DE04                jlt   L2122			    	;  GOTO L2122			
211E  D54B                jnv   L216B                      	; if ( !Overflow ) GOTO L216B
2120  2002                sjmp  L2124			   	; GOTO L2124
2122  DD47          L2122 jv    L216B			   	; if ( Overflow ) GOTO L216B
2124  3AB55F        L2124 jbs   REG_B5,BIT_02,L2186         	; if ( REG_B5.2 ) GOTO L2186
2127  99027A              cmpb  REG_7A,#$02	           	; if ( REG_7A > 02 )		
212A  D152                jnh   L217E                      	;  GOTO L217E 
212C  2058                sjmp  L2186                       	; GOTO L2186 
212E  B10157        L212E ldb   REG_57,#$01		    	; REG_57 = $01	
2131  33B10F              jbc   REG_B1,BIT_03,ADC_RAW_READ  	; if ( !REG_B1.3 ) GOTO ADC_RAW_READ
2134  A1820030            ld    REG_30,#$0082               	; REG_30 = $0082  здесь МЫ читаем значение ADC портов 1-6
2138  B101B9              ldb   REG_B9,#$01		    	; REG_B9 = $01	
213B  B107B8              ldb   REG_B8,#$07                 	; REG_B8 = $07
213E  71F7B1              andb  REG_B1,#$F7		    	; REG_B1 &= $F7 ; REG_B1.3 = 0
2141  200D                sjmp  ADC_RAWR_L                  	; GOTO L2150  чтение портов ADC 

; Чтение значений портов ADC в область памяти с ячейки $008E
; Читаются порты ADC с 07 по 0D  (7портов) причём Значение маскируется $FFC0 - 6 младших бит = 0
; Временный переменные wREG_30,bREG_B9,bREG_B8,wREG_32
; Порт ADC0 - неиспользуется , хм по схеме вроде так
; Порты подлежащие ADC преобразованию 
; VAF
; TPS
; ACT
; ECT
; ЧТо есть ЧТО
; 0082  ADC_1  ДА , таблица преобразований $2772 1 раз   VCAL ???
; 0084  ADC_2  НЕТ					 KEYPWR
; 0086  ADC_3  НЕТ					 OCC
; 0088  ADC_4  ДА , таблица преобразований $29E0 1 раз   SCCS ???
; 008A  ADC_5  ДА , таблица преобразований $29F0 1 раз   EGO2 ???
; 008C  ADC_6  ДА , нет таблицы преобразования           VAF  ???
; 008E  ADC_7  ДА , нет таблицы преобразования		 TPS  ???
; 0090  ADC_8  ДА , нет таблицы преобразования 		 ECT  +++	
; 0092  ADC_9  ДА , таблица преобразований $28F2 1 раз   ACT  +++
; 0094  ADC_A  ДА , нет таблицы преобразования           NDS  ???
; 0096  ADC_B  ДА , нет таблицы преобразования 		 EGO1 ??? 
; 0098  ADC_C  ДА , нет таблицы преобразования 		 NDS  ??? 
; 009A  ADC_D  ДА , нет таблицы преобразования 		 EVP  ???
 
            ADC_RAW_READ:
2143  A18E0030      L2143 ld    REG_30,#$008E		    	; REG_30 = $008E
2147  B107B9              ldb   REG_B9,#$07                 	; REG_B9 = $07
214A  B10DB8              ldb   REG_B8,#$0D		    	; REG_B8 = $0D
214D  9108B1              orb   REG_B1,#$08                 	; REG_B1 |= $08 ;  REG_B1.3 = 1
2150  B0B904  ADC_RAWR_L: ldb   AD_Command,REG_B9           	; AD_Command  = REG_B9 какой порт читаем 
2153  330AFD        L2153 jbc   IO_Status,BIT_03,L2153      	; if ( !IO_Status.3 ) GOTO L2153 ; статус завершения преобразования
2156  C43204              stb   ADC_HI,REG_32               	; REG_32 = ADC_HI
2159  C43305              stb   ADC_LO,REG_33               	; REG_33 = ADC_LO 
215C  61C0FF32            and   REG_32,#$FFC0               	; REG_32 &= $FFC0 
2160  C23132              st    REG_32,[REG_30]+            	; [REG_30++] = REG_32;
2163  17B9                incb  REG_B9			    	; REG_B9 ++;
2165  98B8B9              cmpb  REG_B9,REG_B8               	; if ( REG_B9 < REG_B8)
2168  DEE6                jlt   L2150                      	;  GOTO L2150 следующий порт
216A  F0                  ret                              	; GOTO Main_Loop
                    ;*  End Main Loop
                    ;************************************************************
216B  1705          L216B incb  Watchdog_Timer		    	; Вообще здесь хрень, на LSO мы дёргаем пин получается короткий пик сигнала - строб ?
216D  FA                  di
216E  FF                  nop
216F  954002              xorb  Low_Speed_Output,#$40	    	; LSO.7 != HSO.7
2172  FF                  nop			
2173  FF                  nop
2174  1705                incb  Watchdog_Timer
2176  954002              xorb  Low_Speed_Output,#$40       	; LSO.7 != HSO.7		
2179  FB                  ei
217A  A00654              ld    REG_54,Master_IO_Timer_Lo   	; REG_54 = IO_Timer  Запоминаем значение таймера.
217D  F0                  ret                               	; GOTO Main_Loop 
                    ;************************************************************
                    ;* Run Tasks
                    ;************************************************************
217E  1157          L217E clrb  REG_57				; REG_57 = 0				
2180  177A                incb  REG_7A				; REG_7A++
2182  E72709              ljmp  L2AAC				; Do Tasks
2185  F0            L2185 ret

2186  B10357        L2186 ldb   REG_57,#$03
2189  990353              cmpb  REG_53,#$03
218C  D105                jnh   L2193
218E  717F02              andb  Low_Speed_Output,#$7F
2191  200B                sjmp  L219E
2193  3A5605        L2193 jbs   REG_56,BIT_02,L219B
2196  717F02              andb  Low_Speed_Output,#$7F
2199  2003                sjmp  L219E
219B  918002        L219B orb   Low_Speed_Output,#$80
219E  71DFAC        L219E andb  REG_AC,#$DF
21A1  38E417              jbs   REG_E4,BIT_00,L21BB
21A4  390B03              jbs   HSI_Sample,BIT_01,L21AA
21A7  9120AC              orb   REG_AC,#$20
21AA  71E7B3        L21AA andb  REG_B3,#$E7
21AD  300303              jbc   BiDirect_Port,BIT_00,L21B3
21B0  9108B3              orb   REG_B3,#$08
21B3  310314        L21B3 jbc   BiDirect_Port,BIT_01,L21CA
21B6  9110B3              orb   REG_B3,#$10
21B9  200F                sjmp  L21CA
21BB  3D0B03        L21BB jbs   HSI_Sample,BIT_05,L21C1
21BE  9120AC              orb   REG_AC,#$20
21C1  71EF56        L21C1 andb  REG_56,#$EF
21C4  3B0B03              jbs   HSI_Sample,BIT_03,L21CA
21C7  911056              orb   REG_56,#$10
21CA  117A          L21CA clrb  REG_7A
21CC  F0                  ret


; DO_OUTPUTS()
; REG_B2 Биты определяющие требование вывода
; REG_B2.0 - если 1 то выполняется DO_INJECTION() 
; REG_B2.1 - DO_INJ0BANK()
; REG_B2.2 - DO_SPOUT()
; REG_B2.3 - DO_INJ1BANK()
; REG_B2.4 - DO_STO()
; REG_B2.5 - DO_EGR()
; REG_B2.6 - 
; REG_B2.7 - DO_ISC()
;

21CD  28C2          L21CD scall L2291				; DO_SPOUT ()
21CF  31B205              jbc   REG_B2,BIT_01,L21D7		; if ( !REG_B2.1 ) Goto L21D7
21D2  EF0509              lcall L2ADA				; DO_INJ0BANK
21D5  28BA                scall L2291				; DO_SPOUT ()	
21D7  33B205        L21D7 jbc   REG_B2,BIT_03,L21DF		; if ( !REG_B2.3 ) Goto L21DF
21DA  EF6509              lcall L2B42				; DO_INJ1BANK
21DD  28B2                scall L2291				; DO_SPOUT ()
21DF  37B205        L21DF jbc   REG_B2,BIT_07,L21E7		; if ( !REG_B2.7 ) Goto L21E7
21E2  EF9F09              lcall L2B84				; DO_ISC ()				
21E5  28AA                scall L2291				; DO_SPOUT ()
21E7  34B205        L21E7 jbc   REG_B2,BIT_04,L21EF		; if ( !REG_B2.4 ) Goto L21EF
21EA  EF020A              lcall L2BEF				; DO_STO ()
21ED  28A2                scall L2291				; DO_SPOUT ()
21EF  35B205        L21EF jbc   REG_B2,BIT_05,L21F7		; if ( !REG_B2.5 ) Goto L21F7
21F2  EFBB0B              lcall L2DB0				; DO_EGR () ????
21F5  289A                scall L2291
21F7  EF990B        L21F7 lcall L2D93				; Всегда
21FA  2895                scall L2291				; DO_SPOUT ()
21FC  F0            L21FC ret

		; DO_INJECTION ()
		; Вызов обработки инжектора
		; Входные параметры
		; REG_BA    -
		; REG_BC    - 
		; REG_BE    -
		; REG_38   <= $16   | $17
		; REG_39   <= $06   | $07
		; REG_B4.6  - задержано событие
		; REG_B4.3  - задержано событие
		; REG_B4.2  - задержано событие
		; REG_C0 - ширина импульса впрыска ??
		;
  		L21FD:
21FD  9101B2              orb   REG_B2,#$01			; REG_B2.0 = 1 
2200  3BB406        L2200 jbs   REG_B4,BIT_03,L2209		; if ( REG_B4.3 ) GOTO L2209   
2203  3AB42E        L2203 jbs   REG_B4,BIT_02,L2234		; if ( REG_B4.2 ) GOTO L2234
2206  3EB411              jbs   REG_B4,BIT_06,L221A		; if ( REG_B4.6 ) GOTO L221A
2209  3E1A0E        L2209 jbs   REG_1A,BIT_06,L221A		; if ( REG_1A.6 ) GOTO L221A
220C  48BE0630            sub   REG_30,IO_Timer,REG_BE		; REG_30 = IO_TIMER - REG_BE  	// REG_BE - время наступление предыдущего события 
2210  D504                jnv   L2216				; if ( !Overflow ) GOTO L2216  >= 0 ???
2212  DE06                jlt   L221A				; if ( < 0 ) L221A ???
2214  2002                sjmp  L2218				; GOTO L2218 ???
2216  D602          L2216 jge   L221A				; if ( >= 0 ) GOTO L221A
2218  2076          L2218 sjmp  L2290				; GOTO L2290  			// End Function

221A  11B0          L221A clrb  REG_B0				; bREG_B0 = 0    		// От текущего времени таймера, одно событие
221C  B10AB8              ldb   REG_B8,#$0A			; bREG_B8 = $0A  		// CLR+HSO.A
221F  296C                scall HS_OUT				;
2221  30B005              jbc   REG_B0,BIT_00,L2229		; if ( !REG_B0.0 ) GOTO L2229 -- вывод свободен
2224  9108B4        L2224 orb   REG_B4,#$08			; REG_B4.3 = 1
2227  2067                sjmp  L2290				; GOTO L2290 			// End Function

2229  B038B8        L2229 ldb   REG_B8,REG_38			; bREG_B8 = SET+HSO.INJ		// От текущего момента, одно событие	
222C  295F                scall HS_OUT
222E  38B0F3              jbs   REG_B0,BIT_00,L2224		; if ( REG_B0.0 ) GOTO L2224 	// Вывод занят
2231  A030BA              ld    REG_BA,REG_30			; REG_BA 			// Время совершившегося события 

2234  A3011024      L2234 ld    REG_32,$2410[Zero]		; REG_32 = $6201		// ???
      32
2239  361A05              jbc   REG_1A,BIT_06,L2241		; if ( !REG_1A.6 ) GOTO L2241
223C  A3011224            ld    REG_32,$2412[Zero]		; REG_32 = $4103		// ???
      32
2241  4832C0B8      L2241 sub   REG_B8,REG_C0,REG_32		; REG_B8 = REG_C0 - REG_32 ( $6201 или $4103 в зависимости от бита REG_1A.6)
2245  D325                jnc   L226C				; if ( > 0 )  GOTO L226C
2247  A03234              ld    REG_34,REG_32			; REG_34 = REG_32  		// Время наступления события 1
224A  A0B836              ld    REG_36,REG_B8			; REG_36 = REG_B8  		// Время 2го события 
224D  B11AB8              ldb   REG_B8,#$1A			; REG_B8 = $#1A    		// SET + HSO.A - Событие 1
2250  B039B9              ldb   REG_B9,REG_39			; REG_B9 = REG_39  		// Событие 2 - всегда CLR+HSO.INJ
2253  B180B0              ldb   REG_B0,#$80			; REG_B0 = $80     		// Событие 1 и 2 время 34 и [3С]
2256  A1BA003C            ld    REG_3C,#$00BA			; REG_3C = $00BA   		// [REG_BA] относительно какого времени 
225A  2931                scall HS_OUT
225C  30B005              jbc   REG_B0,BIT_00,L2264             ; if ( !REG_B0.0 ) GOTO L2264 	// Вывод удачен
225F  9104B4              orb   REG_B4,#$04			; REG_B4.2 = 1 
2262  202C                sjmp  L2290				; GOTO L2290

2264  A030BC        L2264 ld    REG_BC,REG_30			; REG_BC = REG_30 		// время наступления события 1 
2267  A032BE              ld    REG_BE,REG_32			; REG_BE = REG_32 		// время наступления события 2 
226A  201E                sjmp  L228A				; GOTO L228A 			

226C  4432B834      L226C add   REG_34,REG_B8,REG_32		; REG_34 = REG_B8+REG_32  	// Время наступления события 1
2270  B1C0B0              ldb   REG_B0,#$C0			; REG_B0 = $C0   		// 6,7 bit  - одно  событие  
2273  A1BA003C            ld    REG_3C,#$00BA			; REG_3C = $00BA 		// [REG_BA] относительно какого времени 
2277  B039B8              ldb   REG_B8,REG_39			; 				// CLR+HSO.INJ
227A  2911                scall HS_OUT
227C  30B005              jbc   REG_B0,BIT_00,L2284		; if ( !REG_B0.0 ) L2284 	// удачно 
227F  9140B4              orb   REG_B4,#$40			; REG_B4.6 = 1 - 		// Был занят вывод 
2282  200C                sjmp  L2290				;  GOTO L2290
2284  A030BC        L2284 ld    REG_BC,REG_30			; REG_BC = REG_30 - 		// время наступления события 1
2287  A030BE              ld    REG_BE,REG_30			; REG_BE = REG_30 - 		// время наступления события 1
228A  71FEB2        L228A andb  REG_B2,#$FE			; REG_B2.0 = 0 
228D  71B3B4              andb  REG_B4,#$B3			; REG_B4.6 = REG_B4.3 =REG_B4.2 = 0
2290  F0            L2290 ret					; 



;******************* Управление сигналом SPOUT
; DO_SPOUT ()
; REG_B2.2 - 1 - требование обслуживания сигнала SPOUT
; Переменные 
; bREG_1C  -
; REG_CE   -
; REG_CC   - FE_PIP_TIME
; REG_70   - Обороты ??? 
; REG_62   - SPOUT_On	- Время совершения события 
; REG_16   - SPOUT_Off	- Время совершения события 
;
;
; REG_1A.7 -
; REG_1A.6 -
; REG_1A.5 - 1 - Требование установки сигнала SPOUT в "1"
; REG_1A.4 - 1 - Требование установки сигнала SPOUT в "1"
; REG_1A.3 - 1 - Игнорировать SPOUT, после выполнения процедуры очищается 
; REG_1A.2 - 1 - 
; REG_1A.1 - 1 - 
; REG_1A.0 - 1 - 
;
;
;*********************************************

2291  32B210        L2291 jbc   REG_B2,BIT_02,L22A4		; if ( !REG_B2.2 ) GOTO L22A4
2294  8B014824            cmp   REG_70,$2448[Zero]		; if (REG.70 < $7530) ; CUTOFF RPM x4 ?? 7500 ???
      70
2299  D10B                jnh   L22A6				;   GOTO L22A6  
229B  A00662              ld    REG_62,IO_Timer			; REG_62 = IO_Timer          	// SPOUT_On =
229E  A00616              ld    REG_16,IO_Timer			; REG_16 = IO_Timer	     	// SPOUT_Off= 
22A1  71C01A              andb  REG_1A,#$C0			; bREG_1A.7 = bREG_1A.6  = 1
22A4  20E6          L22A4 sjmp  L238C				; GOTO L238C end DO_SPOUT
22A6  3D1A05        L22A6 jbs   REG_1A,BIT_05,L22AE		; if (  REG_1A.5 ) GOTO L22AE 	// IgnImmed2
22A9  3C1A02              jbs   REG_1A,BIT_04,L22AE		; if (  REG_1A.4 ) GOTO L22AE 	// IgnImmed1
22AC  203C                sjmp  L22EA				;  Goto L22EA
22AE  3B1A34        L22AE jbs   REG_1A,BIT_03,L22E5             ; if (  REG_1A.3 ) GOTO L22E5 	// IgnoreIgnImmed
22B1  11B0                clrb  REG_B0				; REG_B0 = 0			// Текущее время таймера , только одно событие
22B3  305212              jbc   REG_52,BIT_00,L22C8		; if ( !REG_52.0 ) GOTO L22C8
22B6  B115B8              ldb   REG_B8,#$15			; REG_B8 = $15   		// Событие SET+HS0.5 
22B9  28D2                scall HS_OUT				; 
22BB  30B002              jbc   REG_B0,BIT_00,L22C0		; if ( !REG_B0.0 ) GOTO L22C0   // Событие произошло
22BE  2010                sjmp  L22D0				; SPOUT_ON - Не произошло занят
22C0  91041A        L22C0 orb   REG_1A,#$04			; REG_1A.2 = 1			// SPOUT = ON 
22C3  A03062              ld    REG_62,REG_30			; REG_62 = REG_30		// SPOUT_On = когда on было 
22C6  2013                sjmp  L22DB				; GOTO  L22DB
22C8  B105B8        L22C8 ldb   REG_B8,#$05			; REG_B8 = $05                  // Событие OFF + HSO.5
22CB  28C0                scall HS_OUT				; 
22CD  30B005              jbc   REG_B0,BIT_00,L22D5		; if ( !REG_B0.0 ) GOTO L22D5   // Событие произошло
22D0  9110B4        L22D0 orb   REG_B4,#$10			; REG_B4.4 = 1			// Событие SPOUT_OFF непроизошло
22D3  20B7                sjmp  L238C				; GOTO L238C
22D5  71FB1A        L22D5 andb  REG_1A,#$FB			; REG_1A.2 = 0			// SPOUT = OFF
22D8  A03016              ld    REG_16,REG_30			; REG_16 = REG_30		// Last_SPOUT_Off = когда off было
22DB  351A02        L22DB jbc   REG_1A,BIT_05,L22E0		; if ( !REG_1A.5 ) GOTO L22E0   // 
22DE  20A9                sjmp  L2389				; END DO_SPOUT
22E0  3C1A07        L22E0 jbs   REG_1A,BIT_04,L22EA		; if (  REG_1A.4 ) GOTO L22EA
22E3  20A4                sjmp  L2389				; END DO_SPOUT
22E5  71F71A        L22E5 andb  REG_1A,#$F7			; REG_1A.3 = 0
22E8  209F                sjmp  L2389				; END DO_SPOUT
		; Если есть требование SPOUT и нет REG_1A.5 или REG_1A.4
22EA  91081A        L22EA orb   REG_1A,#$08			; REG_1A.3 = 1			// ?? Занят 
22ED  381A6A              jbs   REG_1A,BIT_00,L235A		; if (  REG_1A.0 ) GOTO L235A   //
22F0  391A03              jbs   REG_1A,BIT_01,L22F6		; if (  REG_1A.1 ) GOTO L22F6   //
22F3  3A1A59              jbs   REG_1A,BIT_02,L234F		; if (  REG_1A.2 ) GOTO L234F	// 
		; Нет REG_1A.0 REG_1A.1 REG_1A.2
22F6  0130          L22F6 clr   REG_30				; REG_30 = 0			// 
22F8  A3012C24            ld    REG_34,$242C[Zero]		; REG_34 = 0168			// REG_34 = $0168
      34
22FD  45280034            add   REG_36,REG_34,#$0028		; REG_36 = REG_34 + $0028	// REG_36 = REG_34+$0028
      36
2302  AC1C38              ldbze REG_38,REG_1C			; REG_38 = bREG_1C		// REG_38 = REG_1C
2305  48383632            sub   REG_32,REG_36,REG_38		; REG_32 = REG_36 - REG_38      // REG_32 = REG_36 - REG_38   ( $0168 +$0028 -REG_1C  )
2309  090134              shl   REG_34,#$01			; REG_34 *= 2			// $0168 *= 2	
230C  8C3430              divu  REG_30,REG_34			; (long)REG_30,REG_32 / REG_34 => REG_30 div REG_32 rem       ( $0168 +$0028 -REG_1C  )/ ($0168 * 2) => (360+40-REG_1C)/720
230F  DD30                jv    L2341				; Если реультат больше 1? - ошибка SPOUT пропускается
2311  A03018              ld    REG_18,REG_30			; REG_18 = REG_30 		//  ($0168+$0028-bREG_1C)/($0168*2) остаток от деления  > 1
2314  91801B              orb   REG_1B,#$80			; REG_1B.7 = 1 
2317  4C18CE30            mulu  REG_30,REG_CE,REG_18		; (long)REG_30,REG_32 = REG_CE * REG_18 // REG_CE*( ($0168+$0028-bREG_1C)/($0168*2) )
231B  0D0130              shll  REG_30,#$01			; (long)REG_30,REG_32 * =2  	//  REG_CE*( ($0168+$0028-bREG_1C)/($0168*2) )* 2 ;	
231E  490080CE            sub   REG_30,REG_CE,#$8000		; REG_30 = REG_CE - $8000	//  REG_CE-$8000 
      30
2323  0330                neg   REG_30				; REG_30 = -REG_30		// Типа REG_CE <0 ??
2325  48303234            sub   REG_34,REG_32,REG_30		; REG_34 = REG_32 - REG_30      //  (REG_CE*( ($0168+$0028-bREG_1C)/($0168*2) )* 2)/65535  - ( -(REG_CE-$8000) )
2329  6C1E34              mulu  REG_34,REG_1E			; REG_34 * Ton_PIP              //  (REG_CE*( ($0168+$0028-bREG_1C)/($0168*2) )* 2)/65535  - ( -(REG_CE-$8000) ) * Ton_PIP
232C  0D0134              shll  REG_34,#$01			; (long) REG_34 * = 2 		//  (REG_CE*( ($0168+$0028-bREG_1C)/($0168*2) )* 2)/65535  - ( -(REG_CE-$8000) ) * Ton_PIP * 2
232F  A03634              ld    REG_34,REG_36			; REG_34 = ABOVE/65535		//  (REG_CE*( ($0168+$0028-bREG_1C)/($0168*2) )* 2)/65535  - ( -(REG_CE-$8000) ) * Ton_PIP * 2 / $FFFF  - время наступления события 1
								; //  (REG_CE*((360+40-bREG_1C)/720)* 2)/65535  - ( -(REG_CE-$8000) ) * T_CrankRev / $FFFF 
2332  A1CC003C            ld    REG_3C,#$00CC			; REG_3C = $00CC 		// Фактически REG_CC - FE_PIP_TIME 
2336  B115B8              ldb   REG_B8,#$15			; REG_B8 = 15			// SET+HSO.5
2339  B1C0B0              ldb   REG_B0,#$C0			; 				// Одно событие время его в REG_34 И [REG_3C]
233C  284F                scall HS_OUT
233E  30B005              jbc   REG_B0,BIT_00,L2346		; if ( !REG_B0.0 ) GOTO L2346	// OK 
2341  91021A        L2341 orb   REG_1A,#$02			; REG_1A.1 = 1			// Ошибка SPOUT пропущен или требование SPOUT.ON ???
2344  2046                sjmp  L238C				; END DO_SPOUT
2346  A03062        L2346 ld    REG_62,REG_30			; REG_62 = REG_30 		// SPOUT_On = Время планируемого SPOUT 
2349  71FD1A              andb  REG_1A,#$FD			; REG_1A.1 = 0			
234C  91041A              orb   REG_1A,#$04			; REG_1A.2 = 1
234F  881606        L234F cmp   IO_Timer,REG_16			; if ( IO_TIMER < SPOUT_Off )	// Здесь уточнить логику в диаграмме , можно ли совершить SPOUT.OFF ???
2352  DE04                jlt   L2358				;  GOTO L2358 			// Если SPOUT.OFF в будующим
2354  DD36                jv    L238C				; if ( IO_TIMER > SPOUT_Off ) GOTO L238C  // END DO_SPOUT 	  
2356  2002                sjmp  L235A				; GOTO L235A
2358  D532          L2358 jnv   L238C				; if ( IO_TIMER == SPOUT_Off) GOTO  L238C // END DO_SPOUT 		
235A  89CA011E      L235A cmp   REG_1E,#$01CA			; if ( Ton_PIP < $01CA )	// 
235E  D106                jnh   L2366				;  GOTO L2366 	
2360  89B1281E            cmp   REG_1E,#$28B1			; if ( Ton_PIP < $28B1 )	// 
2364  D106                jnh   L236C				;  GOTO L236C			// 
2366  A1800334      L2366 ld    REG_34,#$0380			; REG_34 = $0380		// Если Ton_PIP < $01CA или Ton_PIP > $28B1 то время наступления события 
236A  2003                sjmp  L236F				; GOTO L236F
236C  A01E34        L236C ld    REG_34,REG_1E			; REG_34 = Ton_PIP		// Время наступления события  REG_1E содержит длительность сигнала PIP ON
236F  A162003C      L236F ld    REG_3C,#$0062			; REG_3C = $0062		// [REG_62] - смещение от SPOUT_On
2373  B105B8              ldb   REG_B8,#$05			; REG_B8 = $05			// CLR+HS0.5
2376  B1C0B0              ldb   REG_B0,#$C0			; REG_B0 = $C0 			// ОДно событие время в REG_34 и [REG_3C]
2379  2812                scall HS_OUT				; 
237B  30B005              jbc   REG_B0,BIT_00,L2383		; if ( !REG_B0.0 ) GOTO 2383    // SPOUT OK
237E  91011A              orb   REG_1A,#$01			; REG_1A.1 = 1                  // SPOUT FailEdge - пропущен
2381  2009                sjmp  L238C				; GOTO L238C			// END SPOUT
2383  71FA1A        L2383 andb  REG_1A,#$FA			; REG_1A.2 = REG_1A.0 = 0
2386  A03016              ld    REG_16,REG_30			; REG_16   = REG_30		//  SPOUT_Off = Время события 
2389  71FBB2        L2389 andb  REG_B2,#$FB			; REG_B2.2 = 0 			//  SPOUT обслужен
238C  F0            L238C ret


			;***********************************************************
			; HS_OUT
			; REG_B8 - Событие 1
			; REG_B9 - Событие 2
			; REG_34 - Время совершения события 1 
			; REG_36 = Время совершения события как добавление к времени 1го события
			; REG_3C - указатель на дополнительную задержку
			; REG_B0 - Флаги
			;       .7 - 1 время события задаётся REG_34 и [REG_3C]
  			;            0 берётся текущее время таймера
			;       .6 - нет 2го события когда  .7=1  
			;       .4 - есть 2ое событие когда .7=0 
			;
			;   REG_30 = Время совершения события 1
			;   REG_32 = Время совершения события 2
			;   REG_B0.0   1= HSO занят (отложить) 0 = Поставлен в очередь
			;***********************************************************
		    HS_OUT:
238D  71FEB0        L238D andb  REG_B0,#$FE			; REG_B0.0 = 0
2390  380A40              jbs   IO_Status,BIT_00,L23D3		; if ( IO_Status.0 ) GOTO L23D3
2393  0534                dec   REG_34				; REG34 --
2395  3FB005              jbs   REG_B0,BIT_07,L239D		; if ( REG_B0.7 ) GOTO L239D
2398  A00630              ld    REG_30,IO_Timer			; REG_30 = IO_TIMER
239B  2004                sjmp  L23A1				; GOTO L23A1
239D  463C3430      L239D add   REG_30,REG_34,[REG_3C]		; REG_30 = REG_34+[REG_3C]
23A1  B0B83E        L23A1 ldb   REG_3E,REG_B8			; REG_3E = REG_B8   ; Событие порта HSO
23A4  A030B6              ld    REG_B6,REG_30			; REG_B6 = REG_30   ;( REG_34+[REG_3C] )  или IO_TIMER
23A7  4830063A            sub   REG_3A,IO_Timer,REG_30		; REG_3A = IO_TIMER - ( REG_34+[REG_3C] ) - дельта наступления события
23AB  282A                scall Do_HSO_Event
23AD  A0B630              ld    REG_30,REG_B6			; REG_30 = REG_B6 (REG_B6 или IO_TIMER + $002A или
23B0  3FB005              jbs   REG_B0,BIT_07,L23B8		; if ( REG_B0.7 ) GOTO L23B8
23B3  3CB005              jbs   REG_B0,BIT_04,L23BB		; if ( REG_B0.4 ) GOTO L23BB
23B6  201E                sjmp  L23D6				; Всё завершили
23B8  3EB01B        L23B8 jbs   REG_B0,BIT_06,L23D6		; if ( REG_B0.6 ) GOTO L23D6
23BB  380A15        L23BB jbs   IO_Status,BIT_00,L23D3          ; if ( IO_Status.0 ) GOTO L23D3
23BE  44303632            add   REG_32,REG_36,REG_30		; REG_32 = REG36+REG30
23C2  B0B93E              ldb   REG_3E,REG_B9			; REG_3E = REG_B9
23C5  A032B6        L23C5 ld    REG_B6,REG_32			; REG_36 = REG_32
23C8  4832063A            sub   REG_3A,IO_Timer,REG_32		; REG_3A = IO_TIMER - REG_32
23CC  2809                scall Do_HSO_Event
23CE  A0B632              ld    REG_32,REG_B6			; REG_32 = REG_36
23D1  2003                sjmp  L23D6
23D3  9101B0        L23D3 orb   REG_B0,#$01			; REG_B0.0 = 1 Занят порт HSO
23D6  F0            L23D6 ret


			;***********************************************************
			; Do_HSO_Event
			; REG_B6 - Время наступления события
			; REG_3E - Событие 
			; REG_3A - Дельта наступления события от текущего времени таймера 
			;  sub   REG_3A,IO_Timer,REG_30 типично перед вызовом
			;  
			;***********************************************************
		Do_HSO_Event:
23D7  DE04          L23D7 jlt   L23DD				; if ( < ) GOTO L23DD ; 
23D9  DD04                jv    L23DF				; if ( Overflow ) GOTO L23DF
23DB  2014                sjmp  L23F1				; GOTO L23F1
23DD  DD12          L23DD jv    L23F1				; if ( overflow  ) GOTO L23F1 ; уже сейчас событие должно быть
23DF  FA            L23DF di					;
23E0  FF                  nop
23E1  033A                neg   REG_3A				; REG_3A = - REG_3A     ; здесь когда REG_3A < 0 , просто инвертируем знак
23E3  892A003A            cmp   REG_3A,#$002A			; if ( REG_3A < $002A)
23E7  D308                jnc   L23F1				;  GOTO L23F1  Задержка неможет быть < 42 тиков
23E9  A0B60E              ld    HSO_Time,REG_B6			; Время наступления события
23EC  B03E0D              ldb   HSO_Data,REG_3E    		; Событие 
23EF  200D                sjmp  L23FE				; GOTO L23FE

23F1  FA            L23F1 di
23F2  FF                  nop
23F3  452A0006            add   REG_B6,IO_Timer,#$002A  	; REG_B6 = IO_TIMER + $002A
      B6
23F8  A0B60E              ld    HSO_Time,REG_B6         	; событие от текущего времени + 42 тика 
23FB  B03E0D              ldb   HSO_Data,REG_3E			; собственно событие 
23FE  FB            L23FE ei
23FF  F0                  ret

2400  0080                word  $8000
2402  0000                word  $0000
2404  D007                word  $07D0
2406  9001                word  $0190
2408  6009                word  $0960
240A  5802                word  $0258
240C  0A19                word  $190A
240E  0040                word  $4000
2410  6201                word  $0162
2412  4103                word  $0341
2414  F163                word  $63F1
2416  4D15                word  $154D
2418  3108                word  $0831
241A  80FF                word  $FF80
241C  4001                word  $0140
241E  0001                word  $0100
2420  8000                word  $0080
2422  0080                word  $8000
2424  A00F                word  $0FA0
2426  00F0                word  $F000
2428  80FF                word  $FF80
242A  0000                word  $0000
242C  6801                word  $0168
242E  603C                word  $3C60
2430  EBFF                word  $FFEB
2432  8813                word  $1388
2434  B80B                word  $0BB8
2436  01FF                word  $FF01
2438  0400                word  AD_Lo
243A  3F05                word  $053F
243C  FFFF                word  $FFFF
243E  4D80                word  $804D
2440  0040                word  $4000
2442  0C00                word  $00C0
2444  0000                word  $0000
2446  40FF                word  $FF40
2448  3075                word  $7530
244A  1605                word  $0516
244C  D007                word  $07D0
244E  D8FF                word  $FFD8
2450  0000                word  $0000
2452  9001                word  $0190
2454  3300                word  $0033
2456  1220                word  $2012
2458  0000                word  $0000
245A  F401                word  $01F4
245C  DC05                word  $05DC
245E  0200                word  $0020
2460  F628                word  $28F6
2462  6606                word  $0666
2464  55FF                word  $FF55
2466  0068                word  $6800
2468  0000                word  $0000
246A  F8FF                word  $FFF8
246C  F0FF                word  $FFF0
246E  E8FF                word  $FFE8
2470  3000                word  $0030
2472  00AF                word  $AF00
2474  0078                word  $7800
2476  0018                word  $1800	; 0 in I_PIP_ROUTINE
2478  0101                word  $0101
247A  00FA                word  $FA00
247C  800C                word  $0C80
247E  00E6                word  $E600
2480  8007                word  $0780
2482  00E6                word  $E600
2484  000D                word  $0D00
2486  00FA                word  $FA00
2488  800C                word  $0C80
248A  19FF                word  $FF19
248C  007D                word  $7D00
248E  0032                word  $3200
2490  00FF                word  $FF00
2492  0040                word  $4000
2494  3313                word  $1333
2496  CD6C                word  $6CCD
2498  6666                word  $6666
249A  9A19                word  $199A
249C  2308                word  $0823
249E  2020                word  $2020
24A0  1000                word  $0010
24A2  0C62                word  $620C
24A4  37FF                word  $FF37
24A6  5802                word  $0258
24A8  9065                word  $6590
24AA  E803                word  $03E8
24AC  13FF                word  $FF13
24AE  B004                word  $04B0
24B0  3CFF                word  $FF3C
24B2  8025                word  $2580
24B4  1027                word  $2710
24B6  3333                word  $3333
24B8  0080                word  $8000
24BA  3333                word  $3333
24BC  0080                word  $8000
24BE  0032                word  $3200					; init ??
24C0  00FF                word  $FF00
24C2  1027                word  $2710
24C4  0000                word  $0000
24C6  0000                word  $0000
24C8  0000                word  $0000
24CA  0000                word  $0000
24CC  CA71                word  $71CA
24CE  8000                word  $0080
24D0  403A                word  $3A40
24D2  3630                word  $3036
24D4  2D26                word  $262D
24D6  2520                word  $2025
24D8  403A                word  $3A40
24DA  3630                word  $3036
24DC  2D25                word  $252D
24DE  2520                word  $2025
24E0  403A                word  $3A40
24E2  3630                word  $3036
24E4  2D25                word  $252D
24E6  2320                word  $2023
24E8  403A                word  $3A40
24EA  3630                word  $3036
24EC  2D25                word  $252D
24EE  2320                word  $2023
24F0  403A                word  $3A40
24F2  3630                word  $3036
24F4  2D24                word  $242D
24F6  2320                word  $2023
24F8  403A                word  $3A40
24FA  3630                word  $3036
24FC  2D24                word  $242D
24FE  2320                word  $2023
;TBL_Lookup
2500  E6DA                word  $DAE6
2502  C0B3                word  $B3C0
2504  A69A                word  $9AA6
2506  8D8D                word  $8D8D
2508  E6DA                word  $DAE6
250A  C0A6                word  $A6C0
250C  9A8D                word  $8D9A
250E  8080                word  $8080
2510  DACD                word  $CDDA
2512  B39A                word  $9AB3
2514  8D80                word  $808D
2516  8080                word  $8080
2518  C0B3                word  $B3C0
251A  A68D                word  $8DA6
251C  8080                word  $8080
251E  8080                word  $8080
2520  9A9A                word  $9A9A
2522  8D8D                word  $8D8D
2524  8080                word  $8080
2526  8080                word  $8080
2528  8080                word  $8080
252A  8080                word  $8080
252C  8080                word  $8080
252E  8080                word  $8080
;TBL_Lookup
2530  4231                word  $3142
2532  211D                word  $1D21
2534  190C                word  $0C19
2536  0A0A                word  $0A0A
2538  2921                word  $2129
253A  1D11                word  $111D
253C  0D09                word  $090D
253E  0605                word  $0506
2540  211D                word  $1D21
2542  190F                word  $0F19
2544  0C08                word  $080C
2546  0504                word  $0405
2548  1D19                word  $191D
254A  120D                word  $0D12
254C  0A08                word  $080A
254E  0504                word  $0405
2550  1414                word  $1414
2552  0D0A                word  $0A0D
2554  0807                word  $0708
2556  0504                word  $0405
2558  1410                word  $1014
255A  0A08                word  $080A
255C  0707                word  $0707
255E  0504                word  $0405
2560  0A08                word  $080A
2562  0706                word  $0607
2564  0606                word  $0606
2566  0504                word  $0405
2568  0907                word  $0709
256A  0606                word  $0606
256C  0606                word  $0606
256E  0504                word  $0405
2570  0806                word  $0608
2572  0505                word  $0505
2574  0505                word  $0505
2576  0404                word  $0404
2578  0606                word  $0606
257A  0505                word  $0505
257C  0505                word  $0505
257E  0404                word  $0404
2580  0606                word  $0606
2582  0505                word  $0505
2584  0505                word  $0505
2586  0404                word  $0404
;TBL_Lookup
2588  5030                word  $3050
258A  3030                word  $3030
258C  3C64                word  $643C
258E  78A0                word  $A078
2590  A0A0                word  $A0A0
2592  A4A8                word  $A8A4
2594  A850                word  $50A8
2596  3030                word  $3030
2598  3048                word  $4830
259A  6478                word  $7864
259C  A0A0                word  $A0A0
259E  A0A4                word  $A4A0
25A0  A8A8                word  $A8A8
25A2  5040                word  $4050
25A4  4040                word  $4040
25A6  5064                word  $6450
25A8  78A0                word  $A078
25AA  A0A0                word  $A0A0
25AC  A4A8                word  $A8A4
25AE  A850                word  $50A8
25B0  4040                word  $4040
25B2  6480                word  $8064
25B4  989C                word  $9C98
25B6  A0A0                word  $A0A0
25B8  A0A4                word  $A4A0
25BA  A8A8                word  $A8A8
25BC  3840                word  $4038
25BE  5064                word  $6450
25C0  8CA0                word  $A08C
25C2  A4A4                word  $A4A4
25C4  A8A0                word  $A0A8
25C6  9C9C                word  $9C9C
25C8  9C2C                word  $2C9C
25CA  4064                word  $6440
25CC  8890                word  $9088
25CE  969C                word  $9C96
25D0  A4A8                word  $A8A4
25D2  B4B8                word  $B8B4
25D4  A4A8                word  $A8A4
25D6  2840                word  $4028
25D8  7880                word  $8078
25DA  8890                word  $9088
25DC  989C                word  $9C98
25DE  A8AC                word  $ACA8
25E0  B0A4                word  $A4B0
25E2  A428                word  $28A4
25E4  4060                word  $6040
25E6  7480                word  $8074
25E8  888C                word  $8C88
25EA  949C                word  $9C94
25EC  A0A8                word  $A8A0
25EE  A0A0                word  $A0A0
25F0  2030                word  $3020
25F2  4854                word  $5448
25F4  7080                word  $8070
25F6  8084                word  $8480
25F8  989C                word  $9C98
25FA  A09C                word  $9CA0
25FC  A020                word  $20A0
25FE  3030                word  $3030
2600  4058                word  $5840
2602  686C                word  $6C68
2604  7C90                word  $907C
2606  98A0                word  $A098
2608  8C8C                word  $8C8C
260A  2030                word  $3020
260C  3040                word  $4030
260E  5864                word  $6458
2610  6C74                word  $746C
2612  8080                word  $8080
2614  8484                word  $8484
2616  8820                word  $2088
2618  3030                word  $3030
261A  4054                word  $5440
261C  646C                word  $6C64
261E  707A                word  $7A70
2620  8088                word  $8880
2622  8888                word  $8888
2624  2030                word  $3020
2626  3040                word  $4030
2628  5464                word  $6454
262A  6C70                word  $706C
262C  7A80                word  $807A
262E  8888                word  $8888
2630  8800                word  $0088
; 2631 TBL_Lookup
2632  0000                word  $0000
2634  0000                word  $0000
2636  0000                word  $0000
2638  0000                word  $0000
263A  0000                word  $0000
263C  0000                word  $0000
263E  0000                word  $0000
2640  0000                word  $0000
2642  0000                word  $0000
2644  0000                word  $0000
2646  0000                word  $0000
2648  0000                word  $0000
264A  0000                word  $0000
264C  0000                word  $0000
264E  0000                word  $0000
2650  0000                word  $0000
2652  0000                word  $0000
2654  0000                word  $0000
2656  0000                word  $0000
2658  0000                word  $0000
265A  0000                word  $0000
265C  0000                word  $0000
265E  0000                word  $0000
; 2661 !!! TBL_Lookup
2660  0078                word  $7800
2662  787C                word  $7C78
2664  7B7B                word  $7B7B
2666  7979                word  $7979
2668  7979                word  $7979
266A  7979                word  $7979
266C  7976                word  $7679
266E  7676                word  $7676
2670  6060                word  $6060
2672  7979                word  $7979
2674  7979                word  $7979
2676  7979                word  $7979
2678  7978                word  $7879
267A  7676                word  $7676
267C  7660                word  $6076
267E  6068                word  $6860
2680  6C6C                word  $6C6C
2682  7074                word  $7470
2684  7979                word  $7979
2686  7876                word  $7678
2688  7676                word  $7676
268A  7575                word  $7575
268C  7576                word  $7675
268E  7375                word  $7573
2690  7575                word  $7575
2692  7470                word  $7074
2694  6E76                word  $766E
2696  7672                word  $7276
2698  7276                word  $7672
269A  7673                word  $7376
269C  7474                word  $7474
269E  7470                word  $7074
26A0  6E6B                word  $6B6E
26A2  7676                word  $7676
26A4  7075                word  $7570
26A6  7675                word  $7576
26A8  7472                word  $7274
26AA  7272                word  $7272
26AC  7273                word  $7372
26AE  7476                word  $7674
26B0  7670                word  $7076
26B2  777A                word  $7A77
26B4  7876                word  $7678
26B6  726E                word  $6E72
26B8  7072                word  $7270
26BA  7370                word  $7073
26BC  6060                word  $6060
26BE  646A                word  $6A64
26C0  6C6B                word  $6B6C
26C2  6A68                word  $686A
26C4  6A70                word  $706A
26C6  7273                word  $7372
26C8  7050                word  $5070
26CA  605E                word  $5E60
26CC  6266                word  $6662
26CE  6666                word  $6666
26D0  6565                word  $6565
26D2  6E70                word  $706E
26D4  7271                word  $7172
26D6  5058                word  $5850
26D8  5D5F                word  $5F5D
26DA  6263                word  $6362
26DC  6463                word  $6364
26DE  6265                word  $6562
26E0  6660                word  $6066
26E2  6050                word  $5060
26E4  5862                word  $6258
26E6  5E60                word  $605E
26E8  6264                word  $6462
26EA  635E                word  $5E63
26EC  5856                word  $5658
26EE  5A5A                word  $5A5A
26F0  5058                word  $5850
26F2  6265                word  $6562
26F4  6062                word  $6260
26F6  6463                word  $6364
26F8  5E58                word  $585E
26FA  565A                word  $5A56
26FC  5A50                word  $505A
26FE  5062                word  $6250
2700  6560                word  $6065
2702  6264                word  $6462
2704  635E                word  $5E63
2706  5856                word  $5658
2708  5A5A                word  $5A5A
; TBL_Lookup
270A  0000                word  $0000
270C  0000                word  $0000
270E  0000                word  $0000
2710  0000                word  $0000
2712  0000                word  $0000
2714  0000                word  $0000
2716  0000                word  $0000
2718  0000                word  $0000
271A  0000                word  $0000
271C  0000                word  $0000
271E  0000                word  $0000
2720  0000                word  $0000
2722  0000                word  $0000
2724  0000                word  $0000
2726  0000                word  $0000
2728  0000                word  $0000
272A  0000                word  $0000
272C  0000                word  $0000
272E  0000                word  $0000
2730  0000                word  $0000
2732  0000                word  $0000
2734  0000                word  $0000
2736  0000                word  $0000
2738  0000                word  $0000
273A  0000                word  $0000
273C  0000                word  $0000
273E  0000                word  $0000
2740  0000                word  $0000
2742  0000                word  $0000
2744  0000                word  $0000
2746  0000                word  $0000
2748  0000                word  $0000
; UWLookup
274A  FFFF                word  $FFFF,$0089                       ; Lookup Table first word InValue second OutValue etc
274E  0078                word  $7800,$0089
2752  0070                word  $7000,$00AB
2756  0068                word  $6800,$00C9
275A  0060                word  $6000,$00F3
275E  0058                word  $5800,$012A
2762  0050                word  $5000,$017C
2766  0048                word  $4800,$01D0
276A  0038                word  $3800,$037F
276E  0000                word  $0000,$037F
; Это то что преобразуется ADC_1
; UWlookup
2772  FFFF                word  $FFFF,$D3F0                 	; Lookup Table first word InValue second OutValue etc
2776  C0FF                word  $FFC0,$D3F0
277A  0000                word  $0000,$0000
277E  0000                word  $0000,$0000
;UWLookup
2782  FFFF                word  $FFFF,$B540			; Lookup Table first word InValue second OutValue etc
2786  007D                word  $7D00,$B540
278A  803E                word  $3E80,$A8C0
278E  0019                word  $1900,$7080
2792  0000                word  $0000,$1900
; UWLookup
2796  FFFF                word  $FFFF,$0500			; Lookup Table first word InValue second OutValue etc
279A  3C00                word  $003C,$0500
279E  1E00                word  $001E,$0400
27A2  0A00                word  $000A,$0200
27A6  0000                word  $0000,$0000

27AA  0000                word  $0000
27AC  0000                word  $0000
27AE  0000                word  $0000
27B0  0000                word  $0000

; UWLookup
27B2  FFFF                word  $FFFF,$0A00			; Lookup Table first word InValue second OutValue etc
27B6  FF00                word  $00FF,$000A
27BA  3C00                word  $003C,$0900
27BE  2A00                word  $002A,$0800
27C2  1E00                word  $001E,$0700
27C6  1600                word  $0016,$0500
27CA  0E00                word  $000E,$0400
27CE  0600                word  $0006,$0200
27D2  0000                word  $0000,$0000
; WORD SWLookup
27D6  FF7F                word  $7FFF,$0700
27DA  0041                word  $4100,$0700
27DE  0028                word  $2800,$0600
27E2  0014                word  $1400,$0500
27E6  00E2                word  $E200,$0000
27EA  0080                word  $8000,$0000
27EE  0080                word  $8000,$0000

; UWLookup
27F2  FFFF                word  $FFFF,$0500			; Lookup Table first word InValue second OutValue etc
27F6  3411                word  $1134,$0500
27FA  6210                word  $1062,$0400
27FE  3108                word  $0831,$0000
2802  0000                word  $0000,$0000

; Таблица от оборотов КВ ()
2806  FFFF                word  $FFFF,$0010             ;UpTo Lookup Table first word InValue second OutValue etc
280A  6009                word  $0960,$0010		;2400 - 16
280E  4006                word  $0640,$0018		;1600 - 24
2812  B004                word  $04B0,$0020		;1200 - 32
2816  0000                word  $0000,$0020		;0000 - 32
281A  0000                word  $0000,$0020
281E  0000                word  $0000,$0020

; UWLookup
2822  FFFF                word  $FFFF,$0C00
2826  C05D                word  $5DC0,$0C00
282A  E02E                word  $2EE0,$0700
282E  A00F                word  $0FA0,$0200
2832  F00A                word  $0AF0,$0000
2836  0000                word  $0000,$0000

283A  0000                word  $0000
283C  0000                word  $0000
283E  0000                word  $0000
2840  0000                word  $0000
2842  0000                word  $0000
2844  0000                word  $0000
; UWLookup
2846  FFFF                word  $FFFF,$0C00			; Lookup Table first word InValue second OutValue etc
284A  A913                word  $13A9,$0C00
284E  0000                word  $0000,$0000
2852  0000                word  $0000,$0000
; SWLookup 
2856  FF7F                word  $7FFF,$00C0
285A  0073                word  $7300,$00C0
285E  0060                word  $6000,$0000
2862  0080                word  $8000,$0000
; UWLookup
2866  FFFF                word  $FFFF,$FFFF			; Lookup Table first word InValue second OutValue etc
286A  C0FF                word  $FFC0,$FFFF
286E  80E9                word  $E980,$8DA5
2872  80DA                word  $DA80,$6C66
2876  80CD                word  $CD80,$551F
287A  40C1                word  $C140,$4480
287E  40B7                word  $B740,$38ED

2882  00AB                word  $AB00,$2D8E			; Lookup Table first word InValue second OutValue etc,
2886  409B                word  $9B40,$220D
288A  408B                word  $8B40,$199B
288E  807D                word  $7D80,$13F3
2892  006B                word  $6B00,$0E3B
2896  004F                word  $4F00,$0883
289A  003E                word  $3E00,$0640
289E  802C                word  $2C80,$0497
28A2  C00C                word  $0CC0,$0298
28A6  0000                word  $0000,$0000
28AA  0000                word  $0000,$0000


; ADC_8 таблица преобразований ECT  актуальные значения в приложении .XLS
; SWLookup
ADC_8_TFR:
28AE  FF7F                word  $7FFF,$D800
28B2  E073                word  $73E0,$D800
28B6  8070                word  $7080,$E700
28BA  C06E                word  $6EC0,$EC00
28BE  E069                word  $69E0,$F600
28C2  0063                word  $6300,$0000
28C6  005A                word  $5A00,$0A00
28CA  C054                word  $54C0,$0F00
28CE  6031                word  $3160,$2D00
28D2  0027                word  $2700,$3700
28D6  401E                word  $1E40,$4100
28DA  4017                word  $1740,$4B00
28DE  C011                word  $11C0,$5500
28E2  E00B                word  $0BE0,$6400
28E6  2009                word  $0920,$6E00
28EA  0007                word  $0700,$7800
28EE  0080                word  $8000,$7800


; ADC_9 таблица преобразований ACT
; SWLookup
ADC_9_TFR: 
28F2  FF7F                word  $7FFF,$D800		; Lookup Table first word InValue second OutValue etc
28F6  0073                word  $7300,$D800
28FA  0067                word  $6700,$FC00
28FE  A01C                word  $1CA0,$4600
2902  C00C                word  $0CC0,$6900
2906  1509                word  $0915,$7F00
290A  0080                word  $8000,$7F00

; Табличка интересная ....
;UWLookup
290E  FFFF                word  $FFFF,$FFFD
2912  ADAF                word  $AFAD,$D411
2916  5C8F                word  $8F5C,$BF92
291A  6666                word  $6666,$A1E8
291E  3333                word  $3333,$727C
2922  7B14                word  $147B,$4869
2926  3D0A                word  $0A3D,$3332
292A  1F05                word  $051F,$246A
292E  0601                word  $0106,$123C
2932  0000                word  $0000,$0000

;UBLookup
2936  FFE6                word  $E6FF
2938  00E6                word  $E600
293A  00E6                word  $E600
293C  00E6                word  $E600
293E  00E6                word  $E600

;SBLookup
2940  7F00                word  $007F
2942  4B00                word  $004B
2944  2812                word  $1228
2946  1924                word  $2419
2948  073B                word  $3B07
294A  803B                word  $3B80

; SWLookup
294C  FF7F                word  $7FFF,$0C80
2950  3700                word  $0037,$0C80
2954  F6FF                word  $FFF6,$0E10
2958  E2FF                word  $FFE2,$0FA0
295C  0080                word  $8000,$0FA0

; SWLookup
2960  FF7F                word  $7FFF,$FD71
2964  BC02                word  $02BC,$FD71
2968  9001                word  $0190,$FEFA
296C  C800                word  $00C8,$FFCC
2970  6400                word  $0064,$0000
2974  9CFF                word  $FF9C,$0000
2978  38FF                word  $FF38,$009D
297C  70FE                word  $FE70,$020C
2980  A8FD                word  $FDA8,$051F
2984  0080                word  $8000,$051F

; SWLookup
2988  FF7F                word  $7FFF,$1000
298C  3C00                word  $003C,$1000
2990  1A00                word  $001A,$0B33
2994  0000                word  $0000,$0A66
2998  F6FF                word  $FFF6,$099A
299C  0080                word  $8000,$099A

; UWLookup
29A0  FFFF                word  $FFFF,$8000                       ; Lookup Table first word InValue second OutValue etc
29A4  0080                word  $8000,$8000
29A8  357E                word  $7E35,$6666
29AC  E976                word  $76E9,$50A4
29B0  CB31                word  $31CB,$3333
29B4  9C14                word  $149C,$2666
29B8  9C04                word  $049C,$199A
29BC  0000                word  $0000,$0000

29C0  0000                word  $0000
29C2  0000                word  $0000
29C4  0000                word  $0000
29C6  0000                word  $0000

;SWLookup
29C8  FF7F                word  $7FFF,$35C3
29CC  4400                word  $0044,$35C3
29D0  1400                word  $0014,$4666
29D4  0000                word  $0000,$5333
29D8  F6FF                word  $FFF6,$63D7
29DC  0080                word  $8000,$63D7


; ADC_4  таблица преобразований со знаком
29E0  FF7F                word  $7FFF,$00FF			; Lookup Table first word InValue second OutValue etc
29E4  0000                word  $0000,$FF00
29E8  0080                word  $8000,$FF00
29EC  0080                word  $8000,$FF00

; ADC_5  таблица преобразований 
; UWLookup
29F0  FFFF                word  $FFFF,$8000			; Lookup Table first word InValue second OutValue etc
29F4  C0FF                word  $FFC0,$8000
29F8  0000                word  $0000,$0000
29FC  0000                word  $0000,$0000

; UWLookup
2A00  FFFF                word  $FFFF,$00F8			; Lookup Table first word InValue second OutValue etc
2A04  5AA2                word  $A25A,$00F8
2A08  468A                word  $8A46,$00B8
2A0C  CC74                word  $74CC,$0078
2A10  0000                word  $0000,$0078

; UWLookup
2A14  FFFF                word  $FFFF,$4666			; Lookup Table first word InValue second OutValue etc
2A18  E02E                word  $2EE0,$4666
2A1C  401F                word  $1F40,$399A
2A20  7017                word  $1770,$35C3
2A24  3011                word  $1130,$3333
2A28  0000                word  $0000,$3333

; SWLookup
2A2C  FF7F                word  $7FFF,$0000
2A30  3700                word  $0037,$0000
2A34  0F00                word  $000F,$199A
2A38  0000                word  $0000,$1C29
2A3C  F6FF                word  $FFF6,$2000
;SBLookup
2A40  0080                word  $8000
2A42  0020                word  $2000
2A44  7F00                word  $007F
2A46  8000                word  $0080
2A48  8000                word  $0080
2A4A  8000                word  $0080
2A4C  8000                word  $0080
; SBLookup
2A4E  7F00                word  $007F
			  word  $0080
2A52  8000                word  $0080
			  word  $0080
2A56  8000                word  $0080
; UWLookup
2A58  FFFF                word  $FFFF,$0000			; Lookup Table first word InValue second OutValue etc
2A5C  0000                word  $0000,$0000

2A60  0000                word  $0000
2A62  0000                word  $0000
2A64  0000                word  $0000
2A66  0000                word  $0000
2A68  0000                word  $0000
2A6A  0000                word  $0000
2A6C  0000                word  $0000
2A6E  0000                word  $0000
2A70  0000                word  $0000
2A72  0000                word  $0000
2A74  0000                word  $0000
2A76  0000                word  $0000
2A78  0000                word  $0000
2A7A  0000                word  $0000
2A7C  0000                word  $0000
2A7E  0000                word  $0000

2A80  FFFF                word  $FFFF,$0000			; Lookup Table first word InValue second OutValue etc
2A84  0000                word  $0000,$0000

2A88  0000                word  $0000
2A8A  0000                word  $0000
2A8C  0000                word  $0000
2A8E  0000                word  $0000
2A90  0000                word  $0000
2A92  0000                word  $0000

;SBLookup
2A94  7F46                word  $467F
2A96  4646                word  $4646
2A98  3740                word  $4037
2A9A  F640                word  $40F6
2A9C  EC36                word  $36EC
2A9E  E633                word  $33E6
2AA0  E230                word  $30E2
2AA2  8030                word  $3080
2AA4  8030                word  $3080
2AA6  8030                word  $3080
2AA8  8030                word  $3080
2AAA  8030                word  $3080
                    ;************************************************************
                    ;*Do Tasks
                    ;************************************************************
2AAC  6502009C      L2AAC add   REG_9C,#$0002			; REG_9C += $0002
2AB0  892A009C            cmp   REG_9C,#$002A			; if ( REG_9C <= $2A) 
2AB4  D302                jnc   L2AB8				;  GOTO L2AB8
2AB6  019C                clr   REG_9C				; REG_9C = 0
2AB8  CB9D0C3F      L2AB8 push  $3F0C[REG_9C]			; sp[] = TASKNUM
2ABC  F0                  ret					; GOTO TASKNUM
2ABD  E7C5F6        L2ABD ljmp  L2185				; GOTO END_RUNTASK
                    ;************************************************************
                    ;* HSI #0 Interrupt Vector
                    ;************************************************************
2AC0  F2                  pushf
2AC1  1153                clrb  REG_53			;REG_53 = 0 !
2AC3  FA                  di
2AC4  FF                  nop
2AC5  F3                  popf
2AC6  F1                  reti
                    ;************************************************************
                    ;*  Master I/O Timer OverFlow
                    ;************************************************************
2AC7  F2                  pushf
2AC8  0712                inc   REG_12				; REG_12 ++ ; Overflow count
2ACA  D703                jne   L2ACF				; if ( REG_12 != 0 ) GOTO L2ACF
2ACC  9101B3              orb   REG_B3,#$01			; REG_B3.0 = 0 когда OSC*65536*65536 - очень длительный таймер
2ACF  1753          L2ACF incb  REG_53				; REG_53++
2AD1  D702                jne   L2AD5				; if ( REG_53!=0 ) IRET  по сути с моменета запуска MCU 255 * Overflow возрастает значение потом всегда 0
2AD3  1553                decb  REG_53				; REG_53--	
2AD5  FA            L2AD5 di
2AD6  FF                  nop
2AD7  F3                  popf
2AD8  F1            L2AD8 byte  $F1
                    ;************************************************************
                    ;*  A/D End of Conversion Interrupt
                    ;************************************************************
2AD9  F1                  reti


                    ;************************************************************
                    ;*   DO_INJ0BANK
                    ;*  
                    ;*  w[$0120] 
                    ;*  w[$0122] - последнее время SET HSO.A
                    ;*  w[$0124] - последнее время SET HSO.INJ0
                    ;*  b[$012C] - Маска 
                    ;*  REG_C0 - входные данные
                    ;*  REG_E2 - входные данные
                    ;*  REG.B4 - ???
                    ;*  
                    ;*  
                    ;*  
                    ;*  
                    ;*  
                    ;************************************************************

2ADA  A3012001      L2ADA ld    REG_BA,$0120[Zero]		; REG_BA = [$0120]
      BA
2ADF  A3012201            ld    REG_BC,$0122[Zero]		; REG_BC = [$0122]
      BC
2AE4  A3012401            ld    REG_BE,$0124[Zero]		; REG_BE = [$0124]
      BE
2AE9  B11638              ldb   REG_38,#$16			; REG_38 = $16
2AEC  B10639              ldb   REG_39,#$06			; REG_39 = $06		; В дальнейшем используется как порт 6 - а это банк инжектора 0
2AEF  71B3B4              andb  REG_B4,#$B3			; REG_B4.6 = REG_B4.3 =REG_B4.2 = 0
2AF2  93012C01            orb   REG_B4,$012C[Zero]      	; REG_B4 |= [012C] 		// Маска незавершённых событий инжектора
      B4
2AF7  EF03F7              lcall L21FD				; Что-То с Инжекторами 
2AFA  38B20C              jbs   REG_B2,BIT_00,L2B09		; if ( REG_B2.0 ) GOTO L2B09	// Занят вывод на инжекторе
2AFD  71FDB2              andb  REG_B2,#$FD			; REG_B2.1 = 0 			// Завершили обслуживание ЭТОГО вывода
2B00  387706              jbs   REG_77,BIT_00,L2B09     	; if ( REG_77.0 ) GOTO L2B09	// требоване чего-то ??
2B03  A0C032              ld    REG_32,REG_C0			; REG_32 = REG_C0
2B06  EF1900              lcall L2B22				; (dword) [$0134,$0136] = [$0134,$0136] + REG_32- (REG_E2 * $CB74/$FFFFFF )
2B09  514CB430      L2B09 andb  REG_30,REG_B4,#$4C		; REG_30 = REG_B4.6 =REG_B4.5=REG_B4.1=REG_B4.0 = 0
2B0D  C7012C01            stb   REG_30,$012C[Zero]		; [$012C] = REG_30
      30
2B12  C3012001            st    REG_BA,$0120[Zero]		; [$0120] = REG_BA
      BA
2B17  C3012201            st    REG_BC,$0122[Zero]		; [$0122] = REG_BC
      BC
2B1C  C3012401            st    REG_BE,$0124[Zero]		; [$0124] = REG_BE
      BE
2B21  F0                  ret					; 
;---------------
; Один фиг непонятны значения ....
; REG_32 <= REG_C0 
; REG_E2 - ???
; 
; Типа получаем 
; (dword) [$0134,$0136] = [$0134,$0136] + REG_32- (REG_E2 * $CB74/$FFFFFF )

2B22  4D74CBE2      L2B22 mulu  REG_38,REG_E2,#$CB74		; REG_38,REG_39 = REG_E2*$CB74	// ??
      38
2B27  683A32              sub   REG_32,REG_3A			; REG_32 -= REG_3A   		// старший байт от умножения , нихуя себе
2B2A  67013401            add   REG_32,$0134[Zero]		; REG_32 += [$0134]
      32
2B2F  A3013601            ld    REG_34,$0136[Zero]		; REG_34  = [$0136]
      34
2B34  A40034              addc  REG_34,Zero			; (dword) (REG_32,REG34)	
2B37  C3013601            st    REG_34,$0136[Zero]		; [$0136] = REG_34	
      34
2B3C  C3013401            st    REG_32,$0134[Zero]		; [$0134] = REG_32
      32
2B41  F0                  ret


; DO_INJ1BANK
2B42  A3012601      L2B42 ld    REG_BA,$0126[Zero]
      BA
2B47  A3012801            ld    REG_BC,$0128[Zero]
      BC
2B4C  A3012A01            ld    REG_BE,$012A[Zero]
      BE
2B51  B11738              ldb   REG_38,#$17
2B54  B10739              ldb   REG_39,#$07			; Здесь банк инжектора 1 порт 7
2B57  30E429              jbc   REG_E4,BIT_00,L2B83		; if ( REG_E4.0  ) GOTO L2B83
2B5A  71B3B4              andb  REG_B4,#$B3			; 
2B5D  93012D01            orb   REG_B4,$012D[Zero]		; [$012D]
      B4
2B62  EF98F6              lcall L21FD				; Что- то с инжекторами
2B65  38B203              jbs   REG_B2,BIT_00,L2B6B
2B68  71F7B2              andb  REG_B2,#$F7
2B6B  514CB430      L2B6B andb  REG_30,REG_B4,#$4C
2B6F  C7012D01            stb   REG_30,$012D[Zero]
      30
2B74  C3012601            st    REG_BA,$0126[Zero]
      BA
2B79  C3012801            st    REG_BC,$0128[Zero]
      BC
2B7E  C3012A01            st    REG_BE,$012A[Zero]
      BE
2B83  F0            L2B83 ret
			;*********************************************************************
			; Idle Speed Control
			; DO_ISC	
			; REG_EA   - ISC_END_TIME - время завершения цикла ISC
			; REG_EC   - ISC_VAL      - Значение для расчёта времён цикла
			; REG_B1.4 - 1 Принудительный цикл ISC
			; REG_B1.5 - 1 Цикл ISC, 0 - Запрет ISC , сбрасывается после отработки процедуры
			; REG_B2.7 - 0 Процедура DO_ISC завершена
			; $0148 <= ISC_VAL <=$8000
			; Ton  = TSC_VAL*2*$0516/$FFFF 
			; Toff = $0516 - Ton
			; Tcyc = $A2C
			;*********************************************************************

2B84  34B116        L2B84 jbc   REG_B1,BIT_04,L2B9D		; if ( !REG_B1.4 ) GOTO L2B9D
2B87  35B164              jbc   REG_B1,BIT_05,L2BEE		; if ( !REG_B1.5 ) GOTO L2B9D 
2B8A  11B0                clrb  REG_B0				; REG_B0 = 0		// только событие 1 и от текущего времени таймера
2B8C  B108B8              ldb   REG_B8,#$08			; CLR+HSO.8
2B8F  EFFBF7              lcall HS_OUT
2B92  38B059              jbs   REG_B0,BIT_00,L2BEE		; if ( REG_B0.0 ) L2BEE // Ошибка занят HSO
2B95  A030EA              ld    REG_EA,REG_30			; REG_EA = REG_30  	// ISC_END_TIME
2B98  71DFB1              andb  REG_B1,#$DF			; REG_B1.5 = 0
2B9B  2051                sjmp  L2BEE				; GOTO L2BEE            
2B9D  A0EC30        L2B9D ld    REG_30,REG_EC			; REG_30 = REG_EC	// ISC_VAL
2BA0  89008030            cmp   REG_30,#$8000			; if ( REG_30 < $8000 )
2BA4  D104                jnh   L2BAA				;  GOTO  L2BAA
2BA6  A1008030            ld    REG_30,#$8000			; REG_30 = $8000
2BAA  89480130      L2BAA cmp   REG_30,#$0148			; if ( REG_30 > $0148)
2BAE  DB04                jc    L2BB4				;  GOTO L2BB4
2BB0  A1480130            ld    REG_30,#$0148			; REG_30 = $0148	// $0148 <= REG_30 <=$8000
2BB4  A3014A24      L2BB4 ld    REG_B8,$244A[Zero]		; REG_B8 = [$244A]	// $0516 - const
      B8
2BB9  0901B8              shl   REG_B8,#$01			; REG_B8 *= 2
2BBC  6CB830              mulu  REG_30,REG_B8			; REG_30,REG_32 = REG_30 * REG_B8
2BBF  A03234              ld    REG_34,REG_32			; REG_34 = (REG_30,REG_32)/65536   - Длительность ISC_E1 ( ISC_Ton )
2BC2  A3014A24            ld    REG_30,$244A[Zero]		; REG_30 = [$244A]	// $0516 - const
      30
2BC7  48323036            sub   REG_36,REG_30,REG_32		; REG_36 = REG_30-REG_32           - Длительность ISC_E2 ( ISC_Toff )
2BCB  DB05                jc    L2BD2				; if ( REG_36 > 0 ) GOTO L2BD2
2BCD  A3014A24            ld    REG_36,$244A[Zero]		; REG_36 = [$244A]	// $0516 - const - время второго событие PW и оно константа ?
      36
2BD2  A1EA003C      L2BD2 ld    REG_3C,#$00EA			; REG_3C = $00EA	// FE_ISC_TIME
2BD6  B180B0              ldb   REG_B0,#$80			; REG_B0 = $80		// 2 события, 1ое REG 34+[REG_36]
2BD9  B108B8              ldb   REG_B8,#$08			; CLR+HSO.8 		// 1 событие
2BDC  B138B9              ldb   REG_B9,#$38			; SET+HSO.8 + INT 	// 2 событие
2BDF  EFABF7              lcall HS_OUT				;
2BE2  38B009              jbs   REG_B0,BIT_00,L2BEE		; if ( REG_B0.0 ) GOTO L2BEE
2BE5  A032EA              ld    REG_EA,REG_32			; REG_EA = REG_32       // Время наступления 2го события В данном случае ISC_ON 
2BE8  717FB2              andb  REG_B2,#$7F			; REG_B2.7 = 0 
2BEB  71DFB1              andb  REG_B1,#$DF			; REG_B1.5 = 0
2BEE  F0            L2BEE ret					; Всё


			;***************************************
			;* Self Test Output
			;* DO_STO - Расход топлива или Коды ошибок ???
			;* REG_A2 - время наступления последнего события
			;* REG_A0 - ??? 
			;* REG_56.5
			;* REG_B1.1
			;* REG_B2.4 
			;***************************************


2BEF  3D5605        L2BEF jbs   REG_56,BIT_05,L2BF7		; if ( REG_56.5 ) GOTO L2BF7
2BF2  A006A2              ld    REG_A2,IO_Timer			; REG_A2 = IO_TIMER
2BF5  2044                sjmp  L2C3B				; GOTO L2C3B
2BF7  A0A034        L2BF7 ld    REG_34,REG_A0			; REG_34 = REG_A0	// Время совершения события 1
2BFA  A0A036              ld    REG_36,REG_A0			; REG_36 = REG_A0	// Время совершения события 2 к первому
2BFD  A1A2003C            ld    REG_3C,#$00A2			; REG_3C = $00A2	// [REG_A2] - смещение от
2C01  39B11C              jbs   REG_B1,BIT_01,L2C20		; if ( REG_B1.1 ) GOTO L2C20
2C04  89FF3FA0            cmp   REG_A0,#$3FFF			; if ( REG_A0 > $3FFF )
2C08  D90B                jh    L2C15				;  GOTO 2C15
2C0A  B180B0              ldb   REG_B0,#$80			; bREG_B0 = $80  	// 2 события,
2C0D  B119B8              ldb   REG_B8,#$19			; ON+HSO.9 
2C10  B129B9              ldb   REG_B9,#$29			; OFF+HSO.9+?INT
2C13  2014                sjmp  L2C29				; GOTO  L2C29
2C15  B1C0B0        L2C15 ldb   REG_B0,#$C0			; REG_B0 = $C0          // 1 событие
2C18  B139B8              ldb   REG_B8,#$39			; ON+HSO.9+?INT		// Событие 1		
2C1B  9102B1              orb   REG_B1,#$02			; REG_B1.1 = 1
2C1E  2009                sjmp  L2C29				; GOTO L2C29
2C20  B1C0B0        L2C20 ldb   REG_B0,#$C0			; REG_B0 = $C0		// 1 события,
2C23  B129B8              ldb   REG_B8,#$29			; OFF+HSO.9+?INT	// Событие 1
2C26  71FDB1              andb  REG_B1,#$FD			; REG_B1.1 = 0
2C29  EF61F7        L2C29 lcall HS_OUT
2C2C  38B00C              jbs   REG_B0,BIT_00,L2C3B		; if ( REG_B0.0 ) GOTO 2C3B ; Отложить !!!
2C2F  36B003              jbc   REG_B0,BIT_06,L2C35		; if ( !REG_B0.6 ) GOTO L2C35;
2C32  A03032              ld    REG_32,REG_30			; REG_32 = REG_30 	// Время совершения события 1
2C35  A032A2        L2C35 ld    REG_A2,REG_32			; REG_A2 = REG_32	// 
2C38  71EFB2              andb  REG_B2,#$EF			; REG_B2.4 = 0 ; 
2C3B  F0            L2C3B ret
                    ;************************************************************
                    ;* HSI Port Input Data Available
		    ;  REG_52 - HSI_DATA_PREVIOS
		    ;  REG_7E - HSI_TIME_DELTA
		    ;  REG_7C - HSI_TIME_PREVIOS
                    ;************************************************************
2C3C  F2                  pushf
2C3D  FA                  di
2C3E  FF                  nop
2C3F  A00E48              ld    REG_48,HSI_Time_Hold		; wREG_48 = I_HSI_TIME_HOLD
2C42  B00D75              ldb   REG_75,HSI_Data_Hold		; bREG_75 = HSI_DATA
2C45  B07547              ldb   REG_47,REG_75			; bREG_47 = bREG_75
2C48  FB                  ei
2C49  945275              xorb  REG_75,REG_52			; REG_75 ^= HSI_Data_Previos => REG_75 = HSI changed
2C4C  B04752              ldb   REG_52,REG_47			; HSI_Data_Previos = REG_47
              I_HSI_CYCLE:
2C4F  307502        L2C4F jbc   REG_75,BIT_00,L2C54		; if ( !REG_75.0 ) GOTO L2C54
2C52  2027                sjmp  L2C7B			        ;  GOTO L2C7B 
2C54  38E407        L2C54 jbs   REG_E4,BIT_00,L2C5E		; if ( REG_E4.0 )  GOTO L2C5E
2C57  317509              jbc   REG_75,BIT_01,L2C63		; if ( !REG_75.1 ) GOTO L2C63
2C5A  20EB                sjmp  L2D47				;  GOTO L2D47
2C5C  2005                sjmp  L2C63				; Никогда ?
2C5E  357502        L2C5E jbc   REG_75,BIT_05,L2C63		; if ( !REG_75.5 ) GOTO L2C63
2C61  20E9                sjmp  L2D4C				;  GOTO L2D4C 
2C63  327502        L2C63 jbc   REG_75,BIT_02,L2C68		; if ( !REG_75.2 ) GOTO L2C68
2C66  20D0                sjmp  L2D38                           ;  GOTO L2D38
2C68  30E405        L2C68 jbc   REG_E4,BIT_00,L2C70		; if ( !REG_4E.0 ) GOTO L2C70
2C6B  337502              jbc   REG_75,BIT_03,L2C70             ; if ( !REG_75.3 ) GOTO L2C70
2C6E  20E1                sjmp  L2D51				;  GOTO L2D51  
2C70  1175          L2C70 clrb  REG_75				; REG_75 = 0  => End HSI processing
             I_HSI_NEXT:
2C72  990075        L2C72 cmpb  REG_75,#$00			; if ( HSI_MASK != 0 )
2C75  D7D8                jne   L2C4F				;   Goto I_HSI_CYCLE
2C77  FA                  di
2C78  FF                  nop
2C79  F3                  popf
2C7A  F1                  reti


; Когда HSI.0 == 1  !!! обработка PIP сигнала
; REG_52.0   если 1 - ошибка обработки PIP ???
; REG_50 - 
; REG_40 - RE_PIP_TIME_HOLD - время предыдущего фронта PIP   ( только здесь)
; REG_44 - PIP_WIDTH        - дельта захвата RE_PIP как следствие время 1/2 об. кв
; REG_1E - Ton_PIP          - интервал Ton_PIP  текущее
; REG_CA - Ton_PIP_prev     - интервал Ton_PIP  предыдущее
; REG_CC - FE_PIP_TIME      - время захвата спада сигнала PIP текущее
; REG_C8 - PIP_WIDTH_P      - предыдущее PIP_WIDTH
; REG_A7.5 - 0 если FailEdge
; REG_1D   - Счётчик 0 - 255 
; REG_AB.5
; REG_AB.6
PIP_INTERRUPT :
2C7B  0548          L2C7B dec   REG_48				; HSI_TIME_HOLD -- 
2C7D  0548                dec   REG_48				; HSI_TIME_HOLD -- 
2C7F  38472D              jbs   REG_47,BIT_00,L2CAF		; if ( PIP == 1 ) GOTO L2CAF
                          ; PIP = 0 FailEdge !!!!!!!!!!!!!!!!!!!!!!!!
2C82  71DFA7              andb  REG_A7,#$DF			; REG_A7.5 =0
2C85  48404846            sub   REG_46,REG_48,REG_40		; REG_46 = (HSI_TIME_HOLD-2) - PIP_TIME_HOLD
2C89  89040146            cmp   REG_46,#$0104			; if ( REG_46 > $0104 ) 
2C8D  DB05                jc    L2C94				;  GOTO L2C94
                                                                ; Здесь ЕСЛИ ВРЕМЯ Ton_PIP < $0104 => высокая частота КВ 
2C8F  910152              orb   REG_52,#$01			; REG_52.0 = 1  Признак высокой частоты КВ ?
2C92  27DE                sjmp  L2C72				; GOTO I_HSI_NEXT
								; REG_46 > $0104  
2C94  A048CC        L2C94 ld    REG_CC,REG_48			; REG_CC = REG_48 ; REG_CC = (HSI_TIME_HOLD-2)        
2C97  3DAB06              jbs   REG_AB,BIT_05,L2CA0		; if ( REG_AB.5 ) GOTO L2CA0
2C9A  A01ECA              ld    REG_CA,REG_1E			; REG_CA =  REG_1E                           ; предыдущее значение дельты PIP_RiseEdge - PIP_FailEdge
2C9D  A0461E              ld    REG_1E,REG_46			; REG_1E = (HSI_TIME_HOLD-2) - PIP_TIME_HOLD ; текущая дельта PIP_RiseEdge - PIP_FailEdge
2CA0  71DFAB        L2CA0 andb  REG_AB,#$DF			; REG_AB.5 = 0				     ; ????	
2CA3  371A07              jbc   REG_1A,BIT_07,L2CAD		; if ( !REG_1A.7 ) GOTO L2CAD
2CA6  99FF1D              cmpb  REG_1D,#$FF			; if ( REG_1D == $FF ) 
2CA9  DF02                je    L2CAD				;  GOTO L2CAD
2CAB  171D                incb  REG_1D				; REG_1D ++ 
2CAD  205D          L2CAD sjmp  L2D0C				; завершаем процедуру

		;************************* PIP = 1 RiseEdge ***********************************
2CAF  48404846      L2CAF sub   REG_46,REG_48,REG_40	      	; REG_46 = (HSI_TIME_HOLD-2) - RE_PIP_TIME_HOLD	// REG_46 = dRE_PIP
2CB3  890D0346            cmp   REG_46,#$030D			; if ( REG_46 > $030D )
2CB7  DB05                jc    L2CBE				;   GOTO L2CBE  
								;  Здесь  ЕСЛИ ПЕРИОД T_PIP < $030D => высокая частота КВ ?
2CB9  71FE52              andb  REG_52,#$FE			; REG_52.0 = 0 				  	// 
2CBC  2075                sjmp  L2D33				; Out of routine

2CBE  A04840        L2CBE ld    REG_40,REG_48			; REG_40 = (HSI_TIME_HOLD-2)                	// Перыдущее значение = RE_PIP_TIME_HOLD 
2CC1  3EAB06              jbs   REG_AB,BIT_06,L2CCA		; if ( REG_AB.6 ) GOTO L2CCA
2CC4  A044C8              ld    REG_C8,REG_44			; REG_C8 = REG_44 				// REG_C8 = PIP_WIDTH 
2CC7  A04644              ld    REG_44,REG_46			; REG_44 = REG_46 			        // REG_44 = PIP_WIDTH
2CCA  71BFAB        L2CCA andb  REG_AB,#$BF			; REG_AB.6 = 0
2CCD  1750                incb  REG_50				; REG_50 ++					// REG_50 - Счётчик цилиндров 
2CCF  B3017624            ldb   REG_46,$2476[Zero]		; REG_46 = $00 const
      46
2CD4  980046              cmpb  REG_46,Zero			; if (REG_46 == 0 )  
2CD7  DF13                je    L2CEC				;  GOTO L2CEC  Вот это происходит всегда
2CD9  384608              jbs   REG_46,BIT_00,L2CE4		; if ( REG_46.0 ) GOTO L2CE4
2CDC  385008              jbs   REG_50,BIT_00,L2CE7		; if ( REG_50.0 ) GOTO L2CE7			// REG_50.0 => '0' - INJ0BANK '1' - INJ1BANK
2CDF  9102B2        L2CDF orb   REG_B2,#$02			; REG_B2.1 = 1					// Требование DO_INJ0BANK()
2CE2  2022                sjmp  L2D06				; GOTO L2D06
2CE4  3850F8        L2CE4 jbs   REG_50,BIT_00,L2CDF		; if ( REG_50.0 ) GOTO L2CDF
2CE7  9108B2        L2CE7 orb   REG_B2,#$08			; REG_B2.3 = 1					// Требование DO_INJ1BANK()
2CEA  201A                sjmp  L2D06				; GOTO L2D06

2CEC  99014D        L2CEC cmpb  REG_4D,#$01			; if ( REG_4D <> $01)
2CEF  D707                jne   L2CF8				;  GOTO L2CF8
2CF1  910AB2              orb   REG_B2,#$0A			; REG_B2.7 = REG_B2.5 = 1			// Требование DO_ISC(), DO_EGR() 
2CF4  1150                clrb  REG_50				; REG_50 = 0;					// Цилиндр = 0 или INJ0BANK
2CF6  200E                sjmp  L2D06				; GOTO L2D06
2CF8  990150        L2CF8 cmpb  REG_50,#$01			; if ( REG_50 == $01)				// Если INJ1BANK или цилиндр 2 ? 
2CFB  DFEA                je    L2CE7				;  GOTO L2CE7
2CFD  984D50              cmpb  REG_50,REG_4D			; if ( REG_50 < REG_4D )			//  меньше чего
2D00  DE04                jlt   L2D06				;  GOTO L2D06
2D02  1150                clrb  REG_50				; REG_50 = 0;					// иначе Цилиндр = 0 или INJ0BANK	
2D04  27D9                sjmp  L2CDF				; GOTO L2CDF;
2D06  9120A7        L2D06 orb   REG_A7,#$20			; REG_A7.5 = 1 
2D09  91C0B3              orb   REG_B3,#$C0			; REG_B3.7 = REG_B3.6 = 1
			; Common FOR PIP EVENT
2D0C  9104B2        L2D0C orb   REG_B2,#$04			; REG_B2.2 = 1					// Требование DO_SPOUT()
2D0F  351A0B              jbc   REG_1A,BIT_05,L2D1D		; if ( !REG_1A.5 ) GOTO L2D1D
2D12  3E1A06              jbs   REG_1A,BIT_06,L2D1B		; if (  REG_1A.6 ) GOTO L2D1B
2D15  71DF1A              andb  REG_1A,#$DF			;  REG_1A.5 = 0
2D18  91101A              orb   REG_1A,#$10			;  REG_1A.5 = 1
2D1B  2016          L2D1B sjmp  L2D33
2D1D  361A05        L2D1D jbc   REG_1A,BIT_06,L2D25	        ; if ( !REG_1A.6 ) GOTO L2D25
2D20  91301A              orb   REG_1A,#$30			;  REG_1A.5 = REG_1A.4 = 1
2D23  200E                sjmp  L2D33
2D25  3C1A08        L2D25 jbs   REG_1A,BIT_04,L2D30             ; if ( REG_1A.4 )  GOTO L2D30
2D28  35A708              jbc   REG_A7,BIT_05,L2D33             ; if (!REG_A7.5 )  GOTO L2D33
2D2B  71FBB2              andb  REG_B2,#$FB			; REG_B2.2 = 0  
2D2E  2003                sjmp  L2D33
2D30  71EF1A        L2D30 andb  REG_1A,#$EF		        ; REG_1A.4 = 0
2D33  71FE75        L2D33 andb  REG_75,#$FE			; HSI_MASK.0 =  0
2D36  273A                sjmp  L2C72				; I_HSI_NEXT

: HSI.2 == 1 в оригинале BAP а у нас что ????
2D38  487C4846      L2D38 sub   REG_46,REG_48,REG_7C		; REG_46 = REG_48 - HSI_TIME_Previos
2D3C  A0487C              ld    REG_7C,REG_48			; HSI_TIME_Previos = I_HSI_TIME_HOLD
2D3F  A0467E              ld    REG_7E,REG_46			; HSI_TIME_DELTA   = REG_46
2D42  71FB75              andb  REG_75,#$FB			; HSI_MASK.2 = 0
2D45  272B                sjmp  L2C72                           ; I_HSI_NEXT

; HSI.1 == 1
2D47  71FD75        L2D47 andb  REG_75,#$FD			; HSI_MASK.1 =  0
2D4A  2726                sjmp  L2C72				; GOTO I_HSI_NEXT
; HSI.5 == 1
2D4C  71DF75        L2D4C andb  REG_75,#$DF			; HSI_MASK.5 =  0
2D4F  2721                sjmp  L2C72				; GOTO I_HSI_NEXT
; HSI.3 == 1
2D51  71F775        L2D51 andb  REG_75,#$F7			; HSI_MASK.3 =  0
2D54  271C                sjmp  L2C72				; GOTO I_HSI_NEXT
                    ;************************************************************
                    ;* HSO Port Output Interrupt #1
		    ;* Там где заказано по совершении события HSO прерывание
		    ;* REG_A2   -
		    ;* REG_EA   - 
		    ;*
		    ;*
		    ;* REG_B2.4 - изменяется 
		    ;* REG_B2.7 - изменяется 
		    ;* REG_B2.7 - изменяется 
		    ;* REG_B2.5 - изменяется 
		    ;* REG_B1.5 - изменяется 
		    ;*
		    ;*
		    ;*
		    ;*
		    ;*
                    ;************************************************************
2D56  F2                  pushf
2D57  3CB20E              jbs   REG_B2,BIT_04,L2D68		; if ( REG_B2.4 ) GOTO L2D68		// DO_STO Пропустить
2D5A  88A206              cmp   IO_Timer,REG_A2			; 
2D5D  DE04                jlt   L2D63				; if ( IO_Timer <  REG_A2) L2D63 
2D5F  DD07                jv    L2D68				; if ( IO_Timer >  REG_A2) L2D68
2D61  2002                sjmp  L2D65				; if ( IO_Timer == REG_A2) L2D65
2D63  D503          L2D63 jnv   L2D68				; if ( IO_Timer !=  REG_A2) L2D68 ???
2D65  9110B2        L2D65 orb   REG_B2,#$10			; REG_B2.4 = 1 
2D68  3FB211        L2D68 jbs   REG_B2,BIT_07,L2D7C		; if ( REG_B2.7 ) GOTO L2D7C		// DO_ISC
2D6B  88EA06              cmp   IO_Timer,REG_EA
2D6E  DE04                jlt   L2D74
2D70  D504                jnv   L2D76
2D72  2008                sjmp  L2D7C
2D74  D506          L2D74 jnv   L2D7C
2D76  9120B1        L2D76 orb   REG_B1,#$20
2D79  9180B2              orb   REG_B2,#$80
2D7C  3DB210        L2D7C jbs   REG_B2,BIT_05,L2D8F		;					// DO_EGR
2D7F  8B013001            cmp   IO_Timer,$0130[Zero]
      06
2D84  DE04                jlt   L2D8A
2D86  D504                jnv   L2D8C
2D88  2005                sjmp  L2D8F
2D8A  D503          L2D8A jnv   L2D8F
2D8C  9120B2        L2D8C orb   REG_B2,#$20
2D8F  FA            L2D8F di
2D90  FF                  nop
2D91  F3                  popf
2D92  F1                  reti


; Тоже  DO_STO_ctd
2D93  335608        L2D93 jbc   REG_56,BIT_03,L2D9E		; if ( !REG_56.3 ) GOTO L2D9E
2D96  3EB116              jbs   REG_B1,BIT_06,L2DAF		; if (  REG_B1.6 ) GOTO L2DAF
2D99  B119B8              ldb   REG_B8,#$19			; REG_B8 = ON  + HSO.9 
2D9C  2006                sjmp  L2DA4				; GOTO L2DA4
2D9E  36B10E        L2D9E jbc   REG_B1,BIT_06,L2DAF		; if ( !REG_B1.6 ) GOTO L2DAF
2DA1  B109B8              ldb   REG_B8,#$09			; REG_B8 = OFF + HSO.9  HS0.9 = STO
2DA4  11B0          L2DA4 clrb  REG_B0				; REG_B0 = 0
2DA6  EFE4F5              lcall HS_OUT
2DA9  38B003              jbs   REG_B0,BIT_00,L2DAF		; if( REG_B0.0 ) GOTO L2DAF
2DAC  9540B1              xorb  REG_B1,#$40			; REG_B1 ^= $40
2DAF  F0            L2DAF ret

                    ;************************************************************
                    ; DO_EGR HSI.0 ?? EGR ???
                    ; REG_B1.3 -
                    ; REG_B1.2 -
                    ; [$012E]  -
                    ; [$0130]  - Время последнего наступления события HSO.0 !!!
                    ; REG_B2.5 -
                    ;
                    ;
                    ;
                    ;
                    ;
                    ;************************************************************

2DB0  A3012E01      L2DB0 ld    REG_30,$012E[Zero]		; REG_30 = [$012E]		// RAM
      30
2DB5  880030              cmp   REG_30,Zero			; if ( REG_30 <> 0 )
2DB8  D710                jne   L2DCA				;   GOTO L2DCA
								; Здесь константный вывод ЧЕГО ?
2DBA  9104B1              orb   REG_B1,#$04			; REG_B1.3 = 1  		// 
2DBD  B120B8              ldb   REG_B8,#$20			; REG_B8 = $20			// Событие 1, CLR+HS0.0+?INT
2DC0  A3019C24            ld    REG_34,$249C[Zero]		; REG_34 = $2308		// Время его совершения	
      34
2DC5  B1C0B0              ldb   REG_B0,#$C0			; REG_B0 = $C0          	// Одно событие, время REG_34 и [$0130]
2DC8  201F                sjmp  L2DE9				; GOTO L2DE9

2DCA  71FBB1        L2DCA andb  REG_B1,#$FB			; REG_B1.2 = 0
2DCD  6F019C24            mulu  REG_30,$249C[Zero]		; REG_30 *=$2308 => REG30,REG32
      30
2DD2  0D0130              shll  REG_30,#$01			; (long)REG_30 *= 2
2DD5  A03234              ld    REG_34,REG_32			; REG_34 = REG_32  Старшая  часть произведения эквивалентно /65536
2DD8  4B019C24            sub   REG_36,REG_34,$249C[Zero]	; REG_36 = REG_34-$2308	
      3436
2DDE  0336                neg   REG_36				; REG_36 = -REG_36      	// время совершения события 2 относительно 1 длинна OFF ???
2DE0  B100B8              ldb   REG_B8,#$00                     ; REG_B8 = $00			// Событие 1  CLR+HSO.0
2DE3  B130B9              ldb   REG_B9,#$30			; REG_B9 = $30          	// Событие 2  SET+HSO.0+?INT
2DE6  B180B0              ldb   REG_B0,#$80			; REG_B0 = $80			// 2 события  , время 1го REG_34 и [$0130]
2DE9  A130013C      L2DE9 ld    REG_3C,#$0130			; REG_3C = $0130		// от какого времени 
2DED  EF9DF5              lcall HS_OUT
2DF0  38B00E              jbs   REG_B0,BIT_00,L2E01		; if (  REG_B0.0 ) GOTO L2E01
2DF3  32B103              jbc   REG_B1,BIT_02,L2DF9		; if ( !REG_B1.2 ) GOTO L2DF9
2DF6  A03032              ld    REG_32,REG_30			; REG_32 = REG_30		// Время совершения события 2 = Время совершения события 1
2DF9  C3013001      L2DF9 st    REG_32,$0130[Zero]		; [$0130]= REG_32		// Время совершения события 2
      32
2DFE  71DFB2              andb  REG_B2,#$DF			; REG_B2.5 = 0
2E01  F0            L2E01 ret

                    ;************************************************************
                    ;* Do_Sensors() ECT (ADC_9), ACT (ADC_8), (ADC_4),
		    ; bREG_72 = ECT_VAL
		    ; bREG_73 = ACT_VAL
                    ;************************************************************
2E02  A1F22832            ld    REG_32,#$28F2			; REG_32 = $28F2        ACT_TFR	
2E06  A09234              ld    REG_34,REG_92			; REG_34 = ADC_9_RAW   T
2E09  080134              shr   REG_34,#$01       		; REG_34 = ADC_9_RAW/2
2E0C  EFCD04              lcall SWLookup                        ; 
2E0F  65800038            add   REG_38,#$0080			; REG_38 = ACT_TFR( ACT_RAW/2 ) + $0080  СТАРШИЙ БАЙТ ТЕМПЕРАТУРА ACT,МЛАДШИЙ $80 
2E13  331505              jbc   REG_15,BIT_03,L2E1B		; if ( !REG_15.3 ) L2E1B
2E16  B3018A24            ldb   REG_39,$248A[Zero]              ; bREG_39 = 25 градусов  
      39
2E1B  B03973        L2E1B ldb   REG_73,REG_39			; ACT_Val = bREG_39      bREG_73 = ACT температура 
2E1E  A09034              ld    REG_34,REG_90			; REG_34 = ADC_8_RAW
2E21  080134              shr   REG_34,#$01			; REG_34 = ADC_8_RAW/2
2E24  B301C024            ldb   REG_E4,$24C0[Zero]		; REG_E4 = $00 
      E4
2E29  B3015524            ldb   REG_30,$2455[Zero]		; REG_30 = $00
      30
2E2E  353003              jbc   REG_30,BIT_05,L2E34		; if ( !REG_30.5 ) GOTO L2E34
2E31  30E42D              jbc   REG_E4,BIT_00,L2E61		; if ( !REG_E4.0 ) GOTO L2E61
2E34  A1AE2832      L2E34 ld    REG_32,#$28AE			; REG_32  = $28AE ADC_8_TFR  ECT_TFR 
2E38  EFA104              lcall SWLookup                        ; REG_38 температура в старшем байте, в младшем 0
2E3B  01D4                clr   REG_D4				; REG_D4 = 0
2E3D  45800038            add   REG_3A,REG_38,#$0080		; REG_3A = ADC_8_TFR ( ADC_8_RAW/2 + $0080 ) СТАРШИЙ БАЙТ ТЕМПЕРАТУРА ECT, МЛАДШИЙ $80
      3A
2E42  B03B72              ldb   REG_72,REG_3B			; bREG_72 = ECT_Val ; ТЕМПРЕРАТУРА ECT АКТУАЛЬНАЯ
2E45  321508              jbc   REG_15,BIT_02,L2E50		; if ( !REG_15.2 ) GOTO L2E50
2E48  B3016424            ldb   REG_72,$2464[Zero]		;  ECT_Val = 85 градусов
      72
2E4D  B07267              ldb   REG_67,REG_72			;  bREG_67 = ECT_Val 
2E50  30E423        L2E50 jbc   REG_E4,BIT_00,L2E76		; if ( !REG_E4.0 ) GOTO L2E76
2E53  B3015524            ldb   REG_30,$2455[Zero]		;  REG_30 = $00
      30
2E58  35301B              jbc   REG_30,BIT_05,L2E76		; if ( !REG_30.5 ) GOTO L2E76
2E5B  A08834              ld    REG_34,REG_88			; REG_34 = ADC_4_RAW
2E5E  080134              shr   REG_34,#$01			; REG_34 = ADC_4_RAW/2
2E61  A1E02932      L2E61 ld    REG_32,#$29E0			; REG_32 = ADC_4_TFR
2E65  EF7404              lcall SWLookup
2E68  A038D4              ld    REG_D4,REG_38			; REG_D4 = ADC_4_TFR( ADC_4_RAW/2 )
2E6B  38E408              jbs   REG_E4,BIT_00,L2E76	        ; if ( REG_E4.0 ) GOTO L2E76
2E6E  B3016424            ldb   REG_72,$2464[Zero]		;  ECT_Val = 85 градусов
      72
2E73  B07267              ldb   REG_67,REG_72			; bREG_67 = ECT_Val
2E76  990A7B        L2E76 cmpb  REG_7B,#$0A			; if ( REG_7B < $0A)
2E79  DB33                jc    L2EAE				;  GOTO L2EAE
2E7B  FE6D9A19            mul   REG_38,#$199A			; REG_38 = ADC_4_TFR( ADC_4_RAW/2 ) * $1991  => REG_38,REG_3A
      38
2E80  643A66              add   REG_66,REG_3A			; ECT_VAL +=  /65536 
2E83  A1C82932            ld    REG_32,#$29C8			; REG_32 = #$29C8
2E87  BC6734              ldbse REG_34,REG_67                   ; REG_34 = (word)REG_67   ; ECT_VAL  со знаком
2E8A  EF4F04              lcall SWLookup			;
2E8D  A038FA              ld    REG_FA,REG_38			; REG_FA =  REG_38  ; 
2E90  9B01A424            cmpb  REG_72,$24A4[Zero]	        ; if ( ECT_Val <= 55 ) 	
      72
2E95  DA15                jle   L2EAC				;  GOTO 2EAC типа непрогретого двигателя
								; Если ECT > 55 то мы фильтруем значение ACT
2E97  A1942A32            ld    REG_32,#$2A94			; REG_32 = $2A94
2E9B  B07334              ldb   REG_34,REG_73			; REG_34 = ACT_Val
2E9E  EF8004              lcall SBLookup				; TBL (ACT_Val)
2EA1  1139                clrb  REG_39				; bREG_39 = 0 HiByte = 0 LOW == ??
2EA3  6CFA38              mulu  REG_38,REG_FA			; REG_38 *= REG_FA => REG_38,REG_3A
2EA6  0C0638              shrl  REG_38,#$06			; (long)REG_38 >>= 6   ;
2EA9  A038FA              ld    REG_FA,REG_38			; REG_FA = REG_38      ; REG_FA = REG_FA* TBL(ACT_Val)/64   
2EAC  177B          L2EAC incb  REG_7B				; REG_7B ++            ; Не найдена инициализация переменной
2EAE  A00630        L2EAE ld    REG_30,Master_IO_Timer_Lo	; REG_30  = C_TIMER    ; REG_30 - временная переменная
2EB1  685830              sub   REG_30,REG_58			; REG_30  -= REG_58 (PREV_TIME)
2EB4  A0305A              ld    REG_5A,REG_30			; REG_5A = deltaTime больше нигде не используется
2EB7  A00658              ld    REG_58,Master_IO_Timer_Lo	; REG_58 = C_TIME    больше нигде не используется 
2EBA  E700FC              ljmp  L2ABD				; END TASK
                    ;************************************************************
                    ;* Task 3  ADC_C,ADC_7 
                    ;************************************************************
2EBD  A3014001            ld    REG_32,$0140[Zero]		; REG_32 = [$0140]	
      32
2EC2  A09834              ld    REG_34,REG_98			; REG_34 = ADC_C_RAW	
2EC5  A301BA24            ld    REG_36,$24BA[Zero]		; REG_36 = [$24BA]		// const
      36
2ECA  EF9604              lcall SDFilter			; SDFilter()
2ECD  C3014001            st    REG_3E,$0140[Zero]		; [$0140] = REG_3E  
      3E
2ED2  A3014201            ld    REG_32,$0142[Zero]		; REG_32 = [$0142]
      32
2ED7  A301BC24            ld    REG_36,$24BC[Zero]              ; REG_36 = [$24BC]		// const
      36
2EDC  EF8404              lcall SDFilter			; SDFilter() 			// Результат в REG_3E,REG_3C
2EDF  C3014201            st    REG_3E,$0142[Zero]              ; [$0142] = REG_3E 		// [0142] -  
      3E
2EE4  71F31B              andb  REG_1B,#$F3			; REG_1B &= $F3 		// REG_1B.2 = REG_1B.3 = 0
2EE7  4B014601            sub   REG_38,REG_8E,$0146[Zero]	; REG_38 = REG_8E - [$0146] 	// REG_38 = ADC_7_RAW - [$0146]
      8E38
2EED  DB02                jc    L2EF1				; if ( REG_38 > 0 ) GOTO L2EF1 	// или наоборот ???
2EEF  0138                clr   REG_38				; REG_38 = 0 
2EF1  C3014601      L2EF1 st    REG_8E,$0146[Zero]              ; [$0146] = REG_8E ;  		// [$0146] = ADC_7_RAW
      8E
2EF6  8B01CE24            cmp   REG_38,$24CE[Zero]		;  if ( REG_38 >= [$24CE])	// 
      38
2EFB  D62E                jge   L2F2B				;   GOTO L2F2B
2EFD  9B01B024            cmpb  REG_72,$24B0[Zero]		; 				// ECT_VAL
      72
2F02  DE27                jlt   L2F2B				; if ( ) GOTO L2F2B
2F04  35B321              jbc   REG_B3,BIT_05,L2F28		; if ( !REG_B3.5 ) GOTO L2F28
2F07  30AC21              jbc   REG_AC,BIT_00,L2F2B		; if ( !REG_AC.0 ) GOTO L2F2B
2F0A  9800A9              cmpb  REG_A9,Zero			; if ( bREG_A9 != 0 )
2F0D  D71C                jne   L2F2B				;  GOTO L2F2B
2F0F  8B01B424            cmp   REG_70,$24B4[Zero]		; if (REG_70 > 10000 )		// > 2500
      70
2F14  D915                jh    L2F2B				; goto L2F2B 
2F16  A09A38              ld    REG_38,REG_9A			; REG_38 = REG_9A
2F19  6701B224            add   REG_38,$24B2[Zero]		; REG_38 += $2580
      38
2F1E  888E38              cmp   REG_38,REG_8E			; if ( REG_38 < REG_8E )
2F21  D308                jnc   L2F2B				; GOTO L2F2B
2F23  91081B              orb   REG_1B,#$08			; REG_1B.3 =1 
2F26  2003                sjmp  L2F2B				; goto L2F2B


2F28  91041B        L2F28 orb   REG_1B,#$04
2F2B  A07E34        L2F2B ld    REG_34,REG_7E			; REG_34 = HSI_P2_TIME_DELTA 
2F2E  A1960132            ld    REG_32,#$0196			; REG_32 = $0196
2F32  A1AAE630            ld    REG_30,#$E6AA			; REG_30 = $E6AA
2F36  8C3430              divu  REG_30,REG_34			; $0196E6AA / HSI_P2_TIME_DELTA => REG_30 div REG_32 rem
2F39  A030A4              ld    REG_A4,REG_30			; REG_4A = REG_30 
2F3C  A03034              ld    REG_34,REG_30			; REG_34 = REG_30 
2F3F  A1002A32            ld    REG_32,#$2A00			; REG_32 = $2A00
2F43  2B94                scall UWLookup			; REG_38 = UWLookup( REG_30,$2A00)
2F45  351505              jbc   REG_15,BIT_05,L2F4D		; if ( !REG_15.5 ) GOTO L2F4D - регистр флагов
2F48  B3013024            ldb   REG_38,$2430[Zero]		;  bREG_38 = $EB;
      38
2F4D  B038A6        L2F4D ldb   REG_A6,REG_38			; bREG_A6 = bREG_38
2F50  B03837              ldb   REG_37,REG_38			; bREG_37 = bREG_38
2F53  1136                clrb  REG_36				; bREG_36 = 0 => REG_36 =  bREG_38 * 256
2F55  080336              shr   REG_36,#$03			; REG_36 / = 8; -- как младшая часть
2F58  0134                clr   REG_34				; REG_34 = 0
2F5A  B07331              ldb   REG_31,REG_73			; bREG_31 = ACT_VAL
2F5D  1A0231              shrab REG_31,#$02			; ACT_VAL /= 4;
2F60  754431              addb  REG_31,#$44			; ACT_VAL += $44;
2F63  1130                clrb  REG_30				; bREG_30 = 0  REG_30 = bREG_31 * 256
2F65  8C3034              divu  REG_34,REG_30			; REG_34,REG_36 / REG_30 => REG_34 div REG_36 rem интересно здесь конкатенация ЧИСЛА ИЗ ДВУХ ??
2F68  A10E2932            ld    REG_32,#$290E			; REG_32 = $290E
2F6C  2B6B                scall UWLookup			; REG_38 - результат
2F6E  6F012E24            mulu  REG_38,$242E[Zero]		; REG_38 * 3C60 => REG_38,REG_3A
      38
2F73  A03A3E              ld    REG_3E,REG_3A			; REG_3E = REG_3A сохранили младшую часть произведения ??
2F76  A09834              ld    REG_34,REG_98			; REG_34 = REG_98 ???
2F79  331B05              jbc   REG_1B,BIT_03,L2F81		; if ( !REG_1B.3 ) GOTO L2F81
2F7C  A3014001            ld    REG_34,$0140[Zero]		; [$0140] = REG_34 
      34
2F81  321B05        L2F81 jbc   REG_1B,BIT_02,L2F89		; if ( !REG_1B.2 ) GOTO L2F89
2F84  A3014201            ld    REG_34,$0142[Zero]		; [$0142] = REG_34
      34
2F89  34151B        L2F89 jbc   REG_15,BIT_04,L2FA7		; if ( !REG_15.4 ) GOTO L2FA7
2F8C  311507              jbc   REG_15,BIT_01,L2F96		; if ( !REG_15.1 ) GOTO L2F96
2F8F  A3018C24            ld    REG_34,$248C[Zero]		; REG_34 = [$248C] 			// 007D  125
      34		
2F94  2011                sjmp  L2FA7				; GOTO 2FA7
2F96  A1822732      L2F96 ld    REG_32,#$2782			; REG_32 = $2782			// Адрес Таблицы
2F9A  489A8E34            sub   REG_34,REG_8E,REG_9A		; REG_34 = REG_8E - REG_9A		// 
2F9E  DB02                jc    L2FA2				; if ( REG_34 > 0 )			// 
2FA0  0134                clr   REG_34				; REG_34 = 0
2FA2  2B35          L2FA2 scall UWLookup			; REG_38 - result
2FA4  A03834              ld    REG_34,REG_38			; REG_34 =  UWLookup ( REG_8E - REG_9A, $2782 )
2FA7  A1662832      L2FA7 ld    REG_32,#$2866			; REG_32 = $2866 			// Адрес Таблицы	
2FAB  2B2C                scall UWLookup			; REG_38 - result
2FAD  6C3E38              mulu  REG_38,REG_3E			; (dword)REG_38,REG_3A = REG_38*REG_3E
2FB0  99203B              cmpb  REG_3B,#$20			; if ( REG_3B < $20)			
2FB3  D304                jnc   L2FB9				;  GOTO L2FB9
2FB5  A1FFFF3A            ld    REG_3A,#$FFFF			; REG_3A = $FFFF	
2FB9  0D0338        L2FB9 shll  REG_38,#$03			; (dword)REG_38,REG_3A * = 8
2FBC  A03A9E              ld    REG_9E,REG_3A			; REG_9E = (dword)REG_38,REG_3A /65535
2FBF  A10040D6            ld    REG_D6,#$4000			; REG_D6 = $4000
2FC3  38E435              jbs   REG_E4,BIT_00,L2FFB		; if ( REG_E4.0 ) GOTO L2FFB
2FC6  71EF56              andb  REG_56,#$EF			; REG_56.7 = 0
2FC9  A09634              ld    REG_34,REG_96			; REG_34 = REG_96
2FCC  B3015524            ldb   REG_30,$2455[Zero]		; REG_30 = 00 
      30
2FD1  3D3017              jbs   REG_30,BIT_05,L2FEB		; if ( REG_30.5 ) GOTO L2FEB		// Этого непроисходит 
2FD4  8B018E24            cmp   REG_96,$248E[Zero]		; if ( REG_96 > 0032 )			// 50
      96
2FD9  D905                jh    L2FE0				;  GOTO L2FE0
2FDB  911056              orb   REG_56,#$10			; REG_56.4 = 1
2FDE  2014                sjmp  L2FF4				; GOTO L2FF4
2FE0  A1722732      L2FE0 ld    REG_32,#$2772			; REG_32 = $2772			// Адрес таблицы
2FE4  2AF3                scall UWLookup
2FE6  A03820              ld    REG_20,REG_38			; REG_20= REG_38 			// 0 или $D3F0
2FE9  2030                sjmp  L301B				; GOTO L301B
2FEB  A1F02932      L2FEB ld    REG_32,#$29F0			; REG_32 = $29F0			// Адрес таблицы
2FEF  2AE8                scall UWLookup
2FF1  A038D6              ld    REG_D6,REG_38			; REG_D6 = UWLookup( ??? ,$29F0)
2FF4  A3016624      L2FF4 ld    REG_20,$2466[Zero]		; REG_20 = 0068				// 104
      20
2FF9  2020                sjmp  L301B				; GOTO L301B

2FFB  A08234        L2FFB ld    REG_34,REG_82			; REG_34 = REG_82
2FFE  A1722732            ld    REG_32,#$2772			; REG_32 = $2772
3002  2AD5                scall UWLookup
3004  A03820              ld    REG_20,REG_38			; REG_20 = REG_38
3007  B3015524            ldb   REG_30,$2455[Zero]		; REG_30 = 00
      30
300C  35300C              jbc   REG_30,BIT_05,L301B		; if ( !REG_30.5 ) GOTO  L301B		// Всегда
300F  A08A34              ld    REG_34,REG_8A			; ADC_5_RAW
3012  A1F02932            ld    REG_32,#$29F0			;
3016  2AC1                scall UWLookup			; или 0000 или 8000
3018  A038D6              ld    REG_D6,REG_38			; REG_D6 = REG_38
301B  71E7AC        L301B andb  REG_AC,#$E7			; REG_AC.4 = REG_AC.3 = 0
301E  8940D094            cmp   REG_94,#$D040			; if ( REG_94 > $D040)
3022  D305                jnc   L3029				;  GOTO L3029
3024  9108AC              orb   REG_AC,#$08			; REG_AC.3 = 1
3027  2014                sjmp  L303D				; GOTO L303D
3029  89008A94      L3029 cmp   REG_94,#$8A00			; if ( REG_94 < $8A00)
302D  DB0E                jc    L303D				; GOTO L303D
302F  89405E94            cmp   REG_94,#$5E40			; if ( REG_94 > $5E40)
3033  D305                jnc   L303A				; GOTO L303A
3035  9118AC              orb   REG_AC,#$18			; REG_AC.4 = REG_AC.3 = 1
3038  2003                sjmp  L303D				; GOTO L303D
303A  9110AC        L303A orb   REG_AC,#$10			; REG_AC.4 =1
303D  B3015524      L303D ldb   REG_32,$2455[Zero]		; REG_32 = 00
      32
3042  3C3203              jbs   REG_32,BIT_04,L3048		; if ( REG_32.4 ) GOTO L3048
3045  71F7AC              andb  REG_AC,#$F7			; REG_AC.3 = 0
3048  38E425        L3048 jbs   REG_E4,BIT_00,L3070		; if ( REG_E4.0 ) GOTO L3070
304B  34B311              jbc   REG_B3,BIT_04,L305F		; if (!REG_B3.4 ) GOTO L305F
304E  33B307              jbc   REG_B3,BIT_03,L3058		; if (!REG_B3.3 ) GOTO L3058
3051  B3016824      L3051 ldb   REG_74,$2468[Zero]		; REG_74 = $0000
      74
3056  202C                sjmp  L3084				; GOTO L3084
3058  B3016A24      L3058 ldb   REG_74,$246A[Zero]		; REG_74 = $FFF8
      74
305D  2025                sjmp  L3084				; GOTO L3084
305F  33B307        L305F jbc   REG_B3,BIT_03,L3069		; if ( !REG_B3.3 ) GOTO L3069	
3062  B3016C24      L3062 ldb   REG_74,$246C[Zero]		; REG_74 = $FFF0
      74
3067  201B                sjmp  L3084				; GOTO L3084
3069  B3016E24      L3069 ldb   REG_74,$246E[Zero]		; REG_74 = $FFE8
      74
306E  2014                sjmp  L3084				; GOTO L3084

3070  89C0BE8C      L3070 cmp   REG_8C,#$BEC0			; if ( ADC_6_RAW > $BEC0 )
3074  DBDB                jc    L3051				;  GOTO L3051
3076  89405C8C            cmp   REG_8C,#$5C40			; if ( ADC_6_RAW > $5C40 )
307A  DBDC                jc    L3058				; GOTO L3058
307C  8900358C            cmp   REG_8C,#$3500			; if ( ADC_6_RAW > $3500 )
3080  DBE0                jc    L3062				;  GOTO L3062
3082  27E5                sjmp  L3069				; GOTO L3069
3084  E736FA        L3084 ljmp  L2ABD				; END TASK
                    ;************************************************************
                    ;* Task 4
		    ;* REG_8E - ADC_7_RAW
		    ;* REG_D8 - ADC_7_RAW_FILTERED
		    ;* $013C  - 
		    ;* REG_44 - 
		    ;* REG_9A -
		    ;* REG_70 - Обороты КВ RPMx4??
		    ;*
                    ;************************************************************
3087  37A90F              jbc   REG_A9,BIT_07,L3099		; if ( !REG_A9.7 ) GOTO L3099
308A  A0D832              ld    REG_32,REG_D8			; REG_32 = REG_D8
308D  A08E34              ld    REG_34,REG_8E			; ADC_7_RAW
3090  A1750736            ld    REG_36,#$0775			; REG_36 = $0775
3094  2ACD                scall SDFilter			; REG_3E - result
3096  A03ED8              ld    REG_D8,REG_3E			; 
3099  37B33C        L3099 jbc   REG_B3,BIT_07,L30D8		; if ( !REG_B3.7 ) GOTO L30D8
309C  880044              cmp   REG_44,Zero			; if ( PIP_WIDTH > 0)
309F  D704                jne   L30A5				;  GOTO L30A5 
30A1  0134                clr   REG_34				; REG_34 = 0			// Здесь что-то вроде отсутствует вращение
30A3  200B                sjmp  L30B0				; GOTO L30B0
30A5  A17D0136      L30A5 ld    REG_36,#$017D			; REG_36 = $017D		// $017D7840 => 25000000
30A9  A1407834            ld    REG_34,#$7840			; REG_34 = $7840
30AD  8C4434              divu  REG_34,REG_44			; (dword)REG_34,REG_36/PIP_WIDTH => REG_34 div REG_36 rem // делим на время захвата PIP ???
30B0  A03470        L30B0 ld    REG_70,REG_34			; REG_70 = REG_34		// RPMx4
30B3  717FB3              andb  REG_B3,#$7F			; REG_B3.7 = 0
30B6  A3013C01            ld    REG_32,$013C[Zero]		; REG_32 = [$013C]
      32
30BB  A301B624            ld    REG_36,$24B6[Zero]		; REG_36 = [$24B6]
      36
30C0  2AA1                scall SDFilter			; REG_3E - result
30C2  C3013C01            st    REG_3E,$013C[Zero]		; [$013C] = REG_3E
      3E
30C7  A3013E01            ld    REG_32,$013E[Zero]		; REG_32 = [$013E] 
      32
30CC  A301B824            ld    REG_36,$24B8[Zero]		; REG_36 = [$24B8]		// $8000
      36
30D1  2A90                scall SDFilter
30D3  C3013E01            st    REG_3E,$013E[Zero]		; [$013E] = REG_3E
      3E
30D8  889AD8        L30D8 cmp   REG_D8,REG_9A			; if ( REG_D8 > REG_9A )
30DB  D903                jh    L30E0				; goto L30E0
30DD  A0D89A              ld    REG_9A,REG_D8			; REG_9A = REG_D8
30E0  990253        L30E0 cmpb  REG_53,#$02			; if (REG_53 $02)
30E3  DE0B                jlt   L30F0				; ???
30E5  0170                clr   REG_70				; REG_70  = 0
30E7  91201B              orb   REG_1B,#$20			; REG_1B.5= 1 
30EA  111D                clrb  REG_1D				; bREG_1D = 0 
30EC  A1FFFF44            ld    REG_44,#$FFFF			; PIP_WIDTH = $FFFF			// 
30F0  89000070      L30F0 cmp   REG_70,#$0000			; if ( REG_70 <> $0000 )
30F4  D705                jne   L30FB				;  GOTO L30FB
30F6  91201B              orb   REG_1B,#$20			; REG_B1.5 = 1
30F9  2003                sjmp  L30FE				; GOTO L30FE
30FB  71DF1B        L30FB andb  REG_1B,#$DF			; REG_B1.5 = 0
30FE  3F1A0E        L30FE jbs   REG_1A,BIT_07,L310F		; if (REG_1A.7 ) GOTO L310F
3101  8B010A24            cmp   REG_70,$240A[Zero]		; if ( REG_70 > [$240A] )		// $0258 => 600
      70
3106  D218                jgt   L3120				;  GOTO L3120
3108  91C01A        L3108 orb   REG_1A,#$C0			; REG_1A.7 = REG_1A.6 = 1
310B  111D                clrb  REG_1D				; bREG_1D = 0
310D  2032                sjmp  L3141
310F  8B010824      L310F cmp   REG_70,$2408[Zero]		; if ( REG_70 <= [$240A] ) 		// $960 => 2400
      70
3114  D3F2                jnc   L3108				;  GOTO 3108
3116  9B010C24            cmpb  REG_1D,$240C[Zero]		; if ( REG_1D <= [$240C])		// => 6410
      1D
311B  D324                jnc   L3141				;  GOTO L3141
311D  717F1A              andb  REG_1A,#$7F			; REG_1A.7 = 0
3120  361A14        L3120 jbc   REG_1A,BIT_06,L3137		; if ( !REG_1A.6 ) GOTO L3137
3123  A3010424            ld    REG_38,$2404[Zero]		; REG_38  = $07D0			// $07D0 => 2000
      38
3128  67010624            add   REG_38,$2406[Zero]		; REG_38 += $0190			// $0190 => 400
      38	
312D  887038              cmp   REG_38,REG_70			; if ( REG_38 > REG_70 )
3130  DB0F                jc    L3141				;  GOTO L3141
3132  71BF1A              andb  REG_1A,#$BF			; REG_1A.6 = 0
3135  200A                sjmp  L3141				; GOTO L3141
3137  8B010424      L3137 cmp   REG_70,$2404[Zero]		; if ( REG_70 > $07D0 )
      70
313C  DB03                jc    L3141				;  GOTO  L3141
313E  91401A              orb   REG_1A,#$40			; REG_1A.6 = 1				// Типа если обороты < 2000
3141  71FBAC        L3141 andb  REG_AC,#$FB			; REG_AC.2 = 0
3144  31150C              jbc   REG_15,BIT_01,L3153		; if ( !REG_15.1 ) GOTO L3153
3147  A301BE24            ld    REG_9A,$24BE[Zero]		; REG_9A = $3200
      9A
314C  A09AD8              ld    REG_D8,REG_9A			; REG_D8  = REG_9A
314F  11A9                clrb  REG_A9				; bREG_9A = 0
3151  207B                sjmp  L31CE				; GOTO L31CE
3153  A09A38        L3153 ld    REG_38,REG_9A			; REG_38  = REG_9A
3156  30A926              jbc   REG_A9,BIT_00,L317F		; if ( !REG_A9.0 ) GOTO L317F
3159  31A915              jbc   REG_A9,BIT_01,L3171		; if ( !REG_A9.1 ) GOTO L3171	
315C  67011C24            add   REG_38,$241C[Zero]		; REG_38 += $0140			// 320
      38
3161  DB6B                jc    L31CE				; if ( > 0 ) GOTO L31CE
3163  67012024            add   REG_38,$2420[Zero]		; REG_38 += $0080			// 128
      38
3168  DB64                jc    L31CE				; IF ( > 0 ) GOTO L31CE
316A  888E38              cmp   REG_38,REG_8E			; REG_38 += ADC_7_RAW 			// +
316D  D30C                jnc   L317B				; if ( < ) GOTO L317B
316F  205D                sjmp  L31CE				; GOTO L31CE
3171  67012224      L3171 add   REG_38,$2422[Zero]		; REG_38 += $8000
      38
3176  888E38              cmp   REG_38,REG_8E			; if ( REG_38 < ADC_7_RAW )
3179  D143                jnh   L31BE				;  GOTO L31BE
317B  11A9          L317B clrb  REG_A9				; bREG_A9 = 0
317D  204F                sjmp  L31CE				; GOTO L31CE
317F  67011C24      L317F add   REG_38,$241C[Zero]		; REG_38 += $0140
      38
3184  DB05                jc    L318B				; if ( > 0) GOTO L318B
3186  888E38              cmp   REG_38,REG_8E			; if (REG_38 < ADC_7_RAW )
3189  D105                jnh   L3190				;  GOTO L3190
318B  B1FFA9        L318B ldb   REG_A9,#$FF			; bREG_A9 = $FF
318E  203E                sjmp  L31CE				; GOTO L31CE
3190  32770F        L3190 jbc   REG_77,BIT_02,L31A2		; if ( !REG_77.2 ) GOTO L31A2
3193  0128                clr   REG_28				; REG_28 = 0
3195  B301C724            ldb   REG_2C,$24C7[Zero]		; bREG_2C = 00
      2C
319A  A301CA24            ld    REG_26,$24CA[Zero]		; REG_26 = $0000
      26
319F  910277              orb   REG_77,#$02			; REG_77.1 = 1
31A2  71FB77        L31A2 andb  REG_77,#$FB			; REG_77.2 = 0
31A5  910877              orb   REG_77,#$08			; REG_77.4 = 1
31A8  A09A38              ld    REG_38,REG_9A			; REG_38 = REG_9A
31AB  67012224            add   REG_38,$2422[Zero]		; REG_38 += $8000
      38
31B0  DB1C                jc    L31CE				; if ( > 0 ) GOTO L31CE
31B2  67011E24            add   REG_38,$241E[Zero]		; REG_38 += $0100	
      38
31B7  DB15                jc    L31CE				; if ( > 0 ) GOTO L31CE
31B9  888E38              cmp   REG_38,REG_8E			; if ( REG_38 > ADC_7_RAW )
31BC  DB10                jc    L31CE				;  GOTO L31CE
31BE  B101A9        L31BE ldb   REG_A9,#$01			; REG_A9 = $01
31C1  8B012424            cmp   REG_70,$2424[Zero]		; if ( REG_70 < $0FA0)			// $0FA0 => 4000
      70
31C6  D106                jnh   L31CE				; GOTO 	L31CE
31C8  9104AC              orb   REG_AC,#$04			; REG_AC.2 = 1				// >= 4000
31CB  71F377              andb  REG_77,#$F3			; REG_77.3 = 0 = REG_77.2 = 0
31CE  8B01A224      L31CE cmp   REG_70,$24A2[Zero]		; if ( REG_70 > $620C )			// $620C => 25100 
      70
31D3  D961                jh    L3236				;  GOTO L3236
31D5  1130                clrb  REG_30				; bREG_30 = 0
31D7  9B013624            cmpb  REG_30,$2436[Zero]		; if ( bREG_30 = $01)			//	
      30
31DC  DF63                je    L3241				; GOTO L3241				// Никогда
31DE  9B010D24            cmpb  REG_72,$240D[Zero]		; if ( ECT_VAL <= $19)			//ECT_VAL
      72
31E3  DE5C                jlt   L3241				;  GOTO L3241
31E5  9B015624            cmpb  REG_67,$2456[Zero]		; if ( bREG_67 <= $12)
      67
31EA  DE0E                jlt   L31FA				;  GOTO L31FA
31EC  9B015724            cmpb  REG_67,$2457[Zero]		; if ( bREG_67 >= $20)
      67
31F1  D207                jgt   L31FA				;  GOTO L31FA
31F3  8B015824            cmp   REG_FE,$2458[Zero]		; if (REG_FE < 0000)
      FE
31F8  D347                jnc   L3241				;   GOTO L3241
31FA  99FFA9        L31FA cmpb  REG_A9,#$FF			; if ( REG_A9 != $FF)
31FD  D742                jne   L3241				;   GOTO L3241
31FF  A3013224            ld    REG_30,$2432[Zero]		; REG_30 = $1388			// 5000
      30
3204  34AC05              jbc   REG_AC,BIT_04,L320C		; if ( !REG_AC.4 ) GOTO L320C
3207  6701AA24            add   REG_30,$24AA[Zero]		; REG_30 += $03E8			// 1000
      30
320C  387705        L320C jbs   REG_77,BIT_00,L3214		; if ( REG_77.0 ) GOTO L3214
320F  67013424            add   REG_30,$2434[Zero]		; REG_30 += $0BB8			// 3000
      30
3214  883070        L3214 cmp   REG_70,REG_30			; if ( REG_70 < REG_30)
3217  D124                jnh   L323D				;  GOTO L323D
3219  33770F              jbc   REG_77,BIT_03,L322B		; if ( !REG_77.0 ) GOTO L322B
321C  0128                clr   REG_28				; REG_28 = 0
321E  B301C624            ldb   REG_2C,$24C6[Zero]		; bREG_2C = 0
      2C
3223  A301C824            ld    REG_26,$24C8[Zero]		; REG_26  = 0
      26
3228  71FD77              andb  REG_77,#$FD			; REG_77.1 = 0
322B  71F777        L322B andb  REG_77,#$F7			; REG_77.3 = 0
322E  882628              cmp   REG_28,REG_26			; if ( REG_28 < REG_26)
3231  D311                jnc   L3244				;  GOTO L3244
3233  910477              orb   REG_77,#$04			; REG_77.2 = 1
3236  910177        L3236 orb   REG_77,#$01			; REG_77.0 = 1
3239  015C                clr   REG_5C				; REG_5C = 0
323B  2007                sjmp  L3244				; GOTO L3244
323D  A1FFFF5C      L323D ld    REG_5C,#$FFFF			; REG_5C = $FFFF
3241  71FE77        L3241 andb  REG_77,#$FE			; REG_77.0 = 0
3244  910456        L3244 orb   REG_56,#$04			; REG_56.2 = 0
3247  990353              cmpb  REG_53,#$03			; if ( REG_53 < 03 )
324A  D303                jnc   L324F				; GOTO L324F
324C  71FB56              andb  REG_56,#$FB			; REG_56.2 = 0 
324F  0130          L324F clr   REG_30				; REG_30 = 0
3251  51C01A30            andb  REG_30,REG_1A,#$C0		; REG_30 = REG_1A & 11000000b
3255  325604              jbc   REG_56,BIT_02,L325C		; if ( !REG_56.2 ) GOTO L325C
3258  81000130            or    REG_30,#$0100			; REG_30 = 0000000011000000 |  000000100000000 //	
325C  980015        L325C cmpb  REG_15,Zero			; if ( bREG_15 > 0)
325F  DF04                je    L3265				; GOTO L3265
3261  81000230            or    REG_30,#$0200			; REG_30 |= 000001000000000 //	
3265  99FFA9        L3265 cmpb  REG_A9,#$FF			; if ( bREG_A9 <> $FF)
3268  D715                jne   L327F				; GOTO L327F
326A  3DB305              jbs   REG_B3,BIT_05,L3272		; if ( REG_B3.5 ) GOTO L3272
326D  910430              orb   REG_30,#$04			; bREG_30 = |  0000100 //	 
3270  201A                sjmp  L328C				; GOTO L328C
3272  307705        L3272 jbc   REG_77,BIT_00,L327A		; if ( !REG_77.0 ) GOTO L327A
3275  910230              orb   REG_30,#$02			; bREG_30 |= 00000010
3278  2012                sjmp  L328C				; GOTO L328C
327A  912030        L327A orb   REG_30,#$20
327D  200D                sjmp  L328C
327F  9800A9        L327F cmpb  REG_A9,Zero			; if (REG_A9 == 0)
3282  DF05                je    L3289				; GOTO L3289
3284  910830              orb   REG_30,#$08			; bREG_30 |= 00001000 ;
3287  2003                sjmp  L328C				; GOTO L328C
3289  911030        L3289 orb   REG_30,#$10			; bREG_30 |= 00010000 ;
328C  C3013201      L328C st    REG_30,$0132[Zero]		; [$0132] = 0
      30
3291  E729F8              ljmp  L2ABD



; REG_38 = Table Address              
; REG_30(31) =  значение 
; REG_32(33) =  значение
; REG_34 = Размер таблицы ( колонки + 1 -> множитель для  REG_33) 
; REG_3B = возвращаемое значение (REG_3B = $80) 
;
;
;
;
;

TBL_Lookup:
3294  5C333436      L3294 mulub REG_36,REG_34,REG_33		; bREG_36 = bREG_34*bREG_33
3298  743136              addb  REG_36,REG_31			; REG_36 += bREG_31
329B  D302                jnc   L329F				; if ( REG_36 < REG_31 ) GOTO L329F
329D  1737                incb  REG_37				; bREG_37 ++
329F  643638        L329F add   REG_38,REG_36			; REG_38 += REG_36
32A2  B23931              ldb   REG_31,[REG_38]+		; bREG_31 = [REG_38++]		
32A5  B23833              ldb   REG_33,[REG_38]			; bREG_33 = [REG_38]
32A8  281C                scall L32C6				; REG_3A = result  
32AA  643438              add   REG_38,REG_34			; REG_38 += REG_34
32AD  B23833              ldb   REG_33,[REG_38]			; bREG_33 = [REG_38]
32B0  0538                dec   REG_38				; REG_38 --
32B2  B23831              ldb   REG_31,[REG_38]			; bREG_31 = [REG_38]
32B5  B03B34              ldb   REG_34,REG_3B			; bREG_34 = bREG_3B --- Вот сюда результат
32B8  280C                scall L32C6				; REG_3A = result
32BA  B03B33              ldb   REG_33,REG_3B			; bREG_33 = bREG_3B --- Вот результат сохранили
32BD  B03431              ldb   REG_31,REG_34			; bREG_31 = bREG_34 
32C0  B03230              ldb   REG_30,REG_32			; bREG_30 = bREG_32
32C3  2801                scall L32C6
32C5  F0                  ret
; 
;
; REG_3A = (b((bREG_30*bREG_33) - (bREG_30*bREG_31) + bREG_31 ))+ $0080 Ахринеть
; Линейная Интерполяция ?????
32C6  5C33303A      L32C6 mulub REG_3A,REG_30,REG_33		; REG_3A = bREG_30*bREG_33
32CA  5C313036            mulub REG_36,REG_30,REG_31		; REG_36 = bREG_30*bREG_31
32CE  68363A              sub   REG_3A,REG_36			; REG_3A -= REG_36
32D1  74313B              addb  REG_3B,REG_31			; bREG_3B += bREG_31
32D4  6580003A            add   REG_3A,#$0080			; REG_3A += $0080
32D8  F0                  ret



; Функция просмотра таблицы с линейной интеРполяцией размерность слово
; REG_32 = Адрес таблицы просмотра
; REG_34 = Входящее значение
; REG_38 = Результирующее значение
; REG_A8 - временные флаги
UWLookup:
32D9  9102A8        L32D9 orb   REG_A8,#$02			; REG_A8.1 = 1
SWLookup:
32DC  8B320434      L32DC cmp   REG_34,$04[REG_32]		; COMPARE ( REG_34 , [REG32+4] ) 
32E0  31A804              jbc   REG_A8,BIT_01,L32E7             ; if ( !REG_A8.1 ) GOTO L32E7
32E3  DB0A                jc    L32EF				; if ((uns) REG_34 >= [REG32+4]) GOTO L32EF
32E5  2002                sjmp  L32E9                           ; GOTO L32E9
32E7  D606          L32E7 jge   L32EF				; if (REG_34 < [REG_32+4]) GOTO L32EF		
32E9  65040032      L32E9 add   REG_32,#$0004			; REG_32 +=4 следующе значение в таблице
32ED  27ED                sjmp  SWLookup                        ; GOTO LSWLookup цикл сравнения
								; Попали в диапазон
32EF  A23336        L32EF ld    REG_36,[REG_32]+                ; REG_36 = [REG_32++] ; Значение в Таблице Vout HI
32F2  A23338              ld    REG_38,[REG_32]+		; REG_38 = [REG_32++] ; Значение в Таблице Vout Lo 
32F5  6A3236              sub   REG_36,[REG_32]			; REG_36 = LookUp_GAP
32F8  6A3334              sub   REG_34,[REG_32]+                ; REG_34 = VIN - (VIN_LOW)  ; dVIN
32FB  6A3238              sub   REG_38,[REG_32]			; REG_38 = VOUT_GAP
32FE  31A804              jbc   REG_A8,BIT_01,L3305		; if ( !REG_A8.1 ) GOTO L3305
3301  DB09                jc    L330C				; if ( REG_38 >= [REG_32] )
3303  2002                sjmp  L3307                           ; GOTO L3307
3305  D605          L3305 jge   L330C				; if ( REG_38 >= [REG_32] ) GOTO 330C
3307  9101A8        L3307 orb   REG_A8,#$01			; REG_A8.0 = 1
330A  0338                neg   REG_38                          ; REG_38 =-REG_38  
330C  6C3438        L330C mulu  REG_38,REG_34			; (long)REG_38 = VOUT_GAP * dVIN  REG_38,REG_3A
330F  8C3638              divu  REG_38,REG_36			; (long)REG_38 = VOUT_GAP * dVIN/LookUP_GAP REG_38 div REG_3A rem
3312  30A802              jbc   REG_A8,BIT_00,L3317		; if (!REG_A8.0) goto L3317
3315  0338                neg   REG_38				; REG_38 =-REG38
3317  663238        L3317 add   REG_38,[REG_32]			; REG_38 = VOUT_LOW + ( VOUT_GAP * dVIN/LookUP_GAP )
331A  71FCA8              andb  REG_A8,#$FC                     ; REG_A8 &= $FC  REG_A8.1 = REG_A8.0 = 0;
331D  F0                  ret				        



; Функция табличного преобразования с интерполяцией 
; R32 = Адрес таблицы просмотра
; R34 = Входящее значение (БАЙТ)
; R38 = Результат  (БАЙТ) 

UBLookup:
331E  9102A8        L331E orb   REG_A8,#$02
SBLookup:
3321  9B320234      L3321 cmpb  REG_34,$02[REG_32]
3325  31A804              jbc   REG_A8,BIT_01,L332C
3328  DB0A                jc    L3334
332A  2002                sjmp  L332E
332C  D606          L332C jge   L3334
332E  65020032      L332E add   REG_32,#$0002
3332  27ED                sjmp  SBLookup
3334  B23336        L3334 ldb   REG_36,[REG_32]+
3337  B23338              ldb   REG_38,[REG_32]+
333A  7A3236              subb  REG_36,[REG_32]
333D  7A3334              subb  REG_34,[REG_32]+
3340  7A3238              subb  REG_38,[REG_32]
3343  31A804              jbc   REG_A8,BIT_01,L334A
3346  DB09                jc    L3351
3348  2002                sjmp  L334C
334A  D605          L334A jge   L3351
334C  9101A8        L334C orb   REG_A8,#$01
334F  1338                negb  REG_38
3351  7C3438        L3351 mulub REG_38,REG_34
3354  9C3638              divub REG_38,REG_36
3357  30A802              jbc   REG_A8,BIT_00,L335C
335A  1338                negb  REG_38
335C  763238        L335C addb  REG_38,[REG_32]
335F  71FCA8              andb  REG_A8,#$FC
3362  F0                  ret

; L3363 SDFilter
; IN  REG_32 - Старое значение
;     REG_34 - Новое значение
;     REG_36 - Множитель
;
; OUT REG_3E,REG_3C
; Формула
; REG_3C = |(REG_34-REG_32)| * REG_36  читать как модуль
; REG_3E = REG_32 
; Вообще непонятна с REG_3E ситуация надо моделировать 
; 
               
3363  B102B8    SDFilter: ldb   REG_B8,#$02			; REG_B8 = $02  REG_B8.1 = 1
3366  2002                sjmp  L336A				; GOTO 336A
3368  11B8                clrb  REG_B8				; REG_B8 = $00
336A  4832343C      L336A sub   REG_3C,REG_34,REG_32            ; REG_3C = REG_34-REG_32
336E  31B804              jbc   REG_B8,BIT_01,L3375             ; if ( !REG_B8.1 ) GOTO L3375 
3371  DB09                jc    L337C                           ; if ( REG_3C >= 0 ) GOTO L337C
3373  2002                sjmp  L3377                           ;  GOTO 3377
3375  D605          L3375 jge   L337C                           ; if ( REG_3C >= ) GOTO L337C
3377  9101B8        L3377 orb   REG_B8,#$01			;  REG_B8.0 = 1
337A  033C                neg   REG_3C                          ; REG_3C = -REG_3C  ; Модуль разности !!
337C  8901003C      L337C cmp   REG_3C,#$0001                   ; if ( REG_3C <= $0001 )
3380  D905                jh    L3387                           ;   Goto L3387
3382  A0323E              ld    REG_3E,REG_32                   ; REG_3E = REG_32   ; Результат = старое если ????
3385  2011                sjmp  L3398                           ; GOTO L3398
3387  6C363C        L3387 mulu  REG_3C,REG_36                   ; REG_3C *= REG_36 => REG_3C,REG_3E
338A  033E                neg   REG_3E                          ; REG_3E = -REG3E
338C  D702                jne   L3390                           ; if ( REG_3E == 0)  GOTO 3390
338E  053E                dec   REG_3E                          ; REG_3E --
3390  38B802        L3390 jbs   REG_B8,BIT_00,L3395             ; if ( REG_B8.0 ) GOTO L3395
3393  033E                neg   REG_3E				; REG_3E = -REG_3E
3395  64323E        L3395 add   REG_3E,REG_32                   ; REG_3E += REG_32
3398  F0            L3398 ret					; RET
                    ;************************************************************
                    ;* Task 6
                    ;************************************************************
3399  371A05              jbc   REG_1A,BIT_07,L33A1		; if ( !REG_1A.7 ) GOTO L33A1
339C  B180C3              ldb   REG_C3,#$80			; REG_3C = $80
339F  2095          L339F sjmp  L3436				; GOTO L3436
33A1  890000F0      L33A1 cmp   REG_F0,#$0000			; if (REG_F0 <> 0 )
33A5  D70C                jne   L33B3				; GOTO L33B3
33A7  AF013B24            ldbze REG_32,$243B[Zero]		; REG_32 = $05
      32
33AC  8832C6              cmp   REG_C6,REG_32			; if (REG_C6 < REG_32)
33AF  D3EE                jnc   L339F				; GOTO L339F
33B1  01C6                clr   REG_C6				; REG_C6 = 0
33B3  AF013B24      L33B3 ldbze REG_38,$243B[Zero]		; REG_38 = $05
      38
33B8  8838C6              cmp   REG_C6,REG_38			; if (REG_C6 > REG_38)
33BB  DB05                jc    L33C2				; GOTO L33C2
33BD  9980C3              cmpb  REG_C3,#$80			; if (REG_3C > $80 )
33C0  D94D                jh    L340F				; GOTO L340F
33C2  48DA8E38      L33C2 sub   REG_38,REG_8E,REG_DA		; REG_38 = ADC_7_RAW - REG_DA
33C6  DB02                jc    L33CA				; if ( < 0 ) GOTO L33CA
33C8  0138                clr   REG_38				; REG_38 = 0
33CA  080638        L33CA shr   REG_38,#$06			; REG_38 /= 64
33CD  8B013824            cmp   REG_38,$2438[Zero]		; if ( REG_38 > 4)
      38
33D2  D33B                jnc   L340F				; GOTO L340F
33D4  A09E34              ld    REG_34,REG_9E			; REG_34 = REG_9E
33D7  B03534              ldb   REG_34,REG_35			; bREG_34 = bREG_35
33DA  A1362932            ld    REG_32,#$2936			; REG_32
33DE  2F3E                scall UBLookup			; bREG_38 = UBLookup( (byte)REG_9E,$2936)
33E0  B03830              ldb   REG_30,REG_38			; REG_30 = (word)bREG_38 
33E3  A1402932            ld    REG_32,#$2940
33E7  B07234              ldb   REG_34,REG_72			; ECT_VAL
33EA  2F35                scall SBLookup			; SBLookup( ECT_VAL,$2940)
33EC  7C3038              mulub REG_38,REG_30			; REG_38 *= bREG_30
33EF  558039C3            addb  REG_C3,REG_39,#$80		; REG_C3 = REG_39+$80
33F3  DB3C                jc    L3431				; if (<0) GOTO L3431
33F5  0130                clr   REG_30				;  REG_30 = 0
33F7  1133                clrb  REG_33				; bREG_33 = 0
33F9  B03932              ldb   REG_32,REG_39			; bREG_32 = bREG_39
33FC  B3013A24            ldb   REG_3B,$243A[Zero]		; bREG_3B = $3F
      3B
3401  113A                clrb  REG_3A				; bREG_3A = 0
3403  8C3A30              divu  REG_30,REG_3A			; (dword) REG_30,REG_32 / REG_3A => REG_30 div REG_32 rem
3406  DD29                jv    L3431				; if ( > 0 ) GOTO  L3431
3408  A030F0              ld    REG_F0,REG_30			; REG_F0 = REG_30
340B  01C6                clr   REG_C6				; REG_C6 = 0
340D  2027                sjmp  L3436				; GOTO L3436

340F  9980C3        L340F cmpb  REG_C3,#$80			; if ( REG_C3 < $80 )
3412  D11D                jnh   L3431				; GOTO L3431
3414  A0C63A              ld    REG_3A,REG_C6			; REG_3A = REG_C6
3417  08043A              shr   REG_3A,#$04			; REG_3A /= 16
341A  AF013A24            ldbze REG_34,$243A[Zero]		; REG_34 = $3F
      34
341F  683A34              sub   REG_34,REG_3A			; REG_34 -= REG_3A
3422  D10D                jnh   L3431				; if ( ? ) GOTO L3431
3424  6CF034              mulu  REG_34,REG_F0			; (dword) REG_34,REG_36 = REG_34 * REG_F0
3427  DD08                jv    L3431				; if ( ? ) GOTO L3431
3429  558035C3            addb  REG_C3,REG_35,#$80		; REG_C3 = REG_35 + $80
342D  DB02                jc    L3431				; if ( < 0 ) GOTO L3431
342F  2005                sjmp  L3436				; GOTO L3436
3431  B180C3        L3431 ldb   REG_C3,#$80			; bREG_C3 = $80
3434  01F0                clr   REG_F0				;  REG_F0 = 0

3436  A08EDA        L3436 ld    REG_DA,REG_8E			; REG_DA = ADC_7_RAW
3439  8B014424            cmp   REG_5C,$2444[Zero]		; if ( REG_5C > 0000)
      5C
343E  D305                jnc   L3445				; GOTO L3445
3440  B14030              ldb   REG_30,#$40			; bREG_30 = $40
3443  2017                sjmp  L345C				; ????? кода нет но и выполнение условия тоже нет

3445  B14030        L3445 ldb   REG_30,#$40			; bREG_30 = $40
3448  7B014624            subb  REG_30,$2446[Zero]		; bREG_30 -= $40 
      30
344D  1131                clrb  REG_31				; bREG_31 = 0
344F  6C5C30              mulu  REG_30,REG_5C			; (dword)REG_30,REG_32 = REG_30 * REG_5C
3452  8F014424            divu  REG_30,$2444[Zero]		; (dword)REG_30,REG_32 / 0 ????
3456  307701              jbc   REG_77,BIT_00,L345A		; if ( !REG_77.0 ) GOTO L345A
3459  462430B0            add   REG_B0,REG_30,[REG_24]		; REG_B0 = REG_30 + [REG_24]			// !!!!
345D  304CE7              jbc   REG_4C,BIT_00,L3447		; if ( !REG_4C.0 ) GOTO L3447
; 3462 !!!!
3460  5BF6A09E            subb  REG_38,REG_9E,$A0[REG_F6]	; REG_38 = REG_9E + $A0[REG_F6]			// !!!!
      38
3465  6F010024            mulu  REG_38,$2400[Zero]		; (dword)REG_38,REG_39 = REG_38 * $8000
      38
346A  47010224            add   REG_3E,REG_3A,$2402[Zero]	; REG_3E = REG_3A  + $0000
      3A3E
3470  373F02              jbc   REG_3F,BIT_07,L3475		; if ( !REG_3F.7 ) GOTO L3475
3473  013E                clr   REG_3E				; REG_3E = 0
3475  A03ED2        L3475 ld    REG_D2,REG_3E			; REG_D2 = REG_3E
3478  F0                  ret
                    ;************************************************************
                    ;* Task 7
		    ; Входные параметры
		    ; bREG_72 -??
		    ; bREG_51 -??
		    ; REG_70  -??
	   	    ;
		    ; Результат  
	   	    ; REG_C0 - Для обработки инжектора , DO_INJECTION()
		    ;
	   	    ;
                    ;************************************************************
3479  371A4A              jbc   REG_1A,BIT_07,L34C6		; if ( !REG_1A.7 ) GOTO L34C6
347C  A1D62732            ld    REG_32,#$27D6			; REG_32 = #27D6 		// Адрес таблицы просмотра
3480  B07235              ldb   REG_35,REG_72			; bREG_35 = ECT_VAL		
3483  1134                clrb  REG_34				; bREG_34 = 0			// REG_34 = ECT_VAL
3485  2E55                scall SWLookup			; 				// Результат в REG_38
3487  A0386C              ld    REG_6C,REG_38			; REG_6C = SWLookup ( ECT_VAL ,$27D6  )
348A  A1B22732            ld    REG_32,#$27B2			; REG_32 = #27D6 		// Адрес таблицы просмотра
348E  AC5134              ldbze REG_34,REG_51			; 				// REG_34 = bREG_51
3491  2E46                scall UWLookup			; 
3493  A03832              ld    REG_32,REG_38			; REG_32 = UWLookup ( bREG_51 ,$27B2 )
3496  A06C30              ld    REG_30,REG_6C			; REG_30 = REG_6C
3499  A1080034            ld    REG_34,#$0008			; REG_34 = $0008
349D  A1302538            ld    REG_38,#$2530			; REG_38 = $2530
34A1  2DF1                scall TBL_Lookup			; bREG_3B = TBL_Lookup (SWLookup(ECT_VAL,$27D6),UWLookup(bREG_51,$27B2),8,$2530)
34A3  AC3BC4              ldbze REG_C4,REG_3B			; REG_C4 = bREG_3B
34A6  A1062832            ld    REG_32,#$2806			; REG_32 = $2806		// Адрес таблицы просмотра
34AA  A07034              ld    REG_34,REG_70			; REG_34 = REG_70		// От Скорости вращения КВ
34AD  2E2A                scall UWLookup			; REG_38 = UWLookup ( REG_70 , $2806 )
34AF  6CC438              mulu  REG_38,REG_C4			; (dword)REG_38,REG_39 = UWLookup ( REG_70 , $2806 ) * TBL_Lookup (SWLookup(ECT_VAL,$27D6),UWLookup(bREG_51,$27B2),8,$2530)
34B2  0D0338              shll  REG_38,#$03			; (dword)REG_38,REG_39 /= 8 ;
34B5  6D74CB38            mulu  REG_38,#$CB74			; (dword)REG_38,REG_39 = REG_38 *$CB74	// Предпологается что результат поместится в (word)
34B9  B1014D              ldb   REG_4D,#$01			; REG_4D = $01
34BC  A03AC0              ld    REG_C0,REG_3A			; REG_C0 = REG_3A 		// это вообще старший байт от произведения выше и является дополнительным временем впрыска 
34BF  9901A9              cmpb  REG_A9,#$01			; 
34C2  D702                jne   L34C6				; if ( REG_A9 != $01) GOTO L34C6
34C4  01C0                clr   REG_C0				; REG_C0 = 0			// В обработке инжектора 
34C6  E7F4F5        L34C6 ljmp  L2ABD
                    ;************************************************************
                    ;* Task 8
                    ;************************************************************
34C9  3F1AFA              jbs   REG_1A,BIT_07,L34C6		; if ( REG_1A.7 ) GOTO L34C6
34CC  2F94                scall L3462				; ???????
34CE  A07034              ld    REG_34,REG_70			; REG_34 = RPMx4
34D1  331B05              jbc   REG_1B,BIT_03,L34D9		; if ( !REG_1B.3 ) GOTO L34D9
34D4  A3013C01            ld    REG_34,$013C[Zero]		; REG_34 = [$013C]
      34
34D9  321B05        L34D9 jbc   REG_1B,BIT_02,L34E1		; if ( !REG_1B.2 ) GOTO L34E1
34DC  A3013E01            ld    REG_34,$013E[Zero]		; REG_34 = [$013E]
      34
34E1  013C          L34E1 clr   REG_3C				; REG_3C = 0
34E3  8C343C              divu  REG_3C,REG_34			; (dword)REG_3C,REG_3E / REG_34 => REG_3C div REG_3E rem
34E6  DD0D                jv    L34F5				; if ( ?? ) GOTO L34F5
34E8  013E                clr   REG_3E				; REG_3E = 0 
34EA  8D08003C            divu  REG_3C,#$0008			; (dword)REG_3C,REG_3E / 8 => REG_3C div REG_3E rem
34EE  8B011624            cmp   REG_3C,$2416[Zero]		; if ( REG_3C < $154D )
      3C
34F3  D105                jnh   L34FA				; GOTO L34FA
34F5  A3011624      L34F5 ld    REG_3C,$2416[Zero]		; REG_3C = $154D
      3C
34FA  9901A9        L34FA cmpb  REG_A9,#$01			; if ( bREG_A9 != 1)
34FD  D70C                jne   L350B				; GOTO L350B
34FF  8B011824            cmp   REG_3C,$2418[Zero]		; if ( REG_3C > $0831)
      3C
3504  DB05                jc    L350B				; GOTO L350B
3506  A3011824            ld    REG_3C,$2418[Zero]		; REG_3C = $0831
      3C
350B  A03C64        L350B ld    REG_64,REG_3C			; REG_64 = REG_3C
350E  A1D62732            ld    REG_32,#$27D6			; REG_32 = adrTable
3512  B07235              ldb   REG_35,REG_72			; ECT_VAL
3515  1134                clrb  REG_34				; bREG_34  = 0
3517  2DC3                scall SWLookup			; 
3519  A0386C              ld    REG_6C,REG_38			; REG_6C = SWLookup( ECT_VAL,$27D6)
351C  A1F22732            ld    REG_32,#$27F2			; REG_32 = adrTable
3520  A06434              ld    REG_34,REG_64			;
3523  2DB4                scall UWLookup			; 
3525  A0386E              ld    REG_6E,REG_38			; REG_6E = UWLookup( REG_64, $27F2)
3528  E792F5              ljmp  L2ABD
                    ;************************************************************
                    ;* Task 9
                    ;* 
                    ;* Входные 
		    ;*  REG_1A.7 -
                    ;*  bREG_24  - 
                    ;*  wREG_6C  -
                    ;*  REG_AC.2 - 1 => bREG_39 = [$241A] , 0 => bREG_39 = $80
                    ;* Результат 
                    ;*  wREG_6A  -
                    ;* 
                    ;* Формула
                    ;* REG_6A = TBL_Lookup(REG_6C,UWLookup(bREG_32,$2796),8,$2500) * bREG_39
                    ;************************************************************
352B  3F1A98              jbs   REG_1A,BIT_07,L34C6		; if ( REG_1A.7 ) GOTO L34C6 	// необрабатываем End TASK
352E  A1962732            ld    REG_32,#$2796			; REG_32 = $2796		// Адрес таблицы
3532  AC2434              ldbze REG_34,REG_24			; REG_34 = bREG_24
3535  2DA2                scall UWLookup			; REG_38 = UWLookup(bREG_24, $2796 )
3537  A03832              ld    REG_32,REG_38			; REG_32 = UWLookup(bREG_32, $2796 )
353A  A06C30              ld    REG_30,REG_6C			; REG_30 = REG_6C
353D  A1080034            ld    REG_34,#$0008			; REG_34 = $08			// Колонок 
3541  A1002538            ld    REG_38,#$2500			; REG_38 = $2500		// Адрес таблицы
3545  2D4D                scall TBL_Lookup			; bREG_3B = TBL_Lookup(REG_6C,UWLookup(bREG_32,$2796),8,$2500)
3547  B3011A24            ldb   REG_39,$241A[Zero]		; bREG_39  = [$241A]
      39
354C  3AAC03              jbs   REG_AC,BIT_02,L3552		; if ( REG_AC.2 ) GOTO L3552
354F  B18039              ldb   REG_39,#$80			; bREG_39  = $80
3552  5C393B6A      L3552 mulub REG_6A,REG_3B,REG_39		; REG_6A = TBL_Lookup(REG_6C,UWLookup(bREG_32,$2796),8,$2500) * bREG_39
3556  E764F5              ljmp  L2ABD				; End Task
                    ;************************************************************
                    ;* Task 10
                    ;* 
                    ;* Входные  
	            ;*  REG_1A.7 - 
                    ;*  REG_6C   -
                    ;*  REG_6E   -
                    ;*  REG_3B   -
                    ;* 
                    ;* Выходные  - REG_6A
                    ;* 
                    ;* Формула
                    ;*  wREG_6A =  TBL_Lookup(REG_6C,REG_6E,8,$2500) * REG_3B
                    ;************************************************************
3559  3F1A14              jbs   REG_1A,BIT_07,L3570		; if ( REG_1A.7 ) GOTO L3570 	// End Task
355C  A06C30              ld    REG_30,REG_6C			;  
355F  A06E32              ld    REG_32,REG_6E			;
3562  A1080034            ld    REG_34,#$0008			;
3566  A1D02438            ld    REG_38,#$24D0			;
356A  2D28                scall TBL_Lookup			;
356C  5C3B6B6A            mulub REG_6A,REG_6B,REG_3B    	;  wREG_6A =  TBL_Lookup(REG_6C,REG_6E,8,$2500) * REG_3B
3570  E74AF5        L3570 ljmp  L2ABD
                    ;************************************************************
                    ;* Task 11
                    ;* 
                    ;* 
                    ;* Входные 
                    ;*  REG_70   - 
                    ;*  REG_64   -
                    ;*  REG_1B.3 -
                    ;*  REG_1B.2 -
                    ;* 
                    ;* 
                    ;* 
                    ;* 
                    ;* 
                    ;* 
                    ;* 
                    ;************************************************************
3573  3F1A3C              jbs   REG_1A,BIT_07,L35B2		; if ( REG_1A.7 ) GOTO L3570 	// End Task
3576  A1222832            ld    REG_32,#$2822			;  Адрес таблицы  $2822
357A  A07034              ld    REG_34,REG_70			; REG_34 = REG_70	
357D  331B05              jbc   REG_1B,BIT_03,L3585		i if ( !REG_1B.3 ) GOTO L3585
3580  A3013C01            ld    REG_34,$013C[Zero]		; REG_34 = [$013C] 	
      34
3585  321B05        L3585 jbc   REG_1B,BIT_02,L358D		; if ( !REG_1B.2 ) GOTO L358D
3588  A3013E01            ld    REG_34,$013E[Zero]		; REG_34 = [$013E] 	
      34
358D  2D4A          L358D scall UWLookup			; 
358F  A0386C              ld    REG_6C,REG_38			; REG_6C = UWLookup({REG_70|[$013C]|[$013E]},$2822) 	// 
3592  A1462832            ld    REG_32,#$2846			; Адрес таблицы  $2846
3596  A06434              ld    REG_34,REG_64			; REG_34 = REG_64
3599  2D3E                scall UWLookup
359B  A0386E              ld    REG_6E,REG_38			; REG_6E = UWLookup( REG_64 , $2846)
359E  A06C30              ld    REG_30,REG_6C			; REG_32 = UWLookup( REG_64 , $2846)
35A4  A10D0034            ld    REG_34,#$000D			; REG_34 = $000D					//
35A8  A1612638            ld    REG_38,#$2661			; $2661 - Адрес таблицы 
35AC  EFE5FC              lcall TBL_Lookup
35AF  B03B76              ldb   REG_76,REG_3B			; bREG_76 = TBL_Lookup (UWLookup({REG_70|[$013C]|[$013E]},$2822),UWLookup(REG_64,$2846),D,$2661)
35B2  E708F5        L35B2 ljmp  L2ABD				; END TASK
                    ;************************************************************
                    ;* Task 12
		    ;
		    ;
		    ;
		    ;
		    ;
		    ;
		    ;
		    ;
		    ;
                    ;************************************************************
35B5  3F1AFA              jbs   REG_1A,BIT_07,L35B2		; if ( REG_1A.7 ) GOTO L35B2
35B8  B0763A              ldb   REG_3A,REG_76			; bREG_3A = bREG_76
35BB  113B                clrb  REG_3B				; bREG_3B = 0 				// REG_3A= (word)bREG_76
35BD  0138                clr   REG_38				; REG_38  = 0
35BF  8C6A38              divu  REG_38,REG_6A			; (dword)REG_38,REG_3A / REG_6A => REG_38 div REG_3A rem
35C2  080538              shr   REG_38,#$05			; REG_38 /= 32
35C5  B03876              ldb   REG_76,REG_38			; bREG_76 = bREG_38
35C8  AC763A              ldbze REG_3A,REG_76			; REG_3A = bREG_76
35CB  A3011424            ld    REG_38,$2414[Zero]		; REG_38 = $63F1
      38
35D0  6C3A38              mulu  REG_38,REG_3A			; (dword)REG_38,REG_3A =  REG_3A * REG_38
35D3  0C0638              shrl  REG_38,#$06			; (dword)REG_38,REG_3A /= 64
35D6  A0643E              ld    REG_3E,REG_64			; REG_3E = REG_64
35D9  013C                clr   REG_3C				; REG_3C = 0
35DB  8C383C              divu  REG_3C,REG_38			; (dword) REG_3C,REG_3E / REG_38 => REG_3C div REG_3E rem
35DE  08023C              shr   REG_3C,#$02			; REG_3C /=4
35E1  A03CC4              ld    REG_C4,REG_3C			; REG_C4 = REG_3C
35E4  ACC334              ldbze REG_34,REG_C3			; REG_34 = bREG_3C
35E7  4C34C430            mulu  REG_30,REG_C4,REG_34		; (dword)REG_30,REG_32 = REG_C4 * REG_34
35EB  0C0730              shrl  REG_30,#$07			; (dword)REG_30,REG_32 /= 128
35EE  AF004C34            ldbze REG_34,$4C[Zero]		; REG_34 = (word) REG_4C			// !!
35F2  6C3430              mulu  REG_30,REG_34			; (dword)REG_30,REG_32 = REG_30 *REG_ 34
35F5  0C0630              shrl  REG_30,#$06			; (dword)REG_30,REG_32 /= 64
35F8  6CD630              mulu  REG_30,REG_D6			; REG_30 = REG_30*REG_D6
35FB  0D0230              shll  REG_30,#$02			; REG_30 *= 2
35FE  DB18                jc    L3618				; if ( ?? ) GOTO L3618
3600  A03230              ld    REG_30,REG_32			; REG_30 = REG_32
3603  A14A2732            ld    REG_32,#$274A			;
3607  A02034              ld    REG_34,REG_20		
360A  2CCD                scall UWLookup			; UWLookup ( REG_20,$274A )
360C  A038E2              ld    REG_E2,REG_38			; REG_E2 = UWLookup ( REG_20,$274A )
360F  64E230              add   REG_30,REG_E2			; REG_30 += REG_E2
3612  89676630            cmp   REG_30,#$6667			; if ( REG_30 < $6667)
3616  D104                jnh   L361C				;  GOTO L361C
3618  A1676630      L3618 ld    REG_30,#$6667			; REG_30 = $6667
361C  6D74CB30      L361C mulu  REG_30,#$CB74			; (dword)REG_30,REG_32 *= $CB74;
3620  361A0B              jbc   REG_1A,BIT_06,L362E		; if ( REG_1A.6 ) GOTO 	L362E
3623  A03230              ld    REG_30,REG_32			; REG_30 = REG_32
3626  6F010E24            mulu  REG_30,$240E[Zero]		; (dword)REG_30,REG_32 *= $4000
      30
362B  0D0230              shll  REG_30,#$02			; (dword)REG_30,REG_32 *= 2
362E  307702        L362E jbc   REG_77,BIT_00,L3633		; if (REG_77.0 ) GOTO L3633
3631  0132                clr   REG_32				; REG_32 = 0
3633  361A05        L3633 jbc   REG_1A,BIT_06,L363B		; if ( !REG_1A.6 ) GOTO L363B
3636  B1024D        L3636 ldb   REG_4D,#$02			; REG_4D = $02
3639  2014                sjmp  L364F				; GOTO L364F
363B  9B014E24      L363B cmpb  REG_72,$244E[Zero]		; if ( ECT_VAL > -40 )
      72
3640  D2F4                jgt   L3636				; GOTO L3636
3642  8B015024            cmp   REG_32,$2450[Zero]		; if (REG_32 >  0000 )
      32
3647  D9ED                jh    L3636				; GOTO L3636
3649  0D0130              shll  REG_30,#$01			; REG_32 *= 2 
364C  B1044D              ldb   REG_4D,#$04			; REG-4D = $04
364F  A032C0        L364F ld    REG_C0,REG_32			; В обработке инжектора  - ширина импульса впрыска в дополнение к основному 
3652  E768F4              ljmp  L2ABD				; END Task
                    ;************************************************************
                    ;* Task 15
                    ;* 
                    ;* 
                    ;* 
                    ;* 
                    ;************************************************************
3655  361A05              jbc   REG_1A,BIT_06,L365D		; if ( !REG_1A.6 ) GOTO L365D
3658  B1281C              ldb   REG_1C,#$28			; bREG_1C = $28
365B  2034                sjmp  L3691				; Goto END TASK_15
365D  371B31        L365D jbc   REG_1B,BIT_07,L3691		; if (!REG_1B.7 )  GOTO L3691
3660  A1222832            ld    REG_32,#$2822			; 
3664  A07034              ld    REG_34,REG_70
3667  EF6FFC              lcall UWLookup			; REG_38 = UWLookup( REG_70, $2822)
366A  A0386C              ld    REG_6C,REG_38			; REG_6C = REG_38
366D  A1462832            ld    REG_32,#$2846
3671  A06434              ld    REG_34,REG_64
3674  EF62FC              lcall UWLookup			; REG_38 = UWLookup( REG_64, $2846)
3677  A0386E              ld    REG_6E,REG_38			; REG_6E = REG_38
367A  A06C30              ld    REG_30,REG_6C			;
367D  A06E32              ld    REG_32,REG_6E			;
3680  A10D0034            ld    REG_34,#$000D			;
3684  A1882538            ld    REG_38,#$2588
3688  EF09FC              lcall TBL_Lookup			;
368B  AC3BD0              ldbze REG_D0,REG_3B			; REG_D0   = TBL_Lookup(UWLookup( REG_70, $2822),UWLookup( REG_64, $2846),$000D,$2588)
368E  9101B1              orb   REG_B1,#$01			; REG_B1.0 = 0
3691  E729F4        L3691 ljmp  L2ABD
                    ;************************************************************
                    ;* Task 16
		    ; REG_B1.0 - 0 Задача 16 выполнена, иначе требование выполнения
		    ; bREG_67  - ECT_Val_2
		    ;
		    ;
		    ;
		    ;
		    ;
                    ;************************************************************
3694  38B102              jbs   REG_B1,BIT_00,L3699		; if ( REG_B1.0 ) GOTO L3699
3697  20F8                sjmp  L3791				; GOTO L3791
3699  A1562832      L3699 ld    REG_32,#$2856			; REG_32 = adrTbl 
369D  B07235              ldb   REG_35,REG_72			; 
36A0  1134                clrb  REG_34				; REG_34 = (word)ECT_VAL
36A2  EF37FC              lcall SWLookup			; 
36A5  6838D0              sub   REG_D0,REG_38			; REG_D0 -= SWLookup((word)ECT_VAL,$2856)
36A8  9B015624            cmpb  REG_67,$2456[Zero]		; if ( ECT_Val_2 < 18 )
      67
36AD  DE13                jlt   L36C2				; GOTO L36C2
36AF  9B015724            cmpb  REG_67,$2457[Zero]		; if ( ECT_Val_2 > 32)
      67
36B4  D20C                jgt   L36C2				; L36C2
36B6  8B01C424            cmp   REG_FE,$24C4[Zero]		; if (REG_FE > 0000 )
      FE
36BB  D605                jge   L36C2				; GOTO L36C2
36BD  9900A9              cmpb  REG_A9,#$00			; if (bREG_A9 == 0)
36C0  DF06                je    L36C8				; GOTO L36C8
36C2  A100003C      L36C2 ld    REG_3C,#$0000			; REG_3C = 0
36C6  202E                sjmp  L36F6				; GOTO L36F6
36C8  A1582A32      L36C8 ld    REG_32,#$2A58			; 
36CC  A07034              ld    REG_34,REG_70			; REG_34 = RPMx4
36CF  EF07FC              lcall UWLookup			; 
36D2  A0386C              ld    REG_6C,REG_38			; REG_6C = UWLookup(RPMx4,$2A58 )
36D5  A1F22732            ld    REG_32,#$27F2			;
36D9  A06434              ld    REG_34,REG_64
36DC  EFFAFB              lcall UWLookup			; 
36DF  A0386E              ld    REG_6E,REG_38			; REG_6E = UWLookup( REG_64,$27F2 )
36E2  A06C30              ld    REG_30,REG_6C			;
36E5  A06E32              ld    REG_32,REG_6E
36E8  A1080034            ld    REG_34,#$0008
36EC  A1312638            ld    REG_38,#$2631
36F0  EFA1FB              lcall TBL_Lookup			; 
36F3  AC3B3C              ldbze REG_3C,REG_3B			; REG_3C = (word)TBL_Lookup(REG_6C,REG_6E,#$0008,#$2631)
36F6  3DB312        L36F6 jbs   REG_B3,BIT_05,L370B		; if ( REG_B3.5) goto L370B
36F9  A3017024            ld    REG_B8,$2470[Zero]		; REG_B8 = $0030
      B8
36FE  3BAC03              jbs   REG_AC,BIT_03,L3704		; if ( REG_AC.3 ) goto L3704
3701  34AC1D              jbc   REG_AC,BIT_04,L3721		; if ( REG_AC.4 ) goto L3721
3704  6701A024      L3704 add   REG_B8,$24A0[Zero]		; REG_B8 = $0010
      B8
3709  2016                sjmp  L3721				; GOTO L3721
370B  483CD03C      L370B sub   REG_3C,REG_D0,REG_3C		; REG_3C = REG_D0-REG_3C
370F  AF012824            ldbze REG_38,$2428[Zero]		; REG_38 = $80
      38
3714  FE6C383C            mul   REG_3C,REG_38			; (dword)REG_3C,REG_3D = REG_3C*REG_38
3718  0C073C              shrl  REG_3C,#$07			; (dword)REG_3C /= 128
371B  47012A24            add   REG_B8,REG_3C,$242A[Zero]	; REG_B8 = REG_3C + $0000
      3CB8
3721  BC7430        L3721 ldbse REG_30,REG_74			; REG_30 = (word) bREG_74
3724  6430B8              add   REG_B8,REG_30			; REG_B8 += REG_30 
3727  64D4B8              add   REG_B8,REG_D4			; REG_B8 += REG_D4
372A  882628              cmp   REG_28,REG_26			; if (REG_28 < REG_26)
372D  D304                jnc   L3733				; GOTO L3733
372F  0130                clr   REG_30				; REG_30 =0
3731  2015                sjmp  L3748				; GOTO L3748
3733  397705        L3733 jbs   REG_77,BIT_01,L373B		; if ( REG_77.1 ) GOTO L373B
3736  A02830              ld    REG_30,REG_28			; REG_30 = REG_28
3739  2004                sjmp  L373F				; GOTO L373F
373B  48282630      L373B sub   REG_30,REG_26,REG_28		; REG_30 = REG_26-REG-28
373F  AC2CB6        L373F ldbze REG_B6,REG_2C			; REG_B6 = (word) REG_2C
3742  6CB630              mulu  REG_30,REG_B6			; REG_30 = REG_30 * REG_B6
3745  8C2630              divu  REG_30,REG_26			; REG_30 /= REG_26
3748  C3014401      L3748 st    REG_30,$0144[Zero]		; $[0144] = REG_30
      30
374D  6830B8              sub   REG_B8,REG_30			; REG_B8 -= REG_30
3750  3FB90C              jbs   REG_B9,BIT_07,L375F		; if ( REG_B9.7 ) GOTO L375F
3753  9900B9              cmpb  REG_B9,#$00			; if ( REG_B9 != 0)
3756  D713                jne   L376B				; GOTO L376B
3758  9B012624            cmpb  REG_B8,$2426[Zero]		; if ( REG_B8 > $00)
      B8	
375D  D905                jh    L3764				; GOTO L3764
375F  B3012624      L375F ldb   REG_B8,$2426[Zero]		; REG_B8  = 0
      B8
3764  9B012724      L3764 cmpb  REG_B8,$2427[Zero]		; if ( REG_B8 < $F0)
      B8
3769  D305                jnc   L3770				; GOTO 3770
376B  B3012724      L376B ldb   REG_B8,$2427[Zero]		; REG_B8 = $F0
      B8
3770  B3017724      L3770 ldb   REG_30,$2477[Zero]		; REG_30 = $18
      30
3775  581CB838            subb  REG_38,REG_B8,REG_1C		; REG_38 = REG_B8 - REG_1C
3779  373804              jbc   REG_38,BIT_07,L3780		; if ( !REG_38.7 ) GOTO L3780
377C  1330                negb  REG_30				; REG_30 = - REG_30
377E  1338                negb  REG_38
3780  9B017724      L3780 cmpb  REG_38,$2477[Zero]		; if ( REG_38 < $18)
      38
3785  D104                jnh   L378B				; GOTO L378B
3787  54301CB8            addb  REG_B8,REG_1C,REG_30		; bREG_B8 = bREG_1C + bREG_30
378B  B0B81C        L378B ldb   REG_1C,REG_B8			; bREG_1C = bREG_B8
378E  717F1B              andb  REG_1B,#$7F			; REG_1B.7 = 0
3791  71FEB1        L3791 andb  REG_B1,#$FE			; REG_B1.0 = 0
3794  E726F3              ljmp  L2ABD
                    ;************************************************************
                    ;* Task 17
		    ;*
		    ;*
		    ;* REG_E0 - используется
                    ;************************************************************
3797  3EB302              jbs   REG_B3,BIT_06,L379C		; if ( REG_B3.6 ) GOTO L379C
379A  20E8                sjmp  L3884				; GOTO END TASK
379C  FA            L379C di
379D  FF                  nop
379E  A044B8              ld    REG_B8,REG_44			; REG_B8 = PIP_WIDTH
37A1  A0C8B6              ld    REG_B6,REG_C8			; REG_B6 = PIP_WIDTH_P
37A4  A0CA3E              ld    REG_3E,REG_CA			; REG_3E = Ton_PIP_prev
37A7  A01E3C              ld    REG_3C,REG_1E			; REG_3C = Ton_PIP
37AA  FB                  ei
37AB  71BFB3              andb  REG_B3,#$BF			; REG_B3.6 = 0
37AE  48B6B836            sub   REG_36,REG_B8,REG_B6		; REG_36 = PIP_WIDTH - PIP_WIDTH_P 	; 
37B2  DB02                jc    L37B6				; if  ( REG_36 > 0 ) GOTO L37B6
37B4  0336                neg   REG_36				; REG_36 = -REG_36							
37B6  4CE0B830      L37B6 mulu  REG_30,REG_B8,REG_E0		; REG_30 = PIP_WIDTH * REG_E0    // результат (long) R30,R32 
37BA  883236              cmp   REG_36,REG_32			; if ( REG_36 > REG_32 )  -- REG_32 = (long)REG_30/65536 (CS_TIME/2) 
37BD  D102                jnh   L37C1				;  GOTO 37C1
37BF  20B3                sjmp  L3874				; GOTO $3874
37C1  0134          L37C1 clr   REG_34				; REG_34 = 0
37C3  8CB834              divu  REG_34,REG_B8			; REG_34,REG_36 /= PIP_WIDTH   //  (long) (CS_TIME/2) / на момент начала RE  => REG_34 div REG_36 rem
37C6  D502                jnv   L37CA				; if ( ??? ) GOTO L37CA
37C8  20BA                sjmp  L3884				; GOTO 3884
37CA  A03430        L37CA ld    REG_30,REG_34			; REG_30 = REG_34
37CD  6C3C30              mulu  REG_30,REG_3C           	; REG_30 *=  Ton_PIP     => REG_30,REG_32 
37D0  483E3C30            sub   REG_30,REG_3C,REG_3E		; REG_30 = Ton_PIP - Ton_PIP_prev  - разность Ton_PIP - акселерация ?
37D4  DB02                jc    L37D8				; if ( < 0 ) GOTO L37D8	 -- замедление ??
37D6  0330                neg   REG_30				; REG_30 = -REG_30
37D8  4D9919E0      L37D8 mulu  REG_38,REG_E0,#$1999		; REG_38 = REG_E0 * $1999 ??? Что за странное значение в REG_E0 результат (long)
      38
37DD  A03A36              ld    REG_36,REG_3A			; REG_36 = REG_3A  (word) (REG_E0 * $1999) /65535
37E0  89410034            cmp   REG_34,#$0041			; if ( REG_34 > $0041 )
37E4  D36F                jnc   L3855				;  GOTO L3855
37E6  08013A              shr   REG_3A,#$01			; REG_3A /= 2    ; 
37E9  A1008038            ld    REG_38,#$8000			; REG_38 = $8000
37ED  683A38              sub   REG_38,REG_3A			; REG_38 -= REG_3A
37F0  DB02                jc    L37F4				; if ( < 0 )  GOTO L37F4
37F2  2090                sjmp  L3884				; GOTO L3884
37F4  6C3238        L37F4 mulu  REG_38,REG_32			; REG_38 *= REG_32 ????
37F7  0D0138              shll  REG_38,#$01			; REG_38 *= 2 
37FA  883A30              cmp   REG_30,REG_3A			; if (REG_38 REG_32)
37FD  D375                jnc   L3874				;  GOTO  L3874
37FF  080136              shr   REG_36,#$01			; REG_36 /= 2
3802  65008036            add   REG_36,#$8000			; REG_36 += $8000
3806  DB7C                jc    L3884				; if ( ??? ) GOTO L3884
3808  4C323638            mulu  REG_38,REG_36,REG_32		; (long)REG_38,REG_3A = REG_36 * REG_32
380C  0D0138              shll  REG_38,#$01			; (long)REG_38,REG_3A *= 2
380F  883A30              cmp   REG_30,REG_3A			; if ( REG_30 > REG_3A)
3812  D960                jh    L3874				;  GOTO L3874
3814  44B6B836      L3814 add   REG_36,REG_B8,REG_B6   		; REG_36 = REG_B8+REG_B6  RE_PIP_TIME+RE_PIP_TIME_prev - ??? если только RE_PIP не сбрасывает таймер в 0
3818  DD6A                jv    L3884				; if ( overflow ) GOTO L3884 типа переход через FFFF
381A  0134                clr   REG_34				; REG_34 = 0
381C  443E3C30            add   REG_30,REG_3C,REG_3E		; REG_30 = Ton_PIP+Ton_PIP_prev
3820  DD62                jv    L3884				; if ( overflow ) GOTO L3884 типа переход через FFFF
3822  0C0234              shrl  REG_34,#$02			; (long)REG_34,REG_36 /= 4  
3825  8C3034              divu  REG_34,REG_30			; REG_34 /= ( Ton_PIP+Ton_PIP_prev )
3828  DD5A                jv    L3884				; if ( overflow ) GOTO L3884 ????
382A  A0CE32              ld    REG_32,REG_CE			; REG_32 = REG_CE ???
382D  A1002036            ld    REG_36,#$2000			; REG_36 = #$2000
3831  EF2FFB              lcall SDFilter
3834  A03ECE              ld    REG_CE,REG_3E			; REG_CE = REG_3E		//	Для SPOUT время ? градусы ? опрежения 
3837  893373CE            cmp   REG_CE,#$7333			; if ( REG_CE > #$7333)
383B  DB04                jc    L3841				;  GOTO L3841
383D  A13373CE            ld    REG_CE,#$7333			; REG_CE = $7333 -- ограничили снизу , что ???
3841  89CC8CCE      L3841 cmp   REG_CE,#$8CCC			; if ( REG_CE < #$8CCC)
3845  D104                jnh   L384B				;  GOTO L384B
3847  A1CC8CCE            ld    REG_CE,#$8CCC			; REG_CE = $8CCC -- ограничили сверху, что ???
384B  694701E0      L384B sub   REG_E0,#$0147			; REG_E0 -= $0147
384F  D602                jge   L3853				; if  ( > 0) goto L3853
3851  01E0                clr   REG_E0				; REG_E0 = 0
3853  202F          L3853 sjmp  L3884				; GOTO L3884
3855  A03034        L3855 ld    REG_34,REG_30			; REG_34 = REG_30
3858  080136              shr   REG_36,#$01			; REG_36 /= 2
385B  65008036            add   REG_36,#$8000			; REG_36 += $8000 
385F  DD23                jv    L3884				; if (overvlow) goto
3861  A03638              ld    REG_38,REG_36
3864  4D41003C            mulu  REG_30,REG_3C,#$0041   		; REG_30 = REG_3C * $0041
      30
3869  6C3238              mulu  REG_38,REG_32			; REG_38 *= REG_32
386C  0D0138              shll  REG_38,#$01			; REG_38 *= 2
386F  883A34              cmp   REG_34,REG_3A			; if ( REG_34 REG_3A )
3872  D1A0                jnh   L3814				;  GOTO
3874  65CC0CE0      L3874 add   REG_E0,#$0CCC			; REG_E0 += $0CCC
3878  DD06                jv    L3880				; if ( Overflow ) GOTO L3880
387A  890080E0            cmp   REG_E0,#$8000			; if ( REG_E0 < $8000)
387E  D304                jnc   L3884				;  GOTO L3884
3880  A10080E0      L3880 ld    REG_E0,#$8000			; REG_E0 = $8000
3884  E736F2        L3884 ljmp  L2ABD				; END TASK
                    ;************************************************************
                    ;* Task 18
                    ;* Расчёт ISC_VAL
                    ;*  REG_EC  - ISC_PW - Ширина импульса ISC
                    ;*  REG_70  - RPMx4	- Частота вращения коленвала об/мин
                    ;* bREG_72  - ECT
                    ;* bREG_73  - ACT
                    ;* 
                    ;* REG_EE   - RPMx4 - фильтрованное 
                    ;* REG_FA   -
                    ;* REG_F8   -
                    ;* REG_56.4 - ?? 
                    ;* REG_1A.7 - ?? 1 - Not Runing ?? 0 - runing
                    ;* REG_1A.6 - ?? 
                    ;* REG_B8   - ??
                    ;* REG_AC.0 
                    ;* 
                    ;* 
                    ;* 
                    ;* 
                    ;************************************************************
3887  9120B3              orb   REG_B3,#$20			; REG_B1.5 = 1
388A  3A5605              jbs   REG_56,BIT_02,L3892		; if ( REG_56.2 ) GOTO L3892
388D  A00038              ld    REG_38,REG_0			; REG_38 = REG_0
3890  222D                sjmp  L3ABF				; GOTO End_Task_18
3892  A0EE32        L3892 ld    REG_32,REG_EE			; REG_32 = REG_EE
3895  A07034              ld    REG_34,REG_70			; REG_34 = RPMx4
3898  A3013C24            ld    REG_36,$243C[Zero]		; REG_36 = $FFFF
      36
389D  EFC3FA              lcall SDFilter			;
38A0  A03EEE              ld    REG_EE,REG_3E			; REG_EE = REG_3E 		// новое значение
38A3  9B01A424            cmpb  REG_72,$24A4[Zero]		; if  ( bECT_VAL <= 55 )	// ECT_VAL
      72
38A8  DA0F                jle   L38B9				; GOTO L38B9			// Температура двигателя < 55С
38AA  A1942A32            ld    REG_32,#$2A94			; REG_32 = $2A94	
38AE  B07334              ldb   REG_34,REG_73			; bREG_34 = ACT_VAL
38B1  EF6DFA              lcall SBLookup
38B4  AC382A              ldbze REG_2A,REG_38			; REG_2A = SBLookup ( ACT_VAL,$2A94) 
38B7  2004                sjmp  L38BD
38B9  A140002A      L38B9 ld    REG_2A,#$0040			; REG_2A = #$0040
38BD  0138          L38BD clr   REG_38				; REG_38 = 0
38BF  B3014024            ldb   REG_30,$2440[Zero]		; bREG_30 = 0
      30
38C4  990130              cmpb  REG_30,#$01			; if ( REG_30 != $01)				// Всегда
38C7  D707                jne   L38D0				;  GOTO L38D0
38C9  B3014124            ldb   REG_39,$2441[Zero]		; REG_39 = $40					// 64
      39
38CE  21EF                sjmp  L3ABF				; GOTO L3ABF
38D0  01B6          L38D0 clr   REG_B6				; REG_B6 = 0
38D2  34560F              jbc   REG_56,BIT_04,L38E4		; if ( !REG_56.4 ) GOTO L38E4
38D5  AF019E24            ldbze REG_32,$249E[Zero]		; REG_32 = $20
      32
38DA  67015E24            add   REG_32,$245E[Zero]		; REG_32 += $0020
      32
38DF  8832FE              cmp   REG_FE,REG_32			; if ( REG_FE < REG_32 )
38E2  D105                jnh   L38E9				;  GOTO L38E9
38E4  990230        L38E4 cmpb  REG_30,#$02			; if ( bREG_30 != $02 )				// Всегда  REG_30 = 0
38E7  D707                jne   L38F0				; GOTO L38F0
38E9  3AFE04        L38E9 jbs   REG_FE,BIT_02,L38F0		;  if ( REG_FE.2 ) GOTO L38F0
38EC  A12003B6            ld    REG_B6,#$0320			; REG_B6 = $0320
38F0  A0FA3E        L38F0 ld    REG_3E,REG_FA			; REG_3E = REG_FA
38F3  A0F83C              ld    REG_3C,REG_F8			; REG_3C = REG_F8
38F6  A1C82932            ld    REG_32,#$29C8			; REG_32 = $29C8
38FA  BC7234              ldbse REG_34,REG_72			; REG_34 = (sword)ECT_VAL
38FD  EFDCF9              lcall SWLookup			; REG_38 = SWLookup (ECT_VAL,$29C8)		// ECT фиксирован -9 ... 68 С выход линеен 
3900  6C2A38              mulu  REG_38,REG_2A			; REG_38 *= REG_2A => (dword)REG_38,REG_39	// REG_2A = $040 для ECT < 55 или табличное значение от ACT
3903  0C0638              shrl  REG_38,#$06			; (dword)REG_38 /= 64
3906  8900003A            cmp   REG_3A,#$0000			; if ( REG_3A = 0 )
390A  DF04                je    L3910				;  GOTO L3910
390C  A1FFFF38            ld    REG_38,#$FFFF			; REG_38 = $FFFF
3910  A038B8        L3910 ld    REG_B8,REG_38			; REG_B8 = REG_38				// сохранили значение 
3913  371A0A              jbc   REG_1A,BIT_07,L3920		; if ( !REG_1A.7 ) GOTO L3920			// Если REG_1A.7 == 1 - значение ISC_PW от ECT
3916  B3013F24            ldb   REG_39,$243F[Zero]		; bREG_39 = $80 				// bREG_39 = $80 ?? REG_38 временная переменная
      39
391B  71FEAC              andb  REG_AC,#$FE			; REG_AC.0 = 0
391E  219F                sjmp  L3ABF				; GOTO L3ABF
3920  361A0A        L3920 jbc   REG_1A,BIT_06,L392D		; if ( !REG_1A.6 ) GOTO L392D			// 
3923  B3013E24            ldb   REG_39,$243E[Zero]		; bREG_39 = 4D					// 
      39
3928  71FEAC              andb  REG_AC,#$FE			; REG_AC.0 = 0					// 
392B  2192                sjmp  L3ABF				; GOTO L3ABF
392D  307744        L392D jbc   REG_77,BIT_00,L3974		; if ( !REG_77.0 ) GOTO L3974
3930  38AC0C        L3930 jbs   REG_AC,BIT_00,L393F		; if (  REG_AC.0 ) GOTO L393F
3933  301B02              jbc   REG_1B,BIT_00,L3938		; if ( !REG_1B.0 ) L3938
3936  20AE                sjmp  L39E6				; GOTO L39E6
3938  014E          L3938 clr   REG_4E				; REG_4E = 0
393A  91011B              orb   REG_1B,#$01			; REG_1B.0 = 1
393D  20A7                sjmp  L39E6				; GOTO L39E6
393F  014E          L393F clr   REG_4E				; REG_4E = 0
3941  A1142A32            ld    REG_32,#$2A14			;
3945  A0EE34              ld    REG_34,REG_EE			;
3948  EF8EF9              lcall UWLookup			; 
394B  A03830              ld    REG_30,REG_38			; REG_30 = UWLookup( RPMx4_FLT ,$2A14)		// 1100 - 3000
394E  A12C2A32            ld    REG_32,#$2A2C
3952  BC7234              ldbse REG_34,REG_72			; REG_34 = (word) ECT_VAL			// -9 .. 55
3955  EF84F9              lcall SWLookup			; REG_38 = SWLookup( (word) ECT_VAL, $2A2C )
3958  643830              add   REG_30,REG_38			; REG_30 +=  REG_38
395B  DB0C                jc    L3969				; if ( < 0 )  GOTO L3969
395D  6C2A30              mulu  REG_30,REG_2A			; (dword) REG_30,REG_32 = REG_30 * REG_2A
3960  0C0630              shrl  REG_30,#$06			; (dword) REG_30,REG_32 /= 64
3963  89000032            cmp   REG_32,#$0000			; if ( REG_32 == 0 )
3967  DF04                je    L396D				; GOTO L396D
3969  A1FFFF30      L3969 ld    REG_30,#$FFFF			; REG_30 = $FFFF
396D  A0303E        L396D ld    REG_3E,REG_30			; REG_3E = REG_30
3970  013C                clr   REG_3C				; REG_3C = 0
3972  20FF                sjmp  L3A73				; GOTO L3A73
3974  311505        L3974 jbc   REG_15,BIT_01,L397C		; if ( REG_15.1 ) GOTO L397C
3977  A0B83E              ld    REG_3E,REG_B8			; REG_3E = REG_B8
397A  20F7                sjmp  L3A73				; GOTO L3A73
397C  99FFA9        L397C cmpb  REG_A9,#$FF			; if ( REG_A9 == FF)
397F  DF07                je    L3988				; GOTO L3988
3981  9101AC              orb   REG_AC,#$01			; REG_AC.0 = 1
3984  014E                clr   REG_4E				; REG_4E = 0
3986  20EB                sjmp  L3A73				; GOTO L3A73
3988  A14C2932      L3988 ld    REG_32,#$294C			; 
398C  BC7234              ldbse REG_34,REG_72			; REG_34 = (word)ECT_VAL
398F  EF4AF9              lcall SWLookup			; SWLookup((word)ECT_VAL,$294C )
3992  6438B6              add   REG_B6,REG_38			; REG_B6 += REG_38
3995  33AC11              jbc   REG_AC,BIT_03,L39A9		; if ( !REG_AC.3 ) GOTO L39A9
3998  3EAC05              jbs   REG_AC,BIT_06,L39A0		; if (  REG_AC.6 ) GOTO L39A0	
399B  015E                clr   REG_5E				; REG_5E = 0
399D  9140AC              orb   REG_AC,#$40			; REG_AC.6 = 1
39A0  8B015C24      L39A0 cmp   REG_5E,$245C[Zero]		; if ( REG_5E  > 05DC)
      5E
39A5  D316                jnc   L39BD				;  GOTO L39BD
39A7  200F                sjmp  L39B8				; GOTO L39B8
39A9  36AC05        L39A9 jbc   REG_AC,BIT_06,L39B1		; if ( !REG_AC.6 ) GOTO L39B1
39AC  015E                clr   REG_5E				; REG_5E = 0
39AE  71BFAC              andb  REG_AC,#$BF			; REG_AC.6 = 0
39B1  8B015A24      L39B1 cmp   REG_5E,$245A[Zero]		; if (REG_5E > $01F4)
      5E
39B6  D905                jh    L39BD				; GOTO L39BD
39B8  6B015224      L39B8 sub   REG_B6,$2452[Zero]		; REG_B6 -= $0190
      B6
39BD  35AC0B        L39BD jbc   REG_AC,BIT_05,L39CB		; if ( !REG_AC.5) GOTO L39CB
39C0  3BAC04              jbs   REG_AC,BIT_03,L39C7		; if ( !REG_AC.3) GOTO L39C7
39C3  656400B6            add   REG_B6,#$0064			; REG_B6 += $64
39C7  65C800B6      L39C7 add   REG_B6,#$00C8			; REG_B6 += $C8
39CB  A0B6F4        L39CB ld    REG_F4,REG_B6			; REG_F4 = REG_B6
39CE  4701AE24            add   REG_38,REG_F4,$24AE[Zero]	; REG_38 = REG_F4 + $04B0
      F438
39D4  34AC05              jbc   REG_AC,BIT_04,L39DC		; if ( !REG_AC.4 ) GOTO L39DC
39D7  6701AA24            add   REG_38,$24AA[Zero]		; REG_38 += 03E8		// += 1000 ( 250 x 4 )
      38
39DC  883870        L39DC cmp   REG_70,REG_38			; if ( REG_70 < REG_38 )
39DF  D305                jnc   L39E6				;  GOTO L39E6
39E1  9101AC              orb   REG_AC,#$01			; REG_AC.1 = 1 
39E4  274A                sjmp  L3930				; GOTO L3930
39E6  8B015E24      L39E6 cmp   REG_FE,$245E[Zero]		; if ( REG_FE 0020)
      FE
39EB  DB05                jc    L39F2				; GOTO L39F2
39ED  A0B83E              ld    REG_3E,REG_B8			; REG_3E = REG_B8
39F0  2081                sjmp  L3A73				; GOTO L3A73
39F2  71DFB3        L39F2 andb  REG_B3,#$DF			; REG_B3.5 = 0
39F5  71FEAC              andb  REG_AC,#$FE			; REG_AC.1 = 0
39F8  A3014224            ld    REG_34,$2442[Zero]		; REG_34  = $00C0
      34
39FD  887834              cmp   REG_34,REG_78			; if ( REG_34 < REG_78)
3A00  D102                jnh   L3A04				; GOTO L3A04
3A02  20BE                sjmp  L3AC2				; GOTO L3AC2
3A04  0178          L3A04 clr   REG_78				; REG_78 = 0
3A06  48F4EE34            sub   REG_34,REG_EE,REG_F4		; REG_34 = REG_EE - REG_F4
3A0A  A034DC              ld    REG_DC,REG_34			; REG_DC = REG_34
3A0D  8B014C24            cmp   REG_4E,$244C[Zero]		; if ( REG_4E > 07D0)
      4E
3A12  D905                jh    L3A19				; GOTO L3A19
3A14  A0B83E              ld    REG_3E,REG_B8			; REG_3E= REG_B8
3A17  205A                sjmp  L3A73				; GOTO L3A73
3A19  8B01C224      L3A19 cmp   REG_4E,$24C2[Zero]		; if ( REG_4E < 2710)
      4E
3A1E  D303                jnc   L3A23				; GOTO L3A23
3A20  71FE1B              andb  REG_1B,#$FE			; REG_1B.1 = 0
3A23  A1602932      L3A23 ld    REG_32,#$2960			;
3A27  EFB2F8              lcall SWLookup			; REG_38 = SWLookup( REG_34,$2960)
3A2A  A038DE              ld    REG_DE,REG_38			; REG_DE = REG_38
3A2D  BC7234              ldbse REG_34,REG_72			; REG_34 = (word)ECT_VAL
3A30  A1882932            ld    REG_32,#$2988			; 
3A34  EFA5F8              lcall SWLookup			; REG_38 = SWLookup( (word)ECT_VAL,#$2988)
3A37  A038F6              ld    REG_F6,REG_38			; REG_F6 = REG_38
3A3A  34AC08              jbc   REG_AC,BIT_04,L3A45		; if ( !REG_AC.4 ) GOTO L3A45
3A3D  6F01AC24            mulu  REG_38,$24AC[Zero]		; (dword) REG_38,REG_3A = REG_38 * FF13
      38
3A42  0C0438              shrl  REG_38,#$04			; (dword) REG_38,REG_3A *= 16
3A45  A0DE32        L3A45 ld    REG_32,REG_DE			; REG_32  = REG_DE
3A48  3F3317              jbs   REG_33,BIT_07,L3A62		; if ( REG_33.7 ) GOTO L3A62
3A4B  6C3238              mulu  REG_38,REG_32			; (dword) REG_38,REG_3A = REG_38 * REG_32
3A4E  64383C              add   REG_3C,REG_38			; REG_3C += REG_38
3A51  A43A3E              addc  REG_3E,REG_3A			; REG_3E += REG_3A 
3A54  8900803E            cmp   REG_3E,#$8000			; if ( REG_3E < $8000)
3A58  D319                jnc   L3A73				; GOTO L3A73
3A5A  A100803E            ld    REG_3E,#$8000			; REG_3E = $8000
3A5E  013C                clr   REG_3C				; REG_3C = 0
3A60  2011                sjmp  L3A73				; GOTO L3A73
3A62  0332          L3A62 neg   REG_32				; REG_32 = - REG_32
3A64  6C3238              mulu  REG_38,REG_32			; (dword)REG_38,REG_3A = REG_38 * REG_32
3A67  68383C              sub   REG_3C,REG_38			; REG_3C -= REG_38
3A6A  A83A3E              subc  REG_3E,REG_3A			; REG_3E -= REG_3A
3A6D  DB04                jc    L3A73				; if ( < 0 ) GOTO L3A73
3A6F  013C                clr   REG_3C				; REG_3C = 0
3A71  013E                clr   REG_3E				; REG_3E = 0
3A73  A02A38        L3A73 ld    REG_38,REG_2A			; REG_38 = REG_2A
3A76  6F016024            mulu  REG_38,$2460[Zero]		; (dword)REG_38,REG_3A *= $28F6
      38
3A7B  0C0638              shrl  REG_38,#$06			; (dword)REG_38,REG_3A /= 64
3A7E  8900003A            cmp   REG_3A,#$0000			; if ( REG_3A = $0000)
3A82  DF04                je    L3A88				; GOTO L3A88
3A84  A1FFFF38            ld    REG_38,#$FFFF			; REG_38 = $FFFF
3A88  88383E        L3A88 cmp   REG_3E,REG_38			; if ( REG_3E > REG_38)
3A8B  D903                jh    L3A90				; GOTO L3A90
3A8D  A0383E              ld    REG_3E,REG_38			; REG_3E = REG_38
3A90  A03EFA        L3A90 ld    REG_FA,REG_3E			; REG_FA = REG_3E
3A93  A03CF8              ld    REG_F8,REG_3C			; REG_F8 = REG_3C
3A96  A03E34              ld    REG_34,REG_3E			; REG_34 = REG_3E
3A99  34AC1C              jbc   REG_AC,BIT_04,L3AB8		; if ( !REG_AC.4 ) GOTO L3AB8
3A9C  A02A38              ld    REG_38,REG_2A			; REG_38 = REG_2A
3A9F  6F016224            mulu  REG_38,$2462[Zero]		; (dword)REG_38,REG_3A = REG_38*$0666
      38
3AA4  0C0638              shrl  REG_38,#$06			; (dword)REG_38,REG_3A /=64
3AA7  8900003A            cmp   REG_3A,#$0000			; if ( REG_3A == $0000)
3AAB  DF06                je    L3AB3				; GOTO L3AB3
3AAD  A1FFFF34      L3AAD ld    REG_34,#$FFFF			; REG_34 = $FFFF
3AB1  2005                sjmp  L3AB8				; GOTO L3AB8
3AB3  643834        L3AB3 add   REG_34,REG_38			; REG_33 += REG_38
3AB6  DBF5                jc    L3AAD				; if ( < 0) GOTO L3AAD
3AB8  A1A02932      L3AB8 ld    REG_32,#$29A0			; 
3ABC  EF1AF8              lcall UWLookup
3ABF  A038EC        L3ABF ld    REG_EC,REG_38			; ISC_VAL  = UWLookup ( REG_34,$29A0)
3AC2  E7F8EF        L3AC2 ljmp  L2ABD				; END TASK
                    ;************************************************************
                    ;* Task 13
                    ;************************************************************
3AC5  38770A              jbs   REG_77,BIT_00,L3AD2		; if ( REG_77.0 ) GOTO  L3AD2
3AC8  9800FC              cmpb  REG_FC,Zero			; if ( REG_FC <> 0 )
3ACB  D705                jne   L3AD2				;  GOTO L3AD2
3ACD  880070              cmp   REG_70,Zero			; if ( REG_70 <> 0 )
3AD0  D705                jne   L3AD7				;  GOTO L3AD7
3AD2  71DF56        L3AD2 andb  REG_56,#$DF			; REG_56.5 = 0
3AD5  2065                sjmp  L3B3C				; GOTO L3B3C
3AD7  A3005A34      L3AD7 ld    REG_34,$5A[Zero]		; REG_34  = [REG_5A]
3ADB  67013801            add   REG_34,$0138[Zero]		; REG_34 += [$0138]
      34
3AE0  A3013A01            ld    REG_36,$013A[Zero]		; REG_36  = [$013A]
      36
3AE5  A40036              addc  REG_36,Zero			; REG_36 +=0 ,с переносом
3AE8  A03438              ld    REG_38,REG_34			; REG_38 = REG_34
3AEB  A0363A              ld    REG_3A,REG_36			; REG_3A = REG_36
3AEE  0C0338              shrl  REG_38,#$03			; (long) R38,R39 / 8 
3AF1  8B01A824            cmp   REG_38,$24A8[Zero]		; if ( REG_38 < $6590)
      38
3AF6  D33A                jnc   L3B32				; goto L3B32
3AF8  A3013401            ld    REG_30,$0134[Zero]		; REG_30 = [$0134]
      30
3AFD  A3013601            ld    REG_32,$0136[Zero]		; REG_32 = [$0136]
      32
3B02  8F01A624            divu  REG_30,$24A6[Zero]		; (long) R30,R32 /$0258 => REG_30 div REG_32 rem
3B06  30C301              jbc   REG_C3,BIT_00,L3B0A		; if ( !REG_C3.1 ) GOTO L3B0A
3B09  340132              jbc   REG_01,BIT_04,L3B3E		; if ( !REG_01.4 ) GOTO L3B3E
3B0C  C3013601            st    Zero,$0136[Zero]		; [$0136] = 0
      00
3B11  8C3034              divu  REG_34,REG_30			; (long)REG_34,REG_36/ REG_30 => REG_34 div REG_36 rem
3B14  A034A0              ld    REG_A0,REG_34			; REG_A0 = REG_34
3B17  896901A0            cmp   REG_A0,#$0169			; if ( REG_A0 > $0169)
3B1B  DB04                jc    L3B21				; GOTO L3B21
3B1D  A16901A0            ld    REG_A0,#$0169			; REG_A0 = $0169
3B21  89FF7FA0      L3B21 cmp   REG_A0,#$7FFF			; if ( REG_A0 < $7FFF)
3B25  D104                jnh   L3B2B				; GOTO L3B2B
3B27  A1FF7FA0            ld    REG_A0,#$7FFF			; REG_A0 = $7FFF
3B2B  0134          L3B2B clr   REG_34				; REG_34 = 0
3B2D  0136                clr   REG_36				; REG_36 = 0
3B2F  912056              orb   REG_56,#$20			; REG52.5 = 1
3B32  C3013801      L3B32 st    REG_34,$0138[Zero]		; [$0138] = REG_34
      34
3B37  C3013A01            st    REG_36,$013A[Zero]		; [$013A] = REG_36
      36
3B3C  E77EEF        L3B3C ljmp  L2ABD				; End TASK
                    ;************************************************************
                    ;* Task 19
                    ;************************************************************
3B3F  2893                scall L3BD4				
3B41  9902C2              cmpb  REG_C2,#$02			; if ( bREG_C2 <= 02 )
3B44  D130                jnh   L3B76				;  GOTO L3B76
3B46  9900FC              cmpb  REG_FC,#$00			; if ( bREG_FC != 0)
3B49  D702                jne   L3B4D				;  GOTO L3B4D
3B4B  11FD                clrb  REG_FD				; REG_FD = 0
3B4D  3A560E        L3B4D jbs   REG_56,BIT_02,L3B5E		; if (  REG_56.2 ) GOTO L3B5E
3B50  345618              jbc   REG_56,BIT_04,L3B6B		; if ( !REG_56.4 ) GOTO L3B6B
3B53  3AFC26              jbs   REG_FC,BIT_02,L3B7C		; if (  REG_FC.2 ) GOTO L3B7C
3B56  3BFC10              jbs   REG_FC,BIT_03,L3B69		; if (  REG_FC.3 ) GOTO L3B69
3B59  B104FC              ldb   REG_FC,#$04			; bREF_FC = $04
3B5C  201E                sjmp  L3B7C				; GOTO L3B7C
3B5E  345615        L3B5E jbc   REG_56,BIT_04,L3B76		; if ( !REG_56.4 ) GOTO L3B76
3B61  3BFC05              jbs   REG_FC,BIT_03,L3B69		; if (  REG_FC.3 ) GOTO L3B69
3B64  B108FC              ldb   REG_FC,#$08			; bREF_FC = $08
3B67  11FD                clrb  REG_FD				; bREF_FD = 0
3B69  2148          L3B69 sjmp  L3CB3				; GOTO L3CB3
3B6B  39FC43        L3B6B jbs   REG_FC,BIT_01,L3BB1		; if (  REG_FC.3 ) GOTO L3BB1
3B6E  B102FC              ldb   REG_FC,#$02			; bREF_FC = $02
3B71  71F756              andb  REG_56,#$F7			; REG_56.3 = 0 
3B74  203B                sjmp  L3BB1				; GOTO L3BB1
3B76  11FC          L3B76 clrb  REG_FC				; REG_FC = 0
3B78  11FD                clrb  REG_FD				; REG_FD = 0
3B7A  21C5                sjmp  L3D41				; GOTO L3D41
3B7C  9908F2        L3B7C cmpb  REG_F2,#$08			; if ( REG_F2 < 08)
3B7F  DE03                jlt   L3B84				; GOTO L3B84
3B81  71F756              andb  REG_56,#$F7			; REG_56.3 = 0 
3B84  71FDAC        L3B84 andb  REG_AC,#$FD			; REG_AC.1 = 0
3B87  89003298            cmp   REG_98,#$3200			; if (REG_98 ?? $3200 )
3B8B  D303                jnc   L3B90				; GOTO L3B90
3B8D  9102AC              orb   REG_AC,#$02			; REG_AC.1 = 1
3B90  513AAC43      L3B90 andb  REG_43,REG_AC,#$3A		; REG_43 = REG_AC & $3A
3B94  37A905              jbc   REG_A9,BIT_07,L3B9C		; if ( REG_A9.7 ) GOTO L3B9C
3B97  918043              orb   REG_43,#$80			; REG_43.7 =1 
3B9A  2006                sjmp  L3BA2				; GOTO L3BA2
3B9C  30A903        L3B9C jbc   REG_A9,BIT_00,L3BA2		; if ( !REG_A9.0 ) GOTO L3BA2
3B9F  914043              orb   REG_43,#$40			; REG_43.6 = 1
3BA2  9843F3        L3BA2 cmpb  REG_F3,REG_43			; if ( REG_F3 == REG_43 )
3BA5  DF05                je    L3BAC				; GOTO L3BAC
3BA7  910856              orb   REG_56,#$08			; REG_58.3 = 1
3BAA  11F2                clrb  REG_F2				; REG_F2 = 0
3BAC  B043F3        L3BAC ldb   REG_F3,REG_43			; REG_F3 = REG_43
3BAF  2190                sjmp  L3D41				; GOTO L3D41
3BB1  ACFD30        L3BB1 ldbze REG_30,REG_FD			; REG_30 = (word)REG_FD
3BB4  B331CF3B            ldb   REG_32,$3BCF[REG_30]		; REG_32 = [$3BCF+REG_30]
      32
3BB9  98A932              cmpb  REG_32,REG_A9			; if ( REG_32 != REG_A9)
3BBC  D70F                jne   L3BCD				; GOTO L3BCD
3BBE  17FD                incb  REG_FD				; bREG_FD ++
3BC0  9904FD              cmpb  REG_FD,#$04			; if ( REG_FD $04)
3BC3  DA08                jle   L3BCD				; GOTO L3BCD
3BC5  980014              cmpb  REG_14,Zero			; if (REG_14 <> REG_0 )
3BC8  D703                jne   L3BCD				; GOTO L3BCD
3BCA  910856              orb   REG_56,#$08			; REG_56.3 = 1
3BCD  2172          L3BCD sjmp  L3D41				; goto L3D41
// TBL 
3BCF  FF                  nop		
3BD0  0001                skip  REG_01
3BD2  00FF                skip  REG_FF
;
3BD4  B10142        L3BD4 ldb   REG_42,#$01			; REG_42 = 01
3BD7  A1010038            ld    REG_38,#$0001			; REG_38 = 0001
3BDB  AC423A        L3BDB ldbze REG_3A,REG_42			; REG_3A = (word) REG_42
3BDE  09013A              shl   REG_3A,#$01			; REG_3A * = 2;
3BE1  B01537              ldb   REG_37,REG_15			; REG_37 = REG_15
3BE4  083836              shr   REG_36,REG_38			; REG_36 /= REG_38
3BE7  A33B8C00            ld    REG_30,$008C[REG_3A]		; REG_30 = [REG_3A+$008C]
      30
3BEC  CB3BF03B            push  $3BF0[REG_3A]			; SP [] = $3BF0 + [REG_3A]
3BF0  F0                  ret
//
3BF1  FF                  nop
3BF2  10                  byte  $10     ;**** Invalid Op Code ****
3BF3  3C203C              jbs   REG_20,BIT_04,L3C32
3BF6  303CA9              jbc   REG_3C,BIT_00,L3BA2
3BF9  3CA93C              jbs   REG_A9,BIT_04,L3C38
3BFC  003C                skip  REG_3C
3BFE  403C8B01            and   REG_01,REG_8B,REG_3C
3C02  862430              xor   REG_30,[REG_24]
3C05  D973                jh    L3C7A
3C07  8B018824            cmp   REG_30,$2488[Zero]
      30
3C0C  D36C                jnc   L3C7A
3C0E  2041                sjmp  L3C51
3C10  8B017A24            cmp   REG_30,$247A[Zero]
      30
3C15  D963                jh    L3C7A
3C17  8B017C24            cmp   REG_30,$247C[Zero]
      30
3C1C  D35C                jnc   L3C7A
3C1E  2031                sjmp  L3C51
3C20  8B017E24            cmp   REG_30,$247E[Zero]
      30
3C25  D953                jh    L3C7A
3C27  8B018024            cmp   REG_30,$2480[Zero]
      30
3C2C  D34C                jnc   L3C7A
3C2E  2021                sjmp  L3C51
3C30  8B018224            cmp   REG_30,$2482[Zero]
      30
3C35  D943                jh    L3C7A
3C37  8B018424            cmp   REG_30,$2484[Zero]
      30
3C3C  D33C                jnc   L3C7A
3C3E  2011                sjmp  L3C51
3C40  A0A430              ld    REG_30,REG_A4
3C43  8B017224            cmp   REG_30,$2472[Zero]
      30
3C48  D930                jh    L3C7A
3C4A  8B017424            cmp   REG_30,$2474[Zero]
      30
3C4F  D329                jnc   L3C7A
3C51  39FC0D        L3C51 jbs   REG_FC,BIT_01,L3C61
3C54  3AFC0A              jbs   REG_FC,BIT_02,L3C61
3C57  383709              jbs   REG_37,BIT_00,L3C63
3C5A  11B8                clrb  REG_B8
3C5C  C739E400            stb   REG_B8,$00E4[REG_38]
      B8
3C61  2044          L3C61 sjmp  L3CA7
3C63  B339E400      L3C63 ldb   REG_32,$00E4[REG_38]
      32
3C68  9B017824            cmpb  REG_32,$2478[Zero]
      32
3C6D  D338                jnc   L3CA7
3C6F  71FE37              andb  REG_37,#$FE
3C72  093836              shl   REG_36,REG_38
3C75  B03715              ldb   REG_15,REG_37
3C78  202D                sjmp  L3CA7
3C7A  39FC1B        L3C7A jbs   REG_FC,BIT_01,L3C98
3C7D  3AFC18              jbs   REG_FC,BIT_02,L3C98
3C80  303709              jbc   REG_37,BIT_00,L3C8C
3C83  11B8                clrb  REG_B8
3C85  C739E400            stb   REG_B8,$00E4[REG_38]
      B8
3C8A  201B                sjmp  L3CA7
3C8C  B339E400      L3C8C ldb   REG_32,$00E4[REG_38]
      32
3C91  9B017924            cmpb  REG_32,$2479[Zero]
      32
3C96  D30F                jnc   L3CA7
3C98  910137        L3C98 orb   REG_37,#$01
3C9B  093836              shl   REG_36,REG_38
3C9E  B03715              ldb   REG_15,REG_37
3CA1  903714              orb   REG_14,REG_37
3CA4  71DF14              andb  REG_14,#$DF
3CA7  0738          L3CA7 inc   REG_38
3CA9  1742                incb  REG_42
3CAB  990742              cmpb  REG_42,#$07
3CAE  D902                jh    L3CB2
3CB0  2729                sjmp  L3BDB
3CB2  F0            L3CB2 ret
3CB3  9900FD        L3CB3 cmpb  REG_FD,#$00
3CB6  D710                jne   L3CC8
3CB8  3D560B              jbs   REG_56,BIT_05,L3CC6
3CBB  34B208              jbc   REG_B2,BIT_04,L3CC6
3CBE  910856              orb   REG_56,#$08
3CC1  11F2                clrb  REG_F2
3CC3  B1FFFD              ldb   REG_FD,#$FF
3CC6  2079          L3CC6 sjmp  L3D41
3CC8  99FFFD        L3CC8 cmpb  REG_FD,#$FF
3CCB  D70F                jne   L3CDC
3CCD  9928F2              cmpb  REG_F2,#$28
3CD0  DE6F                jlt   L3D41
3CD2  71F756              andb  REG_56,#$F7
3CD5  11F2                clrb  REG_F2
3CD7  B101FD              ldb   REG_FD,#$01
3CDA  2065                sjmp  L3D41
3CDC  B0F231        L3CDC ldb   REG_31,REG_F2
3CDF  080430              shr   REG_30,#$04
3CE2  3F3005              jbs   REG_30,BIT_07,L3CEA
3CE5  71F756              andb  REG_56,#$F7
3CE8  2057                sjmp  L3D41
3CEA  991031        L3CEA cmpb  REG_31,#$10
3CED  DE0F                jlt   L3CFE
3CEF  11F2          L3CEF clrb  REG_F2
3CF1  980014              cmpb  REG_14,Zero
3CF4  D704                jne   L3CFA
3CF6  11FD                clrb  REG_FD
3CF8  2047                sjmp  L3D41
3CFA  17FD          L3CFA incb  REG_FD
3CFC  2043                sjmp  L3D41
3CFE  980014        L3CFE cmpb  REG_14,Zero
3D01  D707                jne   L3D0A
3D03  A301443D            ld    REG_34,$3D44[Zero]
      34
3D08  201F                sjmp  L3D29
3D0A  B01432        L3D0A ldb   REG_32,REG_14
3D0D  18FD32              shrb  REG_32,REG_FD
3D10  38320B              jbs   REG_32,BIT_00,L3D1E
3D13  17FD                incb  REG_FD
3D15  9908FD              cmpb  REG_FD,#$08
3D18  DAF0                jle   L3D0A
3D1A  11FD                clrb  REG_FD
3D1C  2023                sjmp  L3D41
3D1E  ACFD38        L3D1E ldbze REG_38,REG_FD
3D21  090138              shl   REG_38,#$01
3D24  A339443D            ld    REG_34,$3D44[REG_38]
      34
3D29  0136          L3D29 clr   REG_36
3D2B  0D3134              shll  REG_34,REG_31
3D2E  3F3505              jbs   REG_35,BIT_07,L3D36
3D31  71F756              andb  REG_56,#$F7
3D34  2003                sjmp  L3D39
3D36  910856        L3D36 orb   REG_56,#$08
3D39  0C0334        L3D39 shrl  REG_34,#$03
3D3C  880034              cmp   REG_34,Zero
3D3F  DFAE                je    L3CEF
3D41  E779ED        L3D41 ljmp  L2ABD				; end task

3D44  0048                skip  REG_48
3D46  804F00              or    Zero,REG_4F
3D49  4E004F00            mulu  Zero,REG_4F,[Zero]
3D4D  4CC06700            mulu  Zero,REG_67,REG_C0
3D51  720073              andb  REG_73,[Zero]			
                    ;************************************************************
                    ;* Task 20
                    ;************************************************************
3D54  B3019024            ldb   REG_B8,$2490[Zero] 		; REG_B8 = 0       
      B8
3D59  9900B8              cmpb  REG_B8,#$00			; if ( REG_B8 != 0 )
3D5C  D705                jne   L3D63				;   GOTO L3D63  -- Никогда не происходит
3D5E  A00032              ld    REG_32,Zero			; REG_32 = 0
3D61  20AC                sjmp  L3E0F				; GOTO L3E0F
3D63  9901B8        L3D63 cmpb  REG_B8,#$01			; if ( REG_B8 <> 01)
3D66  D707                jne   L3D6F				; GOTO L3D6F
3D68  A3019224            ld    REG_32,$2492[Zero]		; REG_32 = $2492
      32
3D6D  20A0                sjmp  L3E0F				; GOTO L3E0F
3D6F  34562B        L3D6F jbc   REG_56,BIT_04,L3D9D		; if (!REG_56.4 ) GOTO L3D9D
3D72  AF019E24            ldbze REG_32,$249E[Zero]		; REG_32 = (word)[$249E]
      32
3D77  67015E24            add   REG_32,$245E[Zero]		; REG_32 += [$245E]
      32
3D7C  8832FE              cmp   REG_FE,REG_32			; if ( REG_FE < REG_32 )
3D7F  D11C                jnh   L3D9D				; GOTO L3D9D
3D81  AF019F24            ldbze REG_30,$249F[Zero]		; REG_30 = (word)[$249F]
      30
3D86  643032              add   REG_32,REG_30			; REG_32 += REG_30
3D89  8832FE              cmp   REG_FE,REG_32			;if ( REG_FE > REG_32 )
3D8C  D90F                jh    L3D9D				; GOTO L3D9D
3D8E  A3019824            ld    REG_32,$2498[Zero]		; REG_32 = [$2498]
      32
3D93  39FE79              jbs   REG_FE,BIT_01,L3E0F		; if ( REG_FE.1 ) GOTO L3E0F
3D96  A3019A24            ld    REG_32,$249A[Zero]		; REG_32 = [$249A]
      32
3D9B  2072                sjmp  L3E0F				; GOTO L3E0F
3D9D  9900A9        L3D9D cmpb  REG_A9,#$00			; if ( bREG_A9 == 0 )
3DA0  DF05                je    L3DA7				; GOTO L3DA7
3DA2  A00032              ld    REG_32,Zero			; REG_32 = REG_0 ??
3DA5  2068                sjmp  L3E0F				; GOTO L3E0F
3DA7  B07234        L3DA7 ldb   REG_34,REG_72			; REG_32 = ECT_VAL
3DAA  A1442A32            ld    REG_32,#$2A44			;
3DAE  EF70F5              lcall SBLookup			; 
3DB1  B038B6              ldb   REG_B6,REG_38			; REG_B6 = SBLookup (ECT_VAL, $2A44)
3DB4  B07334              ldb   REG_34,REG_73			; REG_34 = REG_73
3DB7  A14E2A32            ld    REG_32,#$2A4E			;
3DBB  EF63F5              lcall SBLookup			; 
3DBE  7C38B6              mulub REG_B6,REG_38			; REG_B6 * =  SBLookup(REG_73,#$2A4E )
3DC1  A07034              ld    REG_34,REG_70			; REG_34 = RPMx4
3DC4  A1582A32            ld    REG_32,#$2A58			; 
3DC8  EF0EF5              lcall UWLookup			;
3DCB  A038B8              ld    REG_B8,REG_38			; REG_B8 = UWLookup( RPMx4 , $2A58)
3DCE  A06434              ld    REG_34,REG_64			; REG_34 = REG_64
3DD1  A1802A32            ld    REG_32,#$2A80
3DD5  EF01F5              lcall UWLookup			; 
3DD8  A03832              ld    REG_32,REG_38			; REG_32 = UWLookup( REG_64, $2A80)
3DDB  A0B830              ld    REG_30,REG_B8			; REG_30 = REG_B8
3DDE  A1080034            ld    REG_34,#$0008			; REG_34 = $0008
3DE2  A10A2738            ld    REG_38,#$270A			; 
3DE6  EFABF4              lcall TBL_Lookup			; 
3DE9  113A                clrb  REG_3A				; REG_3A = (word)TBL_Lookup(REG_30,REG_32,8,$270A  )
3DEB  4C3AB630            mulu  REG_30,REG_B6,REG_3A		; (dword)REG_30,REG_32 = REG_B6 * REG_3A
3DEF  991033              cmpb  REG_33,#$10			; if ( REG_33 ?? $10 )
3DF2  DB0A                jc    L3DFE				; GOTO L3DFE
3DF4  0D0430              shll  REG_30,#$04			; (dword)REG_30,REG_32 /= 16
3DF7  8B019624            cmp   REG_32,$2496[Zero]		; if ( REG_32 < [$2496])
      32
3DFC  D106                jnh   L3E04				; GOTO L3E04
3DFE  A1FF7F32      L3DFE ld    REG_32,#$7FFF			; REG_32 = $FFFF
3E02  200B                sjmp  L3E0F				; GOTO L3E0F
3E04  8B019424      L3E04 cmp   REG_32,$2494[Zero]		; if ( REG_32 ?? [$2496])
      32
3E09  DB04                jc    L3E0F				;  GOTO L3E0F
3E0B  A1000032            ld    REG_32,#$0000			; REG_32 = 0
3E0F  C3012E01      L3E0F st    REG_32,$012E[Zero]		; [$012E] = REG_32
      32
3E14  E7A6EC              ljmp  L2ABD				; END Task
                    ;************************************************************
                    ;* TimerUpdate ()
                    ;************************************************************
3E17  371A04              jbc   REG_1A,BIT_07,L3E1E		; if ( !REG_1A.7 ) GOTO L3E1E
3E1A  1124                clrb  REG_24				; bREG_24 = 0
3E1C  01FE                clr   REG_FE				; REG_FE  = 0
3E1E  351B02        L3E1E jbc   REG_1B,BIT_05,L3E23		; if ( !REG_1B.5 ) GOTO L3E23
3E21  1151                clrb  REG_51				; bREG_51 = 0
3E23  EF2800        L3E23 lcall L3E4E
3E26  E794EC              ljmp  L2ABD				; END TASK

3E29  89                  byte  $89
3E2A  24                  byte  $24
3E2B  80                  byte  $80
3E2C  1A                  byte  $1A
3E2D  81                  byte  $81
3E2E  51                  byte  $51
3E2F  80                  byte  $80
3E30  1A                  byte  $1A
3E31  22                  byte  $22
3E32  C6                  byte  $C6
3E33  22                  byte  $22
3E34  78                  byte  $78
3E35  22                  byte  $22
3E36  5C                  byte  $5C
3E37  22                  byte  $22
3E38  4E                  byte  $4E
3E39  22                  byte  $22
3E3A  5E                  byte  $5E
3E3B  22                  byte  $22
3E3C  28                  byte  $28
3E3D  82                  byte  $82
3E3E  FE                  byte  $FE
3E3F  40                  byte  $40
3E40  F2                  byte  $F2
3E41  80                  byte  $80
3E42  C2                  byte  $C2
3E43  80                  byte  $80
3E44  E5                  byte  $E5
3E45  80                  byte  $80
3E46  E6                  byte  $E6
3E47  80                  byte  $80
3E48  E7                  byte  $E7
3E49  80                  byte  $80
3E4A  E8                  byte  $E8
3E4B  80                  byte  $80
3E4C  E9                  byte  $E9
3E4D  00                  byte  $00

3E4E  A1293E30      L3E4E ld    REG_30,#$3E29			; REG_30 = $3E29		// TBL Addr
3E52  A00636              ld    REG_36,IO_Timer			; REG_36 = IO_Timer
3E55  484A3638            sub   REG_38,REG_36,REG_4A		; REG_38 = REG_36 - REG_4A
3E59  013A                clr   REG_3A				; REG_3A = 0
3E5B  0D0838              shll  REG_38,#$08			; (dword)REG_38,REG_3A /= 256 
3E5E  8D55D038            divu  REG_38,#$D055			; (dword)REG_38,REG_3A /= $D055
3E62  89000038            cmp   REG_38,#$0000			; if (REG_38 <> 0)
3E66  D702                jne   L3E6A				; GOTO L3E6A
3E68  2083                sjmp  L3EED				; GOTO L3EED
3E6A  6580003A      L3E6A add   REG_3A,#$0080			; REG_3A += $0080
3E6E  08083A              shr   REG_3A,#$08			; REG_3A /= 256
3E71  483A364A            sub   REG_4A,REG_36,REG_3A		; REG_4A = REG_36 - REG_3A
3E75  B1203E              ldb   REG_3E,#$20			; bREG_3E =  $20
3E78  743823              addb  REG_23,REG_38			; bREG_23 += bREG_38
3E7B  597D233F            subb  REG_3F,REG_23,#$7D		; bREG_3F = REG_23 - $7D
3E7F  D30F                jnc   L3E90				; if ( < 0 ) GOTO L3E90
3E81  B03F23              ldb   REG_23,REG_3F			; REG_23 = REG_3F
3E84  91403E              orb   REG_3E,#$40			; REG_3E.6 = 1
3E87  E02506              djnz  REG_25,L3E90			; if ( REG_25-- > 0 ) GOTO L3E90
3E8A  91803E              orb   REG_3E,#$80			; REG_3E.7 = 1
3E8D  B10825              ldb   REG_25,#$08			; bREG_25 = $08
3E90  B2313C        L3E90 ldb   REG_3C,[REG_30]+		; REG_3C = [REG_30++]
3E93  99003C              cmpb  REG_3C,#$00			; if ( REG_3C == 0 )
3E96  DF55                je    L3EED				;  GOTO L3EED
3E98  AE3132              ldbze REG_32,[REG_30]+		; REG_32 = (word)[REG_30++]
3E9B  303C12              jbc   REG_3C,BIT_00,L3EB0		; if ( REG_3C.0 ) GOTO L3EB0
3E9E  B2313D              ldb   REG_3D,[REG_30]+		; bREG_3D = [REG_30++]
3EA1  AE3134              ldbze REG_34,[REG_30]+		; REG_34 = (word)[REG_30++]
3EA4  72343D              andb  REG_3D,[REG_34]			; REG_3D &= [REG_34]
3EA7  333C04              jbc   REG_3C,BIT_03,L3EAE		; if ( !REG_3C.3) GOTO L3EAE
3EAA  DF04                je    L3EB0				; if ( ?? ) L3EB0
3EAC  27E2                sjmp  L3E90				; GOTO L3E90
3EAE  DFE0          L3EAE je    L3E90				; if ( ?? ) L3E90
3EB0  503C3E00      L3EB0 andb  Zero,REG_3E,REG_3C		; 0 = REG_3E & REG_3C
3EB4  DFDA                je    L3E90				; if ( == 0) GOTO L3E90
3EB6  313C05              jbc   REG_3C,BIT_01,L3EBE		; if ( !REG_3C.1 ) GOTO L3EBE
3EB9  A23236              ld    REG_36,[REG_32]			; REG_36 = [REG_32]
3EBC  2003                sjmp  L3EC1				; GOTO  L3EC1
3EBE  BE3236        L3EBE ldbse REG_36,[REG_32]			; REG_36 = (word) [REG_32]
3EC1  323C04        L3EC1 jbc   REG_3C,BIT_02,L3EC8		; if ( !REG_3C.2 ) GOTO L3EC8
3EC4  0336                neg   REG_36				; REG_36 = - REG_36
3EC6  DF18                je    L3EE0				; if ( == 0 ) GOTO L3EE0
3EC8  3D3C04        L3EC8 jbs   REG_3C,BIT_05,L3ECF		; if ( REG_3C.5 ) GOTO L3ECF
3ECB  0736                inc   REG_36				; REG_36 ++
3ECD  2003                sjmp  L3ED2				; GOTO L3ED2
3ECF  643836        L3ECF add   REG_36,REG_38			; REG_36 += REG_38
3ED2  D307          L3ED2 jnc   L3EDB				; if ( > 0 ) GOTO L3EDB	
3ED4  0136                clr   REG_36				; REG_36 = 0
3ED6  3A3C07              jbs   REG_3C,BIT_02,L3EE0		; if ( REG_3C.2 ) GOTO L3EE0
3ED9  0536                dec   REG_36				; REG_36 --
3EDB  323C02        L3EDB jbc   REG_3C,BIT_02,L3EE0		; if ( !REG_3C.2 ) GOTO L3EE0
3EDE  0336                neg   REG_36				; REG_36 = -REG_36
3EE0  313C05        L3EE0 jbc   REG_3C,BIT_01,L3EE8		; if ( !REG_3C.1 ) GOTO L3EE0
3EE3  C23236              st    REG_36,[REG_32]			; [REG_32] = REG_36 
3EE6  27A8                sjmp  L3E90				; GOTO L3E90
3EE8  C63236        L3EE8 stb   REG_36,[REG_32]			; [REG_32] = REG_36 
3EEB  27A3                sjmp  L3E90				; GOTO L3E90
3EED  F0            L3EED ret					
                    ;************************************************************
                    ;* CAL_CON
                    ;************************************************************
3EEE  F2                  pushf
3EEF  A301000D            ld    REG_30,$0D00[Zero]		; REG_30 = [$0D00]
      30
3EF4  992A31              cmpb  REG_31,#$2A			; if (REG_31 == $2A)
3EF7  DF0A                je    L3F03       			;  GOTO L3F03
3EF9  A15A0030            ld    REG_30,#$005A			; REG_30 = $005A
3EFD  0530          L3EFD dec   REG_30				; REG_30 --
3EFF  D2FC                jgt   L3EFD				; if (REG_30 > 0) GOTO L3EFD
3F01  2003                sjmp  L3F06				; GOTO L3F06
3F03  EFFA90        L3F03 lcall LD000				; ВЫзов функции за пределами этого ROM
3F06  FA            L3F06 di					;
3F07  FF                  nop					;
3F08  F3                  popf					;
3F09  E7B1EB              ljmp  L2ABD				; End TASK
                    ;************************************************************
                    ;* Task List
                    ;************************************************************
3F0C  EE3E                word  $3EEE                       ;CAL_CON()
3F0E  022E                word  $2E02                       ;Do_Sensors();
3F10  BD2E                word  $2EBD                       ;
3F12  8730                word  $3087                       ;
3F14  173E                word  $3E17                       ;TimerUpdate ()
3F16  9933                word  $3399                       ;
3F18  7934                word  $3479                       ;
3F1A  C934                word  $34C9                       ;
3F1C  2B35                word  $352B                       ;
3F1E  5935                word  $3559                       ;
3F20  7335                word  $3573                       ;
3F22  B535                word  $35B5                       ;
3F24  C53A                word  $3AC5                       ;
3F26  173E                word  $3E17                       ;
3F28  5536                word  $3655                       ;TimerUpdate ()
3F2A  9436                word  $3694                       ;
3F2C  9737                word  $3797                       ;
3F2E  8738                word  $3887                       ;
3F30  3F3B                word  $3B3F                       ;
3F32  543D                word  $3D54                       ;
3F34  173E                word  $3E17                       ;TimerUpdate ()
3F36  FFFF                word  $FFFF
3F38  FFFF                word  $FFFF
3F3A  FFFF                word  $FFFF
3F3C  FFFF                word  $FFFF
3F3E  FFFF                word  $FFFF
3F40  FFFF                word  $FFFF
3F42  FFFF                word  $FFFF
3F44  FFFF                word  $FFFF
3F46  FFFF                word  $FFFF
3F48  FFFF                word  $FFFF
3F4A  FFFF                word  $FFFF
3F4C  FFFF                word  $FFFF
3F4E  FFFF                word  $FFFF
3F50  FFFF                word  $FFFF
3F52  FFFF                word  $FFFF
3F54  FFFF                word  $FFFF
3F56  FFFF                word  $FFFF
3F58  FFFF                word  $FFFF
3F5A  FFFF                word  $FFFF
3F5C  FFFF                word  $FFFF
3F5E  FFFF                word  $FFFF
3F60  FFFF                word  $FFFF
3F62  FFFF                word  $FFFF
3F64  FFFF                word  $FFFF
3F66  FFFF                word  $FFFF
3F68  FFFF                word  $FFFF
3F6A  FFFF                word  $FFFF
3F6C  FFFF                word  $FFFF
3F6E  FFFF                word  $FFFF
3F70  FFFF                word  $FFFF
3F72  FFFF                word  $FFFF
3F74  FFFF                word  $FFFF
3F76  FFFF                word  $FFFF
3F78  FFFF                word  $FFFF
3F7A  FFFF                word  $FFFF
3F7C  FFFF                word  $FFFF
3F7E  FFFF                word  $FFFF
3F80  FFFF                word  $FFFF
3F82  FFFF                word  $FFFF
3F84  FFFF                word  $FFFF
3F86  FFFF                word  $FFFF
3F88  FFFF                word  $FFFF
3F8A  FFFF                word  $FFFF
3F8C  FFFF                word  $FFFF
3F8E  FFFF                word  $FFFF
3F90  FFFF                word  $FFFF
3F92  FFFF                word  $FFFF
3F94  FFFF  $FFFF
3F96  FFFF                word  $FFFF
3F98  FFFF                word  $FFFF
3F9A  FFFF                word  $FFFF
3F9C  FFFF                word  $FFFF
3F9E  FFFF                word  $FFFF
3FA0  FFFF                word  $FFFF
3FA2  FFFF                word  $FFFF
3FA4  FFFF                word  $FFFF
3FA6  FFFF                word  $FFFF
3FA8  FFFF                word  $FFFF
3FAA  FFFF                word  $FFFF
3FAC  FFFF                word  $FFFF
3FAE  FFFF                word  $FFFF
3FB0  FFFF                word  $FFFF
3FB2  FFFF                word  $FFFF
3FB4  FFFF                word  $FFFF
3FB6  FFFF                word  $FFFF
3FB8  FFFF                word  $FFFF
3FBA  FFFF                word  $FFFF
3FBC  FFFF                word  $FFFF
3FBE  FFFF                word  $FFFF
3FC0  FFFF                word  $FFFF
3FC2  FFFF                word  $FFFF
3FC4  FFFF                word  $FFFF
3FC6  FFFF                word  $FFFF
3FC8  FFFF                word  $FFFF
3FCA  FFFF                word  $FFFF
3FCC  FFFF                word  $FFFF
3FCE  FFFF                word  $FFFF
3FD0  FFFF                word  $FFFF
3FD2  FFFF                word  $FFFF
3FD4  FFFF                word  $FFFF
3FD6  FFFF                word  $FFFF
3FD8  FFFF                word  $FFFF
3FDA  FFFF                word  $FFFF
3FDC  FFFF                word  $FFFF
3FDE  FFFF                word  $FFFF
3FE0  FFFF                word  $FFFF
3FE2  FFFF                word  $FFFF
3FE4  FFFF                word  $FFFF
3FE6  FFFF                word  $FFFF
3FE8  FFFF                word  $FFFF
3FEA  FFFF                word  $FFFF
3FEC  FFFF                word  $FFFF
3FEE  FFFF                word  $FFFF
3FF0  FFFF                word  $FFFF
3FF2  FFFF                word  $FFFF
3FF4  FFFF                word  $FFFF
3FF6  FFFF