3 ms·
Z80 C code looks mostly like what you'd expect -- being able to push/pop 16-bit registers helps a lot: http://8bitworkshop.com/v2.1.1/viz.html?platform=base_z80
by sehugg 8y ago
Z80 C code looks mostly like what you'd expect -- being able to push/pop 16-bit registers helps a lot: http://8bitworkshop.com/v2.1.1/viz.html?platform=base_z80&file=fib.c http://8bitworkshop.com/v2.1.1/viz.html?platform=base_z80&fi...
On 6502 you are usually better off with bytecode (SWEET16, p-code) or threaded code (FORTH) to improve code density. There are even people making new languages (Cowgol, PLASMA) that are self-hosted on the 6502!
- Zardoz84 8y agoOriginal 16bit x86 was 8080/8085 assembly upgrade to 16bit (source code compatible to the 8080), and the Z80 was a upgraded clone for the 8080. You can get a assembly code for a 8080 and just compile it for the 8086 and it would work. So, it's logic that compilers that target Z80/8080/8085, generate something similar to what any compiler would do on x86.