$NOMACRO
$SEGMENTED CASE MOD167
;
; 'INT.SRC' GENERATED FROM INPUT FILE 'INT.C'
; COMPILER INVOKED BY:
;	C:\C166\BIN\C166.EXE INT.C MOD167 NOINIT LARGE FLOAT64 SYMBOLS CODE PREPRINT SRC
;
$MODINF (183)
		 NAME INT

         CC19IC  DEFR  0F166H
         CC28IC  DEFR  0F178H
        BUSCON1  DEFR  0FF14H
         CC18IC  DEFR  0F164H
         CC27IC  DEFR  0F176H
        BUSCON0  DEFR  0FF0CH
         CC17IC  DEFR  0F162H
         CC26IC  DEFR  0F174H
         CC16IC  DEFR  0F160H
         CC25IC  DEFR  0F172H
            PSW  DEFR  0FF10H
         CC15IC  DEFR  0FF96H
         CC24IC  DEFR  0F170H
         CC14IC  DEFR  0FF94H
         CC23IC  DEFR  0F16EH
         CC13IC  DEFR  0FF92H
         CC22IC  DEFR  0F16CH
         CC31IC  DEFR  0F194H
         CC12IC  DEFR  0FF90H
         CC21IC  DEFR  0F16AH
         CC30IC  DEFR  0F18CH
         CC11IC  DEFR  0FF8EH
         CC20IC  DEFR  0F168H
         CC10IC  DEFR  0FF8CH
            TFR  DEFR  0FFACH
          T6CON  DEFR  0FF48H
          T5CON  DEFR  0FF46H
          T4CON  DEFR  0FF44H
          T3CON  DEFR  0FF42H
          XP3IC  DEFR  0F19EH
          T2CON  DEFR  0FF40H
          XP2IC  DEFR  0F196H
          ADCON  DEFR  0FFA0H
          XP1IC  DEFR  0F18EH
          XP0IC  DEFR  0F186H
          S0CON  DEFR  0FFB0H
          S0TIC  DEFR  0FF6CH
          S0RIC  DEFR  0FF6EH
         SYSCON  DEFR  0FF12H
          ADEIC  DEFR  0FF9AH
          ADCIC  DEFR  0FF98H
          S0EIC  DEFR  0FF70H
            MDC  DEFR  0FF0EH
         WDTCON  DEFR  0FFAEH
          CC9IC  DEFR  0FF8AH
            DP8  DEFR  0FFD6H
          CC8IC  DEFR  0FF88H
            DP7  DEFR  0FFD2H
         SSCTIC  DEFR  0FF72H
         SSCCON  DEFR  0FFB2H
          CC7IC  DEFR  0FF86H
          CC6IC  DEFR  0FF84H
         SSCRIC  DEFR  0FF74H
          CC5IC  DEFR  0FF82H
         EXICON  DEFR  0F1C0H
          CC4IC  DEFR  0FF80H
            DP3  DEFR  0FFC6H
          CC3IC  DEFR  0FF7EH
            DP2  DEFR  0FFC2H
          CC2IC  DEFR  0FF7CH
          CC1IC  DEFR  0FF7AH
          CC0IC  DEFR  0FF78H
         SSCEIC  DEFR  0FF76H
           ISNC  DEFR  0F1DEH
         S0TBIC  DEFR  0F19CH
         T78CON  DEFR  0FF20H
           CRIC  DEFR  0FF6AH
           T8IC  DEFR  0F17CH
           T7IC  DEFR  0F17AH
         T01CON  DEFR  0FF50H
           T6IC  DEFR  0FF68H
           T5IC  DEFR  0FF66H
           T4IC  DEFR  0FF64H
           T3IC  DEFR  0FF62H
           T2IC  DEFR  0FF60H
           T1IC  DEFR  0FF9EH
           T0IC  DEFR  0FF9CH
           CCM7  DEFR  0FF28H
           CCM6  DEFR  0FF26H
           CCM5  DEFR  0FF24H
           CCM4  DEFR  0FF22H
             P8  DEFR  0FFD4H
             T4  DEFR  0FE44H
        PWMCON1  DEFR  0FF32H
           CCM3  DEFR  0FF58H
             T3  DEFR  0FE42H
        PWMCON0  DEFR  0FF30H
           CCM2  DEFR  0FF56H
           CCM1  DEFR  0FF54H
             P5  DEFR  0FFA2H
           CCM0  DEFR  0FF52H
             P3  DEFR  0FFC4H
             P2  DEFR  0FFC0H
          PWMIC  DEFR  0F17EH
        BUSCON4  DEFR  0FF1AH
        BUSCON3  DEFR  0FF18H
         CC29IC  DEFR  0F184H
        BUSCON2  DEFR  0FF16H
          DP2_9  BIT   DP2.9
          DP2_8  BIT   DP2.8
         DP2_11  BIT   DP2.11
         DP2_10  BIT   DP2.10

          SDATA  DGROUP  ?BD?INT,?ID?INT,SYSTEM

                 ASSUME  DPP3 : SDATA

        ?ID?INT  SECTION  DATA WORD 'IDATA'
       HSTEP_HO  DSW  1
         PUBLIC  HSTEP_HO
   CUR_ARC10_HO  DSW  2
         PUBLIC  CUR_ARC10_HO
    CFG_HSTS_VE  DSW  4
         PUBLIC  CFG_HSTS_VE
       SPEED_VE  DSW  1
         PUBLIC  SPEED_VE
    CFG_HSTS_FR  DSW  4
         PUBLIC  CFG_HSTS_FR
    CFG_HSTS_HO  DSW  4
         PUBLIC  CFG_HSTS_HO
   ENC_ARC10_VE  DSW  2
         PUBLIC  ENC_ARC10_VE
       SPEED_FR  DSW  1
         PUBLIC  SPEED_FR
       SPEED_HO  DSW  1
         PUBLIC  SPEED_HO
   ENC_ARC10_HO  DSW  2
         PUBLIC  ENC_ARC10_HO
    SPEED_VE_CT  DSW  1
         PUBLIC  SPEED_VE_CT
        TIMER10  DSW  1
         PUBLIC  TIMER10
    SPEED_FR_CT  DSW  1
         PUBLIC  SPEED_FR_CT
    SPEED_HO_CT  DSW  1
         PUBLIC  SPEED_HO_CT
            DAY  DSW  1
         PUBLIC  DAY
         MINUTE  DSW  1
         PUBLIC  MINUTE
           HOUR  DSW  1
         PUBLIC  HOUR
         SECOND  DSW  1
         PUBLIC  SECOND
      THISMDAYS  DSW  1
         PUBLIC  THISMDAYS
           YEAR  DSW  1
         PUBLIC  YEAR
         DITMP2  DSW  4
         PUBLIC  DITMP2
         DITMP1  DSW  4
         PUBLIC  DITMP1
  TRG_HSTEPS_VE  DSW  2
         PUBLIC  TRG_HSTEPS_VE
  CUR_HSTEPS_VE  DSW  2
         PUBLIC  CUR_HSTEPS_VE
  TRG_HSTEPS_HO  DSW  2
         PUBLIC  TRG_HSTEPS_HO
  CUR_HSTEPS_HO  DSW  2
         PUBLIC  CUR_HSTEPS_HO
         hsteps  DSB  8
         PUBLIC  hsteps
  ARC10PERENCVE  DSW  1
         PUBLIC  ARC10PERENCVE
    HSTEPSHO359  DSW  2
         PUBLIC  HSTEPSHO359
  ARC10PERENCHO  DSW  1
         PUBLIC  ARC10PERENCHO
        MSECOND  DSW  1
         PUBLIC  MSECOND
    HSTEPSHO090  DSW  2
         PUBLIC  HSTEPSHO090
    HSTEPSHO180  DSW  2
         PUBLIC  HSTEPSHO180
    HSTEPSHO270  DSW  2
         PUBLIC  HSTEPSHO270
          MONTH  DSW  1
         PUBLIC  MONTH
     CFG_ENC_VE  DSW  1
         PUBLIC  CFG_ENC_VE
       HSTEP_VE  DSW  1
         PUBLIC  HSTEP_VE
     CFG_ENC_HO  DSW  1
         PUBLIC  CFG_ENC_HO
   CUR_ARC10_VE  DSW  2
         PUBLIC  CUR_ARC10_VE
       HSTEP_FR  DSW  1
         PUBLIC  HSTEP_FR
        ?ID?INT  ENDS

        ?BD?INT  SECTION  DATA BITADDRESSABLE 'BDATA'
      MOT_FLAGS  DSB  1
         PUBLIC  MOT_FLAGS
      ENC_FLAGS  DSB  1
         PUBLIC  ENC_FLAGS
        ?BD?INT  ENDS

     ?C_INITSEC  SECTION  HDATA WORD GLOBAL

                 DW  04008H
                 DW  DPP3:POF (hsteps)
                 DB  0EEH ; uchar
                 DB  0AAH ; uchar
                 DB  0BBH ; uchar
                 DB  099H ; uchar
                 DB  0DDH ; uchar
                 DB  055H ; uchar
                 DB  077H ; uchar
                 DB  066H ; uchar
     ?C_INITSEC  ENDS

          EXTRN  modf : FAR
          EXTRN  ?C_DCAST : FAR
          EXTRN  ?C_DPDIV : FAR
          EXTRN  ?C_CASTD : FAR
      MOTVE_RUN  BIT   MOT_FLAGS.1
         PUBLIC  MOTVE_RUN
      MOTHO_RUN  BIT   MOT_FLAGS.0
         PUBLIC  MOTHO_RUN
      MOTFR_USE  BIT   MOT_FLAGS.2
         PUBLIC  MOTFR_USE
 MOT_CORRECTION  BIT   MOT_FLAGS.7
         PUBLIC  MOT_CORRECTION
      MOTVE_DIR  BIT   MOT_FLAGS.4
         PUBLIC  MOTVE_DIR
      MOTFR_DIR  BIT   MOT_FLAGS.5
         PUBLIC  MOTFR_DIR
      MOTHO_DIR  BIT   MOT_FLAGS.3
         PUBLIC  MOTHO_DIR
      ENCVE_USE  BIT   ENC_FLAGS.1
         PUBLIC  ENCVE_USE
      ENCHO_USE  BIT   ENC_FLAGS.0
         PUBLIC  ENCHO_USE
      ENCVE_COR  BIT   ENC_FLAGS.3
         PUBLIC  ENCVE_COR
      ENCHO_COR  BIT   ENC_FLAGS.2
         PUBLIC  ENCHO_COR
      ENCVE_DIR  BIT   ENC_FLAGS.5
         PUBLIC  ENCVE_DIR
      ENCHO_DIR  BIT   ENC_FLAGS.4
         PUBLIC  ENCHO_DIR
   ENCVE_CORUSE  BIT   ENC_FLAGS.7
         PUBLIC  ENCVE_CORUSE
   ENCHO_CORUSE  BIT   ENC_FLAGS.6
         PUBLIC  ENCHO_CORUSE
       MOT_GOTO  BIT   MOT_FLAGS.6
         PUBLIC  MOT_GOTO


                 REGDEF   R0 - R15
     TIMER_BANK  REGBANK  R0 - R15
 ENCODER10_BANK  REGBANK  R0 - R15
 ENCODER11_BANK  REGBANK  R0 - R15
 ENCODER20_BANK  REGBANK  R0 - R15
 ENCODER21_BANK  REGBANK  R0 - R15


        ?PR?INT  SECTION  CODE WORD 'FCODE'
