Help with shifting pointers to arrays
Hello all! I'm in a digital platform class and have the assignment to optimize a 8081 processor design.
Currently a very small part of the code looks like this:
Code:
unsigned char t[3];
t[0] = t[1];
t[1] = t[2];
t[2] = 0;
It seems useless to load and save all these values from memory. Instead I would like to try:
Code:
unsigned char t[3], (*tptr)[3] = &t;
*tptr = *tptr << 8;
Which is supposed to do the same reassignment to my array.
I get the following error codes:
Quote:
error 48: cannot assign values to aggregates
error 43: invalid operand for shift operator
warning 113: left & right types are unsigned-char [3] ,literal-unsigned-char
The rest of my code works fine. I'm also allowed to use in-line ASM code instead. Where did I go wrong with my alternative implementation?