PIC18F2550 and DS1307 i2c RTC MPLAB assembly code. Have to loop for seconds,mins,hrs
After spending many hours on the internet I have come up with an answer to my own question. 
Below is the Updated code that in some parts replace the above code.
PIC18F2550 and DS1307 i2c RTC MPLAB assembly code.
 Code used to get time,date,etc from DS1307.