VVM Program Examples
VVM Program Examples
A simple VVM Assembly Language program which adds an input value to the constant value -1 is shown
below (note that lines starting with "//" and characters to the right of program statements are considered
comments, and are ignored by the VVM machine).
// A sample VVM Assembly program
// to add a number to the value -1.
IN Input number to be added
ADD 99 Add value stored at address 99 to input
OUT Output result
HLT Halt (program ends here)
*99 Next value loaded at address 99
DAT -001 Data value
This same program could be written in VVM Machine Language format as follows:
// The Machine Language version
901 Input number to be added
199 Add value stored at address 99 to input
902 Output result
000 Halt (program ends here)
*99 Next value loaded at address 99
-001 Data value