; Generated by holtek-gcc v3.19, Mon Jul 14 16:56:27 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
___status equ [10]
___pa equ [20]
public _main
#pragma debug scope 2 1
#line 48 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
IFDEF WITH_DEFAULT_STARTUP
extern _main_initial0:near
extern _main_startup:near
ENDIF

ROMBANK 0 @start
@start .section com_l 'code'
_main_startup1:
@start .section com_e 'code'
	jmp _main

_main .section 'code'
_main proc
    local _main_2 db 4 dup(?)
#line 51 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	snz [10].5
	jmp _L2
#line 51 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	sz [10].4
	jmp _L3
_L2:
#pragma debug scope 3 2
;begin block, line: 51.-1
#pragma debug variable 14 3 _main_2+0 "restartNum"
#line 53 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	call _Sys_PowerOnInit
#line 55 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	call _Sys_ReadCalibratePara
#line 57 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	call _Init_AFE
#line 59 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	clr _main_2[0]
	clr _main_2[1]
	clr _main_2[2]
	clr _main_2[3]
#line 60 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	mov a,4
	mov _Eeprom_ReadBuff_2[4],a
	clr _Eeprom_ReadBuff_2[5]
	mov a,low offset _main_2
	mov _Eeprom_ReadBuff_2[2],a
	mov a,high offset _main_2
	mov _Eeprom_ReadBuff_2[3],a
	mov a,-4
	mov _Eeprom_ReadBuff_2[0],a
	mov a,1
	mov _Eeprom_ReadBuff_2[1],a
	call _Eeprom_ReadBuff
#line 61 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	mov a,1
	addm a,_main_2[0]
	mov a,0
	adcm a,_main_2[1]
	adcm a,_main_2[2]
	adcm a,_main_2[3]
#line 62 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	mov a,4
	mov _Eeprom_WriteBuf_2[4],a
	clr _Eeprom_WriteBuf_2[5]
	mov a,low offset _main_2
	mov _Eeprom_WriteBuf_2[2],a
	mov a,high offset _main_2
	mov _Eeprom_WriteBuf_2[3],a
	mov a,-4
	mov _Eeprom_WriteBuf_2[0],a
	mov a,1
	mov _Eeprom_WriteBuf_2[1],a
	call _Eeprom_WriteBuf
#line 63 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	mov a,54
	add a,_cgmApiP[0]
	mov mp,a
	mov a,0
	adc a,_cgmApiP[1]
	mov sbp,a
	mov a,_main_2[0]
	mov ir,a
	inc mp
	mov a,_main_2[1]
	mov ir,a
	inc mp
	mov a,_main_2[2]
	mov ir,a
	inc mp
	mov a,_main_2[3]
	mov ir,a
#pragma debug scope 2 1
#line 52 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	jmp _L4
_L3:
#line 70 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
;# 70 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c" 1
	clr wdt
_L4:
#line 74 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
;# 74 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c" 1
	clr wdt
#line 76 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	clr _isWork[0]
#line 83 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	sz [20].5
	jmp _L6
#line 85 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	mov a,1
	mov _isWork[0],a
_L6:
#line 89 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	snz _isWork[0]
	jmp _L7
#line 91 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	call _Protocol_RxLoop
#line 93 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	call _Work_Mode_Polling
#line 97 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	call _Protocol_TxLoop
	jmp _L4
_L7:
#line 101 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	call _Enter_Halt
#line 103 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
	call _WakeUpInit
	jmp _L4
	jmp $
_main endp

@dummy proc
	call _main
@dummy endp

#line 103 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
#pragma debug scope 1 1
#line 45 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
public _isWork
@HCCINIT0_isWork .section 'data'
_isWork	db 0
#pragma debug variable 8 1 _isWork "isWork"

@HCCINIT .section 'data'
#pragma debug struct_begin 42 "__status_bits"
#pragma debug field 21 8 0 1 "__c" ;0,1
#pragma debug field 21 8 0 1 "__ac" ;1,1
#pragma debug field 21 8 0 1 "__z" ;2,1
#pragma debug field 21 8 0 1 "__ov" ;3,1
#pragma debug field 21 8 0 1 "__pdf" ;4,1
#pragma debug field 21 8 0 1 "__to" ;5,1
#pragma debug field 21 8 0 1 "__cz" ;6,1
#pragma debug field 21 8 0 1 "__sc" ;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 ___status "__status" 1
#pragma debug struct_begin 44 "__pa_bits"
#pragma debug field 21 8 0 1 "__pa0" ;0,1
#pragma debug field 21 8 0 1 "__pa1" ;1,1
#pragma debug field 21 8 0 1 "__pa2" ;2,1
#pragma debug field 21 8 0 1 "__pa3" ;3,1
#pragma debug field 21 8 0 1 "__pa4" ;4,1
#pragma debug field 21 8 0 1 "__pa5" ;5,1
#pragma debug field 21 8 0 1 "__pa6" ;6,1
#pragma debug field 21 8 0 1 "__pa7" ;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 ___pa "__pa" 1

; output external variables
extern _cgmApiP:byte
#line 48 "d:\d200\product\git\bh66f2455_evm_cgm\2.code\bh66f2455_driver\application_projects\source\main.c"
@code .section at 0 'code'
	jmp _main_startup1

extern _Sys_PowerOnInit:near
extern _Sys_ReadCalibratePara:near
extern _Init_AFE:near
extern _Eeprom_ReadBuff_2:byte
extern _Eeprom_ReadBuff:near
extern _Eeprom_WriteBuf_2:byte
extern _Eeprom_WriteBuf:near
extern _Protocol_RxLoop:near
extern _Work_Mode_Polling:near
extern _Protocol_TxLoop:near
extern _Enter_Halt:near
extern _WakeUpInit:near

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