;/////////////////////////////////////////////////////////////////////////////////
;// Code Generator: BoostC Compiler - http://www.sourceboost.com
;// Version       : 7.03
;// License Type  : Pro License
;// Limitations   : PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited
;/////////////////////////////////////////////////////////////////////////////////

	include "P12F675.inc"
; Heap block 0, size:15 (0x00000050 - 0x0000005E)
__HEAP_BLOCK0_BANK               EQU	0x00000000
__HEAP_BLOCK0_START_OFFSET       EQU	0x00000050
__HEAP_BLOCK0_END_OFFSET         EQU	0x0000005E
; Heap block 1, size:0 (0x00000000 - 0x00000000)
__HEAP_BLOCK1_BANK               EQU	0x00000000
__HEAP_BLOCK1_START_OFFSET       EQU	0x00000000
__HEAP_BLOCK1_END_OFFSET         EQU	0x00000000
; Heap block 2, size:0 (0x00000000 - 0x00000000)
__HEAP_BLOCK2_BANK               EQU	0x00000000
__HEAP_BLOCK2_START_OFFSET       EQU	0x00000000
__HEAP_BLOCK2_END_OFFSET         EQU	0x00000000
; Heap block 3, size:0 (0x00000000 - 0x00000000)
__HEAP_BLOCK3_BANK               EQU	0x00000000
__HEAP_BLOCK3_START_OFFSET       EQU	0x00000000
__HEAP_BLOCK3_END_OFFSET         EQU	0x00000000
gbl_status                       EQU	0x00000003 ; bytes:1
gbl_14_LSR                       EQU	0x00000020 ; bytes:4
gbl_float_detect_tininess        EQU	0x0000003D ; bytes:1
gbl_float_rounding_mode          EQU	0x0000003E ; bytes:1
gbl_float_exception_flags        EQU	0x0000003F ; bytes:1
gbl_15_gbl_aSig                  EQU	0x00000024 ; bytes:4
gbl_15_gbl_bSig                  EQU	0x00000028 ; bytes:4
gbl_15_gbl_zSig                  EQU	0x0000002C ; bytes:4
gbl_15_gbl_aExp                  EQU	0x00000040 ; bytes:1
gbl_15_gbl_bExp                  EQU	0x00000041 ; bytes:1
gbl_15_gbl_zExp                  EQU	0x00000037 ; bytes:2
gbl_15_gbl_aSign                 EQU	0x00000042 ; bytes:1
gbl_15_gbl_bSign                 EQU	0x00000043 ; bytes:1
gbl_15_gbl_zSign                 EQU	0x00000044 ; bytes:1
gbl_15_gbl_zSigZero              EQU	0x00000045 ; bytes:1
gbl_15_gbl_ret                   EQU	0x00000030 ; bytes:4
gbl_indf                         EQU	0x00000000 ; bytes:1
gbl_tmr0                         EQU	0x00000001 ; bytes:1
gbl_pcl                          EQU	0x00000002 ; bytes:1
gbl_fsr                          EQU	0x00000004 ; bytes:1
gbl_gpio                         EQU	0x00000005 ; bytes:1
gbl_pclath                       EQU	0x0000000A ; bytes:1
gbl_intcon                       EQU	0x0000000B ; bytes:1
gbl_pir1                         EQU	0x0000000C ; bytes:1
gbl_tmr1l                        EQU	0x0000000E ; bytes:1
gbl_tmr1h                        EQU	0x0000000F ; bytes:1
gbl_t1con                        EQU	0x00000010 ; bytes:1
gbl_cmcon                        EQU	0x00000019 ; bytes:1
gbl_adresh                       EQU	0x0000001E ; bytes:1
gbl_adcon0                       EQU	0x0000001F ; bytes:1
gbl_option_reg                   EQU	0x00000081 ; bytes:1
gbl_trisio                       EQU	0x00000085 ; bytes:1
gbl_pie1                         EQU	0x0000008C ; bytes:1
gbl_pcon                         EQU	0x0000008E ; bytes:1
gbl_osccal                       EQU	0x00000090 ; bytes:1
gbl_wpu                          EQU	0x00000095 ; bytes:1
gbl_ioc                          EQU	0x00000096 ; bytes:1
gbl_iocb                         EQU	0x00000096 ; bytes:1
gbl_vrcon                        EQU	0x00000099 ; bytes:1
gbl_eedata                       EQU	0x0000009A ; bytes:1
gbl_eeadr                        EQU	0x0000009B ; bytes:1
gbl_eecon1                       EQU	0x0000009C ; bytes:1
gbl_eecon2                       EQU	0x0000009D ; bytes:1
gbl_adresl                       EQU	0x0000009E ; bytes:1
gbl_ansel                        EQU	0x0000009F ; bytes:1
gbl_FCV_A1                       EQU	0x00000046 ; bytes:1
gbl_FCV_A                        EQU	0x00000039 ; bytes:2
gbl_old_tris                     EQU	0x00000047 ; bytes:1
gbl_tris_mask                    EQU	0x00000048 ; bytes:1
gbl_tris_reg                     EQU	0x0000003B ; bytes:2
FC_CAL_Ena_00051_arg_Channel     EQU	0x0000004B ; bytes:1
FC_CAL_Ena_00051_arg_Conv_Speed  EQU	0x0000004C ; bytes:1
FC_CAL_Ena_00051_arg_Vref        EQU	0x0000004D ; bytes:1
FC_CAL_Ena_00051_arg_T_Charge    EQU	0x0000004E ; bytes:1
CompTempVar2185                  EQU	0x0000004F ; bytes:1
CompTempVar2186                  EQU	0x0000004F ; bytes:1
CompTempVar2187                  EQU	0x0000004F ; bytes:1
FC_CAL_Sam_00052_arg_Sample_Mode EQU	0x0000004B ; bytes:1
CompTempVarRet2188               EQU	0x0000004E ; bytes:2
FC_CAL_Sam_00052_1_iRetVal       EQU	0x0000004C ; bytes:2
CompTempVar2191                  EQU	0x0000004E ; bytes:1
CompTempVarRet2195               EQU	0x0000004B ; bytes:2
FCD_ADC0_R_00056_1_retVal        EQU	0x00000049 ; bytes:2
CompTempVar2222                  EQU	0x00000049 ; bytes:1
CompTempVar2223                  EQU	0x00000049 ; bytes:1
CompTempVar2224                  EQU	0x00000049 ; bytes:1
CompTempVar2225                  EQU	0x00000049 ; bytes:1
delay_us_00000_arg_del           EQU	0x0000004F ; bytes:1
delay_ms_00000_arg_del           EQU	0x00000049 ; bytes:1
Int1Context                      EQU	0x0000005F ; bytes:1
Int1BContext                     EQU	0x00000034 ; bytes:3
	ORG 0x00000000
	GOTO	_startup
	ORG 0x00000004
	MOVWF Int1Context
	SWAPF STATUS, W
	BCF STATUS, RP0
	MOVWF Int1BContext
	SWAPF PCLATH, W
	MOVWF Int1BContext+D'1'
	SWAPF FSR, W
	MOVWF Int1BContext+D'2'
	BCF PCLATH,3
	BCF PCLATH,4
	GOTO	interrupt
	ORG 0x00000010
