; Generated by holtek-gcc v3.19, Mon May 18 14:56:20 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.19" "build 20130711"
; Rebuild 718

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
___eeah equ [66]
___eeal equ [65]
___mp1h equ [4]
___mp1l equ [3]
___iar1 equ [2]
___eed equ [67]
public _Read_EEPROMByte
#pragma debug scope 2 1
#line 63 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
_Read_EEPROMByte .section 'code'
_Read_EEPROMByte proc
public _Read_EEPROMByte_2
    local _Read_EEPROMByte_2 db 4 dup(?)	; 4,0
#pragma debug variable 12 2 _Read_EEPROMByte_2+0 "addr"
#pragma debug pointer 42 8 2
#pragma debug variable 42 2 _Read_EEPROMByte_2+2 "data"
#line 64 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,0
	sub a,_Read_EEPROMByte_2[0]
	mov a,4
	sbc a,_Read_EEPROMByte_2[1]
	snz c
	jmp _L3
#pragma debug scope 3 2
;begin block, line: 64.-1
#pragma debug scope 4 3
;begin block, line: 64.-1
#line 70 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Read_EEPROMByte_2[1]
	mov [66],a
#line 71 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Read_EEPROMByte_2[0]
	mov [65],a
#line 72 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,1
	mov [4],a
#line 73 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,64
	mov [3],a
#line 74 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
;# 74 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c" 1
	set [0x02].1
#line 75 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
;# 75 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c" 1
	set [0x02].0
#line 76 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
;# 76 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c" 1
	sz  [0x02].0
#line 77 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
;# 77 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c" 1
	jmp $-1
#line 78 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	clr [2]
#line 79 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Read_EEPROMByte_2[2]
	mov mp,a
	mov a,_Read_EEPROMByte_2[3]
	mov sbp,a
	mov a,[67]
	mov ir,a
	mov a,1
	mov ra,a
	clr rb
	jmp _L2
_L3:
#pragma debug scope 3 2
#pragma debug scope 2 1
#line 66 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	clr ra
	clr rb
_L2:
	ret
_Read_EEPROMByte endp
#line 66 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
#pragma debug scope 1 1
public _Read_EEPROMBuf
#pragma debug scope 5 1
#line 84 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
_Read_EEPROMBuf .section 'code'
_Read_EEPROMBuf proc
public _Read_EEPROMBuf_2
    local _Read_EEPROMBuf_2 db 9 dup(?)	; 5,4
#pragma debug variable 12 5 _Read_EEPROMBuf_2+0 "addr"
#pragma debug variable 8 5 _Read_EEPROMBuf_2+2 "len"
#pragma debug pointer 43 8 5
#pragma debug variable 43 5 _Read_EEPROMBuf_2+3 "buf"
#line 85 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Read_EEPROMBuf_2[2]
	add a,_Read_EEPROMBuf_2[0]
	mov _Read_EEPROMBuf_2[7],a
	clr acc
	adc a,_Read_EEPROMBuf_2[1]
	mov _Read_EEPROMBuf_2[8],a
	mov a,0
	sub a,_Read_EEPROMBuf_2[7]
	mov a,4
	sbc a,_Read_EEPROMBuf_2[8]
	snz c
	jmp _L6
#line 85 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Read_EEPROMBuf_2[0]
	mov _Read_EEPROMBuf_2[5],a
	mov a,_Read_EEPROMBuf_2[1]
	mov _Read_EEPROMBuf_2[6],a
	jmp _L7
_L6:
#line 87 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	clr ra
	clr rb
	jmp _L8
_L9:
#line 92 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,rb
	mov _Read_EEPROMByte_2[2],a
	mov a,rc
	mov _Read_EEPROMByte_2[3],a
	mov a,_Read_EEPROMBuf_2[5]
	mov _Read_EEPROMByte_2[0],a
	mov a,_Read_EEPROMBuf_2[6]
	mov _Read_EEPROMByte_2[1],a
	fcall _Read_EEPROMByte
	mov a,ra
	xor a,1
	or a,rb
	snz z
	jmp _L6
#line 96 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	inc _Read_EEPROMBuf_2[5]
	sz z
	inc _Read_EEPROMBuf_2[6]
_L7:
	mov a,_Read_EEPROMBuf_2[3]
	sub a,_Read_EEPROMBuf_2[0]
	mov rd,a
	mov a,_Read_EEPROMBuf_2[4]
	sbc a,_Read_EEPROMBuf_2[1]
	mov re,a
	mov a,rd
	mov rb,a
	mov a,re
	mov rc,a
	mov a,_Read_EEPROMBuf_2[5]
	addm a,rb
	mov a,_Read_EEPROMBuf_2[6]
	adcm a,rc
