Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No higher level languages were ever competitive with assembler for the 6502. The stack model of C is not a good fit, as the 6502 machine stack doesn't give any support for reading or writing stack-based variables. Good performance depends on effective use of the zero-page -- the first 256 bytes of memory which have special addressing modes and allow more efficient access. Registers are few and quirky -- accumulator, two index registers which are not quite interchangeable, a byte stack pointer. All operations are 8 bit; 16 bit calcs like for pointers are costly both in code size and speed.

Back in the 80's and 90's the best compiled languages were probably COBAL and Forth. As far as I know nobody seriously used these for games or applications.

There are more recent C compilers, but the code generation is multiples of size and speed (5* maybe?) away from assembler.



Well, Mattel used Forth: https://groups.google.com/d/msg/comp.lang.forth/omi6PUvymEE/...

Because it was cheap: https://groups.google.com/d/msg/comp.lang.forth/LzOasFOyIMg/... (forth not mentioned here; plausibly(?) extrapolating)

Some nearby discussion about 6502 market penetration (I can't determine whether Forth is being discussed here - oh and dodge the cartoon fistfight-cloud wending its way between the posts, happens a lot on this usenet group): https://groups.google.com/d/msg/comp.lang.forth/Yoa9u55cpbo/...


For those into modern (!) medium-level 6502 programming, PLASMA [0] may be better (syntax-wise) than Forth and better (size and performance-wise) than C.

[0] https://github.com/dschmenk/PLASMA



Ha! Yes, COMAL. Thanks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: