Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ima.UUCP Path: utzoo!decvax!ima!johnl From: johnl@ima.UUCP (Compilers mailing list) Newsgroups: mod.compilers Subject: P-code translation Message-ID: <160@ima.UUCP> Date: Sun, 13-Jul-86 23:04:44 EDT Article-I.D.: ima.160 Posted: Sun Jul 13 23:04:44 1986 Date-Received: Mon, 14-Jul-86 19:51:27 EDT Reply-To: uiucdcs!b.CS.UIUC.EDU!robison (Arch Robison) Lines: 29 Approved: I want to translate stack-based pseudo-code into real code for a register based machine. For example, I would want to translate the pseudo-code: dupl add into the register code: r0 = r0 + r0; assuming that the top-of-stack is in r0. E.g. Does anyone know of references on this subject? Arch D. Robison robison@uiucdcs University of Illinois at Urbana-Champaign [This is a classic problem, since reverse polish is a particularly easy intermediate form to get from simple-minded parsing schemes. You translate it to register code essentially by treating the registers as a stack. You'd probably want to make some arrangement to spill to memory if you run out of registers, and to optimize the output a little. See Aho and Ullman. Other references are welcome. -John] -- Send compilers mail to ima!compilers or, in a pinch to Levine@YALE.EDU Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | bbncca}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request