On Thu, Mar 12, 2015 at 6:34 AM, cdb wrote: > On Wed, 11 Mar 2015 23:16:45 -0400, Josh Koffman wrote: > :: I've seen a few different ways to do this, and I'm not sure if > :: there are better or worse ways on this one. I am working in XC8, and I > :: want to be able to set multiple bits in a register at once. > > I normally try different ways with a new compiler/build and check the > assembler to see which gives the closest to an assembler instruction. > > Is this what you are wanting to do? > > OPTION_REG=3D(1< > Note the first two set to '1' the last keeps it as '0' Hi Colin, I goofed when I first asked the question. I should have stated I was trying to merge some data into a register, not specifically set or clear bits. However, I do have an adjunct question. When performing an operation like you mentioned above, what happens to the bits that aren't specifically called out? Is that type of operation compiled such that it executes as something that leaves the existing bits alone? Thanks! Josh --=20 A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. -Douglas Adams --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .