Scientific RPN Calculator (with ATTINY85)
|
03-06-2018, 09:22 PM
Post: #9
|
|||
|
|||
RE: Scientific RPN Calculator (with ATTINY85)
(03-06-2018 02:23 PM)deetee Wrote: One thing to save memory is to use local variables. So I did with declaring the stack variables (xyzu) local. So I have to send to the push and pop subroutine the 4 variable pointers. Checking is easy (pull is similar): Code: #define push(a,b,c,d) push_stack() I declared the function static because some compilers can do better knowing they are always local. Improved calling conventions etc. I don't think I seen a case where doing so produced larger code. Another trick that sometimes works is to reduce the optimisation level used when compiling -- paradoxically smaller/faster code is sometimes produced. Another thought that came overnight is to not use the library mathematical function -- they usually trade space for speed, check for edge cases in detail and probably implement the IEEE standard. Pauli |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)