; Generated by holtek-gcc v3.20, Fri Aug 28 11:21:43 2020
; 
; Configuration:
;       with long instruction
;       Multi-ROM, Multi-RAM
;       bits_per_rom_unit:16
;       with mp1
;       with tbhp, address(0x9)
;          Use tabrd-const
;       
; SFR address of long-instruction arch:
;    mp0 = -1,1,0
;    mp1 = 4,3,2
;    mp2 = 14,13,12
;    tbp = 9,7,8
;    acc = 5
;    pcl = 6
;    status = 10
;    bp = 11
;    intc = 16
;       
;       
; use 'tabrdc' instead of 'tabrd'
;       

#pragma translator "holtek-gcc 4.6.4" "3.20" "build 20130711"
; Rebuild 610

ir equ [2]
mp equ [3]
sbp equ [4]
acc equ [5]
bp equ [11]
tblp equ [7]
tbhp equ [9]
status equ [10]
c equ [10].0
ac equ [10].1
z equ [10].2
ov equ [10].3
cz equ [10].6
sc equ [10].7
intc equ [16]
mduwr0 equ [59h]
mduwr1 equ [5ah]
mduwr2 equ [5bh]
mduwr3 equ [5ch]
mduwr4 equ [5dh]
mduwr5 equ [5eh]
mduwrctrl equ [5fh]

extern ra:byte
extern rb:byte
extern rc:byte
extern rd:byte
extern re:byte
extern rf:byte
extern rg:byte
extern rh:byte
extern _Crom2Prom:near
extern _Crom2PromNext:near

RAMBANK 0 @BITDATASEC, @BITDATASEC1
@HCCINIT	.section 'data'
@HCCINIT0	.section 'data'
@BITDATASEC	 .section 'data'
@BITDATASEC1	 .section 'data'

#pragma debug scope 1 1
	extern __DELAY3:near
	extern __DELAYX3:near
	extern __DELAYX6:near
	extern __DELAYY5:near
	extern __DELAYY3:near
	extern _builtin_holtek_delay_2:byte
___sadc0 equ [105]
___sadc2 equ [107]
___sadc1 equ [106]
___pcs0 equ [338]
___pcs1 equ [339]
___pds0 equ [340]
___pas0 equ [334]
___pas1 equ [335]
___sadol equ [103]
___sadoh equ [104]
public _Drv_GetADC
#pragma debug scope 2 1
#line 26 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
_Drv_GetADC .section 'code'
_Drv_GetADC proc
    local _Drv_GetADC_2 db 1 dup(?)	; 0,1
	mov _Drv_GetADC_2[0],a
#pragma debug variable 8 2 _Drv_GetADC_2+0 "channel"
#line 27 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	set [105].4
#line 28 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	set [105].5
#line 29 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	clr [107].3
	clr [107].3
#line 30 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	set [106].2
	clr [106].1
	set [106].0
#line 31 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,_Drv_GetADC_2[0]
	sub a,0
	sz z
	jmp _L3
	sub a,(1)-(0)
	sz z
	jmp _L4
#line 31 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,_Drv_GetADC_2[0]
	sub a,2
	sz z
	jmp _L5
	sub a,(3)-(2)
	sz z
	jmp _L6
	mov a,_Drv_GetADC_2[0]
	sub a,4
	sz z
	jmp _L7
	sub a,(5)-(4)
	sz z
	jmp _L8
	mov a,_Drv_GetADC_2[0]
	sub a,6
	sz z
	jmp _L9
	sub a,(7)-(6)
	sz z
	jmp _L10
	mov a,_Drv_GetADC_2[0]
	sub a,8
	sz z
	jmp _L11
	sub a,(9)-(8)
	sz z
	jmp _L12
	mov a,_Drv_GetADC_2[0]
	sub a,10
	sz z
	jmp _L13
	sub a,(11)-(10)
	sz z
	jmp _L14
	mov a,_Drv_GetADC_2[0]
	sub a,12
	sz z
	jmp _L15
	sub a,(13)-(12)
	sz z
	jmp _L16
	mov a,_Drv_GetADC_2[0]
	sub a,14
	sz z
	jmp _L17
	sub a,(15)-(14)
	sz z
	jmp _L18
	mov a,_Drv_GetADC_2[0]
	sub a,16
	sz z
	jmp _L19
	sub a,(17)-(16)
	sz z
	jmp _L20
	mov a,_Drv_GetADC_2[0]
	sub a,18
	sz z
	jmp _L21
	sub a,(19)-(18)
	sz z
	jmp _L22
	mov a,_Drv_GetADC_2[0]
	sub a,20
	snz z
	jmp _L2
