Here is my code , Time/temp display and IR decode

Pls advise ...

Define LOADER_USED 1
DEFINE OSC 4
@ Device pic16F877A, xt_OSC, BOD_OFF, PWRT_ON, WDT_OFF, PROTECT_OFF 'WRT_On

Segments Var PORTC
Digits Var PORTD 'D
i Var Byte
n Var Byte
Value Var Word

' Allocate variables
command var Byte ' Storage for command
J var Byte ' Storage for loop counter
temp var Word ' Storage for temperature
T VAR Word
DQ var PORTD.5 ' Alias DS1820 data pin
DQ_DIR var TRISD.5 ' Alias DS1820 data direction pin
read_done var Byte

'=================DS1307

'include"modedefs.bas"
'SO var portc.6 ' tx
DPIN var PORTE.0 ' I2C DATA PIN 24LC256 and ds1307,with 4K7 pull up
CPIN var PORTE.1 ' I2C CLOCK PIN with pulled up resister 4K7
B1 var Byte
B2 var Byte
B3 var Byte
B4 var Byte
B5 var Byte
B6 var Byte
B7 var Byte
B8 var Byte

BB var Byte
B_H var Byte
B_L var Byte
B_W VAR Word
SEC VAR Byte
M VAR Byte
HR VAR Byte
TIMES VAR Word
LOOPP VAR Byte

'==================DS1307

'IR +++++++++++++++++++++
pulses VAR Byte[16]
BitMask VAR Word
U VAR Byte 'loop index
V VAR Byte 'byte index
LeadIn VAR Word 'start pulse
Lstatus con 10
Bot con 15
Cmd con 17
Bot1 Var Byte
Cmd1 var Byte

Botx Var Byte
Cmdx var Byte
Botxstr Var Byte
Cmdxstr var Byte
n = 0
'===========ir

'TRISA = $F1 '1
'PORTA = $FF
TRISB = $01 '1
PORTB = $01 '1
TRISc = $00 ' Set segment pins to output
portc = $FF
TRISd = $F0 ' F0 Set digit pins to output
portd = $FF 'FF
TRISE = $00 ' Set digit pins to output
portE = $FF 'FF

On Interrupt GoTo IR_B0
INTCON = %10010000 ' Enable RB0 interrupt

' Set time & date to 21:58:00 Tuesday 6th of July 2004
' [$00,$20,$21,$2,$6,$7,$4]
' sec,min,hrs,date,month,year
' I2CWRITE DPIN,CPIN,$D0,$00,[$00,$20,$21,$2,$6,$7,$4] ' Write to DS1307

ADCON1 = 6 ' Set PORTA and PORTE to digital

'debug ====
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 12 ' 19200 Bauds ,4 m
'debug ====

'pause 150

mainloop:
LOOPP = 0
GoSub TEMP_PROCESS
date:
GoSub TIMEDS1307
GoTo mainloop

'=========================
TEMP_PROCESS:
GoSub init1820 ' Init the DS1820

command = $cc ' Issue Skip ROM command

GoSub write1820

command = $44 ' Start temperature conversion

GoSub write1820

'Pause 2000 ' Wait 2 seconds for conversion to complete

GoSub init1820 ' Do another init

command = $cc ' Issue Skip ROM command

GoSub write1820

command = $be ' Read the temperature

GoSub write1820

GoSub read1820

'Display the decimal temperature

value = ((temp>> 1)*100)+((TEMP.0*5)*10)
GoSub display
If LOOPP < 254 Then 'goto TIMEDS1307
LOOPP = LOOPP + 1
GoTo TEMP_PROCESS
EndIf
Return 'return to mainloop

' Initialize DS1820 and check for presence
init1820:
Low DQ ' Set the data pin low to init
Pauseus 500 ' Wait > 480us
DQ_DIR = 1 ' Release data pin (set to input for high)

Pauseus 100 '100 ' Wait > 60us
If DQ = 1 Then
'Lcdout $fe, 1, "DS1820 not present"
PORTC = $39
Low DIGITS.0
PAUSE 150
PORTC = $0
'Pause 150
GoTo mainloop ' Try again
EndIf
Pauseus 400 ' Wait for end of presence pulse
Return


' Write "command" byte to the DS1820
write1820:
For i = 1 To 8 ' 8 bits to a byte
If command.0 = 0 Then
GoSub write0 ' Write a 0 bit
Else
GoSub write1 ' Write a 1 bit
EndIf
command = command >> 1 ' Shift to next bit
Next i
Return

' Write a 0 bit to the DS1820
write0:
Low DQ
Pauseus 60 ' Low for > 60us for 0
DQ_DIR = 1 ' Release data pin (set to input for high)
Return

' Write a 1 bit to the DS1820
write1:
Low DQ ' Low for < 15us for 1
@ nop ' Delay 1us at 4MHz
DQ_DIR = 1 ' Release data pin (set to input for high)
Pauseus 60 ' Use up rest of time slot
Return


' Read temperature from the DS1820
read1820:
For i = 1 To 16 ' 16 bits to a word
temp = temp >> 1 ' Shift down bits
GoSub readbit ' Get the bit to the top of temp
Next i
Return

' Read a bit from the DS1820
readbit:
temp.15 = 1 ' Preset read bit to 1
Low DQ ' Start the time slot
@ nop ' Delay 1us at 4MHz
DQ_DIR = 1 ' Release data pin (set to input for high)
If DQ = 0 Then
temp.15 = 0 ' Set bit to 0
EndIf
Pauseus 60 ' Wait out rest of time slot
Return

'========================================