⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boot_process.a51

📁 AT89C51CC02RSR232引导程序C51源代码
💻 A51
字号:
;*A**************************************************************************
; NAME:             api.a51
;----------------------------------------------------------------------------
; CREATED_BY:       J.S. BERTHY
; COMPANY:          ATMEL-WM
; CREATION_DATE:    10/08/2001
; AUTHOR:           $author: $
; REVISION:         $version: $
; DATE:             $date: $
;----------------------------------------------------------------------------
; PURPOSE:          This file the softawre boot process after RESET
;
;----------------------------------------------------------------------------
; NOTES:           
;
;****************************************************************************
; CHANGES:
;
;****************************************************************************


$TITLE      (*** Bootprocess ***)

SOFT_BOOT_PROCESS          SEGMENT     CODE

;_____ I N C L U D E S ____________________________________________________

$include (config.inc)
$include (register.inc)

PUBLIC      boot_process

;_____ M A C R O S ________________________________________________________


;_____ D E F I N I T I O N ________________________________________________
EXTRN       CODE (fm_read_xrow)
EXTRN       DATA (hex_type)


 
;_____ D E C L A R A T I O N ______________________________________________




;*F***************************************************************************
; NAME:     boot_process
;-----------------------------------------------------------------------------
; PARAMS:    
;
; RETURN:
;
;-----------------------------------------------------------------------------
; PURPOSE:  
; 
;*****************************************************************************

RSEG        SOFT_BOOT_PROCESS
;**********************************************************************************************************************        
; BOOT PROCESS : conf. document "T89C51CC02 Bootloader" 
;************************************************************************************************************************      
boot_process:

RD_P1_CF:
; Read P1_CF : if P1_CF = FFh then no hardware condition defines on Port 1 by user
	MOV			DPL, #P1_CF_ADDRESS
	LCALL		fm_read_xrow
	CJNE 		A, #0FFh, HW_ON_P1   
		
RD_P3_CF:
; Read P3_CF : if P3_CF = FFh then no hardware condition defines on Port 3 by user
	MOV			DPL, #P3_CF_ADDRESS
	LCALL		fm_read_xrow
	CJNE 		A, #0FFh, HW_ON_P3  

RD_P4_CF:
; Read P4_CF : if P4_CF = FFh then no hardware condition defines on Port 4 by user
	MOV			DPL, #P4_CF_ADDRESS
	LCALL		fm_read_xrow
	CJNE 		A, #0FFh, HW_ON_P4

; No Hardware condition define by user so execute the default bootloader  
	LJMP		DEFAULT_BOOTLOADER


HW_ON_P1:
	MOV			hex_type, A	; save the mask value in unused0 variable
	ORL			A, P1
	CJNE		A, hex_type, NO_HARDWARE_CONDITION
	LJMP		DEFAULT_BOOTLOADER
HW_ON_P3:
	MOV			hex_type, A	; save the mask value in unused0 variable
	ORL			A, P3
	CJNE		A, hex_type, NO_HARDWARE_CONDITION
	LJMP		DEFAULT_BOOTLOADER
HW_ON_P4:                             	
	MOV			hex_type, A	; save the mask value in unused0 variable
	ORL			A, P4
	CJNE		A, hex_type, NO_HARDWARE_CONDITION
	LJMP		DEFAULT_BOOTLOADER

NO_HARDWARE_CONDITION:

; Read BSB and Test if BSB == 00h then execute application
TEST_BSB_00:
	MOV 		DPL, #BSB_ADDRESS                   
	LCALL		fm_read_xrow
	JZ		 	USER_APPLICATION	

; Read SBV and Test if SBV < 3Fh then execute user bootloader at [SBV]00h
TEST_SBV_3F:
	MOV 		DPL, #SBV_ADDRESS                   
	LCALL		fm_read_xrow
	ANL			A, #0C0h
	JZ 			USER_BOOT   

DEFAULT_BOOTLOADER:

	RET               

USER_BOOT:
	MOV 	 	DPH, A			
	MOV 	 	DPL, #000h
	CLR  		A			
	JMP		@A+DPTR


USER_APPLICATION:
	LJMP    0000h    			

END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -