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

syntax error

always get a syntax error 141 near else

void shiftout (char a)
{
char R3;
char R2;
R3 = a;
for (R2 = 0x08; R2 !=0; R2--)
{
if (R3^7 == 1);
{
R3 =_crol_(R3,1);
datalijn = 1;
}
else
{
R3 =_crol_(R3,1);
datalijn = 0;
}
_nop_();
klok = 1;
_nop_();
klok = 0;
}
}

Parents
  • Please read the instructions about posting code!

    Then you will get a legible layout, like this:

    void shiftout (char a)
    {
       char R3;
       char R2;
       R3 = a;
       for (R2 = 0x08; R2 !=0; R2--)
       {
          if (R3^7 == 1); // Semicolon??!!
          {
             R3 =_crol_(R3,1);
             datalijn = 1;
          }
          else
          {
             R3 =_crol_(R3,1);
             datalijn = 0;
          }
          _nop_();
          klok = 1;
          _nop_();
          klok = 0;
       }
    }

Reply
  • Please read the instructions about posting code!

    Then you will get a legible layout, like this:

    void shiftout (char a)
    {
       char R3;
       char R2;
       R3 = a;
       for (R2 = 0x08; R2 !=0; R2--)
       {
          if (R3^7 == 1); // Semicolon??!!
          {
             R3 =_crol_(R3,1);
             datalijn = 1;
          }
          else
          {
             R3 =_crol_(R3,1);
             datalijn = 0;
          }
          _nop_();
          klok = 1;
          _nop_();
          klok = 0;
       }
    }

Children
No data