•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FileSWAP(x)

x: iexp

The function SWAP() re-formulates (if necessary) the numerical expression x as
a long word (4 bytes) and exchanges its upper and lower words (2 bytes in each
case). This could be useful when passing longword parameters to an operating
system routine which requires the words in reverse order.

Note: This function has nothing to do with the instruction of the same
      name, which swaps values of variables.

Example:

    x=1044480
    PRINT BIN$(x,32)
    y=SWAP(x)
    PRINT BIN$(y,32)

--> The following appears on the screen: 00000000000011111111000000000000
                                         11110000000000000000000000001111

An example of SWAP() in use might be: ~WIND_SET(0,13,SWAP(t%),t%,0,0)