On Apr 18, 10:50 am, "Bison" <Sean.D.Gilles...@gmail.com> wrote:> Hello everyone. I've been trying to read about VMs for quite some> time now, and I am still a bit confused about compiling to bytecode.>> How would the typical structure of a bytecode-compiled file look? I> don't think a java *.class file would be a good example here either,> just because all java files are also classes.

> More specifically, how would I represent literals, like String and> numbers? The problem I have with this is, how could the VM> differentiate between instructions and literal data? I've heard> someone say that I could use a delimiter to mark start and end points.

What differentiates them, is simply what you do with it. If you try to
execute it, it must be code.

> I'm also wondering if things would likely go in a specific order. For> example, should code and constants be logically seperated?

Not neccessarily, but it does makes everything more manageable.

> Also, I'm wondering if there are any decent readings on the subject> other than source code. Are there any VMs that would be good examples> (and that is open source)?