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

error in code

i still have problem in the code

i think it is startup.a51 and fix but still proble when run on cpu if it does not do what i say in code

when i build it gives a message

** error C138 interupt can not recieive or return a value

but i do not interupt i do not clik the stop build button

the proj is needed and i now worry big in my pants

plz send code

Parents
  • #include <stdio.h>

    int main( integer argc, char ***argv[] ) interrupt 10
    { ilv( 12 , 7); // chek the list

    initibit( 11 ); // ???

    // while (argc<>0) compiler thinks is bad

    while (argc); { initibit( argv[ argc ] };

    argc := argc - 1; }

    printf( "program complete %d\a" , argc);

    return 0

    }

Reply
  • #include <stdio.h>

    int main( integer argc, char ***argv[] ) interrupt 10
    { ilv( 12 , 7); // chek the list

    initibit( 11 ); // ???

    // while (argc<>0) compiler thinks is bad

    while (argc); { initibit( argv[ argc ] };

    argc := argc - 1; }

    printf( "program complete %d\a" , argc);

    return 0

    }

Children
  • but i do not interupt
    then what is this
    int main( integer argc, char ***argv[] ) interrupt 10

    Erik

  • i say already again

    i do not clik the stop build button!!!

    the code txes to pc. i think interrupt is for sbuf

    sbuf sends to pc not comopiler

    i thinking is big bug in compiler !!!!????

  • "when i build it gives a message

    ** error C138 interupt can not recieive or return a value"

    The first thing to do when you get such a message is to read its description in the Manual:

    "Description: An interrupt function was defined with one or more formal parameters or with a return value. Interrupt functions may not contain invocation parameters or return values."
    http://www.keil.com/support/man/docs/c51/c51_c138.htm

    So, let's have a look at your code:

    int main( integer argc, char ***argv[] ) interrupt 10
    


    The interrupt keyword defines the funcion to be an interrupt function:
    http://www.keil.com/support/man/docs/c51/c51_le_interruptfuncs.htm

    Clearly your code gives the function both a return value and some parameters, and you can't do that - just as the message says!

    "the proj is needed and i now worry big in my pants"

    Yes, I'm afraid you do have a very big worry here indeed!
    You clearly have a lot of basic study to do about embedded programming in general and the Keil tools in particular...

  • "i say already again
    i do not clik the stop build button!!!"

    It's not talking about you interrupting the build process!

    The concept of Imterrupts is absolutely basic to just about all computers - they go by the name of "IRQ" on PCs (short for "interrupt request")

    www.8052.com/tutflow.phtml

    If you don't understand this now, you have a very long way to go to complete your project!

    :=0

    "i thinking is big bug in compiler !!!!????"

    No - just a big hole in your understanding

  • initibit( 11 );

    Here, initibit() is being passed an integer.

    initibit( argv[ argc ]

    Despite the syntax errors, here initibit() is being a pointer to a pointer to a char pointer.

    What is initibit() actually doing with the pointer -- erm, I mean integer?

    argc := argc - 1;

    Did you enable the Pascal compile option?