Thanks for the help Salem. I had a read of the FAQ and saw your suggestion shown on there. If you go back to my second from last post you will see I said that I said I tried to change the condition of the while loop just like you asked. For some reason though it seems to just endlessly print out "FF". I have posed the change here just encase I made a stupid mistake somewhere. I'm also now reading the characters into a int like you said and then casting to a char.
Code:
unsigned char c;
int a = 0;
while ( ( (c = fgetc(in)) != EOF )) {
a = fgetc(in);
c = a;
//int opcode = c & 0xc0;
//opcode = opcode >> 6;
//int operand = c & 0x3f;
//printf("\n%d %d", opcode, operand);
printf("%02x\n", c);
}
printf("\nEnd of file\n");