标签:star loop 手册 设置 lan href nbsp 裸机 blank
转载请注明原文出处,http://www.cnblogs.com/flyingcloude/p/6992476.html
.globl _start
_start:
/*硬件相关的设置-该设置是ARM11中特有的,告诉CPU外围设备的基地址*/
ldr r0, =0x70000000
orr r0, r0, #0x13
/*设置协寄存器,在ARM11内核手册中有说明*/
/*r0 = 0x70000013 表示 长度为256M*/
mcr p15, 0, r0, c15, c2, 4
/*关看门狗*/
/*WTCON(0X7E004000) = 0*/
ldr r0, =0x7E004000
mov r1, #0
str r1, [r0]
/*设置GPKCON0让 GPK4,GPK5,GPK6,GPK7作为输出引脚*/
ldr r0, =0x7F008800
ldr r1, =0x11110000
str r1, [r0]
/*设置GPKDAT让 GPK4 = 0, GPK5 = 1, GPK6 = 0, GPK7 = 1*/
/*即LED1亮,LED2暗,LED3亮,LED4暗*/
ldr r0, =0x7F008808
mov r1, #0x00A0
str r1, [r0]
loop:
str r1, [r0]
add r1, r1, #1
moveq r1, #0
bl delay
cmp r1, #256
moveq r1,#0
b loop
delay:
mov r2, #0x100
delay_loop:
sub r2, r2, #1
cmp r2, #0
bne delay_loop
mov pc, lr
halt:
b halt
转载请注明原文出处,http://www.cnblogs.com/flyingcloude/p/6992476.html
标签:star loop 手册 设置 lan href nbsp 裸机 blank
原文地址:http://www.cnblogs.com/flyingcloude/p/6992476.html