This preview shows page 1. Sign up to view the full content.
Unformatted text preview: t(7), with %st(0) being the top of the stack. When more than eight values are pushed onto the stack, the ones at the bottom simply disappear. Rather than directly indexing the registers, most of the arithmetic instructions pop their source operands from the stack, compute a result, and then push the result onto the stack. Stack architectures were considered a clever idea in the 1970s, since they provide a simple mechanism for evaluating arithmetic instructions, and they allow a very dense coding of the instructions. With advances in compiler technology and with the memory required to encode instructions no longer considered a critical resource, these properties are no longer important. Compiler writers would be much happier with a larger, conventional set of ﬂoating-point registers. 3.14. *FLOATING-POINT CODE
Aside: Other stack-based languages. Stack-based interpreters are still commonly used as an intermediate representation between a high-level language and its mapping onto an actual machine. Other examples of stack-based evaluators include Java byte code,...
View Full Document
- Spring '10
- The American