<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>


2@ Search:

In Programming and Stack Management Words in 32-bit library

Word Name: 2@
Type: Standard word
Data Stack Signature: address – d:x
Return Stack Signature: --
Availability: V1.2
Description:

2@ returns a double-precision value previously stored in a double-precision variable with 2!.

Example:

2VARIABLE AMOUNT
1234567. AMOUNT 2!
AMOUNT 2@ D. (displays 1234567)

The above example declares a double-precision variable called AMOUNT. The value 1,234,567 is then stored in the variable with 2!. Finally, the value is retrieved from the variable using 2@ and displayed with D..

As can be seen (and as indicated by the stack signature) AMOUNT returns its address (see 2VARIABLE) which is used by 2@ to return the actual double value stored at that address.

Comment:

Pronounced “2 fetch” or “double-fetch”.

See Also: 2VARIABLE 

<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>