I having problems with the C51 v6.2 not compiling certain lines of codes. I tried doing a search on previous posts but didn't see anything related. here are the C statements:
if (msg_inbuf!=0) // check if message waiting */ { ack_flag=1; // next received character should be ack*/ Write_S(); // Send to tx buffer */ }
; if (msg_inbuf!=0) // check if message waiting */ ; SOURCE LINE # 1562 MOV DPTR,#msg_inbuf MOVX A,@DPTR JNZ ?C0363 INC DPTR MOVX A,@DPTR ?C0363: JZ ?C0242 ; { ; SOURCE LINE # 1563 ; ack_flag=1; // next received character should be ack*/ ; SOURCE LINE # 1564 ; Write_S(); // Send to tx buffer */ ; SOURCE LINE # 1565 ; } ; SOURCE LINE # 1566
Tried everything without success. The section was part of a if-else statement. Being desperate, I swapped the if-else sections and it worked. So now it reads:
if (msg_inbuf==0) { code } else { ack_flag=1; Write_S(); }