Just in case, this helps, here is the last processor emulator that I wrote in C ++. Actually, this is the only emulator I wrote in C ++.
The specification language is a little idiosyncratic, but this is a completely respectable, simple description of a virtual machine, perhaps very similar to your prof VM:
http://www.boundvariable.org/um-spec.txt
Here is my (somewhat redesigned) code that should give you some ideas. For example, it shows how to implement math operators in a Giant Switch statement in um.cpp:
http://www.eschatonic.org/misc/um.zip
You can find other implementations to compare with web search, as the competition included a lot of people (I was not one of them: I did this much later). Although not much in C ++, I would suggest.
If I were you, I would only save the instructions as strings to begin with, if so, your virtual machine specification defines operations on them. Then convert them to integers as needed, every time you want to execute them. It will be slow, but what? Your virtual machine is not a virtual machine that you are going to use to run mission-critical programs, and the slow translator still illustrates the important points you need to know at this point.
It is possible that the virtual machine actually defines everything in terms of integers, and the lines are simply intended to describe the program when it is loaded into the machine. In this case, convert the program to integers at the beginning. If the VM stores programs and data together, with the same operations acting on both, then this is the way to go.
The way to choose between them is to view the operation code, which is used to change the program. Is the new instruction passed to it as an integer or as a string? Whatever it is, the easiest way to start is to probably store the program in this format. You can always change it after its work.
In the case of the unified messaging system described above, the machine is defined in terms of βplatesβ with space for 32 bits. Obviously, they can be represented in C ++ as 32-bit integers, so my implementation does.