; line 1: 
; line 2: #ifndef  _int_c_
; line 3: #define  _int_c_
; line 4: 
; line 5: #include "int.h"
; line 6: 
; line 7: #pragma SRC
; line 8: 
; line 9: 
; line 10: 
; line 11: unsigned char bdata ENC_FLAGS;
; line 12: 
; line 13: sbit	ENCHO_USE		= ENC_FLAGS^0;
; line 14: sbit	ENCVE_USE		= ENC_FLAGS^1;
; line 15: 
; line 16: sbit	ENCHO_COR		= ENC_FLAGS^2;
; line 17: sbit	ENCVE_COR		= ENC_FLAGS^3;
; line 18: 
; line 19: sbit	ENCHO_DIR 		= ENC_FLAGS^4;
; line 20: sbit	ENCVE_DIR   	= ENC_FLAGS^5;
; line 21: 
; line 22: sbit	ENCHO_CORUSE 	= ENC_FLAGS^6;
; line 23: sbit	ENCVE_CORUSE	= ENC_FLAGS^7;
; line 24: 
; line 25: 
; line 26: unsigned char bdata MOT_FLAGS;
; line 27: 
; line 28: sbit	MOTHO_RUN		= MOT_FLAGS^0;
; line 29: sbit	MOTVE_RUN		= MOT_FLAGS^1;
; line 30: sbit	MOTFR_USE		= MOT_FLAGS^2;
; line 31: sbit	MOTHO_DIR		= MOT_FLAGS^3;
; line 32: sbit	MOTVE_DIR		= MOT_FLAGS^4;
; line 33: sbit	MOTFR_DIR		= MOT_FLAGS^5;
; line 34: sbit	MOT_GOTO		= MOT_FLAGS^6;
; line 35: sbit	MOT_CORRECTION	= MOT_FLAGS^7;
; line 36: 
; line 37: 
; line 38: 
; line 39: volatile int idata YEAR;
; line 40: volatile int idata MONTH;
; line 41: volatile int idata DAY;
; line 42: volatile int idata HOUR;
; line 43: volatile int idata MINUTE;
; line 44: volatile int idata SECOND;
; line 45: volatile int idata MSECOND;
; line 46: 
; line 47: volatile int idata TIMER10;
; line 48: volatile int idata THISMDAYS;
; line 49: 
; line 50: volatile int idata CFG_ENC_HO;
; line 51: volatile int idata CFG_ENC_VE;
; line 52: 
; line 53: volatile int idata ARC10PERENCHO;
; line 54: volatile int idata ARC10PERENCVE;
; line 55: 
; line 56: volatile long idata ENC_ARC10_HO;
; line 57: volatile long idata ENC_ARC10_VE;
; line 58: 
; line 59: 
; line 60: volatile long idata HSTEPSHO090;
; line 61: volatile long idata HSTEPSHO180;
; line 62: volatile long idata HSTEPSHO270;
; line 63: volatile long idata HSTEPSHO359;
; line 64: 
; line 65: volatile long idata CUR_HSTEPS_HO;
; line 66: volatile long idata CUR_HSTEPS_VE;
; line 67: volatile long idata TRG_HSTEPS_HO;
; line 68: volatile long idata TRG_HSTEPS_VE;
; line 69: 
; line 70: volatile long idata CUR_ARC10_HO;
; line 71: volatile long idata CUR_ARC10_VE;
; line 72: 
; line 73: volatile int idata SPEED_HO;
; line 74: volatile int idata SPEED_VE;
; line 75: volatile int idata SPEED_FR;
; line 76: 
; line 77: volatile int idata SPEED_HO_CT;
; line 78: volatile int idata SPEED_VE_CT;
; line 79: volatile int idata SPEED_FR_CT;
; line 80: 
; line 81: 
; line 82: volatile unsigned char idata hsteps[8] = { HSTEP1, HSTEP2, HSTEP3, HSTEP4, HSTEP5, HSTEP6, HSTEP7, HSTEP8 };
; line 83: volatile int idata HSTEP_HO;
; line 84: volatile int idata HSTEP_VE;
; line 85: volatile int idata HSTEP_FR;
; line 86: 
; line 87: volatile double idata CFG_HSTS_HO;
; line 88: volatile double idata CFG_HSTS_VE;
; line 89: volatile double idata CFG_HSTS_FR;
; line 90: 
; line 91: volatile double idata DITMP1;
; line 92: volatile double idata DITMP2;
; line 93: 
; line 94: 
; line 95: 
; line 96: 
; line 97: void initTimerInt( void ) {

	initTimerInt  PROC  FAR
	PUBLIC  initTimerInt
; FUNCTION initTimerInt (BEGIN  RMASK = @0x8000)
; line 98: 	
; line 99: 	T3IC  = TIMERINTOFF;
	MOV	T3IC,#167
; line 100: 	T3CON = TIMERSTOP;
	MOV	T3CON,#1025
; line 101: 	T4CON = TIMERSET;
	MOV	T4CON,#39
; line 102: 	T4	  = TIMERRELOAD;
	MOV	T4,#65411
; line 103: 	T3	  = TIMERRELOAD;
	MOV	T3,#65411
; line 104: 
; line 105: }
	RETS	