#line 53 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	set [106].7
	jmp _L26
_L3:
#line 33 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	lset [338].1
	lclr [338].0
	jmp _L2
_L4:
#line 34 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	set [105].0
	lset [338].3
	lclr [338].2
	jmp _L2
_L5:
#line 35 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	set [105].1
	lclr [338].5
	lset [338].4
	jmp _L2
_L6:
#line 36 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,3
	orm a,[105]
	lset [338].7
	lclr [338].6
	jmp _L2
_L7:
#line 37 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	set [105].2
	lclr [339].1
	lset [339].0
	jmp _L2
_L8:
#line 38 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,5
	orm a,[105]
	lset [339].3
	lclr [339].2
	jmp _L2
_L9:
#line 39 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,6
	orm a,[105]
	lclr [339].5
	lset [339].4
	jmp _L2
_L10:
#line 40 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,7
	orm a,[105]
	lset [339].7
	lclr [339].6
	jmp _L2
_L11:
#line 41 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	set [105].3
	lset [340].1
	lclr [340].0
	jmp _L2
_L12:
#line 42 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,9
	orm a,[105]
	lset [340].3
	lclr [340].2
	jmp _L2
_L13:
#line 43 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,12
	orm a,[105]
	lset [334].3
	lclr [334].2
	jmp _L2
_L14:
#line 44 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,13
	orm a,[105]
	lset [334].7
	lclr [334].6
	jmp _L2
_L15:
#line 45 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,14
	orm a,[105]
	lset [335].1
	lclr [335].0
	jmp _L2
_L16:
#line 46 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,15
	orm a,[105]
	lset [335].3
	lclr [335].2
	jmp _L2
_L17:
#line 47 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	set [106].4
	jmp _L26
_L18:
#line 48 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	set [106].5
	jmp _L26
_L19:
#line 49 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,48
	orm a,[106]
	jmp _L26
_L20:
#line 50 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,80
	orm a,[106]
	jmp _L26
_L21:
#line 51 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,96
	orm a,[106]
	jmp _L26
_L22:
#line 52 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,112
	orm a,[106]
_L26:
#line 53 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,240
	andm a,[105]
_L2:
#line 56 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	clr [105].7
	set [105].7
	clr [105].7
_L25:
#line 57 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	sz [105].6
	jmp _L25
#line 59 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,[103]
	mov rb,a
	clr rc
#line 60 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,[104]
	mov rd,a
#line 61 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	clr [105].5
#line 60 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	rrca intc
	clr intc.0
	mov a,rd
	mov mduwr0,a
	mov a,0
	mov mduwr4,a
	clr mduwr1
	mov a,1
	mov mduwr5,a
	mov a,6
_LI1:
	sdz acc
	jmp _LI1
	mov a,mduwr0
	mov rd,a
	mov a,mduwr1
	mov re,a
	sz c
	set intc.0
#line 63 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,rb
	add a,rd
	mov ra,a
	mov a,rc
	adc a,re
	mov rb,a
	ret
_Drv_GetADC endp
#line 63 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
#pragma debug scope 1 1
public _Drv_GetADC_AVGn
#pragma debug scope 3 1
#line 72 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
_Drv_GetADC_AVGn .section 'code'
_Drv_GetADC_AVGn proc
public _Drv_GetADC_AVGn_2
    local _Drv_GetADC_AVGn_2 db 10 dup(?)	; 1,9
	mov _Drv_GetADC_AVGn_2[3],a
#pragma debug variable 8 3 _Drv_GetADC_AVGn_2+3 "channel"
#pragma debug variable 8 3 _Drv_GetADC_AVGn_2+0 "Cnt"
#pragma debug variable 12 3 _Drv_GetADC_AVGn_2+1 "AdcData"
#pragma debug variable 12 3 _Drv_GetADC_AVGn_2+4 "ADCData_Min"
#line 73 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	set [105].4
#line 74 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	set [105].5
#line 75 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	clr [107].3
	clr [107].3
