As others have mentioned, a 6502 is very poorly suited to C-style code, but a Z80 should be somewhat better with that.