The moderator natters>[Not the block structure of the source language, the loops in the>object code. When you get to the bottom of the loop, you need>something that tells the interpreter to go back to the top of the>loop. I've done it with assembler style gotos that require some sort>of symbol table and backpatching, which is doable but unpleasant.

Yes, most VMs implement control flow using assembler-style VM branch
instructions. You don't need backpatching for backward branches
(e.g., the loop-back branch you mentioned), because in that case you
know where you want to branch to when you generate the branch.

However, when you generate a forward branch (e.g., in an
IF-statement), you usually don't know the target of the branch at that
time, and the simplest approach to deal with this is usually
backpatching. Normally, the backpatching itself takes one line of
code and is not at all unpleasant. If your VM design has some
additional complications (e.g., moving the code around after code
generation while avoiding relative VM branch instructions), this can
become more complex and less pleasant, but one usually can avoid such
complications.

Concerning structured VM instructions, one can use them for backward
branches (keeping the target address on a stack or in a register at
run-time), but using them for forward branches at run-time is going to
be inefficient. However, you could use the additional information
such instructions provide in a separate pass that runs after all
relocation (or whatever complication the VM has) and generates and
patches the target addresses at that time.