when i burnt the example hex file the hardware is working. but when the code i copied and compiled using keil uVision2 and converted to hex its not working what is the problem
What other "arbitrary" value? Note that 32000 is close to the limit for a signed integer.
Next thing - repeating the port output 32000 times isn't the way to create a delay. You really should separate the delay functionality from turning on or off the port pins. Your code would greatly change blink frequency if you add some extra lines of code inside the for loops. Having a delay function giving 100ms delay would mean that extra code together with the "port on" or "port off" would make an extremely small change in blink frequency.
please show me using some code.. and please explain me about port0