delay_us_00000
; { delay_us ; function begin
label1
	NOP
	NOP
	DECFSZ delay_us_00000_arg_del, F
	GOTO	label1
	RETURN
; } delay_us function end

	ORG 0x00000015
delay_ms_00000
; { delay_ms ; function begin
	MOVF delay_ms_00000_arg_del, F
	BTFSS STATUS,Z
	GOTO	label2
	RETURN
label2
	MOVLW 0xF5
label3
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	ADDLW 0xFF
	BTFSS STATUS,Z
	GOTO	label3
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	DECFSZ delay_ms_00000_arg_del, F
	GOTO	label2
	RETURN
; } delay_ms function end

	ORG 0x0000003D
FC_CAL_Sam_00052
; { FC_CAL_Sample_ADC ; function begin
	MOVLW 0x02
	IORWF gbl_adcon0, W
	MOVWF gbl_adcon0
label4
	BTFSC gbl_adcon0,1
	GOTO	label4
	MOVF FC_CAL_Sam_00052_arg_Sample_Mode, F
	BTFSC STATUS,Z
	GOTO	label5
	MOVF gbl_adresh, W
	MOVWF FC_CAL_Sam_00052_1_iRetVal
	CLRF FC_CAL_Sam_00052_1_iRetVal+D'1'
	RLF FC_CAL_Sam_00052_1_iRetVal, F
	RLF FC_CAL_Sam_00052_1_iRetVal+D'1', F
	RLF FC_CAL_Sam_00052_1_iRetVal, F
	RLF FC_CAL_Sam_00052_1_iRetVal+D'1', F
	MOVLW 0xFC
	ANDWF FC_CAL_Sam_00052_1_iRetVal, F
	BSF STATUS, RP0
	RRF gbl_adresl, W
	BCF STATUS, RP0
	MOVWF CompTempVar2191
	RRF CompTempVar2191, F
	SWAPF CompTempVar2191, F
	MOVLW 0x03
	ANDWF CompTempVar2191, W
	IORWF FC_CAL_Sam_00052_1_iRetVal, F
	MOVF FC_CAL_Sam_00052_1_iRetVal+D'1', F
	GOTO	label6
label5
	MOVF gbl_adresh, W
	MOVWF FC_CAL_Sam_00052_1_iRetVal
	CLRF FC_CAL_Sam_00052_1_iRetVal+D'1'
label6
	MOVF FC_CAL_Sam_00052_1_iRetVal, W
	MOVWF CompTempVarRet2188
	MOVF FC_CAL_Sam_00052_1_iRetVal+D'1', W
	MOVWF CompTempVarRet2188+D'1'
	RETURN
; } FC_CAL_Sample_ADC function end

	ORG 0x00000061
