![]() |
|
[Assembly] Setting Two Bits High In Register - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5) +---- Thread: [Assembly] Setting Two Bits High In Register (/showthread.php?tid=4462524) |
Setting Two Bits High In Register - _spun - Sep 25, 2014 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, #1So basically I also need to set bit 15 to 1 in r1. I'm confused. * - K4Fr - Sep 26, 2014 Use a bitwise OR to set bits. orr r1, #0x8000 will set bit #15 in r1. Leaving the other bits intact. |