; FUNCTION initTimerInt (END    RMASK = @0x8000)
	initTimerInt  ENDP
; line 106: 
; line 107: 
; line 108: void startTimerInt( void ) {

	startTimerInt  PROC  FAR
	PUBLIC  startTimerInt
; FUNCTION startTimerInt (BEGIN  RMASK = @0x8000)
; line 109: 
; line 110: 	TIMER10 = 0;
	MOV	WORD TIMER10,ZEROS
; line 111: 	T3		= TIMERRELOAD;
	MOV	T3,#65411
; line 112: 	T4		= TIMERRELOAD;
	MOV	T4,#65411
; line 113: 	T3CON	= TIMERSTART;
	MOV	T3CON,#1089
; line 114: 	T3IC	= TIMERINTON;
	MOV	T3IC,#231
; line 115: }
	RETS	
; FUNCTION startTimerInt (END    RMASK = @0x8000)
	startTimerInt  ENDP
; line 116: 
; line 117: 
; line 118: 
; line 119: 
; line 120: void stopTimerInt( void ) {

	stopTimerInt  PROC  FAR
	PUBLIC  stopTimerInt
; FUNCTION stopTimerInt (BEGIN  RMASK = @0x8000)
; line 121: 
; line 122: 	T3IC	= TIMERINTOFF;
	MOV	T3IC,#167
; line 123: 	T3CON	= TIMERSTOP;
	MOV	T3CON,#1025
; line 124: }
	RETS	
; FUNCTION stopTimerInt (END    RMASK = @0x8000)
	stopTimerInt  ENDP
; line 125: 
; line 126: 
; line 127: 
; line 128: #pragma ASM
; line 129: 
; line 130: ;P2	DEFR	0FFC0H
	;P2	DEFR	0FFC0H
; line 131: P7	DEFR	0FFD0H
	P7	DEFR	0FFD0H
; line 132: P8	DEFR	0FFD4H
	P8	DEFR	0FFD4H
