Project CPADS

CPADS - AVM - Valkyr - CTC - ISA - .APP

Valkyr Overview

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:

Library Description
Console Console/Terminal-based input and output routines
Environment OS-standard routines
Events Event register, trigger and handling routines
Exception Exception-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
Web HTML and JavaScript parsing routines

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:

call Valkyr.<libraryname>.<method>

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.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License