Pseudo commands are commands that do not produce any code. They are used to send aditional instructions or information to the assembler itself.
|Set( flag value )|
This is a SCASM configuration command to set some internal flags and variables.table of flag/variable names:
A change of some of these values may probably result in display problems in older FS versions. Set commands should be placed at the beginning of the source code file.
|Include( filname.ext )|
Includes this text file. The file is simply copied into the current source file. In SCASM 2.10 and later an include file can contain other Include()'s or Macro()'s.
Any correct path/filename is accepted (up to 260 characters).
This makes it possible to make a main source file like:
|Macro( filename.scm p1 ... pn )|
Similar to include files the text of an macro file is simply copied into your source file.
But the advantage of an macro is that parameters can be passed to it. These parameters are inserted
into the text during compile time. This makes it very easy to recycle scenery objects. If you want to
design a house, it is usually a good idea to do this as a macro file and use the strings %1 and %2
for the latitude and longitude values of its position. Now you can put this house into your scenery
simply by puting its actual Lat/Lon position as parameters one and two into the Macro() instruction.
SCASM allows up to 30 parameters and each can have 32 characters.
Note: In most cases macros will contain a whole Area() block. But if you are using the macro feature to generate some code within an area (for example 'hand made' aproach lights in an runway area), and if you are using the same macro more than once in the same area, and if the macro contains label definitions you will get an
To avoid this you can include the special @ character in the label name. This character causes SCASM to insert the internal macro counter in the Label name. Since the internal macro counter is a 3 digit code the name is then limited to 12 characters.
:Label@ is expanded to :Label095 during the expansion of the 95th macro.
Mif( <expression> )|
These pseudo commands are used to enable and control conditional compilations. In earlier SCASM versions they are only used in macros for visual scenery. That's why they have the "M" in the name. Now they can be used anywhere in the source text and they even can be nested (up to 8 levels).
<expression> can be a mathematical formula or a single number.
If an error is detected and the compiling condition is FALSE, then the error messages will have the line number of the Mifend command.
|GRP( <Lat> <Lon> )|
This command writes the given position to a SCASM internal General Reference Point memory so it can be used later to calculate new positions.
There are two levels of stored positions, one defined outside of an Area() - EndA block and another
defined inside. Every time an Area() command is compiled with direct Lat/Lon values, the position is stored
into a temporary memory. This position is valid until the EndA command is executed. But the new Lat/Lon position
is not stored if it is a calculated one, using the "d" or "r" option. This means that all calculations are
done with the position defined outside the area block.
If your new position is 150 meters east and 60 meters south of the stored position you can enter:
RefPoint( abs :Label 1.0 d -60 150 )
and SCASM will calculate the new reference point.
If your new position (i.e. for LandMe) is 400 meters away in heading 273.4 degrees you can enter:
LandMe ( r 273.4 400 0 90 r 93.4 400 0 27 )
Do not use this feature for long distances.
|CopyRight( any text with up to 80 characters )|
Traditionaly many 3rd party scenery tools insert a text signature in the output file. Typically this is the name and version of the tool which generated this file. SCASM does the same. This instruction lets you add your own text to this signature.
This text has no effect to FS. This command should be used only once per source/BGL file. If this command is found more than once, only the last one is used (no error message). For this reason it is not a good idea to use it in a macro file.
No underscores '_' are needed for SPACE characters in the text.
|Uvar( $name value )|
This is an internal command to create and initialise an SCASM internal user variable. The names are case sensitive. This command has no effect to the BGL code. User variables can be used by experts for more flexible parameter calculations.
Note: variables which are defined within an Area() are only valid in this Area() and are deleted when the EndA statement is compiled. Other variables are always valid and are even visible from macros and includes.
SCASM can handle up to 200 user variables.
Besides user variables there are some other internal values which might be of interest:
|Map( stat )|
This is another internal command which can be used to enable or suppress the map file generation for some
parts of the source code file.
For more information please see the documentation which comes with the BGLTST.EXE program which uses this information to display the source code line(s) related to an detected error.
|Error( any error message )|
This pseudo command produces an error message and stops the compilation.
This instruction can be used as a reminder for changes you want to do later or to ensure that a specific source file (macro) is compiled with the correct SCASM version.
For example, if internal functions (version 2.02 and later) are used for the parameter calculations, you can use this instruction to notify the user that he needs an compiler update:
In this example the macro receives a parameter from the caller. If the %6 macro parameter has the value 15 the result would be 7.5. Since FS does not accept fractional numbers in point coordinates, an error message is normally generated. The int[ ] or the round[ ] function can now be used to convert the number format but these are not available in earlier versions.
|VTrace( mask "any text" <expression> )|
This is an SCASM internal test command for debugging. It does not produce any code. You can use this
command if you want to know the result of of some SCASM calculations.
|TOP||© Manfred Moldenhauer|