; line 133: 
; line 134: #pragma ENDASM
; line 135: 
; line 136: 
; line 137: 
; line 138: //interrupt every 1/10000 second
; line 139: void timer_int (void) interrupt TIMER_INT = 0x23 using TIMER_BANK {

	timer_int  PROC  INTERRUPT TIMER_INT = 35 USING TIMER_BANK
	GLOBAL  timer_int
; FUNCTION timer_int (BEGIN  RMASK = @0x3FFF)
	SCXT	DPP3,#3
	NOP	
	MOV	TIMER_BANK,R0
	SCXT	CP,#TIMER_BANK
	NOP	
	PUSH	DPP0
	SCXT	MDC,#16
	PUSH	MDH
	PUSH	MDL
; line 140: 
; line 141: 	TIMER10++;
	SUB	TIMER10,ONES
; line 142: 
; line 143: 	if( TIMER10 >= 10 ){
	MOV	R4,WORD TIMER10
	CMP	R4,#10
	JMP	cc_SLT,?C0001
; line 144: 	
; line 145: 		TIMER10 = 0;
	MOV	WORD TIMER10,ZEROS
; line 146: 		MSECOND++;
	SUB	MSECOND,ONES
; line 147: 
; line 148: 		if( MSECOND >= 1000 ){
	MOV	R4,WORD MSECOND
	CMP	R4,#1000
	JMP	cc_SLT,?C0001
; line 149: 		
; line 150: 			MSECOND = 0;
	MOV	WORD MSECOND,ZEROS
; line 151: 			SECOND++;
	SUB	SECOND,ONES
; line 152: 			
; line 153: 			if( SECOND >= 60 ){
	MOV	R4,WORD SECOND
	CMP	R4,#60
	JMP	cc_SLT,?C0001
; line 154: 
; line 155: 				SECOND = 0;
	MOV	WORD SECOND,ZEROS
; line 156: 				MINUTE++;
	SUB	MINUTE,ONES
; line 157: 				
; line 158: 				if( MINUTE >= 60 ){
	MOV	R4,WORD MINUTE
	CMP	R4,#60
	JMP	cc_SLT,?C0001
; line 159: 
; line 160: 					MINUTE = 0;
	MOV	WORD MINUTE,ZEROS
; line 161: 					HOUR++;
	SUB	HOUR,ONES
; line 162: 					
; line 163: 					if( HOUR >= 24 ){
	MOV	R4,WORD HOUR
	CMP	R4,#24
	JMP	cc_SLT,?C0001
; line 164: 
; line 165: 						HOUR = 0;
	MOV	WORD HOUR,ZEROS
; line 166: 						DAY++;
	SUB	DAY,ONES
; line 167: 						
; line 168: 						if( DAY > THISMDAYS ) {
	MOV	R4,WORD THISMDAYS
	CMP	R4,WORD DAY
	JMP	cc_SGE,?C0001
; line 169: 						
; line 170: 							DAY = 1;
	MOV	R4,#1
	MOV	WORD DAY,R4
; line 171: 							MONTH++;
	SUB	MONTH,ONES
; line 172: 							
; line 173: 							if( MONTH > 12 ){
	MOV	R4,WORD MONTH
	CMP	R4,#12
	JMP	cc_SLE,?C0001
; line 174: 
; line 175: 								MONTH = 1;
	MOV	R4,#1
	MOV	WORD MONTH,R4
; line 176: 								YEAR++;							
	SUB	YEAR,ONES
; line 177: 							}
; line 178: 						}						
; line 179: 					}
; line 180: 				}
; line 181: 			}
; line 182: 		}
; line 183: 	}
?C0001:
; line 184: 
; line 185: 	
; line 186: 	/// so updating of date/time is down	
; line 187: 	/// here we do the work for motors
; line 188: 	///
; line 189: 	///
; line 190: 
; line 191: 
; line 192: 
; line 193: 	if( ENCHO_COR == ON ) {
	JNB	ENCHO_COR,?C0008
; line 194: 		if( ENCHO_CORUSE == ON ) {
	JNB	ENCHO_CORUSE,?C0009
; line 195: 			DITMP1 = (double)ENC_ARC10_HO / (double)10;
	MOV	R4,WORD ENC_ARC10_HO
	MOV	R5,WORD ENC_ARC10_HO+2
	MOV	R6,R5
	CALL	?C_DCAST
	MOV	R8,#0
	MOV	R9,#0
	MOV	R10,#0
	MOV	R11,#16420
	CALL	?C_DPDIV
	MOV	WORD DITMP1,R4
	MOV	WORD DITMP1+2,R5
	MOV	WORD DITMP1+4,R6
	MOV	WORD DITMP1+6,R7
; line 196: 			DITMP1 = (double)DITMP1 / (double)CFG_HSTS_HO;
	MOV	R8,WORD CFG_HSTS_HO
	MOV	R9,WORD CFG_HSTS_HO+2
	MOV	R10,WORD CFG_HSTS_HO+4
	MOV	R11,WORD CFG_HSTS_HO+6
	MOV	R4,WORD DITMP1
	MOV	R5,WORD DITMP1+2
	MOV	R6,WORD DITMP1+4
	MOV	R7,WORD DITMP1+6
	CALL	?C_DPDIV
	MOV	WORD DITMP1,R4
	MOV	WORD DITMP1+2,R5
	MOV	WORD DITMP1+4,R6
	MOV	WORD DITMP1+6,R7
; line 197: 			modf( DITMP1, &DITMP2);
	MOV	R4,#POF (DITMP2)
	MOV	R5,#PAG (DITMP2)
	MOV	[-R0],R5
	MOV	R12,R4
	MOV	R8,WORD DITMP1
	MOV	R9,WORD DITMP1+2
	MOV	R10,WORD DITMP1+4
	MOV	R11,WORD DITMP1+6
	CALL	modf
	ADD	R0,#2
; line 198: 			CUR_HSTEPS_HO = ( long )DITMP2;
	MOV	R4,WORD DITMP2
	MOV	R5,WORD DITMP2+2
	MOV	R6,WORD DITMP2+4
	MOV	R7,WORD DITMP2+6
	CALL	?C_CASTD
	MOV	WORD CUR_HSTEPS_HO,R4
	MOV	WORD CUR_HSTEPS_HO+2,R5
; line 199: 		}
?C0009:
; line 200: 		ENCHO_COR = OFF;
	BCLR	ENCHO_COR
; line 201: 	}
?C0008:
; line 202: 
; line 203: 
; line 204: 	if( ENCVE_COR == ON ) {
	JNB	ENCVE_COR,?C0010
; line 205: 		if( ENCVE_CORUSE == ON ) {
	JNB	ENCVE_CORUSE,?C0011
; line 206: 			DITMP1 = (double)ENC_ARC10_VE / (double)10;
	MOV	R4,WORD ENC_ARC10_VE
	MOV	R5,WORD ENC_ARC10_VE+2
	MOV	R6,R5
	CALL	?C_DCAST
	MOV	R8,#0
	MOV	R9,#0
	MOV	R10,#0
	MOV	R11,#16420
	CALL	?C_DPDIV
	MOV	WORD DITMP1,R4
	MOV	WORD DITMP1+2,R5
	MOV	WORD DITMP1+4,R6
	MOV	WORD DITMP1+6,R7
; line 207: 			DITMP1 = (double)DITMP1 / (double)CFG_HSTS_VE;
	MOV	R8,WORD CFG_HSTS_VE
	MOV	R9,WORD CFG_HSTS_VE+2
	MOV	R10,WORD CFG_HSTS_VE+4
	MOV	R11,WORD CFG_HSTS_VE+6
	MOV	R4,WORD DITMP1
	MOV	R5,WORD DITMP1+2
	MOV	R6,WORD DITMP1+4
	MOV	R7,WORD DITMP1+6
	CALL	?C_DPDIV
	MOV	WORD DITMP1,R4
	MOV	WORD DITMP1+2,R5
	MOV	WORD DITMP1+4,R6
	MOV	WORD DITMP1+6,R7
; line 208: 			modf( DITMP1, &DITMP2);
	MOV	R4,#POF (DITMP2)
	MOV	R5,#PAG (DITMP2)
	MOV	[-R0],R5
	MOV	R12,R4
	MOV	R8,WORD DITMP1
	MOV	R9,WORD DITMP1+2
	MOV	R10,WORD DITMP1+4
	MOV	R11,WORD DITMP1+6
	CALL	modf
	ADD	R0,#2
; line 209: 			CUR_HSTEPS_VE = ( long )DITMP2;
	MOV	R4,WORD DITMP2
	MOV	R5,WORD DITMP2+2
	MOV	R6,WORD DITMP2+4
	MOV	R7,WORD DITMP2+6
	CALL	?C_CASTD
	MOV	WORD CUR_HSTEPS_VE,R4
	MOV	WORD CUR_HSTEPS_VE+2,R5
; line 210: 		}
?C0011:
; line 211: 		ENCVE_COR = OFF;
	BCLR	ENCVE_COR
; line 212: 	}
?C0010:
; line 213: 
; line 214: 
; line 215: 
; line 216: 	if( MOT_GOTO == ON ) {
	JNB	MOT_GOTO,?C0012
; line 217: 	
; line 218: 		if( MOTHO_RUN == ON ) {
	JNB	MOTHO_RUN,?C0013
; line 219: 			
; line 220: 			if( (long)CUR_HSTEPS_HO == (long)TRG_HSTEPS_HO ){
	MOV	R4,WORD TRG_HSTEPS_HO
	MOV	R5,WORD TRG_HSTEPS_HO+2
	SUB	R4,WORD CUR_HSTEPS_HO
	SUBC	R5,WORD CUR_HSTEPS_HO+2
	JMP	cc_NZ,?C0013
; line 221: 				MOTHO_RUN = OFF;
	BCLR	MOTHO_RUN
; line 222: 			}
?C0013:
; line 223: 		
; line 224: 		}
; line 225: 		
; line 226: 		
; line 227: 		if( MOTVE_RUN == ON ) {
	JNB	MOTVE_RUN,?C0012
; line 228: 		
; line 229: 			if( (long)CUR_HSTEPS_VE == (long)TRG_HSTEPS_VE ){
	MOV	R4,WORD TRG_HSTEPS_VE
	MOV	R5,WORD TRG_HSTEPS_VE+2
	SUB	R4,WORD CUR_HSTEPS_VE
	SUBC	R5,WORD CUR_HSTEPS_VE+2
	JMP	cc_NZ,?C0012
; line 230: 				MOTVE_RUN = OFF;
	BCLR	MOTVE_RUN
; line 231: 			}
; line 232: 		
; line 233: 		}	
; line 234: 	
; line 235: 	}
?C0012:
; line 236: 
; line 237: 
; line 238: 
; line 239: 	if( ( MOT_GOTO == ON ) || ( MOT_CORRECTION == ON ) ) {
	JB	MOT_GOTO,?C0018
	JB	MOT_CORRECTION,$+8
	JMPA	cc_UC,?C0017
?C0018:
; line 240: 
; line 241: 
; line 242: 		if( MOTHO_RUN == ON ) {
	JNB	MOTHO_RUN,?C0019
; line 243: 			SPEED_HO_CT++;
	SUB	SPEED_HO_CT,ONES
; line 244: 
; line 245: 			if( SPEED_HO_CT >= SPEED_HO ){
	MOV	R4,WORD SPEED_HO
	CMP	R4,WORD SPEED_HO_CT
	JMP	cc_SGT,?C0019
; line 246: 
; line 247: 				SPEED_HO_CT = 0;
	MOV	WORD SPEED_HO_CT,ZEROS
; line 248: 				
; line 249: 				
; line 250: 				if( MOTHO_DIR == LEFT ) {
	JNB	MOTHO_DIR,?C0021
; line 251: 					HSTEP_HO--;
	ADD	HSTEP_HO,ONES
; line 252: 					if( HSTEP_HO < 0 ){
	MOV	R4,WORD HSTEP_HO
	JMP	cc_NN,?C0022
; line 253: 						HSTEP_HO = 7;
	MOV	R4,#7
	MOV	WORD HSTEP_HO,R4
; line 254: 					}
?C0022:
; line 255: 
; line 256: 					CUR_HSTEPS_HO = (long)CUR_HSTEPS_HO - (long)1;
	ADD	CUR_HSTEPS_HO,ONES
	ADDC	CUR_HSTEPS_HO+2,ONES
; line 257: 					
; line 258: 					if( CUR_HSTEPS_HO < (long)0 ){
	MOV	R4,WORD CUR_HSTEPS_HO
	MOV	R5,WORD CUR_HSTEPS_HO+2
	SUB	R4,#0
	SUBC	R5,#0
	JMP	cc_SGE,?C0024
; line 259: 						CUR_HSTEPS_HO = (long)HSTEPSHO359;
	MOV	R4,WORD HSTEPSHO359
	MOV	R5,WORD HSTEPSHO359+2
	MOV	WORD CUR_HSTEPS_HO,R4
	MOV	WORD CUR_HSTEPS_HO+2,R5
; line 260: 					}
	JMP	cc_UC,?C0024
?C0021:
; line 261: 
; line 262: 				}
; line 263: 				else {
; line 264: 					HSTEP_HO++;
	SUB	HSTEP_HO,ONES
; line 265: 					if( HSTEP_HO > 7 ){
	MOV	R4,WORD HSTEP_HO
	CMP	R4,#7
	JMP	cc_SLE,?C0025
; line 266: 						HSTEP_HO = 0;
	MOV	WORD HSTEP_HO,ZEROS
; line 267: 					}
?C0025:
; line 268: 
; line 269: 					CUR_HSTEPS_HO = (long)CUR_HSTEPS_HO + (long)1;
	SUB	CUR_HSTEPS_HO,ONES
	SUBC	CUR_HSTEPS_HO+2,ONES
; line 270: 					
; line 271: 					if( CUR_HSTEPS_HO > (long)HSTEPSHO359 ){
	MOV	R4,WORD HSTEPSHO359
	MOV	R5,WORD HSTEPSHO359+2
	SUB	R4,WORD CUR_HSTEPS_HO
	SUBC	R5,WORD CUR_HSTEPS_HO+2
	JMP	cc_SGE,?C0024
; line 272: 						CUR_HSTEPS_HO = (long)0;
	MOV	WORD CUR_HSTEPS_HO,ZEROS
	MOV	WORD CUR_HSTEPS_HO+2,ZEROS
; line 273: 					}
?C0024:
; line 274: 				}	
; line 275: 
; line 276: 
; line 277: #pragma ASM
; line 278: 				MOV		R7,#hsteps
	MOV		R7,#hsteps
; line 279: 				ADD		R7,HSTEP_HO
	ADD		R7,HSTEP_HO
; line 280: 				MOVB	RL6,[R7]
	MOVB	RL6,[R7]
; line 281: 				ANDB	RL6,#15
	ANDB	RL6,#15
; line 282: 				MOVB	RL5,P7
	MOVB	RL5,P7
; line 283: 				ANDB	RL5,#240
	ANDB	RL5,#240
; line 284: 				ORB		RL6,RL5
	ORB		RL6,RL5
; line 285: 				MOVB	P7,RL6
	MOVB	P7,RL6
; line 286: #pragma ENDASM		
; line 287: 
; line 288: 
; line 289: 			}
?C0019:
; line 290: 		}
; line 291: 
; line 292: 
; line 293: 
; line 294: 		if( MOTVE_RUN == ON ) {
	JNB	MOTVE_RUN,?C0027
; line 295: 			SPEED_VE_CT++;
	SUB	SPEED_VE_CT,ONES
; line 296: 			if( SPEED_VE_CT >= SPEED_VE ){
	MOV	R4,WORD SPEED_VE
	CMP	R4,WORD SPEED_VE_CT
	JMP	cc_SGT,?C0027
; line 297: 				SPEED_VE_CT = 0;
	MOV	WORD SPEED_VE_CT,ZEROS
; line 298: 				
; line 299: 				
; line 300: 				if( MOTVE_DIR == DOWN ) {
	JNB	MOTVE_DIR,?C0029
; line 301: 					HSTEP_VE--;
	ADD	HSTEP_VE,ONES
; line 302: 					if( HSTEP_VE < 0 ){
	MOV	R4,WORD HSTEP_VE
	JMP	cc_NN,?C0030
; line 303: 						HSTEP_VE = 7;
	MOV	R4,#7
	MOV	WORD HSTEP_VE,R4
; line 304: 					}
?C0030:
; line 305: 
; line 306: 					CUR_HSTEPS_VE = (long)CUR_HSTEPS_VE - (long)1;
	ADD	CUR_HSTEPS_VE,ONES
	ADDC	CUR_HSTEPS_VE+2,ONES
; line 307: 				}
	JMP	cc_UC,?C0031
?C0029:
; line 308: 				else {
; line 309: 					HSTEP_VE++;
	SUB	HSTEP_VE,ONES
; line 310: 					if( HSTEP_VE > 7 ){
	MOV	R4,WORD HSTEP_VE
	CMP	R4,#7
	JMP	cc_SLE,?C0032
; line 311: 						HSTEP_VE = 0;
	MOV	WORD HSTEP_VE,ZEROS
; line 312: 					}
?C0032:
; line 313: 					
; line 314: 					CUR_HSTEPS_VE = (long)CUR_HSTEPS_VE + (long)1;	
	SUB	CUR_HSTEPS_VE,ONES
	SUBC	CUR_HSTEPS_VE+2,ONES
; line 315: 				}	
?C0031:
; line 316: 
; line 317: 
; line 318: #pragma ASM
; line 319: 				MOV		R7,#hsteps
	MOV		R7,#hsteps
; line 320: 				ADD		R7,HSTEP_VE
	ADD		R7,HSTEP_VE
; line 321: 				MOVB	RL6,[R7]
	MOVB	RL6,[R7]
; line 322: 				ANDB	RL6,#240
	ANDB	RL6,#240
; line 323: 				MOVB	RL5,P7
	MOVB	RL5,P7
; line 324: 				ANDB	RL5,#15
	ANDB	RL5,#15
; line 325: 				ORB		RL6,RL5
	ORB		RL6,RL5
; line 326: 				MOVB	P7,RL6
	MOVB	P7,RL6
; line 327: #pragma ENDASM		
; line 328: 
; line 329: 
; line 330: 
; line 331: 			}
?C0027:
; line 332: 
; line 333: 		}
; line 334: 		
; line 335: 		
; line 336: 		
; line 337: 		if( ( MOTFR_USE == ON ) && ( MOT_GOTO == ON ) ){
	JNB	MOTFR_USE,?C0017
	JNB	MOT_GOTO,?C0017
; line 338: 			SPEED_FR_CT++;
	SUB	SPEED_FR_CT,ONES
; line 339: 			if( SPEED_FR_CT >= SPEED_FR ){
	MOV	R4,WORD SPEED_FR
	CMP	R4,WORD SPEED_FR_CT
	JMP	cc_SGT,?C0017
; line 340: 				SPEED_FR_CT = 0;
	MOV	WORD SPEED_FR_CT,ZEROS
; line 341: 				
; line 342: 				
; line 343: 				if( MOTFR_DIR == LEFT ) {
	JNB	MOTFR_DIR,?C0035
; line 344: 					HSTEP_FR--;
	ADD	HSTEP_FR,ONES
; line 345: 					if( HSTEP_FR < 0 ){
	MOV	R4,WORD HSTEP_FR
	JMP	cc_NN,?C0037
; line 346: 						HSTEP_FR = 7;
	MOV	R4,#7
	MOV	WORD HSTEP_FR,R4
; line 347: 					}
	JMP	cc_UC,?C0037
?C0035:
; line 348: 
; line 349: 				}
; line 350: 				else {
; line 351: 					HSTEP_FR++;
	SUB	HSTEP_FR,ONES
; line 352: 					if( HSTEP_FR > 7 ){
	MOV	R4,WORD HSTEP_FR
	CMP	R4,#7
	JMP	cc_SLE,?C0037
; line 353: 						HSTEP_FR = 0;
	MOV	WORD HSTEP_FR,ZEROS
; line 354: 					}
?C0037:
; line 355: 
; line 356: 				}	
; line 357: 
; line 358: #pragma ASM
; line 359: 				MOV		R7,#hsteps
	MOV		R7,#hsteps
; line 360: 				ADD		R7,HSTEP_FR
	ADD		R7,HSTEP_FR
; line 361: 				MOVB	RL6,[R7]
	MOVB	RL6,[R7]
; line 362: 				ANDB	RL6,#15
	ANDB	RL6,#15
; line 363: 				MOVB	RL5,P8
	MOVB	RL5,P8
; line 364: 				ANDB	RL5,#240
	ANDB	RL5,#240
; line 365: 				ORB		RL6,RL5
	ORB		RL6,RL5
; line 366: 				MOVB	P8,RL6
	MOVB	P8,RL6
; line 367: #pragma ENDASM		
; line 368: 
; line 369: 
; line 370: 
; line 371: 			}
; line 372: 
; line 373: 		
; line 374: 		}
; line 375: 
; line 376: 	}
?C0017:
; line 377: 
; line 378: 
; line 379: }
	POP	MDL
	POP	MDH
	POP	MDC
	POP	DPP0
	POP	CP
	POP	DPP3
	RETI	
