Mangle VM

I’ve released Mangle VM 1.1.0. It contains two main changes:

  • Support for negative values (load i0, -1)
  • A new jmp_table instruction

The latter makes it easier to conditionally use different behaviours, e.g.

load i0, r
mod i0, 4
jmp_table i0, label1, label2, label3, label4

In this case we pick a number from 0-3 and then jump to a different label (0=>label1, 1=>label2, and so on).

This replaces somewhat laborious code like:

eq i0, 0
jmp_ok label1
eq i0, 1
jmp_ok label2
eq i0, 2
jmp_ok label3
eq i0, 3
jmp_ok label4
1 Like