[Push] Top Level Code or Exec?
Maarten Keijzer
mkeijzer at xs4all.nl
Mon Apr 19 16:01:13 EDT 2010
We wanted to have the program code on the code stack for the program to
manipulate. Although code on the exec stack could in principle copy itself on
the code stack (with some trouble), we thought it would be easiest to push the
code to be executed both on the code stack AND on the exec stack.
So that's what we do. In the C++ version, this is called the push calling
convention, and it is implemented by pushing code on the CODE stack, and
pushing the CODE.DO* instruction on the exec stack.
hth,
-Maarten-
On Monday 19 April 2010 09:46:21 pm Rud Merriam wrote:
> The documentation on Push3 is a bit confusing as to where to load a program.
>
> In discussing configuration and later in the Factorial example the
> implication is that a program is read from a file and then pushed onto the
> CODE stack.
>
> But the description of the execution environment - where the CODE and EXEC
> execution is contrasted - seems to imply a program is pushed onto the EXEC
> stack. This is in the Push Concepts section.
>
> I'm guessing the pushing to CODE is the approach used, although it seems
> inconsistent with the switch to EXEC in Push3.
>
>
> - 73 -
> Rud Merriam K5RUD
> http://mysticlakesoftware.com/
>
>
More information about the Push
mailing list