; FUNCTION timer_int (END    RMASK = @0x3FFF)
	timer_int  ENDP
; line 380: 
; line 381: 
; line 382: 
; line 383: 
; line 384: void initEncoderInts(void) {

	initEncoderInts  PROC  FAR
	PUBLIC  initEncoderInts
; FUNCTION initEncoderInts (BEGIN  RMASK = @0x8000)
; line 385: 
; line 386: 	DP2_8    = INPUT;
	BCLR	DP2_8
; line 387: 	DP2_9    = INPUT;
	BCLR	DP2_9
; line 388: 	DP2_10   = INPUT;
	BCLR	DP2_10
; line 389: 	DP2_11   = INPUT;
	BCLR	DP2_11
; line 390: 	
; line 391: 	CC8IC   = ENC1_0INTOFF;
	MOV	CC8IC,#183
; line 392: 	CC9IC   = ENC1_1INTOFF;
	MOV	CC9IC,#179
; line 393: 	CC10IC  = ENC2_0INTOFF;
	MOV	CC10IC,#175
; line 394: 	CC11IC  = ENC2_1INTOFF;
	MOV	CC11IC,#171
; line 395: 
; line 396: 	EXICON  = 0x00ff;
	EXTR	#1
	MOV	EXICON,#255
; line 397: }
	RETS	
