Here is something I have used in the past.

'************************************************* ***************
'* Name : SCALE15W.BAS *
'* Notes : TO BE USED FOR SCALING 15 BIT VALUES (USING WORDS)*
' Input : INVALUE is the 15-bit value to scale
' : INMIN is the 15-bit lower bound of the value's current range
' : INMAX is the 15-bit upper bound of the value's current range
' : OUTMIN is the 15-bit lower bound of the value's target range
' : OUTMAX is the 15-bit upper bound of the value's target range
' Output : OUTVALUE holds the 16-bit result
'************************************************* ***************
INVALUE VAR WORD
OUTVALUE VAR WORD
INMIN VAR WORD
OUTMIN VAR WORD
INMAX VAR WORD
OUTMAX VAR WORD


SCLTEMP0 VAR WORD
SCLTEMP1 VAR WORD
SCLTEMP2 VAR WORD
SCLTEMP3 VAR WORD


'************************************************* ***************
SCALE_16W:
'************************************************* ***************
SCLTEMP1 = INVALUE - INMIN
SCLTEMP2 = OUTMAX - OUTMIN
SCLTEMP3 = INMAX - INMIN
SCLTEMP0 = SCLTEMP1 * SCLTEMP2
SCLTEMP2 = DIV32 SCLTEMP3
SCLTEMP0 = SCLTEMP2 + OUTMIN
OUTVALUE = SCLTEMP0