LinuxVSX16 Posted November 30, 2020 Share Posted November 30, 2020 (edited) Just for practice with the Cx16 I'm writing a small text editor for the system, I'm just wondering what I can do to make a c file smaller. I'm open to answer any questions. Thank you. Edited November 30, 2020 by LinuxVSX16 1 Quote Link to comment Share on other sites More sharing options...
0 AndyMt Posted November 30, 2020 Share Posted November 30, 2020 I found a very good guide on the web: https://github.com/ilmenit/CC65-Advanced-Optimizations This helped me a lot . 1 Quote Link to comment Share on other sites More sharing options...
0 paulscottrobson Posted November 30, 2020 Share Posted November 30, 2020 C doesn't really fit a 6502. It's a byte orientated CPU. Adding 2 16 bit words takes 19 bytes. There's no way round it that doesn't eat CPU cycles, even clever allocation and deallocation of zero page isn't that effective. So : do as much byte work as humanly possible try to avoid stack frames - no parameters, locals. Make your locals static. try and use zero page. Quote Link to comment Share on other sites More sharing options...
0 rje Posted December 1, 2020 Share Posted December 1, 2020 DO NOT OPTIMIZE PREMATURELY. 1 Quote Link to comment Share on other sites More sharing options...
Question
LinuxVSX16
Just for practice with the Cx16 I'm writing a small text editor for the system, I'm just wondering what I can do to make a c file smaller. I'm open to answer any questions. Thank you.
Edited by LinuxVSX16Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.