📄 assemb.s
字号:
/*********************************************************************
Author : ADI - Apps www.analog.com/MicroConverter
Date : Sept. 2005
File : assemb.s
Hardware : Applicable to ADuC702x rev H or I silicon
Currently targetting ADuC7026.
Description : Blink_Setup enables P4.2 as an output.
Blink takes the value passed too it by the C code,
which is passed in R0 as per APCS Spec., and
compliments P4.2.
assemb is compiled in ARM by default.
If desired, you may return a value in R0 to the C file.
Note: For more complex examples you will be required to
save any registers you corrupt onto the stack.
*********************************************************************/
AREA ?C?bla, CODE, READONLY, ALIGN=2
PUBLIC Blink_Setup?A
PUBLIC Blink_Setup?T
Blink_Setup?T PROC CODE16
BX R15 ; switch to ARM mode
NOP
ENDP
Blink_Setup?A PROC CODE32
GP4DAT EQU 0XFFFFF460
;Begin by initialising Port 4.2 as an output
LDR R0,=GP4DAT
MOV R1,#0x04000000
STR R1,[R0]
BX LR ; return
ENDP
PUBLIC Blink?A
PUBLIC Blink?T
Blink?T PROC CODE16
BX R15 ; switch to ARM mode
NOP
ENDP
Blink?A PROC CODE32
LOOP:
SUBS r0,r0,#1 ; Decrement Delay Value, Set Flags
bne LOOP ; If zero, continue
LDR R0,=GP4DAT
LDR R1, [R0]
EOR R1,R1,#0x00040000 ;Toggle Pin value
STR R1,[R0]
bx lr ; return
ENDP
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -