; Generated by holtek-gcc v3.19, Tue Jan 14 16:58:23 2025
; 
; Configuration:
;       with long instruction
;       Single 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 = 32
;       
;       
; 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 [32]

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
___eeal equ [65]
___eeah equ [66]
___mp1h equ [4]
___mp1l equ [3]
___iar1 equ [2]
___eed equ [67]
public _Eeprom_ReadByte
#pragma debug scope 2 1
#line 50 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
_Eeprom_ReadByte .section 'code'
_Eeprom_ReadByte proc
public _Eeprom_ReadByte_2
    local _Eeprom_ReadByte_2 db 4 dup(?)	; 4,0
#pragma debug variable 12 2 _Eeprom_ReadByte_2+0 "addr"
#pragma debug pointer 42 8 2
#pragma debug variable 42 2 _Eeprom_ReadByte_2+2 "data"
#line 51 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,0
	sub a,_Eeprom_ReadByte_2[0]
	mov a,8
	sbc a,_Eeprom_ReadByte_2[1]
	snz c
	jmp _L3
#pragma debug scope 3 2
;begin block, line: 51.-1
#pragma debug scope 4 3
;begin block, line: 51.-1
#line 57 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,_Eeprom_ReadByte_2[0]
	mov [65],a
#line 58 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,_Eeprom_ReadByte_2[1]
	mov [66],a
#line 59 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,1
	mov [4],a
#line 60 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,64
	mov [3],a
#line 61 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
;# 61 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c" 1
	set [0x02].1
#line 62 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
;# 62 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c" 1
	set [0x02].0
#line 63 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
;# 63 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c" 1
	sz  [0x02].0
#line 64 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
;# 64 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c" 1
	jmp $-1
#line 65 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	clr [2]
#line 66 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,_Eeprom_ReadByte_2[2]
	mov mp,a
	mov a,_Eeprom_ReadByte_2[3]
	mov sbp,a
	mov a,[67]
	mov ir,a
	mov a,1
	mov ra,a
	jmp _L2
_L3:
#pragma debug scope 3 2
#pragma debug scope 2 1
#line 53 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	clr ra
_L2:
#line 69 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,ra
	ret
_Eeprom_ReadByte endp
#line 69 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
#pragma debug scope 1 1
public _Eeprom_ReadBuff
#pragma debug scope 5 1
#line 81 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
_Eeprom_ReadBuff .section 'code'
_Eeprom_ReadBuff proc
public _Eeprom_ReadBuff_2
    local _Eeprom_ReadBuff_2 db 9 dup(?)	; 6,3
#pragma debug variable 12 5 _Eeprom_ReadBuff_2+0 "startAddr"
#pragma debug pointer 43 8 5
#pragma debug variable 43 5 _Eeprom_ReadBuff_2+2 "buf"
#pragma debug variable 12 5 _Eeprom_ReadBuff_2+4 "len"
#pragma debug variable 8 5 _Eeprom_ReadBuff_2+8 "i"
#line 82 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,_Eeprom_ReadBuff_2[4]
	add a,_Eeprom_ReadBuff_2[0]
	mov rb,a
	mov a,_Eeprom_ReadBuff_2[5]
	adc a,_Eeprom_ReadBuff_2[1]
	mov rc,a
	mov a,0
	sub a,rb
	mov a,8
	sbc a,rc
	snz c
	jmp _L6
#line 82 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,_Eeprom_ReadBuff_2[0]
	mov _Eeprom_ReadBuff_2[6],a
	mov a,_Eeprom_ReadBuff_2[1]
	mov _Eeprom_ReadBuff_2[7],a
	clr _Eeprom_ReadBuff_2[8]
	jmp _L7
_L6:
#line 84 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	clr ra
	jmp _L8
_L9:
#line 89 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,rd
	mov _Eeprom_ReadByte_2[2],a
	mov a,re
	mov _Eeprom_ReadByte_2[3],a
	mov a,_Eeprom_ReadBuff_2[6]
	mov _Eeprom_ReadByte_2[0],a
	mov a,_Eeprom_ReadBuff_2[7]
	mov _Eeprom_ReadByte_2[1],a
	call _Eeprom_ReadByte
	mov ra,a
	snz ra
	jmp _L6
