hunter / vm

A virtual register machine for akuma

commit c6351eba550cf79ff9dfb97660dbc8dbb5ec14ec

author Hunter Praska

time 2018-09-11 18:26:45 -05:00

Remove branch instructions

I decided to remove the Branch instructions. I think that approach is
sort of limiting. Instead we have GotoIf and GotoIfNot which take a
register and will only jump if the register contains true. We also added
the Eq and LT instructions for integers. We can actually cover all
integer comparisons with these two instructions (==, <, >, <=, >=) which
is nicer than having Branch instructions for each of them as was needed

We also add Flag and D registers. While they're both general purpose
registers, Flag is intended to be used with the new instructions. This
brings our machine to 5 general purpose registers with a max of 16.

A virtual register machine for Akuma