Firstly, remember that the equality operator is ==, not just =. You need to change this in your if conditions.

Even with this change it's difficult to understand what your code is trying to do. Where are your variables declared? Do you mean getONEorZERO to be called multiple times, and each time it should execute a different section of code (guarded by your A, B, C, D variables) ? You would need to make A,B,C,D static and use else if's to do that, but it doesn't seem necessary.

Perhaps something more like this, although obviously a lot is still missing.
Code:
void read8bits(unsigned char samples[], int n)
{
    int i;
    for (i = 0; i < 8; i++)
    {
        int one_or_zero = READ_YOUR_DEVICE();

        samples[n] <<= 1; // shift bits over one position

        if (one_or_zero == 1)
        {
            samples[n] |= 1;
        }
    }
}

int main(void)
{
    unsigned char samples[4] = { 0 }; // all bits zeroed
    int i;

    // ...

    for (i = 0; i < 4; i++)
    {
        read8bits(samples, i);
    }

    // ...

    return 0;
}