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

📄 psocconfig.asm

📁 Application Note Abstract This Application Note introduces a complete and detailed PSoC&reg project
💻 ASM
字号:
;
;  PSoCConfig.asm
;
;  Version 0.84
;  Data: 19 December, 2000
;  Copyright Cypress MicroSystems 2000
;
;  This file is generated by the Device Editor on Application Generation.
;  It contains code which loads the configuration data table generated in
;  the file PSoCConfigTBL.asm
;  
;  DO NOT EDIT THIS FILE MANUALLY, AS IT IS OVERWRITTEN!!!
;  Edits to this file will not be preserved.
;
include "m8c.inc"

export LoadConfigInit
export _LoadConfigInit
export LoadConfig_calllogger
export _LoadConfig_calllogger

export NO_SHADOW
export _NO_SHADOW

FLAG_CFG_MASK:		equ	10h			;M8C flag register REG address bit mask
END_CONFIG_TABLE:	equ	ffh			;end of config table indicator	

AREA psoc_config(rom, rel)

_LoadConfigInit:
 LoadConfigInit:
	
	call	LoadConfig_calllogger

	ret

;
; Load Configuration calllogger
;
_LoadConfig_calllogger:
 LoadConfig_calllogger:
    push    a
    push    x
	M8C_SetBank1									;set for bank 1
	mov		A, >LoadConfigTBL_calllogger_Bank1	;load bank 1 table
	mov		X, <LoadConfigTBL_calllogger_Bank1
	call	LoadConfig								;load the bank 1 values
	M8C_SetBank0									;switch to bank 0
	mov		A, >LoadConfigTBL_calllogger_Bank0	;load bank 0 table
	mov		X, <LoadConfigTBL_calllogger_Bank0
	call	LoadConfig								;load the bank 0 values
    pop     x
    pop     a
	ret


;
; LoadConfig
;
;  This function is not exported.  It assumes that the address of the table
;  to be loaded is contained in the X and A registers as if a romx instruction
;  is the next instruction to be executed, i.e. lower address in X and uppper
;  address in A.  There is no return value.
;
LoadConfig:
	add		SP, 1
LoadConfigLp:
	M8C_ClearWDT					;clear the watchdog for long inits
	push	X						;save config table address on stack
	push	A
	romx							;load config address
	cmp		A, END_CONFIG_TABLE		;check for end of table
	jz		EndLoadConfig			;if so, end of load
	mov		X, SP					;save the address away
	mov		[X-3], A
	pop		A						;retrieve the table address
	pop		X
	inc		X						;advance to the data byte
	jnc		NoOverFlow1				;check for overflow
	inc		A						;if so, increment MSB
NoOverFlow1:	
	push	X						;save the config table address again
	push	A
	romx							;load the config data
	mov		X, SP					;retrieve the config address
	mov		X, [X-3]
	mov		reg[X], A				;write the config data
	pop		A						;retrieve the table address
	pop		X
	inc		X						;advance to the next address
	jnc		NoOverFlow2				;check for overflow
	inc		A						;if so, increment MSB
NoOverFlow2:	
	jmp		LoadConfigLp			;loop back
EndLoadConfig:
	pop		A						;clean up the stack
	pop		X
	add		SP, -1
	ret

NO_SHADOW:
_NO_SHADOW:

⌨️ 快捷键说明

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