?? psocconfig.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_interop_asmtoc
export _LoadConfig_interop_asmtoc
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:
lcall LoadConfig_interop_asmtoc
ret
;
; Load Configuration interop_asmtoc
;
_LoadConfig_interop_asmtoc:
LoadConfig_interop_asmtoc:
push a
push x
M8C_SetBank1 ;set for bank 1
mov a, 1
asr a
mov A, >LoadConfigTBL_interop_asmtoc_Bank1 ;load bank 1 table
mov X, <LoadConfigTBL_interop_asmtoc_Bank1
lcall LoadConfig ;load the bank 1 values
M8C_SetBank0 ;switch to bank 0
mov a, 0
asr a
mov A, >LoadConfigTBL_interop_asmtoc_Bank0 ;load bank 0 table
mov X, <LoadConfigTBL_interop_asmtoc_Bank0
lcall 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, 2 ;set up temp vars
push X
push A
mov X, SP
mov [X-4], 0
jnc LoadBank0Setup
mov [X-4], 1
LoadBank0Setup:
pop A
pop X
LoadConfigLp:
push X ;save config table address on stack
push A
M8C_SetBank0 ;switch to bank 0
M8C_ClearWDT ;clear the watchdog for long inits
mov X, SP ;check for bank 1 load
tst [X-4], 1
jz LoadingBank0
M8C_SetBank1
LoadingBank0:
pop A
pop X
push X
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, -2
ret
NO_SHADOW:
_NO_SHADOW:
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -