
_main:

;MyProject.c,20 :: 		void main()
;MyProject.c,24 :: 		lcd_init();
	CALL       _Lcd_Init+0
;MyProject.c,25 :: 		Lcd_Cmd(_LCD_CURSOR_OFF);
	MOVLW      12
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;MyProject.c,28 :: 		pwm1_set_duty(0);
	CLRF       FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,29 :: 		pwm2_set_duty(0);
	CLRF       FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,30 :: 		trisd=0b00000011;
	MOVLW      3
	MOVWF      TRISD+0
;MyProject.c,31 :: 		trisb=0;
	CLRF       TRISB+0
;MyProject.c,33 :: 		while(1)
L_main0:
;MyProject.c,35 :: 		x= ADC_Read(0);
	CLRF       FARG_ADC_Read_channel+0
	CALL       _ADC_Read+0
	MOVF       R0+0, 0
	MOVWF      _x+0
	MOVF       R0+1, 0
	MOVWF      _x+1
;MyProject.c,36 :: 		duty=x/4;
	MOVF       R0+0, 0
	MOVWF      R4+0
	MOVF       R0+1, 0
	MOVWF      R4+1
	RRF        R4+1, 1
	RRF        R4+0, 1
	BCF        R4+1, 7
	BTFSC      R4+1, 6
	BSF        R4+1, 7
	RRF        R4+1, 1
	RRF        R4+0, 1
	BCF        R4+1, 7
	BTFSC      R4+1, 6
	BSF        R4+1, 7
	MOVF       R4+0, 0
	MOVWF      _duty+0
	MOVF       R4+1, 0
	MOVWF      _duty+1
;MyProject.c,37 :: 		v=(duty/2.55);
	MOVF       R4+0, 0
	MOVWF      R0+0
	MOVF       R4+1, 0
	MOVWF      R0+1
	CALL       _Int2Double+0
	MOVLW      51
	MOVWF      R4+0
	MOVLW      51
	MOVWF      R4+1
	MOVLW      35
	MOVWF      R4+2
	MOVLW      128
	MOVWF      R4+3
	CALL       _Div_32x32_FP+0
	CALL       _Double2Int+0
	MOVF       R0+0, 0
	MOVWF      _v+0
	MOVF       R0+1, 0
	MOVWF      _v+1
;MyProject.c,38 :: 		intTostr(v,txt);
	MOVF       R0+0, 0
	MOVWF      FARG_IntToStr_input+0
	MOVF       R0+1, 0
	MOVWF      FARG_IntToStr_input+1
	MOVLW      _txt+0
	MOVWF      FARG_IntToStr_output+0
	CALL       _IntToStr+0
;MyProject.c,40 :: 		if(portd.b0==1)
	BTFSS      PORTD+0, 0
	GOTO       L_main2
;MyProject.c,42 :: 		on_state=~on_state;
	MOVLW
	XORWF      _on_state+0, 1
;MyProject.c,43 :: 		}
L_main2:
;MyProject.c,45 :: 		if(portd.b1==1)
	BTFSS      PORTD+0, 1
	GOTO       L_main3
;MyProject.c,47 :: 		direction_state=~direction_state;
	MOVLW
	XORWF      _direction_state+0, 1
;MyProject.c,48 :: 		}
L_main3:
;MyProject.c,49 :: 		if ( direction_state==1)
	BTFSS      _direction_state+0, BitPos(_direction_state+0)
	GOTO       L_main4
;MyProject.c,50 :: 		{if(on_state==0)
	BTFSC      _on_state+0, BitPos(_on_state+0)
	GOTO       L_main5
;MyProject.c,51 :: 		{pwm2_init(1000);
	BSF        T2CON+0, 0
	BCF        T2CON+0, 1
	MOVLW      249
	MOVWF      PR2+0
	CALL       _PWM2_Init+0
;MyProject.c,53 :: 		pwm2_start();
	CALL       _PWM2_Start+0
;MyProject.c,54 :: 		pwm1_set_duty(0);
	CLRF       FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,55 :: 		pwm2_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,56 :: 		}
L_main5:
;MyProject.c,57 :: 		if (on_state==1){
	BTFSS      _on_state+0, BitPos(_on_state+0)
	GOTO       L_main6
;MyProject.c,58 :: 		pwm1_init(1000);
	BSF        T2CON+0, 0
	BCF        T2CON+0, 1
	MOVLW      249
	MOVWF      PR2+0
	CALL       _PWM1_Init+0
;MyProject.c,59 :: 		pwm1_start();
	CALL       _PWM1_Start+0
;MyProject.c,61 :: 		pwm1_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,62 :: 		pwm2_set_duty(0);
	CLRF       FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,63 :: 		}
	GOTO       L_main7
L_main6:
;MyProject.c,66 :: 		{ pwm1_set_duty (0);
	CLRF       FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,67 :: 		pwm2_set_duty(0);
	CLRF       FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,68 :: 		} }  }    }
L_main7:
L_main4:
	GOTO       L_main0
L_end_main:
	GOTO       $+0
; end of _main
