Re: HLL expression -> ASM

Marco van de Voort <>
4 Apr 2001 00:21:31 -0400

          From comp.compilers

Related articles
HLL expression -> ASM (Alexei A. Frounze) (2001-03-26)
Re: HLL expression -> ASM (Dan Bishop) (2001-03-27)
Re: HLL expression -> ASM (Alexei A. Frounze) (2001-03-31)
Re: HLL expression -> ASM (Ben L. Titzer) (2001-03-31)
Re: HLL expression -> ASM (Randall Hyde) (2001-03-31)
Re: HLL expression -> ASM (Marco van de Voort) (2001-04-04)
Re: HLL expression -> ASM (Alexei A. Frounze) (2001-04-10)
Re: HLL expression -> ASM (Bill A.) (2001-04-10)
Re: HLL expression -> ASM (2001-04-10)
| List of all articles for this month |

From: Marco van de Voort <>
Newsgroups: comp.compilers
Date: 4 Apr 2001 00:21:31 -0400
Organization: Eindhoven University of Technology, The Netherlands
References: 01-03-131
Keywords: parse
Posted-Date: 04 Apr 2001 00:21:31 EDT

"Alexei A. Frounze" wrote:
> I know how to parse the source, how to evaluate expressions several
> similar ways: recursively or using stack(s). OK, that works perfectly,
> no problems. And I can create a tree for the expression as well.
> Now, how do I transform the tree/whatever (let's say only integer
> values/vars involved in the expression) into an ASM piece of code w/o
> consuming extra memory for partial results, just using CPU registers?
> Is there any basic idea/algorithm which I'm missing? It must be
> simple, I guess...

- Did you already transform the tree so that the least number of stack
positions are used?

- Is your expression FP or integer? With FP you have some more
"registers", but watch out for built in procedures in your compiler
(that could be the same as I'm using) that may affect the FP stack.

Most expressions can be evaluated using 4 regs. The problem that for
integer (as somebody already said) is that mul and div need specific

Post a followup to this message

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