code efficiency

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

code efficiency

zermelo
Say I'm interested in writing code that simply takes 2 values in memory and sum them up. In the assembly generated by our translator, this will be done by pushing arguments on the stack and then adding up, and each of the operations will require maintaining the value of SP. Although this clearly works out, it will be pretty inefficient compared to written by hand assembler. How does problem actually get resolved. I can't imagine that C code compiled would look like this. Any good reference on the subject?
Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: code efficiency

ivant
You can see this thread for similar discussion.