ZeroNet .usect "ZeroNet_Section",2,1,1 ;
MOVL XAR0, #ZeroNet
还有符号之间的优先级问题:
_ADCDRV_1ch_Rlt:n:.usect "ADCDRV_1ch_Section",2,1,1
MOVW DP, #_ADCDRV_1ch_Rlt:n:>>6
这里# 和》哪个优先级高?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
ZeroNet .usect "ZeroNet_Section",2,1,1 ;
MOVL XAR0, #ZeroNet
还有符号之间的优先级问题:
_ADCDRV_1ch_Rlt:n:.usect "ADCDRV_1ch_Section",2,1,1
MOVW DP, #_ADCDRV_1ch_Rlt:n:>>6
这里# 和》哪个优先级高?
建议做实验看一下。
ZeroNet 是地址,即ZeroNet_Section中存放的2个字节数据,第一个数据的地址。
MOVW DP, #ZeroNet>>6,是把在ZeroNet中的data page,右移6位给到DP。
比如ZeroNet为0xc200,他的datapage就为0x308,再右移6位给到DP的就是0XC
具体的可以参考下面两份文档:
谢谢你的回答,很好!
我想再请教下:
ZeroNet .usect "ZeroNet_Section",2,1,1 ; output terminal 1
.text
; label to DP initialisation function
.def _DPL_Init
_DPL_Init:
ZAPA
MOVL XAR0, #ZeroNet
MOVL *XAR0, ACC
ZeroNet是个指针变量对吧,上面的程序好像是用这个指针变量去初始化辅助寄存器XAR0,为什么不直接给XAR0赋值0,而是通过指针变量去赋值呢?
DCDRV_1ch_INIT .macro n
_ADCDRV_1ch_Rlt:n: .usect "ADCDRV_1ch_Section",2,1,1 ; output terminal 1
; publish Terminal Pointers for access from the C environment
.def _ADCDRV_1ch_Rlt:n:
MOVL XAR2, #ZeroNet ; "ZeroNet" is initialised to 0 in ISR
MOVW DP, #_ADCDRV_1ch_Rlt:n:>>6
MOVL @_ADCDRV_1ch_Rlt:n:, XAR2 ; zero output terminal pointer
.endm
语句MOVW DP, #_ADCDRV_1ch_Rlt:n:>>6中,
我能看懂MOVW DP, #_ADCDRV_1ch_Rlt:n:
就是把ADCDRV_1ch_Rlt:n:所在的页号告诉给DP,但是为什么又要在之后右移6位呢?
谢谢解答!