
_main:

;MyProject.c,23 :: 		void main()
;MyProject.c,25 :: 		lcd_init();
	CALL       _Lcd_Init+0
;MyProject.c,26 :: 		Lcd_Cmd(_LCD_CURSOR_OFF);
	MOVLW      12
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;MyProject.c,28 :: 		trisd=0b00000011;
	MOVLW      3
	MOVWF      TRISD+0
;MyProject.c,29 :: 		trisb=0;
	CLRF       TRISB+0
;MyProject.c,30 :: 		trisc=0;
	CLRF       TRISC+0
;MyProject.c,31 :: 		pwm1_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,32 :: 		pwm2_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,35 :: 		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,36 :: 		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,37 :: 		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,38 :: 		lcd_cmd(_lcd_clear);
	MOVLW      1
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;MyProject.c,39 :: 		option_reg.f0=0;
	BCF        OPTION_REG+0, 0
;MyProject.c,40 :: 		option_reg.f1=0;
	BCF        OPTION_REG+0, 1
;MyProject.c,41 :: 		pwm1_init(1000);
	BSF        T2CON+0, 0
	BCF        T2CON+0, 1
	MOVLW      249
	MOVWF      PR2+0
	CALL       _PWM1_Init+0
;MyProject.c,42 :: 		pwm2_init(1000);
	BSF        T2CON+0, 0
	BCF        T2CON+0, 1
	MOVLW      249
	MOVWF      PR2+0
	CALL       _PWM2_Init+0
