User`s manual
8-13
VARPTR
(variable name)
Returns an address-value, which will help you locate where the variable
name and its value are stored in memory. If the variable you specify has not
been assigned a value, an FC error will occur when this function is called.
If
VARPTR(integer variable)
returns address K:
Address K contains the least significant byte (LSB) of 2-byte
integer.
Address K+1 contains the most significant byte (MSB) of
integer.
You can display these bytes (two's complement decimal representation) by
executing a PRINT PEEK (K) and a PRINT PEEK (K+1).
If VARPT
R(single precision variable)
returns address K:
(K)* = LSB of value
(K+1) = Next most sig. byte (Next MSB)
(K+2) = MSB with hidden (implied) leading one. Most significant bit is the
sign of the number
(K+3) = exponent of value excess 128 (128 is added to the exponent).
If
VARPTR(double precision variable)
returns K:
(K) = LSB of value
(K+1) = Next MSB
(K+…)= Next MSB
(K+6) = MSB with hidden (implied) leading one. Most significant bit is the
sign of the number.
(K+7) = exponent of value excess 128 (128 is added to the exponent).
For single and double precision values, the number is stored in normalized
exponential form, so that a decimal is assumed before the MSB. 128 ,is added
to the exponent. Furthermore, the high bit of MSB is used as a sign bit. It is
set to 0 if the number is positive or to 1 if the number is negative. See
examples below.
You can display these bytes by executing the appropriate PRINT PEEK(x)
where x = the address you want displayed. Remember, the result will be the
decimal representation of byte, with bit 7 (MSB) used as a sign bit. The
number will be in normalized exponential form with the decimal assumed
before the MSB. 128 is added to the exponent,
If
VARPTR(string variable,)
returns K:
K = length of string
(K+1) = LSB of string value starting address
(K+2) = MSB of string value starting address
*
(K) signifies "contents of address K"










