hi thanks for the input guys

to get it to do what i want i used longs ;(
which i would like to change to 2 x word variables for this one long variable "Event_Dist_Speed "

i thinking perhaps the nbit math may work but not sure how it may be done with the calculations i have now


Code:
' routine to calc speed based on sec under 18 hours 
Distance_Calc_Speed0:            
              
  if Event_Dist_Timebase = 0 then Event_Dist_Speed = Event_Dist_Value                      ' calculate speed with base in secs 
  if Event_Dist_Timebase = 1 then Event_Dist_Speed = Event_Dist_Value*60                   ' calculate speed with base in mins
  Event_Dist_Speed = Event_Dist_Speed*100/(EL1_Seconds + (EL1_Minutes + EL1_Hours*60)*60)  
  if Event_Dist_Timebase = 2 then gosub Distance_Speed_Calc2                               ' calculate speed with base in hours - gosub becuase it is called as a seprate display 
 ' HSEROUT [" Event_Dist_Speed = ",dec Event_Dist_Speed, 10,13] ' debug 
             
 return   
' ----------------------------------------------------------------
 ' routine to calc speed based on sec 's 
' used when time is >18 hours so that value is < word max size            
Distance_Calc_Speed1:            
       

 return   

' ------------------------------------------------------------------
' show KPH or MPH on every base reading formular 
' calculate speed with hours base 
' called as 2nd speed display details 
Distance_Speed_Calc2:
    
    Event_Dist_Speed = Event_Dist_Value*360 
    if Event_Dist_Measure  = 0 then  Event_Dist_Speed = (Event_Dist_Speed*1000/5280)/(EL1_Seconds + (EL1_Minutes + EL1_Hours*60)*60)       ' if feet distance base 
    if Event_Dist_Measure  = 1 then  Event_Dist_Speed =  Event_Dist_Speed*100       /(EL1_Seconds + (EL1_Minutes + EL1_Hours*60)*60)/100   ' if meters distance base 
    if Event_Dist_Measure  > 1 then  Event_Dist_Speed =  Event_Dist_Speed*1000      /(EL1_Seconds + (EL1_Minutes + EL1_Hours*60)*60)       ' if Miles or KM  distance base 
   
  '  HSEROUT [" hour reading Event_Dist_Speed = ",dec Event_Dist_Speed ,10,13] ' debug 
return                     

'------------------------------------------------------------------

Show_Speed_Value:
   gl_x = 0
   gl_y = 48  
   gl_k = 0 
   for gl_k = 0 to 7
        lookup gl_k,["    x.xx"],Sml_font               ' 8 chrs 
        gosub Get_Sml_font                                    ' Get Font in K9_Fonts_banners.bas    
        gl_x = gl_x+8
   next gl_k      
  
   gl_x = 0                 ' puts 5 digits of speed 00000.xx 
   g_num = Event_Dist_Speed /100  ' get the base value 00000.xx 
   gosub Sml_put_5dig
             
   
   gl_x = 48                ' put first 2 digits of speed xxxxx.00 
   g_num = Event_Dist_Speed 
   gosub Sml_put_2dig
   
  
   
          
  
 return