;MyProject.c,43 :: 		for(;;){
L_main1:
;MyProject.c,44 :: 		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,45 :: 		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,46 :: 		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,47 :: 		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,48 :: 		if(portd.b0==0) {
	BTFSC      PORTD+0, 0
	GOTO       L_main4
;MyProject.c,49 :: 		pushbutton1=0;
	CLRF       _pushbutton1+0
	CLRF       _pushbutton1+1
;MyProject.c,50 :: 		}
L_main4:
;MyProject.c,51 :: 		if(portd.b0==1){
	BTFSS      PORTD+0, 0
	GOTO       L_main5
;MyProject.c,52 :: 		if(pushbutton1==0)
	MOVLW      0
	XORWF      _pushbutton1+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main27
	MOVLW      0
	XORWF      _pushbutton1+0, 0
L__main27:
	BTFSS      STATUS+0, 2
	GOTO       L_main6
;MyProject.c,53 :: 		{on_state =~on_state;
	MOVLW
	XORWF      _on_state+0, 1
;MyProject.c,54 :: 		pushbutton1=1;
	MOVLW      1
	MOVWF      _pushbutton1+0
	MOVLW      0
	MOVWF      _pushbutton1+1
;MyProject.c,55 :: 		} }
L_main6:
L_main5:
;MyProject.c,56 :: 		if(portd.b1==0) {
	BTFSC      PORTD+0, 1
	GOTO       L_main7
;MyProject.c,57 :: 		pushbutton2=0;
	CLRF       _pushbutton2+0
	CLRF       _pushbutton2+1
;MyProject.c,58 :: 		}
L_main7:
;MyProject.c,60 :: 		if(portd.b1==1) {
	BTFSS      PORTD+0, 1
	GOTO       L_main8
;MyProject.c,61 :: 		if(pushbutton2==0)
	MOVLW      0
	XORWF      _pushbutton2+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main28
	MOVLW      0
	XORWF      _pushbutton2+0, 0
L__main28:
	BTFSS      STATUS+0, 2
	GOTO       L_main9
;MyProject.c,62 :: 		{direction_state =~direction_state;
	MOVLW
	XORWF      _direction_state+0, 1
;MyProject.c,63 :: 		pushbutton2=1;
	MOVLW      1
	MOVWF      _pushbutton2+0
	MOVLW      0
	MOVWF      _pushbutton2+1
;MyProject.c,64 :: 		} }
L_main9:
L_main8:
;MyProject.c,65 :: 		if (  on_state==1)
	BTFSS      _on_state+0, BitPos(_on_state+0)
	GOTO       L_main10
;MyProject.c,66 :: 		{  if ( direction_state==0)
	BTFSC      _direction_state+0, BitPos(_direction_state+0)
	GOTO       L_main11
;MyProject.c,69 :: 		pwm1_start();
	CALL       _PWM1_Start+0
;MyProject.c,70 :: 		pwm1_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,71 :: 		pwm2_stop();
	CALL       _PWM2_Stop+0
;MyProject.c,72 :: 		PORTd.b2=1;
	BSF        PORTD+0, 2
;MyProject.c,73 :: 		PORTd.b3=0;
	BCF        PORTD+0, 3
;MyProject.c,74 :: 		if(var==1||var==2)
	MOVLW      0
	XORWF      _var+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main29
	MOVLW      1
	XORWF      _var+0, 0
L__main29:
	BTFSC      STATUS+0, 2
	GOTO       L__main25
	MOVLW      0
	XORWF      _var+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main30
	MOVLW      2
	XORWF      _var+0, 0
L__main30:
	BTFSC      STATUS+0, 2
	GOTO       L__main25
	GOTO       L_main14
L__main25:
;MyProject.c,75 :: 		{var=0;
	CLRF       _var+0
	CLRF       _var+1
;MyProject.c,76 :: 		lcd_cmd(_lcd_clear);
	MOVLW      1
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;MyProject.c,77 :: 		}
L_main14:
;MyProject.c,78 :: 		lcd_out(1,1,"speed");
	MOVLW      1
	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
;MyProject.c,79 :: 		lcd_out(1,6,txt);
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      6
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      _txt+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;MyProject.c,81 :: 		lcd_out(2,1,"ON,CW");
	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
;MyProject.c,82 :: 		}
L_main11:
;MyProject.c,85 :: 		if (  direction_state==1)
	BTFSS      _direction_state+0, BitPos(_direction_state+0)
	GOTO       L_main15
;MyProject.c,87 :: 		pwm1_stop();
	CALL       _PWM1_Stop+0
;MyProject.c,88 :: 		pwm2_start();
	CALL       _PWM2_Start+0
;MyProject.c,90 :: 		pwm2_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,91 :: 		PORTd.b3=1;
	BSF        PORTD+0, 3
;MyProject.c,92 :: 		PORTd.b2=0;
	BCF        PORTD+0, 2
;MyProject.c,93 :: 		if(var==0||var==2)
	MOVLW      0
	XORWF      _var+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main31
	MOVLW      0
	XORWF      _var+0, 0
L__main31:
	BTFSC      STATUS+0, 2
	GOTO       L__main24
	MOVLW      0
	XORWF      _var+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main32
	MOVLW      2
	XORWF      _var+0, 0
L__main32:
	BTFSC      STATUS+0, 2
	GOTO       L__main24
	GOTO       L_main18
L__main24:
;MyProject.c,94 :: 		{var=1;
	MOVLW      1
	MOVWF      _var+0
	MOVLW      0
	MOVWF      _var+1
;MyProject.c,95 :: 		lcd_cmd(_lcd_clear);
	MOVLW      1
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;MyProject.c,96 :: 		}
L_main18:
;MyProject.c,97 :: 		lcd_out(1,1,"Speed");
	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,98 :: 		lcd_out(1,6,txt);
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      6
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      _txt+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;MyProject.c,100 :: 		lcd_out(2,1,"on, CCW");}
	MOVLW      2
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr6_MyProject+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
L_main15:
;MyProject.c,101 :: 		}
	GOTO       L_main19
L_main10:
;MyProject.c,106 :: 		pwm1_set_duty(0);
	CLRF       FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,107 :: 		pwm2_set_duty(0);
	CLRF       FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;MyProject.c,108 :: 		PORTd.b3=0;
	BCF        PORTD+0, 3
;MyProject.c,109 :: 		PORTd.b2=0;
	BCF        PORTD+0, 2
;MyProject.c,110 :: 		if(var==0|| var==1)
	MOVLW      0
	XORWF      _var+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main33
	MOVLW      0
	XORWF      _var+0, 0
L__main33:
	BTFSC      STATUS+0, 2
	GOTO       L__main23
	MOVLW      0
	XORWF      _var+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main34
	MOVLW      1
	XORWF      _var+0, 0
L__main34:
	BTFSC      STATUS+0, 2
	GOTO       L__main23
	GOTO       L_main22
L__main23:
;MyProject.c,111 :: 		{var=2;
	MOVLW      2
	MOVWF      _var+0
	MOVLW      0
	MOVWF      _var+1
;MyProject.c,112 :: 		lcd_cmd(_lcd_clear);
	MOVLW      1
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;MyProject.c,113 :: 		}
L_main22:
;MyProject.c,114 :: 		lcd_out(1,1,"OFF");
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr7_MyProject+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;MyProject.c,116 :: 		}}}
L_main19:
	GOTO       L_main1
L_end_main:
	GOTO       $+0
; end of _main
