Re: HLL expression -> ASM

"Alexei A. Frounze" <>
10 Apr 2001 01:13:30 -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: "Alexei A. Frounze" <>
Newsgroups: comp.compilers
Date: 10 Apr 2001 01:13:30 -0400
Organization: Global Crossing Telecommunications
References: 01-03-131 01-04-021
Keywords: code
Posted-Date: 10 Apr 2001 01:13:30 EDT

"Marco van de Voort" <> wrote in message
> "Alexei A. Frounze" wrote:
> >
> > 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?

Nope. How would I do that, any example where it's the case and we can
minimize the depth?

> - 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.

As I mentioned, that's for CPU, that's for (I)MUL/(I)DIV, therefore,

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

I know that. But again, what would you recommend to do if I run out of
registers due to a complex expression? Should I just put something to
the stack or what?

Alexei A. Frounze
alexfru [AT] chat [DOT] ru

Post a followup to this message

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