FC_CAL_Ena_00051
; { FC_CAL_Enable_ADC ; function begin
	MOVLW HIGH(gbl_trisio+D'0')
	MOVWF gbl_tris_reg+D'1'
	MOVLW LOW(gbl_trisio+D'0')
	MOVWF gbl_tris_reg
	MOVF FC_CAL_Ena_00051_arg_Channel, W
	XORLW 0x01
	BTFSS STATUS,Z
	GOTO	label7
	MOVLW 0x02
	MOVWF gbl_tris_mask
	BSF STATUS, RP0
	MOVWF gbl_ansel
label7
	MOVLW 0x07
	BCF STATUS, RP0
	ANDWF FC_CAL_Ena_00051_arg_Conv_Speed, W
	MOVWF CompTempVar2185
	SWAPF CompTempVar2185, W
	ANDLW 0xF0
	BSF STATUS, RP0
	IORWF gbl_ansel, W
	MOVWF gbl_ansel
	BCF STATUS, RP0
	MOVF gbl_tris_reg, W
	MOVWF FSR
	MOVF INDF, W
	MOVWF gbl_old_tris
	MOVF gbl_tris_mask, W
	IORWF gbl_old_tris, W
	MOVWF CompTempVar2186
	MOVWF INDF
	MOVF FC_CAL_Ena_00051_arg_Channel, W
	MOVWF CompTempVar2187
	RLF CompTempVar2187, F
	RLF CompTempVar2187, F
	MOVLW 0xFC
	ANDWF CompTempVar2187, W
	IORLW 0x01
	MOVWF gbl_adcon0
	DECF FC_CAL_Ena_00051_arg_Vref, W
	BTFSC STATUS,Z
	BSF gbl_adcon0,6
	MOVF FC_CAL_Ena_00051_arg_T_Charge, W
	MOVWF delay_us_00000_arg_del
	CALL delay_us_00000
	RETURN
; } FC_CAL_Enable_ADC function end

	ORG 0x0000008E
