This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why the compiler thinks I want to write assembly codes

#include<reg51.h>
typedef unsigned int u16;
void main()
{
P0=0x01;
u16 i;
}

Placing a statement declaring a new variable following a statement assigning an 8-bit IO port makes the compliler report the error

syntax error near 'u16', expected '__asm'
'i': undefined identifier

If exchange 'P0=0x01;' and 'u16 i;', the compiler won't report a error, why ? Is this a bug of the compiler?

Parents Reply Children
No data