Re: HLL expression -> ASM

"Alexei A. Frounze" <dummy_addressee@hotmail.com>
10 Apr 2001 01:13:30 -0400

          From comp.compilers

Related articles
HLL expression -> ASM alexfru@chat.ru (Alexei A. Frounze) (2001-03-26)
Re: HLL expression -> ASM danb2k@hotmail.com (Dan Bishop) (2001-03-27)
Re: HLL expression -> ASM dummy_addressee@hotmail.com (Alexei A. Frounze) (2001-03-31)
Re: HLL expression -> ASM titzer@expert.cc.purdue.edu (Ben L. Titzer) (2001-03-31)
Re: HLL expression -> ASM rhyde@transdimension.com (Randall Hyde) (2001-03-31)
Re: HLL expression -> ASM marcov@stack.nl (Marco van de Voort) (2001-04-04)
Re: HLL expression -> ASM dummy_addressee@hotmail.com (Alexei A. Frounze) (2001-04-10)
Re: HLL expression -> ASM bill@megahits.com (Bill A.) (2001-04-10)
Re: HLL expression -> ASM henry@spsystems.net (2001-04-10)
| List of all articles for this month |
From: "Alexei A. Frounze" <dummy_addressee@hotmail.com>
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" <marcov@stack.nl> 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,
*integer*.


> 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
http://alexfru.chat.ru
http://members.xoom.com/alexfru/
http://welcome.to/pmode/


Post a followup to this message

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