I'm carefully following Baking Pi with my model B, making sure I fully understand everything going on. I am now at lesson 5, to flash the SOS Morse code. It works fine, but I am curious why it needs two ldr instructions to load the pattern. (Link to the site)
The data section defines:
.align 2
pattern:
.int 0b11111111101010100010001000101010
And this pattern is loaded into register r4 (.req ptrn) by:
ptrn .req r4
ldr ptrn,=pattern
ldr ptrn,[ptrn]
So why the double ldr?
I tried without the second one, but that screws up the pattern. Does it have to do with the alignment? I thought the first Load Register would be enough to load the value.
Thanks :)