I use evalution version 3.36 of keil compiler. Consider compilable code:
#include <REG52.H> typedef unsigned char BYTE; BYTE BufStart = 0; BYTE BufStop = 0; BYTE IP_ADDR[1]; void send_byte(char c) { while (!TI); TI = 0; SBUF = c; } void main () { // initialization of serial data rate SCON = 0x50; TMOD |= 0x20; TH1 = 243; TR1 = 1; TI = 1; // send addresses of variables to serial send_byte(&BufStop); // 10 send_byte(&BufStart); // 9 send_byte(IP_ADDR); // 8 send_byte(&IP_ADDR[0]); // 8 send_byte(&IP_ADDR[1]); // 9 for (;;); }
It is no bug. If you want to access the IP_ADDR[1] you have to declare a array with the size of 2 elements (BYTE IP_ADDR[2]).
Most of the bugs are in my head.
evalution version 3.36 Wow! That's circa 1989 or 1990. We've had a lot of releases since then. Jon