📄 sysvects.s43
字号:
#define _def_SysVects
#include "SysVects.h"
#ifdef DEBUG_TEST
.sect "TAG" ; needed to guarantee placement
.keep ; make sure it gets loaded
PUBLIC _FlashTag ; provide access by the 'C' code side
_FlashTag
DC.W 0x1248 ; initialize the flash tag at load time to run the loader
#endif
; vector table selection code
.sect "V_SELECT"
.keep
; the indirection code
; since only one jump is ever taken, it always takes 12 clock cycles to complete this
; section of the vector map, including the 2 cycles for the original vector jump.
VECT_0:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_0 ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_0, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_0:
MOV &USER_0, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_1:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_1 ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_1, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_1:
MOV &USER_1, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_2:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_2 ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_2, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_2:
MOV &USER_2, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_3:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_3 ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_3, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_3:
MOV &USER_3, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_4:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_4 ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_4, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_4:
MOV &USER_4, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_5:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_5 ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_5, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_5:
MOV &USER_5, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_6:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_6 ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_6, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_6:
MOV &USER_6, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_7:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_7 ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_7, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_7:
MOV &USER_7, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_8:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_8 ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_8, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_8:
MOV &USER_8, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_9:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_9 ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_9, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_9:
MOV &USER_9, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_A:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_A ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_A, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_A:
MOV &USER_A, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_B:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_B ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_B, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_B:
MOV &USER_B, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_C:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_C ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_C, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_C:
MOV &USER_C, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_D:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_D ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_D, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_D:
MOV &USER_D, PC ; else, jump through the loader vectors 2 words, 3 cycles
VECT_E:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_E ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_E, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_E:
MOV &USER_E, PC ; else, jump through the loader vectors 2 words, 3 cycles
PUBLIC _HardReset
_HardReset: ; Duplicate label allow us to branch here from 'C' code.
VECT_F:
CMP #LOAD_TAG, &FLASH_TAG_ADDR ; check tag for which vector set to use 3 words, 5 cycles
JNE SKIP_F ; if the user vector set is active 1 word, 2 cycles
MOV &LOAD_F, PC ; jump through the user vectors 2 words, 3 cycles
SKIP_F:
MOV &USER_F, PC ; else, jump through the loader vectors 2 words, 3 cycles
; Hardware vectors
.sect "HW_VECTS"
.keep
; the system vectors located at 0xFFE0 - 0xFFFF
DC.W VECT_0 ; 1 word, 2 cycles
DC.W VECT_1 ; 1 word, 2 cycles
DC.W VECT_2 ; 1 word, 2 cycles
DC.W VECT_3 ; 1 word, 2 cycles
DC.W VECT_4 ; 1 word, 2 cycles
DC.W VECT_5 ; 1 word, 2 cycles
DC.W VECT_6 ; 1 word, 2 cycles
DC.W VECT_7 ; 1 word, 2 cycles
DC.W VECT_8 ; 1 word, 2 cycles
DC.W VECT_9 ; 1 word, 2 cycles
DC.W VECT_A ; 1 word, 2 cycles
DC.W VECT_B ; 1 word, 2 cycles
DC.W VECT_C ; 1 word, 2 cycles
DC.W VECT_D ; 1 word, 2 cycles
DC.W VECT_E ; 1 word, 2 cycles
DC.W VECT_F ; Reset vector ; 1 word, 2 cycles
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -