u08 foo; // declare an 8-bit variable
outb(DDRD, 0x00); // set port D pins to input
outb(PORTD, 0xFF); // set pull-ups on port D
foo = inb(PIND); // read the value of the port D pins
// and store it in the variable foo
u08 bar; // declare an 8-bit variable
outb(DDRD, 0x00); // set port D pins to input
outb(PORTD, 0xFF); // set pull-ups on port D
bar = bit_is_set(PIND,1);
// bar now contains the logic value at Port D pin 2