FC_CAL_Dis_00053
; { FC_CAL_Disable_ADC ; function begin
	BCF STATUS, RP0
	MOVF gbl_tris_reg, W
	MOVWF FSR
	MOVF gbl_old_tris, W
	MOVWF INDF
	BSF STATUS, RP0
	CLRF gbl_ansel
	BCF STATUS, RP0
	CLRF gbl_adcon0
	RETURN
; } FC_CAL_Disable_ADC function end

	ORG 0x00000098
FCD_ADC0_R_00056
; { FCD_ADC0_ReadAsInt ; function begin
	MOVLW 0x01
	BCF STATUS, RP0
	MOVWF FC_CAL_Ena_00051_arg_Channel
	MOVLW 0x03
	MOVWF FC_CAL_Ena_00051_arg_Conv_Speed
	CLRF FC_CAL_Ena_00051_arg_Vref
	MOVLW 0x28
	MOVWF FC_CAL_Ena_00051_arg_T_Charge
	CALL FC_CAL_Ena_00051
	MOVLW 0x01
	MOVWF FC_CAL_Sam_00052_arg_Sample_Mode
	CALL FC_CAL_Sam_00052
	MOVF CompTempVarRet2188, W
	MOVWF FCD_ADC0_R_00056_1_retVal
	MOVF CompTempVarRet2188+D'1', W
	MOVWF FCD_ADC0_R_00056_1_retVal+D'1'
	CALL FC_CAL_Dis_00053
	MOVF FCD_ADC0_R_00056_1_retVal, W
	MOVWF CompTempVarRet2195
	MOVF FCD_ADC0_R_00056_1_retVal+D'1', W
	MOVWF CompTempVarRet2195+D'1'
	RETURN
; } FCD_ADC0_ReadAsInt function end

	ORG 0x000000AE
main
; { main ; function begin
	MOVLW 0x20
	BSF STATUS, RP0
	MOVWF gbl_ansel
	MOVLW 0x07
	BCF STATUS, RP0
	MOVWF gbl_cmcon
	MOVLW 0xC0
	BSF STATUS, RP0
	MOVWF gbl_option_reg
label8
	CALL FCD_ADC0_R_00056
	MOVF CompTempVarRet2195, W
	MOVWF gbl_FCV_A
	MOVF CompTempVarRet2195+D'1', W
	MOVWF gbl_FCV_A+D'1'
	MOVLW 0x80
	MOVWF CompTempVar2222
	MOVF gbl_FCV_A+D'1', W
	XORLW 0x80
	SUBWF CompTempVar2222, W
	MOVF gbl_FCV_A, W
	MOVF gbl_FCV_A+D'1', F
	BTFSC STATUS,Z
	SUBLW 0xFF
	BTFSS STATUS,C
	GOTO	label13
	MOVLW 0x01
	MOVWF gbl_FCV_A1
	MOVLW 0xFE
	BSF STATUS, RP0
	ANDWF gbl_trisio, W
	MOVWF gbl_trisio
	BCF STATUS, RP0
	MOVF gbl_FCV_A1, F
	BTFSC STATUS,Z
	GOTO	label9
	MOVLW 0xFE
	ANDWF gbl_gpio, W
	MOVWF CompTempVar2223
	MOVLW 0x01
	IORWF CompTempVar2223, W
	MOVWF gbl_gpio
	GOTO	label10
label9
	MOVLW 0xFE
	ANDWF gbl_gpio, W
	MOVWF gbl_gpio
label10
	MOVLW 0x78
	MOVWF delay_ms_00000_arg_del
	CALL delay_ms_00000
	CLRF gbl_FCV_A1
	MOVLW 0xFE
	BSF STATUS, RP0
	ANDWF gbl_trisio, W
	MOVWF gbl_trisio
	BCF STATUS, RP0
	MOVF gbl_FCV_A1, F
	BTFSC STATUS,Z
	GOTO	label11
	MOVLW 0xFE
	ANDWF gbl_gpio, W
	MOVWF CompTempVar2224
	MOVLW 0x01
	IORWF CompTempVar2224, W
	MOVWF gbl_gpio
	GOTO	label12
label11
	MOVLW 0xFE
	ANDWF gbl_gpio, W
	MOVWF gbl_gpio
label12
	MOVLW 0x78
	MOVWF delay_ms_00000_arg_del
	CALL delay_ms_00000
	GOTO	label8
label13
	CLRF gbl_FCV_A1
	MOVLW 0xFE
	BSF STATUS, RP0
	ANDWF gbl_trisio, W
	MOVWF gbl_trisio
	BCF STATUS, RP0
	MOVF gbl_FCV_A1, F
	BTFSC STATUS,Z
	GOTO	label14
	MOVLW 0xFE
	ANDWF gbl_gpio, W
	MOVWF CompTempVar2225
	MOVLW 0x01
	IORWF CompTempVar2225, W
	MOVWF gbl_gpio
	GOTO	label8
label14
	MOVLW 0xFE
	ANDWF gbl_gpio, W
	MOVWF gbl_gpio
	GOTO	label8
; } main function end

	ORG 0x00000109