#line 76 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	set [106].2
	clr [106].1
	set [106].0
#line 77 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,_Drv_GetADC_AVGn_2[3]
	sub a,0
	sz z
	jmp _L30
	sub a,(1)-(0)
	sz z
	jmp _L31
#line 77 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,_Drv_GetADC_AVGn_2[3]
	sub a,2
	sz z
	jmp _L32
	sub a,(3)-(2)
	sz z
	jmp _L33
	mov a,_Drv_GetADC_AVGn_2[3]
	sub a,4
	sz z
	jmp _L34
	sub a,(5)-(4)
	sz z
	jmp _L35
	mov a,_Drv_GetADC_AVGn_2[3]
	sub a,6
	sz z
	jmp _L36
	sub a,(7)-(6)
	sz z
	jmp _L37
	mov a,_Drv_GetADC_AVGn_2[3]
	sub a,8
	sz z
	jmp _L38
	sub a,(9)-(8)
	sz z
	jmp _L39
	mov a,_Drv_GetADC_AVGn_2[3]
	sub a,10
	sz z
	jmp _L40
	sub a,(11)-(10)
	sz z
	jmp _L41
	mov a,_Drv_GetADC_AVGn_2[3]
	sub a,12
	sz z
	jmp _L42
	sub a,(13)-(12)
	sz z
	jmp _L43
	mov a,_Drv_GetADC_AVGn_2[3]
	sub a,14
	sz z
	jmp _L44
	sub a,(15)-(14)
	sz z
	jmp _L45
	mov a,_Drv_GetADC_AVGn_2[3]
	sub a,16
	sz z
	jmp _L46
	sub a,(17)-(16)
	sz z
	jmp _L47
	mov a,_Drv_GetADC_AVGn_2[3]
	sub a,18
	sz z
	jmp _L48
	sub a,(19)-(18)
	sz z
	jmp _L49
	mov a,_Drv_GetADC_AVGn_2[3]
	sub a,20
	snz z
	jmp _L29
	jmp _L58
_L30:
#line 79 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	lset [338].1
	lclr [338].0
_L29:
#line 72 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	set _Drv_GetADC_AVGn_2[4]
	set _Drv_GetADC_AVGn_2[5]
	clr rb
	clr rc
	clr rd
	clr re
	clr rf
	clr rg
	clr ra
	jmp _L51
_L31:
#line 80 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	set [105].0
	lset [338].3
	lclr [338].2
	jmp _L29
_L32:
#line 81 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	set [105].1
	lclr [338].5
	lset [338].4
	jmp _L29
_L33:
#line 82 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,3
	orm a,[105]
	lset [338].7
	lclr [338].6
	jmp _L29
_L34:
#line 83 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	set [105].2
	lclr [339].1
	lset [339].0
	jmp _L29
_L35:
#line 84 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,5
	orm a,[105]
	lset [339].3
	lclr [339].2
	jmp _L29
_L36:
#line 85 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,6
	orm a,[105]
	lclr [339].5
	lset [339].4
	jmp _L29
_L37:
#line 86 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,7
	orm a,[105]
	lset [339].7
	lclr [339].6
	jmp _L29
_L38:
#line 87 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	set [105].3
	lset [340].1
	lclr [340].0
	jmp _L29
_L39:
#line 88 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,9
	orm a,[105]
	lset [340].3
	lclr [340].2
	jmp _L29
_L40:
#line 89 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,12
	orm a,[105]
	lset [334].3
	lclr [334].2
	jmp _L29
_L41:
#line 90 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,13
	orm a,[105]
	lset [334].7
	lclr [334].6
	jmp _L29
_L42:
#line 91 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,14
	orm a,[105]
	lset [335].1
	lclr [335].0
	jmp _L29
_L43:
#line 92 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,240
	andm a,[105]
	mov a,15
	orm a,[105]
	lset [335].3
	lclr [335].2
	jmp _L29
_L44:
#line 93 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	set [106].4
	jmp _L57