; FUNCTION initEncoderInts (END    RMASK = @0x8000)
	initEncoderInts  ENDP
; line 398: 
; line 399: 
; line 400: 
; line 401: void startEncoderIntsHo(void) {

	startEncoderIntsHo  PROC  FAR
	PUBLIC  startEncoderIntsHo
; FUNCTION startEncoderIntsHo (BEGIN  RMASK = @0x8000)
; line 402: 
; line 403: 	ENCHO_COR		= OFF;
	BCLR	ENCHO_COR
; line 404: 	ENCHO_DIR	  	= RIGHT;
	BCLR	ENCHO_DIR
; line 405: 
; line 406: 	CC8IC   = ENC1_0INTON;
	MOV	CC8IC,#247
; line 407: 	CC9IC   = ENC1_1INTON;
	MOV	CC9IC,#243
; line 408: 
; line 409: }
	RETS	
; FUNCTION startEncoderIntsHo (END    RMASK = @0x8000)
	startEncoderIntsHo  ENDP
; line 410: 
; line 411: 
; line 412: void startEncoderIntsVe(void) {

	startEncoderIntsVe  PROC  FAR
	PUBLIC  startEncoderIntsVe
; FUNCTION startEncoderIntsVe (BEGIN  RMASK = @0x8000)
; line 413: 
; line 414: 	ENCVE_COR		 = OFF;
	BCLR	ENCVE_COR
; line 415: 	ENCVE_DIR	     = UP;
	BCLR	ENCVE_DIR
; line 416: 
; line 417: 	CC10IC  = ENC2_0INTON;
	MOV	CC10IC,#239
; line 418: 	CC11IC  = ENC2_1INTON;
	MOV	CC11IC,#235
; line 419: 
; line 420: }
	RETS	
; FUNCTION startEncoderIntsVe (END    RMASK = @0x8000)
	startEncoderIntsVe  ENDP
; line 421: 
; line 422: 
; line 423: 
; line 424: void stopEncoderInts(void) {

	stopEncoderInts  PROC  FAR
	PUBLIC  stopEncoderInts
; FUNCTION stopEncoderInts (BEGIN  RMASK = @0x8000)
; line 425: 
; line 426: 	CC8IC   = ENC1_0INTOFF;
	MOV	CC8IC,#183
; line 427: 	CC9IC   = ENC1_1INTOFF;
	MOV	CC9IC,#179
; line 428: 	CC10IC  = ENC2_0INTOFF;
	MOV	CC10IC,#175
; line 429: 	CC11IC  = ENC2_1INTOFF;
	MOV	CC11IC,#171
; line 430: 	
; line 431: 	ENCHO_COR = OFF;
	BCLR	ENCHO_COR
; line 432: 	ENCVE_COR = OFF;
	BCLR	ENCVE_COR
; line 433: 
; line 434: }
	RETS	
; FUNCTION stopEncoderInts (END    RMASK = @0x8000)
	stopEncoderInts  ENDP
