#define GPJ0CON 0xE0200240
#define GPJ0DATA 0xE0200244
#define GPD0CON 0xE02000A0
#define GPD0DATA 0xE02000A4
.global _start
_start:
ldr r0,=0x11111111
ldr r1,=GPJ0CON
str r0,[r1]
ldr r0,=0x11111111
ldr r1,=GPD0CON
str r0,[r1]
flash:
ldr r0,=~(1 << 3)
ldr r1,=GPJ0DATA
str r0,[r1]
ldr r0,= 0xff
ldr r1,=GPD0DATA
str r0,[r1]
bl delay
ldr r0,=~(1 << 4)
ldr r1,=GPJ0DATA
str r0,[r1]
ldr r0,=0xff
ldr r1,=GPD0DATA
str r0,[r1]
bl delay
ldr r0,=~(1 << 5)
ldr r1,=GPJ0DATA
str r0,[r1]
ldr r0,=0xff
ldr r1,=GPD0DATA
str r0,[r1]
bl delay
ldr r0,=~(1<<1)
ldr r1,=GPD0DATA
str r0,[r1]
ldr r0,=0xff
ldr r1,=GPJ0DATA
str r0,[r1]
bl delay
b flash
delay:
ldr r2, =9000000
ldr r3, =0
delay_loop:
sub r2, r2,#1
cmp r2,r3
bne delay_loop
mov pc,lr
源码:
https://download.csdn.net/download/u011711997/15249995