Valkyr, or Virtual Assembly Language Runtime a set of runtime libraries for the CPADS environment that encapsulate interfaces with the host operating system, and common routines used by many applications. These library files are specified by the .val extension and included with each application, with libraries being conditionally assembled if used.
All Valkyr libraries reside within the Valkyr.* namespace:
|Console||Console/Terminal-based input and output routines|
|Events||Event register, trigger and handling routines|
|File||File-handling and manipulation routines|
|Form||Window-based graphical elements|
|Math||Math functions and routines|
|Media||Media decoding routines|
|Network||Network information stream handling|
Each library may use another library for routines, such as Valkyr.Form.* requiring Valkyr.Exception.*, and each library may have multiple sub-libraries which may be used independently from it's parent. Please consult the documentation of each library you wish to use before using it.
In order to use a libraries from within FASM, three lines of code must be present in your virtual assembly language file (.asm), where $valkyr is the path to the Valkyr folder and $avm is the path to the AVM folder:
include "$valkyr/src/<libraryname>.val" ... <name> <libraryname> ... include "$avm/vmi.def"
include "$valkyr/src/valkyr.val" ... <name> Valkyr ... include "$avm/vmi.def"
In this code, the first line includes the selected library (first example) or entire library (second example) for assembly. The second line instantiates the object, and may be placed anywhere in the assembly file between the two include commands. The third line is for AVM, and must be on the last line / final directive of assembly file.
To call a Valkyr function (or method), simply use:
where the parameters of the method, indicated in the library's documentation, are present in the AVM's registers. Some methods are public and some are private: do not call private methods. Private methods contain functionality that would be of no use to the application developer whatsoever.