In a Warren's Abstract Machine, where are Argument Variables created?

192 Views Asked by At

I'm trying to create my own WAM implementation and I'm using the instructions in Figure 2.10 of "Warren's Abstract Machine: A Tutorial Reconstruction" as a test case. However, I need to pass A1 and A2 to get_structure. But where are both variables created? put_value and put_variable both create A-variables but neither is listed in the instructions.

1

There are 1 best solutions below

6
On

Ai are "argument registers". They are part of the machine. So put_value does not create them, it fills them. Figure 2.8 on page 23 says:

put_value X_n, A_i ===  A_i <- X_n

meaning, store the value Xn in Ai.