Page 1 of 1

Porting assembly to c/c++

PostPosted: Sun Jan 01, 2017 9:49 pm
by Freeck

Did you (or perhaps somebody else) ever consider porting the assembly code of the gateway to c or c++?
My aim would be to integrate the gateway functionality with the thermostat functions including the controlalgoritm in one processor (esp8266)... do you consider that as feasable?


Re: Porting assembly to c/c++

PostPosted: Sat Jan 07, 2017 10:24 am
by hvxl
The choice for assembly was a no-brainer for me. I only see disadvantages to porting the code to C:
  • It is a lot of work.
  • In assembly you can easily determine how long things take, which is necessary to get the timing right. In C that is much harder.
  • In assembly you have complete control over the resources. C code will have more overhead and there is almost no free data RAM or code space left in the PIC, so features would have to be removed to make it fit.