cpp
复制代码
.text
.global _start
_start:
@1
LDR R0,=0X50000A28
LDR R1,[R0]
ORR R1,R1,#(0X3<<4)
STR R1,[R0]
@2
LDR R0,=0X50006000
LDR R1,[R0]
BIC R1,R1,#(0X3<<20)
ORR R1,R1,#(0X1<<20)
BIC R1,R1,#(0X3<<16)
ORR R1,R1,#(0X1<<16)
STR R1,[R0]
LDR R0,=0X50007000
LDR R1,[R0]
BIC R1,R1,#(0x3<<20)
ORR R1,R1,#(0X1<<20)
STR R1,[R0]
@3
LDR R0,=0X50006004
LDR R1,[R0]
BIC R1,R1,#(0X1<<10)
BIC R1,R1,#(0X1<<8)
STR R1,[R0]
LDR R0,=0X50007004
LDR R1,[R0]
BIC R1,R1,#(0X1<<10)
STR R1,[R0]
@4
LDR R0,=0X50006008
LDR R1,[R0]
BIC R1,R1,#(0X3<<20)
BIC R1,R1,#(0X3<<16)
STR R1,[R0]
LDR R0,=0X50007008
LDR R1,[R0]
BIC R1,R1,#(0X3<<20)
STR R1,[R0]
@5
LDR R0,=0X5000600c
LDR R1,[R0]
BIC R1,R1,#(0x3<<20)
BIC R1,R1,#(0X3<<16)
STR R1,[R0]
LDR R0,=0X5000700c
LDR R1,[R0]
BIC R1,R1,#(0x3<<20)
STR R1,[R0]
@6
@亮
loop:
LDR R0,=0X50006014
LDR R1,[R0]
ORR R1,R1,#(0X1<<10)
STR R1,[R0]
BL delay
@灭
LDR R0,=0X50006014
LDR R1,[R0]
BIC R1,R1,#(0x1<<10)
STR R1,[R0]
BL delay
@6
@亮
LDR R0,=0X50007014
LDR R1,[R0]
ORR R1,R1,#(0X1<<10)
STR R1,[R0]
BL delay
@灭
LDR R0,=0X50007014
LDR R1,[R0]
BIC R1,R1,#(0x1<<10)
STR R1,[R0]
BL delay
@6
@亮
LDR R0,=0X50006014
LDR R1,[R0]
ORR R1,R1,#(0X1<<8)
STR R1,[R0]
BL delay
@灭
LDR R0,=0X50006014
LDR R1,[R0]
BIC R1,R1,#(0x1<<8)
STR R1,[R0]
BL delay
b loop
@延时装置
delay:
LDR R4,=0X10000000
mm:
cmp r4,#0
subne r4,r4,#1
bne mm
mov pc,lr
.end