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

C code for atmel 8951

i want a simple programe that multiply data of 2 ports(port 1&port 2) written in C

Parents
  • i want a simple programe that multiply data of 2 ports(port 1&port 2) written in C

    If this was a class assignment, you might want to give the teacher a more detailed answer to guarantee a grade worthy of your skills...

    #include <http: //www.atmel.com/8951.pdf> /* define the cpu architecture */
    
    auto code main( extern int cpu, static float oscillator ) reentrant using 8951
    {
        far register bit *result;// use the cpu registers for fast multiplication
    
        // Remember to divide both sides by the cpu speed to keep the multiply
        // operator from going unstable:
        result / oscillator = (cpu.Port1 * cpu.Port2) / oscillator;
    
        if( cpu != (void)"Atmel" )// check to make sure it is the correct controller
        {
            result += (volatile) NULL;// adjust for other microcontrollers
        }
    
        // return the result as an embedded number ('enum')
        return( (enum)main->result );
    
        goto main;// infinite loops are typical for embedded applications.
    }
    

    What kind of class would assign such a lame task or question? And what kind of student would use an answer from 'the internet' without being able to understand if it is even in the ball park of being correct? If this question had to be asked, then clearly any answer would be blindly accepted not matter how ridicules it was.

    Seriously, somebody please provide a link to such a class. This forum seems to get a lot of these 'classwork' type questions. I'd like to see what those classes expect of their students, and what the prerequisites must be.

    --Cpt. Vince Foster
    2nd Cannon Place
    Fort Marcy Park, VA

Reply
  • i want a simple programe that multiply data of 2 ports(port 1&port 2) written in C

    If this was a class assignment, you might want to give the teacher a more detailed answer to guarantee a grade worthy of your skills...

    #include <http: //www.atmel.com/8951.pdf> /* define the cpu architecture */
    
    auto code main( extern int cpu, static float oscillator ) reentrant using 8951
    {
        far register bit *result;// use the cpu registers for fast multiplication
    
        // Remember to divide both sides by the cpu speed to keep the multiply
        // operator from going unstable:
        result / oscillator = (cpu.Port1 * cpu.Port2) / oscillator;
    
        if( cpu != (void)"Atmel" )// check to make sure it is the correct controller
        {
            result += (volatile) NULL;// adjust for other microcontrollers
        }
    
        // return the result as an embedded number ('enum')
        return( (enum)main->result );
    
        goto main;// infinite loops are typical for embedded applications.
    }
    

    What kind of class would assign such a lame task or question? And what kind of student would use an answer from 'the internet' without being able to understand if it is even in the ball park of being correct? If this question had to be asked, then clearly any answer would be blindly accepted not matter how ridicules it was.

    Seriously, somebody please provide a link to such a class. This forum seems to get a lot of these 'classwork' type questions. I'd like to see what those classes expect of their students, and what the prerequisites must be.

    --Cpt. Vince Foster
    2nd Cannon Place
    Fort Marcy Park, VA

Children