View Single Post
Old 10-14-2011, 06:22 AM   #394 (permalink)
DJBecker
EcoModding Apprentice
 
Join Date: Nov 2010
Location: Annapolis
Posts: 159
Thanks: 0
Thanked 32 Times in 27 Posts
Quote:
Originally Posted by Freyguy View Post
Hi Harlequin2,
It looks like DJ’s link is still active back on post 386. Don’t think the C conversion was ever finished.
The goal of the C code was to compile to (almost) exactly the same ASM instructions as the hand written code. There are many places where a native C version would be written differently, but that wouldn't generate the same instructions.

There are only a few spots where there is a mismatch. For instance, I haven't figured out a way to get SDCC to generate and propagate the carry bit for 24 bit arithmetic.

The code was essentially complete when I first posted, but I have made minor refinements since then. I just checked in the few minor modifications that I made since August. For instance, I figured out a better set of compile options and function entry code that let me control which registers are saved in the interrupt handler. It now matches the ASM where before it saved a larger set of registers in a different order.

Last edited by DJBecker; 10-14-2011 at 04:02 PM..
  Reply With Quote