?? ecanregdoublerw.asm
字號(hào):
;; C callable assembly function for performing a double-read or double-write:
; Retunrs read value in memory (pointed by XAR5)
.global _CanDoubleRead
_CanDoubleRead:
; XAR4 -> StorePtr
; XAR5 -> RegPtr
PUSH ST1 ; Save status register on stack
SETC INTM ; Disable interrupts
MOVL ACC,*XAR5 ; Read CAN Register
SBF _CanDoubleRead10,NEQ ; Test If Zero (Comment to disable second-read)
MOVL ACC,*XAR5 ; If Zero, Read Again (Comment to disable second-read)
_CanDoubleRead10:
MOVL *XAR4,ACC ; Store value
POP ST1 ; Restore status register
LRETR
.global _CanDoubleWrite
_CanDoubleWrite:
; XAR4 -> RegPtr
; XAR5 -> LoadPtr
PUSH ST1 ; Save status register on stack
SETC INTM ; Disable interrupts
MOVL ACC,*XAR5 ; Load ACC with value to write
MOVL *XAR4,ACC ; Store value in register twice
NOP ; Writes to the MBR by the CAN module takes 4 cycles.
NOP ; The 4 NOPs are needed to ensure that the consecutive
NOP ; writes do not fall within this 4-cycle period.
NOP
MOVL *XAR4,ACC ; Store value in register twice (Comment to disable second-write)
POP ST1 ; Restore status register
LRETR
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -