Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Optimized compilation request

Status
Not open for further replies.

NorthGuy

Well-Known Member
May I please ask someone with optimized compiler for PIC16F to complie the code below with the highest level of optimization and post the disassembly. Would be better still to see results from different compilers.

I need this because I entered a discussion in a different forum concerning the efficiency of C compilers.

C:
void main()
{
    unsigned char var;
    var = 'A';
    while (1) {
        switch (var) {
            case 'A' :
                WREG = 'a';
                break;
            case 'B' :
                NOP();
                NOP();
            case 'C' :
            case 'G' :
            case 'I' :
            case 'K' :
                WREG = 'k';
                break;
            case 'X' :
            case 'Y' :
            case 'Z' :
                WREG = 'z';
                break;
            default :
                WREG = 0;
        }
        var++;
    }
}
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top