A simple arm program that allows LED lights to shine. what's the problem?
Source: Internet
Author: User
A simple arm program that allows LED lights to shine. what's the problem? -- Linux general technology-Linux programming and kernel information. The following is a detailed description. A simple arm program with LED lights shining
. Text
. Global _ start
_ Start:
LDR R0, = 0x56000010 @; GPBCON Set
Mov r1, #0x00015400 @; set all output
Str r1, [r0]
Ldr r0, = 0x56000014 @; GPBDAT
On:
Mov r1, #0x00000000 @; all led on
Str r1, [r0]
Bl dly @; delay
Off:
Mov r2, #0x000001e0 @; all led off
Str r2, [r0]
Bl dly
B on
Dly: @; delay 1000*1000 unit
Mov r3, #1000.
Dly0:
Mov r4, #1000.
Dly1:
Sub r4, r4, #1
Cmp r4, #0
Bne dly1
Sub r3, r3, #1
Cmp r3, #0
Bne dly0
Mov pc, lr @; return
Main_loop:
B main_loop
Let's take a look at the code.
After compilation, binfiles can be generated, but the running results in the memory are not as expected. all the lights are on, but they are not flashing. why?
Is there any problem with the code?
Remove the Latency. the on or off code is valid and can be switched on.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.