Path: utzoo!attcan!uunet!husc6!uwvax!oddjob!rfl From: rfl@oddjob.UChicago.EDU (Bob Loewenstein) Newsgroups: comp.lang.forth Subject: Re: Local variables Message-ID: <14992@oddjob.UChicago.EDU> Date: 8 Aug 88 15:23:29 GMT References: <8808060008.AA10585@jade.berkeley.edu> Organization: U of Chicago - Astronomy & Astrophysics Lines: 11 Implementing local variables and named input parameters for a 68000 machine can be done by creating a third stack using one of the address registers. Cells are transferred from the parameter stack to the variable stack at the beginning of the word execution and local names are assigned to the location on the variable stack. All subsequent references simply do an indexed read to the appropriate stack address and plop the variable back to the top of the parameter stack for processing. For many words, the reduced parameter stack manipulation (rot, dup, over, etc.) makes up for the initial overhead.