Hello Cemetech,

I wondered today if you could compile certain programs in C to both z80 and ez80. z80 is similar to ez80, so the TI 84 PCSE should be able to be another viable compilation target, albeit some complications.
While the eZ80 instruction set is a superset (excepting some undocumented opcodes) of the Z80's, the CSE's hardware (i.e. ports) is totally different from the CE's. The screen isn't memory-mapped on the CSE and sending pixels to the screen is really, really slow. About the only thing they have in common is the keyboard matrix layout. The Z80's smaller 16-bit address space makes memory access a lot more complicated because you need a bunch of platform-specific logic to handle paging. But worst of all, C makes extensive use of stack-local variables. The fastest way to access stack-locals is via the index+offset addressing mode, which on the eZ80 is actually slightly faster than accessing global variables (exceptions and exclusions apply, void where prohibited), but on the Z80, it's very slow, by almost an order of magnitude. That speed difference is probably the biggest reason C never really caught on for the TI-84 Plus, even though a few people did successfully use C. (The TI-84 Plus C SE is literally a TI-84 Plus (using the early 128 K RAM ASIC) with a color screen substituted for the B&W screen and rechargeable battery thrown in.)

TL;DR: Your compiler needs extra platform-specific code to handle paging transparently, displaying pixels on the CSE is horribly slow no matter what, and C produces much slower and larger code than even unoptimized hand-written assembly. Although C on the TI-84 Plus C SE is possible, these factors make it undesirable.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement