•  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-FileIn some cases the compiler will optimize simple math.

In these examples the math/function becomes a single instruction:

GFA code     Assembler output
----------   ---------------------
a&=32+1      move.w #33,-32768(a5)
a&=32-1      move.w #31,-32768(a5)
a&=32*2      move.w #64,-32768(a5)
a&=32/2      move.w #16,-32768(a5)
a&=(2*5)+1   move.w #11,-32768(a5)
a&=SUCC(32)  move.w #33,-32768(a5)
a&=PRED(32)  move.w #31,-32768(a5)

The requirement seems to be that all operands must be numerical constants.
If you mix any variables into the equations it will not be able to optimize
it and it will break it down into multiple assembler instructions.

a&=32    !even though its some fixed value
b&=a&+1  !the compiler will not optimize this