#line 93 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	inc _Eeprom_ReadBuff_2[6]
	sz z
	inc _Eeprom_ReadBuff_2[7]
#line 87 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	inc _Eeprom_ReadBuff_2[8]
_L7:
	mov a,_Eeprom_ReadBuff_2[2]
	sub a,_Eeprom_ReadBuff_2[0]
	mov ra,a
	mov a,_Eeprom_ReadBuff_2[3]
	sbc a,_Eeprom_ReadBuff_2[1]
	mov rb,a
	mov a,ra
	mov rd,a
	mov a,rb
	mov re,a
	mov a,_Eeprom_ReadBuff_2[6]
	addm a,rd
	mov a,_Eeprom_ReadBuff_2[7]
	adcm a,re
	mov a,_Eeprom_ReadBuff_2[8]
	mov rb,a
	clr rc
	mov a,rb
	sub a,_Eeprom_ReadBuff_2[4]
	mov a,rc
	sbc a,_Eeprom_ReadBuff_2[5]
	snz c
	jmp _L9
#line 96 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,1
	mov ra,a
_L8:
#line 97 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,ra
	ret
_Eeprom_ReadBuff endp
#line 97 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
#pragma debug scope 1 1
___intc0 equ [32]
public _Eeprom_WriteByte
#pragma debug scope 6 1
#line 110 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
_Eeprom_WriteByte .section 'code'
_Eeprom_WriteByte proc
public _Eeprom_WriteByte_2
    local _Eeprom_WriteByte_2 db 4 dup(?)	; 3,1
#pragma debug variable 12 6 _Eeprom_WriteByte_2+0 "startAddr"
#pragma debug variable 8 6 _Eeprom_WriteByte_2+2 "data"
#line 111 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,255
	sub a,_Eeprom_WriteByte_2[0]
	mov a,7
	sbc a,_Eeprom_WriteByte_2[1]
	snz c
	jmp _L17
#pragma debug scope 7 6
;begin block, line: 111.-1
#pragma debug variable 8 7 _Eeprom_WriteByte_2+3 "readData"
#line 117 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,[32]
	and a,1
	mov ra,a
#line 119 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	clr [32].0
#line 120 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,1
	mov [4],a
#line 121 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,64
	mov [3],a
#line 122 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,_Eeprom_WriteByte_2[0]
	mov [65],a
#line 123 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,_Eeprom_WriteByte_2[1]
	mov [66],a
#line 124 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,_Eeprom_WriteByte_2[2]
	mov [67],a
#line 126 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
;# 126 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c" 1
	set [0x02].3
#line 127 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
;# 127 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c" 1
	set [0x02].2
#line 128 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
;# 128 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c" 1
	sz  [0x02].2
#line 129 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
;# 129 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c" 1
	jmp $-1
#line 130 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	clr [2]
#line 131 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	clr [32].0
	mov a,ra
	orm a,[32]
#line 133 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,low offset _Eeprom_WriteByte_2
	mov ra,a
	mov a,high offset _Eeprom_WriteByte_2
	mov rb,a
	mov a,3
	add a,ra
	mov _Eeprom_ReadByte_2[2],a
	mov a,0
	adc a,rb
	mov _Eeprom_ReadByte_2[3],a
	mov a,_Eeprom_WriteByte_2[0]
	mov _Eeprom_ReadByte_2[0],a
	mov a,_Eeprom_WriteByte_2[1]
	mov _Eeprom_ReadByte_2[1],a
	call _Eeprom_ReadByte
	mov ra,a
	snz ra
	jmp _L14
	mov a,1
	mov ra,a
	mov a,_Eeprom_WriteByte_2[3]
	sub a,_Eeprom_WriteByte_2[2]
	sz z
	jmp _L14
_L17:
#pragma debug scope 6 1
#line 113 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	clr ra
_L14:
#line 142 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,ra
	ret
