Created
June 11, 2010 04:01
-
-
Save stevej/434027 to your computer and use it in GitHub Desktop.
A simple example of doing memory-mapped IO on an ARM7 (this turns on a Red LED for a UberBoard v2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.equiv GPIO_BASE_ADDR, 0x0E0028000 | |
.equiv IOCLR0, GPIO_BASE_ADDR + 0x0C | |
.equiv IODIR0, GPIO_BASE_ADDR + 0x08 | |
.equiv RED_LED, 1 << 18 | |
.globl _start | |
_start: | |
ldr r1, =IODIR0 | |
ldr r2, =RED_LED | |
str r2, [r1] | |
ldr r1, =IOCLR0 | |
ldr r2, =RED_LED | |
add r2, r2, r1 | |
str r2, [r1] | |
_loop: | |
b _loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment