[A89] Re: Setting bit fields


[Prev][Next][Index][Thread]

[A89] Re: Setting bit fields




> I want to change some things in the I/O ports. $600015. But i dont want to
> change all bits. What is the most used way to do this?
> ...
> AND all bits to be reset with 0 and OR the bits to be set with 1? Or
> should I just move a byte over there?

Yup, you should only need two total instructions -- one AND, one OR.  You
can AND multiple bits in one instruction by ANDing the entire byte with a
mask (want to reset all but bit 6?  AND the byte with 0xBF); same thing with
OR.

    -Scott





Follow-Ups: