; Generated by holtek-gcc v3.19, Mon Jul 14 16:56:29 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
___intc0 equ [32]
___fc0 equ [304]
___farl equ [307]
___farh equ [308]
___fd0l equ [309]
___fd0h equ [310]
public _IAP_Read
#pragma debug scope 2 1
#line 54 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
_IAP_Read .section 'code'
_IAP_Read proc
public _IAP_Read_2
    local _IAP_Read_2 db 5 dup(?)	; 5,0
#pragma debug variable 12 2 _IAP_Read_2+0 "address"
#pragma debug pointer 42 8 2
#pragma debug variable 42 2 _IAP_Read_2+2 "buf"
#pragma debug variable 8 2 _IAP_Read_2+4 "wordLen"
#line 55 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	clr [32].0
#line 56 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
;# 56 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c" 1
	clr wdt
#line 57 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,50
	lmov [304],a
#line 58 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,_IAP_Read_2[0]
	lmov [307],a
#line 59 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,_IAP_Read_2[1]
	lmov [308],a
	mov a,_IAP_Read_2[2]
	mov rb,a
	mov a,_IAP_Read_2[3]
	mov rc,a
#line 61 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	clr ra
_L2:
#line 61 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,ra
	sub a,_IAP_Read_2[4]
	sz z
	jmp _L7
#line 63 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lset [304].0
_L4:
#line 64 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lsz [304].0
	jmp _L4
#line 65 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,rb
	mov mp,a
	mov a,rc
	mov sbp,a
	lmov a,[309]
	mov ir,a
#line 66 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,1
	add a,rb
	mov mp,a
	mov a,0
	adc a,rc
	mov sbp,a
	lmov a,[310]
	mov ir,a
#line 67 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	linc [307]
#line 61 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	inc ra
	mov a,2
	addm a,rb
	mov a,0
	adcm a,rc
	jmp _L2
_L7:
#line 69 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lclr [304].1
#line 70 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	set [32].0
	ret
_IAP_Read endp
#line 70 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
#pragma debug scope 1 1
___fd1l equ [311]
___fd1h equ [312]
___fd2l equ [313]
___fd2h equ [314]
___fd3l equ [315]
___fd3h equ [316]
public _IAP_EraseWrite_Enable
#pragma debug scope 3 1
#line 80 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
_IAP_EraseWrite_Enable .section 'code'
_IAP_EraseWrite_Enable proc
#line 82 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,[32]
	and a,1
	mov ra,a
#line 83 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	clr [32].0
#line 84 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
;# 84 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c" 1
	clr wdt
#line 85 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,104
	lmov [304],a
#line 86 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lclr [311]
#line 87 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,4
	lmov [312],a
#line 88 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,13
	lmov [313],a
#line 89 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,9
	lmov [314],a
#line 90 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,195
	lmov [315],a
#line 91 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,64
	lmov [316],a
#line 92 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	clr [32].0
	mov a,ra
	orm a,[32]
_L10:
#line 93 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lsz [304].3
	jmp _L10
#line 94 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lrla [304]
	and a,1
	mov ra,a
#line 95 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,ra
	ret
_IAP_EraseWrite_Enable endp
#line 95 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
#pragma debug scope 1 1
public _IAP_Erase_Page
#pragma debug scope 4 1
#line 105 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
_IAP_Erase_Page .section 'code'
_IAP_Erase_Page proc
public _IAP_Erase_Page_2
    local _IAP_Erase_Page_2 db 2 dup(?)	; 2,0
#pragma debug variable 12 4 _IAP_Erase_Page_2+0 "address"
#line 106 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	call _IAP_EraseWrite_Enable
	mov rb,a
	snz rb
	jmp _L12
#line 108 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,_IAP_Erase_Page_2[0]
	lmov [307],a
#line 109 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,_IAP_Erase_Page_2[1]
	lmov [308],a
#line 110 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,144
	lmov [304],a
	mov a,64
	mov ra,a
_L14:
#line 114 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lclr [310]
	sdz ra
	jmp _L14
#line 116 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lset [304].2
_L15:
#line 117 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lsnz [304].2
	jmp _L20
#line 119 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
;# 119 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c" 1
	clr wdt
	jmp _L15
_L20:
#line 122 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lclr [304].7
_L12:
#line 124 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,rb
	ret
_IAP_Erase_Page endp
#line 124 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
#pragma debug scope 1 1
___fc2 equ [306]
public _IAP_Write_Page
#pragma debug scope 5 1
#line 136 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
_IAP_Write_Page .section 'code'
_IAP_Write_Page proc
public _IAP_Write_Page_2
    local _IAP_Write_Page_2 db 5 dup(?)	; 5,0
#pragma debug variable 12 5 _IAP_Write_Page_2+0 "address"
#pragma debug pointer 43 8 5
#pragma debug variable 43 5 _IAP_Write_Page_2+2 "buf"
#pragma debug variable 8 5 _IAP_Write_Page_2+4 "wordLen"
#line 137 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	call _IAP_EraseWrite_Enable
	mov rd,a
	snz rd
	jmp _L22
#line 140 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lset [306].0
#line 141 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,128
	lmov [304],a
#line 142 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,_IAP_Write_Page_2[0]
	lmov [307],a
#line 143 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,_IAP_Write_Page_2[1]
	lmov [308],a
	mov a,_IAP_Write_Page_2[2]
	mov rb,a
	mov a,_IAP_Write_Page_2[3]
	mov rc,a
#line 146 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	clr ra
_L23:
	mov a,ra
	sub a,_IAP_Write_Page_2[4]
	sz z
	jmp _L30
#line 148 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,rb
	mov mp,a
	mov a,rc
	mov sbp,a
	call _Crom2Prom
	lmov [309],a
#line 149 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,1
	add a,rb
	mov mp,a
	mov a,0
	adc a,rc
	mov sbp,a
	call _Crom2Prom
	lmov [310],a
#line 150 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
;# 150 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c" 1
	clr wdt
#line 146 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	inc ra
	mov a,2
	addm a,rb
	mov a,0
	adcm a,rc
	jmp _L23
_L30:
#line 153 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lset [304].2
_L25:
#line 154 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lsnz [304].2
	jmp _L31
#line 156 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
;# 156 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c" 1
	clr wdt
	jmp _L25
_L31:
#line 159 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	lclr [304].7
_L22:
#line 161 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
	mov a,rd
	ret
_IAP_Write_Page endp
#line 161 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\driver\Iap.c"
#pragma debug scope 1 1
#pragma debug struct_begin 44 "__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 45 ""
#pragma debug field 2 44 "bits"
#pragma debug field 0 8 "byte"
#pragma debug union_end
#pragma debug variable 45 1 ___intc0 "__intc0" 1
#pragma debug struct_begin 46 "__fc0_bits"
#pragma debug field 21 8 0 1 "__frd" ;0,1
#pragma debug field 21 8 0 1 "__frden" ;1,1
#pragma debug field 21 8 0 1 "__fwt" ;2,1
#pragma debug field 21 8 0 1 "__fwpen" ;3,1
#pragma debug field 21 8 0 1 "__fmod0" ;4,1
#pragma debug field 21 8 0 1 "__fmod1" ;5,1
#pragma debug field 21 8 0 1 "__fmod2" ;6,1
#pragma debug field 21 8 0 1 "__cfwen" ;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 ___fc0 "__fc0" 1
#pragma debug struct_begin 48 "__fc2_bits"
#pragma debug field 21 8 0 1 "__clwb" ;0,1
#pragma debug field 21 8 0 1 "__fwerts" ;1,1
#pragma debug field 21 8 0 6 ;2,6
#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 ___fc2 "__fc2" 1
#pragma debug struct_begin 50 "__farl_bits"
#pragma debug field 21 8 0 1 "__fa0" ;0,1
#pragma debug field 21 8 0 1 "__fa1" ;1,1
#pragma debug field 21 8 0 1 "__fa2" ;2,1
#pragma debug field 21 8 0 1 "__fa3" ;3,1
#pragma debug field 21 8 0 1 "__fa4" ;4,1
#pragma debug field 21 8 0 1 "__fa5" ;5,1
#pragma debug field 21 8 0 1 "__fa6" ;6,1
#pragma debug field 21 8 0 1 "__fa7" ;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 ___farl "__farl" 1
#pragma debug struct_begin 52 "__farh_bits"
#pragma debug field 21 8 0 1 "__fa8" ;0,1
#pragma debug field 21 8 0 1 "__fa9" ;1,1
#pragma debug field 21 8 0 1 "__fa10" ;2,1
#pragma debug field 21 8 0 1 "__fa11" ;3,1
#pragma debug field 21 8 0 1 "__fa12" ;4,1
#pragma debug field 21 8 0 3 ;5,3
#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 ___farh "__farh" 1
#pragma debug variable 8 1 ___fd0l "__fd0l" 1
#pragma debug variable 8 1 ___fd0h "__fd0h" 1
#pragma debug variable 8 1 ___fd1l "__fd1l" 1
#pragma debug variable 8 1 ___fd1h "__fd1h" 1
#pragma debug variable 8 1 ___fd2l "__fd2l" 1
#pragma debug variable 8 1 ___fd2h "__fd2h" 1
#pragma debug variable 8 1 ___fd3l "__fd3l" 1
#pragma debug variable 8 1 ___fd3h "__fd3h" 1

; 
; Generated by holtek-gcc v3.19, Mon Jul 14 16:56:29 2025
; Rebuild 718
; end of file
