Register management tips
Implementing a custom VM and I've come to use开发者_运维问答 registers (these will store pointers and will be NULL when empty). But, I've come to realize that I actually have no idea how to manage register-based memory. Like, what do I do if all my registers are used up and some code wants another? Preferably, without just creating a new one.
This is in C++.I don't think this is a problem of the machine, instead it is a problem of the programmer of the machine. What you can do(IMO) is just to provide the means to move the values of the registers into memory back and forth. Problem solved :)
精彩评论