GETHIGH16 (v)
Purpose This function returns the upper 16-bits of a signed 32-bit integer variable v. This can be used to break the value of a signed 32-bit integer data or variable into two signed 16-bit values so that they can be saved to the EEPROM or to the 16-bit DM[n].
Examples

DM[1] = GetHIGH16(A)
save_EEP GetHIGH16(&H12345678), 10

Note: If the result is saved to a 32-bit variable, the upper 16 bits will retain the sign because all variables are signed in TRiLOGI. A negative value will be reflected by having &HFFFF inserted in the upper 16 bits of the result variable. Otherwise, the upper 16 bits would be &H0000

A= GetHIGH16(&H80000001) ' A will be &HFFFF8000
A= GetHIGH16(&H12345678) ' A will be &H00001234

See Also SETHIGH16

backbutton.gif (507 bytes)  Basic to TBASIC Reference Manual