_startup
	MOVLW 0xD5
	BCF STATUS, RP0
	MOVWF gbl_14_LSR
	MOVLW 0xC4
	MOVWF gbl_14_LSR+D'1'
	MOVLW 0xBB
	MOVWF gbl_14_LSR+D'2'
	MOVLW 0xDC
	MOVWF gbl_14_LSR+D'3'
	CLRF gbl_15_gbl_aSig
	CLRF gbl_15_gbl_aSig+D'1'
	CLRF gbl_15_gbl_aSig+D'2'
	CLRF gbl_15_gbl_aSig+D'3'
	CLRF gbl_15_gbl_bSig
	CLRF gbl_15_gbl_bSig+D'1'
	CLRF gbl_15_gbl_bSig+D'2'
	CLRF gbl_15_gbl_bSig+D'3'
	CLRF gbl_15_gbl_zSig
	CLRF gbl_15_gbl_zSig+D'1'
	CLRF gbl_15_gbl_zSig+D'2'
	CLRF gbl_15_gbl_zSig+D'3'
	CLRF gbl_15_gbl_aExp
	CLRF gbl_15_gbl_bExp
	CLRF gbl_15_gbl_zExp
	CLRF gbl_15_gbl_zExp+D'1'
	CLRF gbl_15_gbl_aSign
	CLRF gbl_15_gbl_bSign
	CLRF gbl_15_gbl_zSign
	CLRF gbl_15_gbl_zSigZero
	CLRF gbl_15_gbl_ret
	CLRF gbl_15_gbl_ret+D'1'
	CLRF gbl_15_gbl_ret+D'2'
	CLRF gbl_15_gbl_ret+D'3'
	CLRF gbl_float_rounding_mode
	CLRF gbl_float_exception_flags
	CLRF gbl_float_detect_tininess
	BCF PCLATH,3
	BCF PCLATH,4
	GOTO	main
	ORG 0x00000130
interrupt
; { interrupt ; function begin
	BCF STATUS, RP0
	SWAPF Int1BContext+D'2', W
	MOVWF FSR
	SWAPF Int1BContext+D'1', W
	MOVWF PCLATH
	SWAPF Int1BContext, W
	MOVWF STATUS
	SWAPF Int1Context, F
	SWAPF Int1Context, W
	RETFIE
; } interrupt function end

	ORG 0x00002007
	DW 0x3F95
	END