_L45:
#line 94 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	set [106].5
_L57:
	mov a,240
	andm a,[105]
	jmp _L29
_L46:
#line 95 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,48
	orm a,[106]
	jmp _L57
_L47:
#line 96 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,80
	orm a,[106]
	jmp _L57
_L48:
#line 97 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,96
	orm a,[106]
	jmp _L57
_L49:
#line 98 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	mov a,112
	orm a,[106]
	jmp _L57
_L58:
#line 99 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,7
	andm a,[106]
	set [106].7
	jmp _L57
_L53:
#line 112 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	sz [105].6
	jmp _L53
#line 113 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,[103]
	mov _Drv_GetADC_AVGn_2[1],a
	clr _Drv_GetADC_AVGn_2[2]
#line 114 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	rrca intc
	clr intc.0
	mov a,[104]
	mov mduwr0,a
	mov a,0
	mov mduwr4,a
	clr mduwr1
	mov a,1
	mov mduwr5,a
	mov a,6
_LI2:
	sdz acc
	jmp _LI2
	mov a,mduwr0
	mov _Drv_GetADC_AVGn_2[8],a
	mov a,mduwr1
	mov _Drv_GetADC_AVGn_2[9],a
	sz c
	set intc.0
	mov a,_Drv_GetADC_AVGn_2[8]
	addm a,_Drv_GetADC_AVGn_2[1]
	mov a,_Drv_GetADC_AVGn_2[9]
	adcm a,_Drv_GetADC_AVGn_2[2]
#line 115 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,_Drv_GetADC_AVGn_2[1]
	addm a,rd
	mov a,_Drv_GetADC_AVGn_2[2]
	adcm a,re
	clr acc
	adcm a,rf
	adcm a,rg
#line 116 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,rb
	sub a,_Drv_GetADC_AVGn_2[1]
	mov a,rc
	sbc a,_Drv_GetADC_AVGn_2[2]
	sz c
	jmp _L54
#line 118 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,_Drv_GetADC_AVGn_2[1]
	mov rb,a
	mov a,_Drv_GetADC_AVGn_2[2]
	mov rc,a
_L54:
#line 120 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,_Drv_GetADC_AVGn_2[1]
	sub a,_Drv_GetADC_AVGn_2[4]
	mov a,_Drv_GetADC_AVGn_2[2]
	sbc a,_Drv_GetADC_AVGn_2[5]
	sz c
	jmp _L55
#line 122 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,_Drv_GetADC_AVGn_2[1]
	mov _Drv_GetADC_AVGn_2[4],a
	mov a,_Drv_GetADC_AVGn_2[2]
	mov _Drv_GetADC_AVGn_2[5],a
_L55:
#line 109 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	inc ra
_L51:
	mov a,ra
	sub a,_Drv_GetADC_AVGn_2[0]
	sz z
	jmp _L59
#line 111 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	clr [105].7
	set [105].7
	clr [105].7