#line 90 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Read_EEPROMBuf_2[5]
	sub a,_Read_EEPROMBuf_2[7]
	mov a,_Read_EEPROMBuf_2[6]
	sbc a,_Read_EEPROMBuf_2[8]
	snz cz
	jmp _L9
#line 99 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,1
	mov ra,a
	clr rb
_L8:
	ret
_Read_EEPROMBuf endp
#line 99 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
#pragma debug scope 1 1
___intc0 equ [16]
public _Write_EEPROMByte
#pragma debug scope 6 1
#line 109 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
_Write_EEPROMByte .section 'code'
_Write_EEPROMByte proc
public _Write_EEPROMByte_2
    local _Write_EEPROMByte_2 db 5 dup(?)	; 4,1
#pragma debug variable 12 6 _Write_EEPROMByte_2+0 "addr"
#pragma debug variable 12 6 _Write_EEPROMByte_2+2 "WriteData"
#line 110 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,0
	sub a,_Write_EEPROMByte_2[0]
	mov a,4
	sbc a,_Write_EEPROMByte_2[1]
	snz c
	jmp _L14
#pragma debug scope 7 6
;begin block, line: 110.-1
#pragma debug variable 8 7 _Write_EEPROMByte_2+4 "readData"
#line 118 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,[16]
	and a,1
	mov ra,a
#line 119 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	clr [16].0
#line 120 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,1
	mov [4],a
#line 121 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,64
	mov [3],a
#line 122 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Write_EEPROMByte_2[1]
	mov [66],a
#line 123 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Write_EEPROMByte_2[0]
	mov [65],a
#line 124 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Write_EEPROMByte_2[2]
	mov [67],a
#line 126 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
;# 126 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c" 1
	set [0x02].3
#line 127 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
;# 127 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c" 1
	set [0x02].2
#line 128 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
;# 128 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c" 1
	sz  [0x02].2
#line 129 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
;# 129 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c" 1
	jmp $-1
#line 130 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	clr [2]
#line 131 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	clr [16].0
	mov a,ra
	orm a,[16]
#line 132 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,low offset _Write_EEPROMByte_2
	mov ra,a
	mov a,high offset _Write_EEPROMByte_2
	mov rb,a
	mov a,4
	add a,ra
	mov _Read_EEPROMByte_2[2],a
	mov a,0
	adc a,rb
	mov _Read_EEPROMByte_2[3],a
	mov a,_Write_EEPROMByte_2[0]
	mov _Read_EEPROMByte_2[0],a
	mov a,_Write_EEPROMByte_2[1]
	mov _Read_EEPROMByte_2[1],a
	fcall _Read_EEPROMByte
	mov a,ra
	xor a,1
	or a,rb
	snz z
	jmp _L14
#line 136 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Write_EEPROMByte_2[4]
	mov rd,a
	clr re
	mov a,1
	mov ra,a
	clr rb
	mov a,rd
	sub a,_Write_EEPROMByte_2[2]
	mov a,re
	sbc a,_Write_EEPROMByte_2[3]
	sz cz
	jmp _L11
	clr ra
	jmp _L11
_L14:
#pragma debug scope 6 1
#line 112 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	clr ra
	clr rb
_L11:
	ret
_Write_EEPROMByte endp
#line 112 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
#pragma debug scope 1 1
public _Write_EEPROMBuf
#pragma debug scope 8 1
#line 147 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
_Write_EEPROMBuf .section 'code'
_Write_EEPROMBuf proc
public _Write_EEPROMBuf_2
    local _Write_EEPROMBuf_2 db 9 dup(?)	; 5,4
#pragma debug variable 12 8 _Write_EEPROMBuf_2+0 "addr"
#pragma debug variable 8 8 _Write_EEPROMBuf_2+2 "len"
#pragma debug pointer 44 8 8
#pragma debug variable 44 8 _Write_EEPROMBuf_2+3 "buf"
#line 148 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Write_EEPROMBuf_2[2]
	mov rb,a
	clr rc
	mov a,_Write_EEPROMBuf_2[0]
	add a,rb
	mov rd,a
	mov a,_Write_EEPROMBuf_2[1]
	adc a,rc
	mov re,a
	mov a,0
	sub a,rd
	mov a,4
	sbc a,re
	snz c
	jmp _L17
	mov a,rb
	add a,_Write_EEPROMBuf_2[3]
	mov _Write_EEPROMBuf_2[7],a
	mov a,rc
	adc a,_Write_EEPROMBuf_2[4]
	mov _Write_EEPROMBuf_2[8],a
#line 148 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Write_EEPROMBuf_2[3]
	mov _Write_EEPROMBuf_2[5],a
	mov a,_Write_EEPROMBuf_2[4]
	mov _Write_EEPROMBuf_2[6],a
	jmp _L18
_L17:
#line 150 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	clr ra
	clr rb
	jmp _L19