_Eeprom_WriteByte endp
#line 142 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
#pragma debug scope 1 1
public _Eeprom_WriteBuf
#pragma debug scope 8 1
#line 154 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
_Eeprom_WriteBuf .section 'code'
_Eeprom_WriteBuf proc
public _Eeprom_WriteBuf_2
    local _Eeprom_WriteBuf_2 db 9 dup(?)	; 6,3
#pragma debug variable 12 8 _Eeprom_WriteBuf_2+0 "startAddr"
#pragma debug pointer 44 8 8
#pragma debug variable 44 8 _Eeprom_WriteBuf_2+2 "buf"
#pragma debug variable 12 8 _Eeprom_WriteBuf_2+4 "len"
#pragma debug variable 8 8 _Eeprom_WriteBuf_2+8 "i"
#line 155 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,_Eeprom_WriteBuf_2[4]
	add a,_Eeprom_WriteBuf_2[0]
	mov rb,a
	mov a,_Eeprom_WriteBuf_2[5]
	adc a,_Eeprom_WriteBuf_2[1]
	mov rc,a
	mov a,255
	sub a,rb
	mov a,7
	sbc a,rc
	snz c
	jmp _L22
#line 155 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,_Eeprom_WriteBuf_2[2]
	mov _Eeprom_WriteBuf_2[6],a
	mov a,_Eeprom_WriteBuf_2[3]
	mov _Eeprom_WriteBuf_2[7],a
	clr _Eeprom_WriteBuf_2[8]
	jmp _L23
_L22:
#line 157 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	clr ra
	jmp _L24
_L25:
#line 162 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,_Eeprom_WriteBuf_2[6]
	mov mp,a
	mov a,_Eeprom_WriteBuf_2[7]
	mov sbp,a
	call _Crom2Prom
	mov _Eeprom_WriteByte_2[2],a
	mov a,rd
	mov _Eeprom_WriteByte_2[0],a
	mov a,re
	mov _Eeprom_WriteByte_2[1],a
	call _Eeprom_WriteByte
	mov ra,a
	snz ra
	jmp _L22
#line 167 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	inc _Eeprom_WriteBuf_2[6]
	sz z
	inc _Eeprom_WriteBuf_2[7]
#line 160 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	inc _Eeprom_WriteBuf_2[8]
_L23:
	mov a,_Eeprom_WriteBuf_2[0]
	sub a,_Eeprom_WriteBuf_2[2]
	mov ra,a
	mov a,_Eeprom_WriteBuf_2[1]
	sbc a,_Eeprom_WriteBuf_2[3]
	mov rb,a
	mov a,ra
	mov rd,a
	mov a,rb
	mov re,a
	mov a,_Eeprom_WriteBuf_2[6]
	addm a,rd
	mov a,_Eeprom_WriteBuf_2[7]
	adcm a,re
	mov a,_Eeprom_WriteBuf_2[8]
	mov rb,a
	clr rc
	mov a,rb
	sub a,_Eeprom_WriteBuf_2[4]
	mov a,rc
	sbc a,_Eeprom_WriteBuf_2[5]
	snz c
	jmp _L25
#line 169 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,1
	mov ra,a
_L24:
#line 170 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
	mov a,ra
	ret
_Eeprom_WriteBuf endp
#line 170 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Eeprom.c"
#pragma debug scope 1 1
#pragma debug variable 8 1 ___mp1l "__mp1l" 1
#pragma debug variable 8 1 ___mp1h "__mp1h" 1
#pragma debug struct_begin 45 "__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 "__autoade" ;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 1 "__autoadf" ;6,1
#pragma debug field 21 8 0 1 ;7,1
#pragma debug struct_end
#pragma debug union_begin 46 ""
#pragma debug field 2 45 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 46 1 ___intc0 "__intc0" 1
#pragma debug struct_begin 47 "__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 48 ""
#pragma debug field 2 47 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 48 1 ___eeal "__eeal" 1
#pragma debug struct_begin 49 "__eeah_bits"
#pragma debug field 21 8 0 1 "__eeah0" ;0,1
#pragma debug field 21 8 0 7 ;1,7
#pragma debug struct_end
#pragma debug union_begin 50 ""
#pragma debug field 2 49 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 50 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, Tue Jan 14 16:58:23 2025
; Rebuild 718
; end of file
