Sol – a sunny little virtual machine (2012)
1–10 of 11 posts
Re: Sol – a sunny little virtual machine (2012)
#2Having written a few toy VMs in the past (and some in production!), there are always avenues to "make it weird."
Sol's yield/end instruction pair looks super abusable if you want to write somethiing obfuscated.
My favourite alteration has always been to not have any control flow instructions in the provided ISA, but allow the programmer direct write access to the program counter register, or force them to write self modifying code.
After all, programming is fun.
Re: Sol – a sunny little virtual machine (2012)
#3(2012) Having written a few toy VMs in the past (and some in production!), there are always avenues to "make it weird." Sol's yield/end instruction pair looks super abusable if you want to write somethiing obfuscated. My favourite alteration has always been to not have any control flow instructions in the provided ISA, but allow the programmer direct write access to the program counter register, or force them to writ…
Re: Sol – a sunny little virtual machine (2012)
#4(2012) Having written a few toy VMs in the past (and some in production!), there are always avenues to "make it weird." Sol's yield/end instruction pair looks super abusable if you want to write somethiing obfuscated. My favourite alteration has always been to not have any control flow instructions in the provided ISA, but allow the programmer direct write access to the program counter register, or force them to writ…
While z80 does have control, it only has jumps to constant addresses. You had to do a push and a ret in order to jump at a calculated address. Or use self-modifying code, although I don't think it was really used.
Re: Sol – a sunny little virtual machine (2012)
#5Earlier quoted context omitted.
While z80 does have control, it only has jumps to constant addresses. You had to do a push and a ret in order to jump at a calculated address. Or use self-modifying code, although I don't think it was really used.
Could this be done by JP (HL) or JP (IX) or JP (IY)
Re: Sol – a sunny little virtual machine (2012)
#6(2012) Having written a few toy VMs in the past (and some in production!), there are always avenues to "make it weird." Sol's yield/end instruction pair looks super abusable if you want to write somethiing obfuscated. My favourite alteration has always been to not have any control flow instructions in the provided ISA, but allow the programmer direct write access to the program counter register, or force them to writ…
Re: Sol – a sunny little virtual machine (2012)
#7(2012) Having written a few toy VMs in the past (and some in production!), there are always avenues to "make it weird." Sol's yield/end instruction pair looks super abusable if you want to write somethiing obfuscated. My favourite alteration has always been to not have any control flow instructions in the provided ISA, but allow the programmer direct write access to the program counter register, or force them to writ…
I did that for a toy RISC ISA of mine, but I added the additional soft constraint of one assembler temporary. It turns out that’s enough to macro-code most control flow instructions in the assembler even if your instruction set is very poor, so it’s really not a huge barrier in practice. (You jump into the middle of a branch island, which performs the test and scales it so that it is large enough that the -1/0/+1 result is enough so that pc+that value is enough to reach all three arms of the condition.)
Re: Sol – a sunny little virtual machine (2012)
#8(2012) Having written a few toy VMs in the past (and some in production!), there are always avenues to "make it weird." Sol's yield/end instruction pair looks super abusable if you want to write somethiing obfuscated. My favourite alteration has always been to not have any control flow instructions in the provided ISA, but allow the programmer direct write access to the program counter register, or force them to writ…
Isn't having control of the program counter just a branch instruction? :)
Re: Sol – a sunny little virtual machine (2012)
#9Earlier quoted context omitted.
While z80 does have control, it only has jumps to constant addresses. You had to do a push and a ret in order to jump at a calculated address. Or use self-modifying code, although I don't think it was really used.
Could this be done by JP (HL) or JP (IX) or JP (IY)