problem in 8051 Microcontroller (AT89C51)

No, your code is wrong.

I think the compiler will optimize out those loops you're hoping to use for a delay, so instead of actually delaying execution, I would wager that your delay implementation has been completely optimized out, so the delay(1000) is executing in a couple of microseconds, rather than acting as a delay.

You also don't appear to actually be changing the LED: You've initialized led=P1^0, so led is ending up set to whatever P1^0 (I'm guessing that's the port register on the 8051's?) is at startup, and then you assign other values to it. But nowhere do you write the new value of led to P1, so you're not changing the pin anywhere after setup().