4 ms·
You'd need to get the architecture supported by LLVM first. This can be a hurdle, because LLVM backends need to be actively maintained to keep up with the rest
by zozbot234 7y ago
You'd need to get the architecture supported by LLVM first. This can be a hurdle, because LLVM backends need to be actively maintained to keep up with the rest of the code. The MC68K (far more popular than the 65C816) is still not supported for example, and work on it is really just starting.
Segmented memory can be supported by C itself in a quasi-standard way, because the "Embedded C" technical report has a proviso for "multiple address spaces". Loosely speaking, this means that a "fully general" pointer type, encompassing all possible address spaces, still has to exist; but address-space specific pointers are also made possible.
- pshc 7y agoWould it work to compile rust code to WebAssembly first and translate that to 65C816 opcodes?
- zozbot234 7y agoIt would be quite inefficient. And you'd still need to write a JIT from WASM to the 65C816.
- johnsoft 7y agoAnother possible avenue is mrustc, an alternative Rust compiler which compiles Rust code to C code. Every platform has a C compiler (though maybe not C11, which is what mrustc targets). https://github.com/thepowersgang/mrustc https://github.com/thepowersgang/mrustc