_L20:
#line 155 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Write_EEPROMBuf_2[5]
	mov mp,a
	mov a,_Write_EEPROMBuf_2[6]
	mov sbp,a
	fcall _Crom2Prom
	mov ra,a
	mov a,ra
	mov _Write_EEPROMByte_2[2],a
	clr _Write_EEPROMByte_2[3]
	mov a,rb
	mov _Write_EEPROMByte_2[0],a
	mov a,rc
	mov _Write_EEPROMByte_2[1],a
	fcall _Write_EEPROMByte
	mov a,ra
	xor a,1
	or a,rb
	snz z
	jmp _L17
#line 160 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	inc _Write_EEPROMBuf_2[5]
	sz z
	inc _Write_EEPROMBuf_2[6]
_L18:
	mov a,_Write_EEPROMBuf_2[0]
	sub a,_Write_EEPROMBuf_2[3]
	mov rd,a
	mov a,_Write_EEPROMBuf_2[1]
	sbc a,_Write_EEPROMBuf_2[4]
	mov re,a
	mov a,rd
	mov rb,a
	mov a,re
	mov rc,a
	mov a,_Write_EEPROMBuf_2[5]
	addm a,rb
	mov a,_Write_EEPROMBuf_2[6]
	adcm a,rc
#line 153 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,_Write_EEPROMBuf_2[5]
	sub a,_Write_EEPROMBuf_2[7]
	mov a,_Write_EEPROMBuf_2[6]
	sbc a,_Write_EEPROMBuf_2[8]
	snz cz
	jmp _L20
#line 162 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
	mov a,1
	mov ra,a
	clr rb
_L19:
	ret
_Write_EEPROMBuf endp
#line 162 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
#pragma debug scope 1 1
public _Flash_WR_Buff
@HCCINIT	.section 'data'
#line 44 "C:\Users\iris\Desktop\2. demo code\BH66F5362_LVDok\BH66F5362_Drv\Drv_EEPROM.c"
@HCCINIT_Flash_WR_Buff .section 'data'
_Flash_WR_Buff label byte
#pragma debug array 45 8 5 1
#pragma debug variable 45 1 _Flash_WR_Buff "Flash_WR_Buff"
	db 85
@ROMDATA_BASE .section inpage 'code'
	db 85
@HCCINIT_Flash_WR_Buff .section 'data'
	db 86
@ROMDATA_BASE .section inpage 'code'
	db 86
@HCCINIT_Flash_WR_Buff .section 'data'
	db 87
@ROMDATA_BASE .section inpage 'code'
	db 87
@HCCINIT_Flash_WR_Buff .section 'data'
	db 88
@ROMDATA_BASE .section inpage 'code'
	db 88
@HCCINIT_Flash_WR_Buff .section 'data'
	db 89
@ROMDATA_BASE .section inpage 'code'
	db 89
@HCCINIT_Flash_WR_Buff .section 'data'
#pragma debug variable 8 1 ___mp1l "__mp1l" 1
#pragma debug variable 8 1 ___mp1h "__mp1h" 1
#pragma debug struct_begin 46 "__intc0_bits"
#pragma debug field 21 8 0 1 "__emi" ;0,1
#pragma debug field 21 8 0 1 "__int0e" ;1,1
#pragma debug field 21 8 0 1 "__int1e" ;2,1
#pragma debug field 21 8 0 1 ;3,1
#pragma debug field 21 8 0 1 "__int0f" ;4,1
#pragma debug field 21 8 0 1 "__int1f" ;5,1
#pragma debug field 21 8 0 2 ;6,2
#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 ___intc0 "__intc0" 1
#pragma debug struct_begin 48 "__eeal_bits"
#pragma debug field 21 8 0 1 "__eeal0" ;0,1
#pragma debug field 21 8 0 1 "__eeal1" ;1,1
#pragma debug field 21 8 0 1 "__eeal2" ;2,1
#pragma debug field 21 8 0 1 "__eeal3" ;3,1
#pragma debug field 21 8 0 1 "__eeal4" ;4,1
#pragma debug field 21 8 0 1 "__eeal5" ;5,1
#pragma debug field 21 8 0 1 "__eeal6" ;6,1
#pragma debug field 21 8 0 1 "__eeal7" ;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 ___eeal "__eeal" 1
#pragma debug struct_begin 50 "__eeah_bits"
#pragma debug field 21 8 0 1 "__eeah0" ;0,1
#pragma debug field 21 8 0 1 "__eeah1" ;1,1
#pragma debug field 21 8 0 6 ;2,6
#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 ___eeah "__eeah" 1
#pragma debug variable 8 1 ___eed "__eed" 1
#pragma debug variable 8 1 ___iar1 "__iar1" 1

; 
; Generated by holtek-gcc v3.19, Mon May 18 14:56:20 2020
; Rebuild 718
; end of file
