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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…