4 ms·
Doesn't the SWEET16 make it straightforward to drop in and out of straight 6502 machine code? Making it more like a library or virtual coprocessor? Did anyone
by buescher 5y ago
Doesn't the SWEET16 make it straightforward to drop in and out of straight 6502 machine code? Making it more like a library or virtual coprocessor? Did anyone ever target it with a compiler?
Yes, though, cool stuff!
- throwaway81523 5y agoYeah Sweet16 was just a way to get denser code on a 6502, by giving you a 16 bit register VM so you could do 16 bit operations without having to expand out multiple 8 bit instructions. For a compiler target you might be better off with bytecode. I remember looking at the sweet16 description and thinking it would be hard to compile to, though partly because the docs I looked at weren't very complete. It was architecturally odd too though.
- spc476 5y agoWikipedia has a page on it: <https://en.wikipedia.org/wiki/SWEET16 https://en.wikipedia.org/wiki/SWEET16>. It's architecturally odd because it was designed to run on a 6502 with as small as footprint as possible (about 300 bytes of code, 32 bytes of RAM) and only did a few operations (add, sub, cmp, call, return, inc, dec, load, store, branch-on-condition).