I have compiled this simple code on XC8 compiler and loaded the hex file into Picsimlab - simulator board (board 4) having PIC16f877a microcontroller.
unsigned int x = 1;
char *ptr = (char *) &x;
if (*ptr == 1)
{
clcd_print("little Endian", LINE1(0));
}
else
{
clcd_print("big Endian", LINE1(0));
}
output: little endian
So can we deducde that Xc8 compiler follows little endian byte ordering system to program PIC16f877a?
Does that also mean that PIC16f877a stores variables into its data memory using little endian byte ordering system?
Can you please provide link to documentation mentioning about the byte ordering system followed by PIC16f877a and XC8 compiler?