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.
#include <AT892051.H> #pragma OPTIMIZE (9, SPEED) void main (void) { unsigned char R; R=0; // this statement always produces ASM-code: // CLR A // MOV R7,A // ...!!!!.... why not MOV R7,#0 (2 bytes 1 cycle instead of 2 bytes and 2 cycles) // but, if R=5; is produced code: MOV R7,#05H ;;;;;;; :o) //.... if(P1==0x55) R++; //... //... }
Excuse me, but you are mistaken.
MOV Rn,#data bytes 2 Cycles 1
Look in the bible on MCS51. It's real .