my code
#include <REGX51.H> void delay(unsigned int i) { unsigned int j,k; for(j=0;j<=i;j++) { for (k=0;k<=1275;k++); } } void main (void) { unsigned char mybyte; P1=0xff; mybyte=P1; delay(250); P2=mybyte; }
Why are you spamming the forum with identical posts? ... that have no bearing on your problem. The 'code' ('code' in quotes, because nothing without comments deserve the name 'code') will not, in itself, create the problem you state.
Erik
Not being a C51 guy, I don't know if it is related, but the OP is missing an infinite loop in his main function...