piclist 2001\12\03\181810a >
Thread: Accessing a var as a byte or bits in C
face BY : mikespam@whitewing.co.uk

On Mon, 3 Dec 2001 15:43:05 -0500, you wrote:

>Normal C has bitfields in it. Usually you use them in structs or unions.
>Problem is you don't usually know which bit is assigned, so I prefer
>assembly at that level of detail.

Hitech allows bit vars to be declared, and also to be assigned to
fixed addresses for hardware, e.g. static volatile bit     GP5     @ (unsigned)&GPIO*8+5;

GP5 = 1;
generates BSF GPIO,5
Unfortunately you can't use the @ operator on vars whose address is
not known at compile time, so this doesn't solve the original problem.

>{Original Message removed}
<kevn0ug5shhlt71a6db7slqieb9glm3prd@4ax.com> quoted-printable

In reply to: <01b801c17c3b$1bce3ca0$2570cd84@concordia.ca>
See also: www.piclist.com/techref/microchip/languages.htm?key=c
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Accessing a var as a byte or bits in C

month overview.

new search...