x and y in binary operations?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

x and y in binary operations?

Henoktes722
I tried StackText on the output of my vm translator and it has an error, difference in one RAM value.
Can someone can check my output of vm translator incase I miss a concept. And If we push two values and do binary operations like

push constant 28
push constant 17
gt

I assume that x is 17 and y is 28 so M[256] is 0.
Reply | Threaded
Open this post in threaded view
|

Re: x and y in binary operations?

WBahn
Administrator
Henoktes722 wrote
I tried StackText on the output of my vm translator and it has an error, difference in one RAM value.
Can someone can check my output of vm translator incase I miss a concept. And If we push two values and do binary operations like

push constant 28
push constant 17
gt

I assume that x is 17 and y is 28 so M[256] is 0.
Instead of assuming which value is x and which value is y, I would recommend seeing what the VM machine specification states about which is which. See Figure 7.5.