|
楼主 |
发表于 2006-3-29 22:34:52
|
显示全部楼层
之前就这一段代码老出问题,现在只能这样写
/* set memory */
memsetup:
ldr r0, =MEMORY_CONFIG
ldmia r0, {r1-r13}
ldr r0, =0x01c80000
stmia r0, {r1-r13}
/* copy kernel from Flash address 0x10000 to RAM address 0xc300000 */
ldr r0, =0x10000
ldr r1, =0xc300000
add r2, r0, #(1536 * 1024)
copy_kernel:
ldmia r0!, {r3-r10}
stmia r1!, {r3-r10}
cmp r0, r2
ble copy_kernel
/* jump to ram */
ldr sp, =0xc700000
ldr r0, =0x0
ldr r1, =0xc300000
mov pc, r1
我的点led程序是这样的 .equ PCONF, 0x01D20034
.equ PDATF, 0x01D20038
.globl _start
_start:
/* set Port B */
ldr r1, =PCONF
ldr r0, =0x09256a
str r0, [r1]
/* set led */
ldr r1, =PDATF
ldr r0, =0x1f7
str r0, [r1]
stop:
b stop |
|