I'm not sure what you mean. Something like one of these?
Code:
#include <stdio.h>
int main()
{
unsigned char x0; /* could be other int data type */
unsigned char x1; /* could be other int data type */
unsigned char y0; /* could be other int data type */
unsigned char y1; /* could be other int data type */
unsigned char z0; /* could be other int data type */
unsigned char z1; /* could be other int data type */
x0 = 0;
x1 = 255;
y0 = x0 & 1; /* bit operation on lsb */
y1 = x1 & 1; /* bit operation on lsb */
z0 = (x0 == 255); /* logic operator */
z1 = (x1 == 255); /* logic operator */
printf("x1 = %3d (0x%02x hex), x1 = %3d (0x%02x hex)\n", x0, x0, x1, x1);
printf("y0 = %3d (0x%02x hex), y1 = %3d (0x%02x hex)\n", y0, y0, y1, y1);
printf("z0 = %3d (0x%02x hex), z1 = %3d (0x%02x hex)\n", z0, z0, z1, z1);
return 0;
}
Regards,
Dave