#line 112 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	jmp _L53
_L59:
#line 125 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,rd
	sub a,rb
	mov rd,a
	mov a,re
	sbc a,rc
	mov re,a
	mov a,rf
	clr rf
	sbcm a,rf
	mov a,rg
	clr rg
	sbcm a,rg
	mov a,rd
	sub a,_Drv_GetADC_AVGn_2[4]
	mov rd,a
	mov a,re
	sbc a,_Drv_GetADC_AVGn_2[5]
	mov re,a
	mov a,rf
	clr rf
	sbcm a,rf
	mov a,rg
	clr rg
	sbcm a,rg
	mov a,254
	add a,_Drv_GetADC_AVGn_2[0]
	mov rb,a
	mov a,255
	clr rc
	adcm a,rc
	mov a,rb
	mov _Drv_GetADC_AVGn_2[4],a
	mov a,rc
	mov _Drv_GetADC_AVGn_2[5],a
	clr acc
	sz _Drv_GetADC_AVGn_2[5].7
	set acc
	mov _Drv_GetADC_AVGn_2[6],a
	mov _Drv_GetADC_AVGn_2[7],a
	clr _builtin_holtek_udivmodsi4_2[12]
	mov a,rd  
	mov _builtin_holtek_udivmodsi4_2[0],a  
	mov a,re  
	mov _builtin_holtek_udivmodsi4_2[1],a
	mov a,rf  
	mov _builtin_holtek_udivmodsi4_2[2],a  
	mov a,rg  
	mov _builtin_holtek_udivmodsi4_2[3],a
	mov a,_Drv_GetADC_AVGn_2[4]  
	mov _builtin_holtek_udivmodsi4_2[4],a  
	mov a,_Drv_GetADC_AVGn_2[5]  
	mov _builtin_holtek_udivmodsi4_2[5],a
	mov a,_Drv_GetADC_AVGn_2[6]  
	mov _builtin_holtek_udivmodsi4_2[6],a  
	mov a,_Drv_GetADC_AVGn_2[7]  
	mov _builtin_holtek_udivmodsi4_2[7],a
	fcall _builtin_holtek_udivmodsi4
	mov a,_builtin_holtek_udivmodsi4_2[0]  
	mov rd,a  
	mov a,_builtin_holtek_udivmodsi4_2[1]  
	mov re,a
	mov a,_builtin_holtek_udivmodsi4_2[2]  
	mov rf,a  
	mov a,_builtin_holtek_udivmodsi4_2[3]  
	mov rg,a
	mov a,rd
	mov _Drv_GetADC_AVGn_2[1],a
	mov a,re
	mov _Drv_GetADC_AVGn_2[2],a
#line 126 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	clr [105].5
#line 128 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
	mov a,_Drv_GetADC_AVGn_2[1]
	mov ra,a
	mov a,_Drv_GetADC_AVGn_2[2]
	mov rb,a
	ret
