RE: stack-based vs. register-based

"Scott J. McCaughrin" <sjmccaug@bluestem.prairienet.org>
26 Jan 2001 17:01:38 -0500

          From comp.compilers

Related articles
Re: Interpreter design gvmt@localhost.vsnl.net.in (Venkatesha Murthy) (2001-01-19)
RE: stack-based vs. register-based sjmccaug@bluestem.prairienet.org (Scott J. McCaughrin) (2001-01-26)
RE: stack-based vs. register-based sjmccaug@bluestem.prairienet.org (Scott J. McCaughrin) (2001-01-28)
| List of all articles for this month |
From: "Scott J. McCaughrin" <sjmccaug@bluestem.prairienet.org>
Newsgroups: comp.compilers
Date: 26 Jan 2001 17:01:38 -0500
Organization: CNI/Prairienet
References: 01-01-109
Keywords: architecture
Posted-Date: 26 Jan 2001 17:01:37 EST

The first complete Pascal compiler I wrote was targeted for a stack
machine, and it was a real pain after having written phases of other
compilers for non-stack targets.
The biggest drawback is the 0-operand mode of the stack architecture
vs. 2- or 3-operand mode with register operands. The LIFO nature of
the stack leads to much larger code generated, even after optimiza-
tion, than with registers.
Yes, it is true that being stack-based frees you from the pitfalls
of register-based code, but you also lose the advantages.





Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.