rrthomas / mit

A simple stack-based VM
Other
10 stars 3 forks source link

Remove `nextff` #356

Closed apt1002 closed 4 years ago

apt1002 commented 4 years ago

Encode pushi and pushreli with an unsigned immediate operand, and subtract off a suitable bias (32 for pushi and 64 for pushreli) before using it.

This allows ir to be consumed using logical right shift, and obviates nextff.

rrthomas commented 4 years ago

I explained (I'm pretty sure!) that this won't work because it breaks jumpi, jumpzi and calli, but then it seems we both forgot!