Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Assembly 

Setting Two Bits High In Register

I'm working with Raspberry Pi for a class project and very new to assembly, so I'm pretty much retarded at it right now.

So I'm trying to enable output to two GPIO pins. I can set one no problem. But I have a fundamental misunderstanding of how assembly handles things

for example
Code
move r1, #1
lsl r1, #12
str r1,[r0,#4]
That code maps to GPIO 14. I also want to set the bit to GPIO 15 and can't seem to get it right. I thought I could just perform another lsl but that shifts over all the data.

So basically I also need to set bit 15 to 1 in r1.
I'm confused.
Use a bitwise OR to set bits. orr r1, #0x8000 will set bit #15 in r1. Leaving the other bits intact.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by thegeistJun 19, 2020 05:33 AM 3 153 Jun 19, 2020 05:33 AM
Last Post: thegeist
by hdev0Sep 1, 2019 02:57 PM 0 94 Sep 1, 2019 02:57 PM
Last Post: hdev0
by g4143Jun 3, 2009 10:03 PM 11 219 Jun 3, 2009 10:03 PM
Last Post: scaryblackguy