i am trying to compile the below code with MPASM assempler but i receive garbage when i checking with hyper terminal the debug but when i change the assempler and compile it again it works fine.do you know why this happends?i want to use darrel interrups so i have to compile it with MPASM. i am using PBP 2.47 and microcode studio 3.0.0.5.

'---------DEFINES---------------------------------
define osc 12
DEFINE DEBUG_REG PORTB 'set pin port for debug
DEFINE DEBUG_BIT 5 'set pin bit for debug
DEFINE DEBUG_BAUD 4800 'set debug baud rate for debug
DEFINE DEBUG_MODE 0 'set debug mode 0=true

'----------VARIABLES-------------------------
temp1 var byte
temp2 var byte
dist var word
command var byte
temp3 var byte
flag var byte 'this flag is for checking


'----------SYMBOLS-------------------------
SYMBOL led=portb.7
symbol sensor_tx=portc.0
symbol sensor_rx=portc.1
symbol wireless_rx_tx=portc.3
symbol wireless_tr_re=portc.2


'---------INITIAL----------------------------
INTCON=0 'no interrupts
CMCON=7 'comparators off
TRISC.4=0 'make trisc bit 4 output
TRISC.3=0 'make trisc bit 3 output
TRISC.0=0 'make tx sensor output
TRISC.1=1 'make rx sensor input
TRISB.7=0 'make trisb bit 7 output
TRISC.2=0 'make trisc bit 2 output
ADCON1=7 'turn off a/d module
flag=0

'-------------MAIN PROGRAMM-------------------------
clear 'clear all variables in ram
gosub logo 'print the logo on local debuger
HIGH led 'light the led
main:


gosub sensor 'take the distance
if dist=0 then
goto error_sensor 'if no value the sensor not connected jump to error
goto main 'loop to main
endif
wait_for:

gosub wait_wireless 'wait to read the command from remote
debug "the value is ",dec dist,10,13
gosub send_data ' transmit data wireless
GOTO wait_for
end

'------------END OF THE PROGRAMM---------------------------------------------




'--------------LABELS-------------------------------------------

sensor:
temp1=0 'clear variable
temp2=0 'clear variable
dist=0 'clear variable
if flag=0 then
serout2 sensor_tx,84,[0,84] 'send serial command to sensor if not jump to error_sensor
serin2 sensor_rx,84,500,error_sensor,[temp2,temp1] 'receive the value if don't jump to error_sensor
else
serout2 sensor_tx,84,[0,84]
serin2 sensor_rx,84,500,error_sensor2,[temp2,temp1]
endif
dist.highbyte=temp2 'convert it to word highbyte(16bits)
dist.lowbyte=temp1 'convert it to word lowbyte (16bits)
return

logo:
debug "OIL LEVEL MEASURMENT VER 1.0 BY VAMVAKOURIS",10,13
debug "COPYRIGHT 2008",10,13
RETURN




error_sensor:

debug "ERROR",10,13
DEBUG "CANNOT COMMUNICATE WITH SENSOR",10,13
DEBUG "CHECK THE CABLE",10,13
PAUSE 10000 'wait 10 sec
flag=0
GOTO main




error_sensor2:

debug "LOST THE COMMUNICATION WITH SENSOR",10,13
DEBUG "CHECK THE CABLE",10,13
GOTO sensor




wait_wireless:
low wireless_tr_re
debug "READY TO RECEIVE COMMAND",10,13
serin2 wireless_rx_tx,84,10000,no_signal,[temp3,command]' 36="$" command=1
if temp3=36 and command=1 then
flag=1
gosub sensor
else
goto error_data
endif

return



no_signal:

pause 10
goto wait_wireless



error_data:
debug "WRONG START COMMAND",10,13
DEBUG "CHECK THE WIRELESS COMMUNICATION",10,13
PAUSE 100 'wait 100msec
GOTO wait_for 'go and check again


send_data:

high wireless_tr_re 'enable transmit mode
pause 2 'pause 2msec
serout2 wireless_rx_tx,84,[dec 35,dist] 'send # and dist
pause 2 'pause 2msec
return