I got an idea, why not design a portable assembler that have a unifying simple core and try to model a VM on that e.g. simple things will be naitive and complex instructions can be dispatched via a named goto.
The solution would fix a few registers like the bp and then have enough instructions to be able to dispatch and move objects in memory and implement correct function call semantics. I would use two fixed hardware - registers. 1. bp: to track the function stack 2. vm: to track vm local data. It would be cool if we could say to gcc to not clobber those registers and compile the vm as before without changing especially much but with some assembler to do the needed jump correctly and also reach the register associated data. One idea was to use sassy, but it does only support x86. Another idea is to port the sbcl assembler to scheme. This means that we will get assemblers for a larger set of targets but still not enough to be portable. The final idea I got was to use the information in gcc or gas somehow. Anyway I need somthing new to chew on, so why not port the sbcl assembler at some level. Regards Stefan