grigory-rechistov / interpreters-comparison

Sample programs for comparison of different VM interpretation techniques
BSD 3-Clause "New" or "Revised" License
27 stars 9 forks source link

Add procedure call return mechanism to several variants of interpreters #2

Closed grigory-rechistov closed 8 years ago

grigory-rechistov commented 8 years ago

Currently the VM lacks any procedure mechanism. The task is to add implementation and tests:

  1. Add a separate return stack to store addresses
  2. Add new instructions:
    • call imm - pushes current PC on return stack and jumps to PC+imm
    • ret - pops new PC value from stack
Vsevolod-Livinskij commented 8 years ago

Assign it to me, please.

grigory-rechistov commented 8 years ago

Done