Scientific RPN Calculator (with ATTINY85)
|
03-08-2018, 12:54 PM
Post: #24
|
|||
|
|||
RE: Scientific RPN Calculator (with ATTINY85)
I think there is another small saving to be had.
Change the assignment of floats/doubles to use the memmove function instead. It seems smaller. I haven't checked but it might even be worth having a copy function: Code: static void copy(double *dest, const double *src) { In this case it is also possible to use memcpy directly since memmove uses memcpy for one direction of copy so no wasted code. Also, change the stack functions to: Code: static void push(void) { // Push stack These have to be memmove calls since the blocks overlap. It is probably also sensible to declare the stack as a structure or array for this to be completely safe. There shouldn't be an extra overhead for doing so. Pauli |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)