; line 435: 
; line 436: 
; line 437: 
; line 438: 
; line 439: 
; line 440: void encoder1_0_int (void) interrupt ENCODER1_0_INT = 0x18 using ENCODER10_BANK {

	encoder1_0_int  PROC  INTERRUPT ENCODER1_0_INT = 24 USING ENCODER10_BANK
	GLOBAL  encoder1_0_int
; FUNCTION encoder1_0_int (BEGIN  RMASK = @0x0030)
	SCXT	DPP3,#3
	NOP	
	MOV	ENCODER10_BANK,R0
	SCXT	CP,#ENCODER10_BANK
	NOP	
; line 441: #pragma ASM
; line 442: 	
; line 443: 	jb	P2.8,LENC10HIGH
	jb	P2.8,LENC10HIGH
; line 444: 
; line 445: 	jnb	P2.9,LENC10RIGHT
	jnb	P2.9,LENC10RIGHT
; line 446: 
; line 447: 	JMPR	cc_UC,LENC10LEFT
	JMPR	cc_UC,LENC10LEFT
; line 448: LENC10HIGH:
	LENC10HIGH:
; line 449: 
; line 450: 	jb	P2.9,LENC10RIGHT
	jb	P2.9,LENC10RIGHT
; line 451: 
; line 452: LENC10LEFT:
	LENC10LEFT:
; line 453: 
; line 454: 	BSET	ENC_FLAGS.4
	BSET	ENC_FLAGS.4
; line 455: 
; line 456: #pragma ENDASM
; line 457: 	ENC_ARC10_HO = (long)ENC_ARC10_HO - (long)ARC10PERENCHO;
	MOV	R4,WORD ARC10PERENCHO
	MOV	R5,R4
	ASHR	R5,#15
	SUB	WORD ENC_ARC10_HO,R4
	SUBC	WORD ENC_ARC10_HO+2,R5
; line 458: 	if( ENC_ARC10_HO < (long)0){
	MOV	R4,WORD ENC_ARC10_HO
	MOV	R5,WORD ENC_ARC10_HO+2
	SUB	R4,#0
	SUBC	R5,#0
	JMP	cc_SGE,?C0039
; line 459: 		ENC_ARC10_HO = (long)12960000 + (long)ENC_ARC10_HO;
	MOV	R4,#49408
	MOV	R5,#197
	ADD	WORD ENC_ARC10_HO,R4
	ADDC	WORD ENC_ARC10_HO+2,R5
; line 460: //		ENC_ARC10_HO = (long)12959999 + (long)ENC_ARC10_HO;		
; line 461: 	}
?C0039:
; line 462: #pragma ASM
; line 463: 	
; line 464: 	jmpr	cc_UC,LENC10END
	jmpr	cc_UC,LENC10END
; line 465: LENC10RIGHT:
	LENC10RIGHT:
; line 466: 
; line 467: 	BCLR	ENC_FLAGS.4
	BCLR	ENC_FLAGS.4
; line 468: 
; line 469: #pragma ENDASM
; line 470: 	ENC_ARC10_HO = (long)ENC_ARC10_HO + (long)ARC10PERENCHO;
	MOV	R4,WORD ARC10PERENCHO
	MOV	R5,R4
	ASHR	R5,#15
	ADD	WORD ENC_ARC10_HO,R4
	ADDC	WORD ENC_ARC10_HO+2,R5
; line 471: 	if( ENC_ARC10_HO > (long)12959999 ){
	MOV	R4,WORD ENC_ARC10_HO
	MOV	R5,WORD ENC_ARC10_HO+2
	SUB	R4,#49407
	SUBC	R5,#197
	JMP	cc_SLE,?C0040
; line 472: 		ENC_ARC10_HO = (long)ENC_ARC10_HO - (long)12960000;
	MOV	R4,#49408
	MOV	R5,#197
	SUB	WORD ENC_ARC10_HO,R4
	SUBC	WORD ENC_ARC10_HO+2,R5
; line 473: //		ENC_ARC10_HO = (long)ENC_ARC10_HO - (long)12959999;			
; line 474: 	}
?C0040:
; line 475: #pragma ASM
; line 476: 
; line 477: 
; line 478: LENC10END:
	LENC10END:
; line 479: 	BSET 	ENC_FLAGS.2
	BSET 	ENC_FLAGS.2
; line 480: #pragma ENDASM
; line 481: // max ~4us
; line 482: }
	POP	CP
	POP	DPP3
	RETI	
; FUNCTION encoder1_0_int (END    RMASK = @0x0030)
	encoder1_0_int  ENDP
; line 483: 
; line 484: 
; line 485: 
; line 486: 
; line 487: void encoder1_1_int (void) interrupt ENCODER1_1_INT = 0x19 using ENCODER11_BANK {

	encoder1_1_int  PROC  INTERRUPT ENCODER1_1_INT = 25 USING ENCODER11_BANK
	GLOBAL  encoder1_1_int
; FUNCTION encoder1_1_int (BEGIN  RMASK = @0x0030)
	SCXT	DPP3,#3
	NOP	
	MOV	ENCODER11_BANK,R0
	SCXT	CP,#ENCODER11_BANK
	NOP	
; line 488: #pragma ASM
; line 489: 	
; line 490: 	jb	P2.9,LENC11HIGH
	jb	P2.9,LENC11HIGH
; line 491: 
; line 492: 	jb	P2.8,LENC11RIGHT
	jb	P2.8,LENC11RIGHT
; line 493: 
; line 494: 	JMPR	cc_UC,LENC11LEFT
	JMPR	cc_UC,LENC11LEFT
; line 495: LENC11HIGH:
	LENC11HIGH:
; line 496: 
; line 497: 	jnb	P2.8,LENC11RIGHT
	jnb	P2.8,LENC11RIGHT
; line 498: 
; line 499: LENC11LEFT:
	LENC11LEFT:
; line 500: 
; line 501: 	BSET	ENC_FLAGS.4
	BSET	ENC_FLAGS.4
; line 502: 
; line 503: #pragma ENDASM
; line 504: 	ENC_ARC10_HO = (long)ENC_ARC10_HO - (long)ARC10PERENCHO;
	MOV	R4,WORD ARC10PERENCHO
	MOV	R5,R4
	ASHR	R5,#15
	SUB	WORD ENC_ARC10_HO,R4
	SUBC	WORD ENC_ARC10_HO+2,R5
; line 505: 	if( ENC_ARC10_HO < (long)0){
	MOV	R4,WORD ENC_ARC10_HO
	MOV	R5,WORD ENC_ARC10_HO+2
	SUB	R4,#0
	SUBC	R5,#0
	JMP	cc_SGE,?C0041
; line 506: 		ENC_ARC10_HO = (long)12960000 + (long)ENC_ARC10_HO;
	MOV	R4,#49408
	MOV	R5,#197
	ADD	WORD ENC_ARC10_HO,R4
	ADDC	WORD ENC_ARC10_HO+2,R5
; line 507: //		ENC_ARC10_HO = (long)12959999 + (long)ENC_ARC10_HO;		
; line 508: 	}
?C0041:
; line 509: #pragma ASM
; line 510: 
; line 511: 	jmpr	cc_UC,LENC11END
	jmpr	cc_UC,LENC11END
; line 512: LENC11RIGHT:
	LENC11RIGHT:
; line 513: 
; line 514: 	BCLR	ENC_FLAGS.4
	BCLR	ENC_FLAGS.4
; line 515: 
; line 516: #pragma ENDASM
; line 517: 	ENC_ARC10_HO = (long)ENC_ARC10_HO + (long)ARC10PERENCHO;
	MOV	R4,WORD ARC10PERENCHO
	MOV	R5,R4
	ASHR	R5,#15
	ADD	WORD ENC_ARC10_HO,R4
	ADDC	WORD ENC_ARC10_HO+2,R5
; line 518: 	if( ENC_ARC10_HO > (long)12959999 ){
	MOV	R4,WORD ENC_ARC10_HO
	MOV	R5,WORD ENC_ARC10_HO+2
	SUB	R4,#49407
	SUBC	R5,#197
	JMP	cc_SLE,?C0042
; line 519: 		ENC_ARC10_HO = (long)ENC_ARC10_HO - (long)12960000;
	MOV	R4,#49408
	MOV	R5,#197
	SUB	WORD ENC_ARC10_HO,R4
	SUBC	WORD ENC_ARC10_HO+2,R5
; line 520: //		ENC_ARC10_HO = (long)ENC_ARC10_HO - (long)12959999;			
; line 521: 	}
?C0042:
; line 522: #pragma ASM
; line 523: 
; line 524: LENC11END:
	LENC11END:
; line 525: 	BSET 	ENC_FLAGS.2
	BSET 	ENC_FLAGS.2
; line 526: #pragma ENDASM
; line 527: 
; line 528: }
	POP	CP
	POP	DPP3
	RETI	
