We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Anyone here with the same Problem? I think that C51 V6.14 generates wrong code. Chris the following code
#pragma src #include "80CL580.H" extern handleLayer2Event( unsigned int ); //extern HandleLayer2Event( unsigned char, unsigned char ); #define EV_CHAR 0 #define EV_BADC 1 #pragma SAVE #pragma AREGS #pragma RB(1) void isrHost() small { CY = RB8; ACC = S0BUF; if( CY != P ) { B = EV_BADC; } else { B = EV_CHAR; } handleLayer2Event( (unsigned int)B << 8 | ACC ); // HandleLayer2Event( B, ACC ); } #pragma RESTORE
$NOMOD51 ?PR?isrHost?M SEGMENT CODE EXTRN CODE (_handleLayer2Event) PUBLIC isrHost RSEG ?PR?isrHost?M isrHost: USING 1 MOV C,RB8 MOV A,S0BUF JNB P,?C0004 CPL C ?C0004: JNC ?C0001 MOV B,#01H SJMP ?C0002 ?C0001: CLR A MOV B,A ?C0002: MOV R7,B MOV A,R7 MOV R6,A MOV R7,A LJMP _handleLayer2Event END
?C0002: MOV R7,B MOV R6,A LJMP _handleLayer2Event