_Drv_GetADC_AVGn endp
#line 128 "c:\users\iris\desktop\2. demo code\bh67f5362_lvd\BH67F5362_Drv\Drv_AFE_ADC.c"
#pragma debug scope 1 1
#pragma debug variable 8 1 ___sadol "__sadol" 1
#pragma debug variable 8 1 ___sadoh "__sadoh" 1
#pragma debug struct_begin 42 "__sadc0_bits"
#pragma debug field 21 8 0 1 "__sacs0" ;0,1
#pragma debug field 21 8 0 1 "__sacs1" ;1,1
#pragma debug field 21 8 0 1 "__sacs2" ;2,1
#pragma debug field 21 8 0 1 "__sacs3" ;3,1
#pragma debug field 21 8 0 1 "__adrfs" ;4,1
#pragma debug field 21 8 0 1 "__adcen" ;5,1
#pragma debug field 21 8 0 1 "__adbz" ;6,1
#pragma debug field 21 8 0 1 "__start" ;7,1
#pragma debug struct_end
#pragma debug union_begin 43 ""
#pragma debug field 2 42 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 43 1 ___sadc0 "__sadc0" 1
#pragma debug struct_begin 44 "__sadc1_bits"
#pragma debug field 21 8 0 1 "__sacks0" ;0,1
#pragma debug field 21 8 0 1 "__sacks1" ;1,1
#pragma debug field 21 8 0 1 "__sacks2" ;2,1
#pragma debug field 21 8 0 1 ;3,1
#pragma debug field 21 8 0 1 "__sains0" ;4,1
#pragma debug field 21 8 0 1 "__sains1" ;5,1
#pragma debug field 21 8 0 1 "__sains2" ;6,1
#pragma debug field 21 8 0 1 "__sains3" ;7,1
#pragma debug struct_end
#pragma debug union_begin 45 ""
#pragma debug field 2 44 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 45 1 ___sadc1 "__sadc1" 1
#pragma debug struct_begin 46 "__sadc2_bits"
#pragma debug field 21 8 0 1 "__pgags0" ;0,1
#pragma debug field 21 8 0 1 "__pgags1" ;1,1
#pragma debug field 21 8 0 1 "__savrs0" ;2,1
#pragma debug field 21 8 0 1 "__savrs1" ;3,1
#pragma debug field 21 8 0 1 "__pgais" ;4,1
#pragma debug field 21 8 0 2 ;5,2
#pragma debug field 21 8 0 1 "__adpgaen" ;7,1
#pragma debug struct_end
#pragma debug union_begin 47 ""
#pragma debug field 2 46 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 47 1 ___sadc2 "__sadc2" 1
#pragma debug struct_begin 48 "__pas0_bits"
#pragma debug field 21 8 0 1 "__pas00" ;0,1
#pragma debug field 21 8 0 1 "__pas01" ;1,1
#pragma debug field 21 8 0 1 "__pas02" ;2,1
#pragma debug field 21 8 0 1 "__pas03" ;3,1
#pragma debug field 21 8 0 1 "__pas04" ;4,1
#pragma debug field 21 8 0 1 "__pas05" ;5,1
#pragma debug field 21 8 0 1 "__pas06" ;6,1
#pragma debug field 21 8 0 1 "__pas07" ;7,1
#pragma debug struct_end
#pragma debug union_begin 49 ""
#pragma debug field 2 48 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 49 1 ___pas0 "__pas0" 1
#pragma debug struct_begin 50 "__pas1_bits"
#pragma debug field 21 8 0 1 "__pas10" ;0,1
#pragma debug field 21 8 0 1 "__pas11" ;1,1
#pragma debug field 21 8 0 1 "__pas12" ;2,1
#pragma debug field 21 8 0 1 "__pas13" ;3,1
#pragma debug field 21 8 0 1 "__pas14" ;4,1
#pragma debug field 21 8 0 1 "__pas15" ;5,1
#pragma debug field 21 8 0 1 "__pas16" ;6,1
#pragma debug field 21 8 0 1 "__pas17" ;7,1
#pragma debug struct_end
#pragma debug union_begin 51 ""
#pragma debug field 2 50 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 51 1 ___pas1 "__pas1" 1
#pragma debug struct_begin 52 "__pcs0_bits"
#pragma debug field 21 8 0 1 "__pcs00" ;0,1
#pragma debug field 21 8 0 1 "__pcs01" ;1,1
#pragma debug field 21 8 0 1 "__pcs02" ;2,1
#pragma debug field 21 8 0 1 "__pcs03" ;3,1
#pragma debug field 21 8 0 1 "__pcs04" ;4,1
#pragma debug field 21 8 0 1 "__pcs05" ;5,1
#pragma debug field 21 8 0 1 "__pcs06" ;6,1
#pragma debug field 21 8 0 1 "__pcs07" ;7,1
#pragma debug struct_end
#pragma debug union_begin 53 ""
#pragma debug field 2 52 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 53 1 ___pcs0 "__pcs0" 1
#pragma debug struct_begin 54 "__pcs1_bits"
#pragma debug field 21 8 0 1 "__pcs10" ;0,1
#pragma debug field 21 8 0 1 "__pcs11" ;1,1
#pragma debug field 21 8 0 1 "__pcs12" ;2,1
#pragma debug field 21 8 0 1 "__pcs13" ;3,1
#pragma debug field 21 8 0 1 "__pcs14" ;4,1
#pragma debug field 21 8 0 1 "__pcs15" ;5,1
#pragma debug field 21 8 0 1 "__pcs16" ;6,1
#pragma debug field 21 8 0 1 "__pcs17" ;7,1
#pragma debug struct_end
#pragma debug union_begin 55 ""
#pragma debug field 2 54 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 55 1 ___pcs1 "__pcs1" 1
#pragma debug struct_begin 56 "__pds0_bits"
#pragma debug field 21 8 0 1 "__pds00" ;0,1
#pragma debug field 21 8 0 1 "__pds01" ;1,1
#pragma debug field 21 8 0 1 "__pds02" ;2,1
#pragma debug field 21 8 0 1 "__pds03" ;3,1
#pragma debug field 21 8 0 1 "__pds04" ;4,1
#pragma debug field 21 8 0 1 "__pds05" ;5,1
#pragma debug field 21 8 0 1 "__pds06" ;6,1
#pragma debug field 21 8 0 1 "__pds07" ;7,1
#pragma debug struct_end
#pragma debug union_begin 57 ""
#pragma debug field 2 56 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 57 1 ___pds0 "__pds0" 1
extern _builtin_holtek_udivmodsi4_2:byte
extern _builtin_holtek_udivmodsi4:near

; 
; Generated by holtek-gcc v3.20, Fri Aug 28 11:21:43 2020
; Rebuild 610
; end of file