; FUNCTION encoder1_1_int (END    RMASK = @0x0030)
	encoder1_1_int  ENDP
; line 529: 
; line 530: 
; line 531: 
; line 532: 
; line 533: void encoder2_0_int (void) interrupt ENCODER2_0_INT = 0x1A using ENCODER20_BANK {

	encoder2_0_int  PROC  INTERRUPT ENCODER2_0_INT = 26 USING ENCODER20_BANK
	GLOBAL  encoder2_0_int
; FUNCTION encoder2_0_int (BEGIN  RMASK = @0x0030)
	SCXT	DPP3,#3
	NOP	
	MOV	ENCODER20_BANK,R0
	SCXT	CP,#ENCODER20_BANK
	NOP	
; line 534: #pragma ASM
; line 535: 	
; line 536: 	jb	P2.10,LENC20HIGH
	jb	P2.10,LENC20HIGH
; line 537: 
; line 538: 	jb	P2.11,LENC20RIGHT
	jb	P2.11,LENC20RIGHT
; line 539: 
; line 540: 	JMPR	cc_UC,LENC20LEFT
	JMPR	cc_UC,LENC20LEFT
; line 541: LENC20HIGH:
	LENC20HIGH:
; line 542: 
; line 543: 	jnb	P2.11,LENC20RIGHT
	jnb	P2.11,LENC20RIGHT
; line 544: 
; line 545: LENC20LEFT:
	LENC20LEFT:
; line 546: 
; line 547: 	BSET	ENC_FLAGS.5
	BSET	ENC_FLAGS.5
; line 548: 
; line 549: #pragma ENDASM
; line 550: 	ENC_ARC10_VE = (long)ENC_ARC10_VE - (long)ARC10PERENCVE;
	MOV	R4,WORD ARC10PERENCVE
	MOV	R5,R4
	ASHR	R5,#15
	SUB	WORD ENC_ARC10_VE,R4
	SUBC	WORD ENC_ARC10_VE+2,R5
; line 551: #pragma ASM
; line 552: 
; line 553: 	jmpr	cc_UC,LENC20END
	jmpr	cc_UC,LENC20END
; line 554: LENC20RIGHT:
	LENC20RIGHT:
; line 555: 
; line 556: 	BCLR	ENC_FLAGS.5
	BCLR	ENC_FLAGS.5
; line 557: 	
; line 558: #pragma ENDASM
; line 559: 	ENC_ARC10_VE = (long)ENC_ARC10_VE + (long)ARC10PERENCVE;
	MOV	R4,WORD ARC10PERENCVE
	MOV	R5,R4
	ASHR	R5,#15
	ADD	WORD ENC_ARC10_VE,R4
	ADDC	WORD ENC_ARC10_VE+2,R5
; line 560: #pragma ASM
; line 561: 
; line 562: LENC20END:
	LENC20END:
; line 563: 	BSET 	ENC_FLAGS.3
	BSET 	ENC_FLAGS.3
; line 564: #pragma ENDASM
; line 565: 
; line 566: //max 3.2 us
; line 567: }
	POP	CP
	POP	DPP3
	RETI	
; FUNCTION encoder2_0_int (END    RMASK = @0x0030)
	encoder2_0_int  ENDP
; line 568: 
; line 569: 
; line 570: 
; line 571: 
; line 572: void encoder2_1_int (void) interrupt ENCODER2_1_INT = 0x1B using ENCODER21_BANK {

	encoder2_1_int  PROC  INTERRUPT ENCODER2_1_INT = 27 USING ENCODER21_BANK
	GLOBAL  encoder2_1_int
; FUNCTION encoder2_1_int (BEGIN  RMASK = @0x0030)
	SCXT	DPP3,#3
	NOP	
	MOV	ENCODER21_BANK,R0
	SCXT	CP,#ENCODER21_BANK
	NOP	
; line 573: 
; line 574: #pragma ASM
; line 575: 	
; line 576: 	jb	P2.11,LENC21HIGH
	jb	P2.11,LENC21HIGH
; line 577: 
; line 578: 	jnb	P2.10,LENC21RIGHT
	jnb	P2.10,LENC21RIGHT
; line 579: 
; line 580: 	JMPR	cc_UC,LENC21LEFT
	JMPR	cc_UC,LENC21LEFT
; line 581: LENC21HIGH:
	LENC21HIGH:
; line 582: 
; line 583: 	jb	P2.10,LENC21RIGHT
	jb	P2.10,LENC21RIGHT
; line 584: 
; line 585: LENC21LEFT:
	LENC21LEFT:
; line 586: 
; line 587: 	BSET	ENC_FLAGS.5
	BSET	ENC_FLAGS.5
; line 588: 
; line 589: #pragma ENDASM
; line 590: 	ENC_ARC10_VE = (long)ENC_ARC10_VE - (long)ARC10PERENCVE;
	MOV	R4,WORD ARC10PERENCVE
	MOV	R5,R4
	ASHR	R5,#15
	SUB	WORD ENC_ARC10_VE,R4
	SUBC	WORD ENC_ARC10_VE+2,R5
; line 591: #pragma ASM
; line 592: 	jmpr	cc_UC,LENC21END
	jmpr	cc_UC,LENC21END
; line 593: LENC21RIGHT:
	LENC21RIGHT:
; line 594: 
; line 595: 	BCLR	ENC_FLAGS.5
	BCLR	ENC_FLAGS.5
; line 596: 
; line 597: #pragma ENDASM
; line 598: 	ENC_ARC10_VE = (long)ENC_ARC10_VE + (long)ARC10PERENCVE;
	MOV	R4,WORD ARC10PERENCVE
	MOV	R5,R4
	ASHR	R5,#15
	ADD	WORD ENC_ARC10_VE,R4
	ADDC	WORD ENC_ARC10_VE+2,R5
; line 599: #pragma ASM
; line 600: 
; line 601: LENC21END:
	LENC21END:
; line 602: 	BSET 	ENC_FLAGS.3
	BSET 	ENC_FLAGS.3
; line 603: #pragma ENDASM
; line 604: }
	POP	CP
	POP	DPP3
	RETI	
; FUNCTION encoder2_1_int (END    RMASK = @0x0030)
	encoder2_1_int  ENDP
        ?PR?INT  ENDS


; line 605: 
; line 606: 
; line 607: #endif
; line 608: 
; line 609: 
; line 610: 
; line 611: 
; line 612: 
; line 613: 
; line 614: 
; line 615: 

	END
