Looking at it makes it pretty clear why it loops forever (mainly
it jumps back to a load, loading always the same value).
Yep. That's a bit complicated. The jit code tries to avoid loading/storing the same register from/to memory. This is achieved by remembering the size of the register loads (load_size) and setting fixup->skip accordingly.
When now a branch goes to the same section (a backward branch like in mops.pasm), then the load should be skipped.
jit/i386/jit_emit.h implements all the necessary bits. s. jit_emit_jcc, fixup->skip and load_size.
.
Stephane
leo