
OverviewVVM has its own simple Programming Language which supports such operations as conditional and unconditional branching, addition and subtraction, and input and output, among others. The language allows the student to create reasonably complex programs, and yet the language is quite easy to learn and to understand -- only eleven unique operations are provided. When VVM programs go awry, as in the case of endless loops or data overflows, VVM (virtual) system errors are triggered before the user's eyes. VVM programs can be written in Machine Language, in Assembly Language, or in a combination of both. The Machine Language format is represented in decimal values, so there is no need for the student user to interpret long binary machine codes. In the Machine Language format, each instruction is a three-digit integer where the first digit specifies the operation code (op code), and the remaining two digits represent the operand. In the Assembly Language format, the operation code is replaced by a three-character mnemonic code. The two-digit operand usually represents a memory address. The sample program below is shown in both formats. Following the automatic syntax validation process, VVM programs are converted to machine language format and loaded into the 100 data-word virtual RAM which is fully visible to the user during program execution. |
Embedding Data in ProgramsData values used by a program can be loaded into memory along with the program. In Machine or Assembly Language form simply use the format "snnn" where s is an optional sign, and nnn is the three-digit data value. In Assembly Language, you can specify "DAT snnn" for clarity. See the sample program for an example of this. |
The VVM Load DirectiveBy default, VVM programs are loaded into sequential memory addresses starting with address 00. VVM programs can include an additional load directive which overrides this default, indicating the location in which certain instructions and data should be loaded in memory. The syntax of the Load Directive is "*nn" where nn represents an address in memory. When this directive is encountered in a program, subsequent program elements are loaded in sequential addresses beginning with address nn. See the sample program for an example of this. |