📄 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.
*********************************************************************/
.include "ADuC7026.equ"
.ARM @ Delcare this code to be assembled as ARM
.GLOBL Blink_Setup @ declare Blink_Setup as global for linking
Blink_Setup:
ldr r5, =GPIOBASE @ Load the GPIOBASE MMR Location into R5
mov r7, #0x04000000 @ Value required to enable P4.2 as an output
str r7, [r5, #0x60] @ Enable P4.2 as output
bx lr @ return
.GLOBL Blink @ declare Blink as global for linking
Blink:
Blink_Del:
subs r0,r0,#1 @ Decrement Delay Value, Set Flags
bne Blink_Del @ If zero, continue
mov r2, #-1560281088
mov r2, r2, asr #19 @ R2 now contains GP4DAT address
ldr r3, [r2, #0] @ Get current value
eor r3, r3, #262144 @ XOR it to cause complimenting
str r3, [r2, #0] @ Write value to GP4DAT
bx lr @ return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -