
_main:

;MyProject.c,21 :: 		void main()
;MyProject.c,23 :: 		lcd_init();
	CALL       _Lcd_Init+0
;MyProject.c,24 :: 		Lcd_Cmd(_LCD_CURSOR_OFF);
	MOVLW      12
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;MyProject.c,25 :: 		pwm1_init(1000);
	BSF        T2CON+0, 0
	BCF        T2CON+0, 1
	MOVLW      249
	MOVWF      PR2+0
	CALL       _PWM1_Init+0
;MyProject.c,26 :: 		pwm2_init(1000);
	BSF        T2CON+0, 0
	BCF        T2CON+0, 1
	MOVLW      249
	MOVWF      PR2+0
	CALL       _PWM2_Init+0
;MyProject.c,27 :: 		pwm1_start();
	CALL       _PWM1_Start+0
;MyProject.c,28 :: 		pwm1_start();
	CALL       _PWM1_Start+0
;MyProject.c,29 :: 		pwm1_set_duty(0);
	CLRF       FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,30 :: 		pwm2_set_duty(0);
	CLRF       FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,31 :: 		trisd=0b00000011;
	MOVLW      3
	MOVWF      TRISD+0
;MyProject.c,32 :: 		trisb=0;
	CLRF       TRISB+0
;MyProject.c,34 :: 		lcd_out(1,1,"Iman_Abu_Ayyash");
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr1_MyProject+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;MyProject.c,35 :: 		lcd_out(2,1,"1111568");
	MOVLW      2
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr2_MyProject+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;MyProject.c,36 :: 		delay_ms(5000);
	MOVLW      26
	MOVWF      R11+0
	MOVLW      94
	MOVWF      R12+0
	MOVLW      110
	MOVWF      R13+0
L_main0:
	DECFSZ     R13+0, 1
	GOTO       L_main0
	DECFSZ     R12+0, 1
	GOTO       L_main0
	DECFSZ     R11+0, 1
	GOTO       L_main0
	NOP
;MyProject.c,37 :: 		lcd_cmd(_lcd_clear);
	MOVLW      1
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;MyProject.c,40 :: 		while(1)
L_main1:
;MyProject.c,42 :: 		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,43 :: 		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,44 :: 		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,45 :: 		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,47 :: 		if(portd.b0==1){
	BTFSS      PORTD+0, 0
	GOTO       L_main3
;MyProject.c,48 :: 		on_state = ~ on_state ;
	MOVLW
	XORWF      _on_state+0, 1
;MyProject.c,49 :: 		}
L_main3:
;MyProject.c,50 :: 		if(portd.b1=1){
	BSF        PORTD+0, 1
	BTFSS      PORTD+0, 1
	GOTO       L_main4
;MyProject.c,51 :: 		direction_state = ~ direction_state ;
	MOVLW
	XORWF      _direction_state+0, 1
;MyProject.c,52 :: 		}
L_main4:
;MyProject.c,54 :: 		if(on_state==1)
	BTFSS      _on_state+0, BitPos(_on_state+0)
	GOTO       L_main5
;MyProject.c,55 :: 		{ if(direction_state ==1){
	BTFSS      _direction_state+0, BitPos(_direction_state+0)
	GOTO       L_main6
;MyProject.c,56 :: 		pwm1_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,57 :: 		pwm2_set_duty(0);
	CLRF       FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,58 :: 		PORTd.b2=1;
	BSF        PORTD+0, 2
;MyProject.c,59 :: 		lcd_out(1,1,txt );
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      _txt+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;MyProject.c,60 :: 		lcd_out(2,1,"on,cw");}
	MOVLW      2
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr3_MyProject+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
L_main6:
;MyProject.c,63 :: 		if(direction_state ==0){
	BTFSC      _direction_state+0, BitPos(_direction_state+0)
	GOTO       L_main7
;MyProject.c,65 :: 		pwm1_set_duty(0);
	CLRF       FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,66 :: 		pwm2_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,67 :: 		PORTd.b3=1;
	BSF        PORTD+0, 3
;MyProject.c,69 :: 		lcd_out(1,1,txt);
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      _txt+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;MyProject.c,70 :: 		lcd_out(2,1,"on, ccw");}
	MOVLW      2
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr4_MyProject+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
L_main7:
;MyProject.c,71 :: 		}
	GOTO       L_main8
L_main5:
;MyProject.c,73 :: 		pwm1_set_duty(0);
	CLRF       FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,74 :: 		pwm2_set_duty(0);
	CLRF       FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,75 :: 		lcd_out(1,1,"off");
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr5_MyProject+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;MyProject.c,76 :: 		}}}
L_main8:
	GOTO       L_main1
L_end_main:
	GOTO       $+0
; end of _main
