jack compiler not compiling or correctly?

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

jack compiler not compiling or correctly?

seagul
I have just finished working on the Math OS module, and tested it, and even though I did exactly as specified, it did not pass the test. Then I noticed a weird translation by the supplied compiler that I believe is wrong.
The line:
if((twoToThe[j] < subX) | (twoToThe[j] = subX)){
in my math.jack, translated to:
push local 0
push static 0
add
pop pointer 1
push that 0
push local 1
lt
push local 0
push static 0
add
pop pointer 1
push that 0
or
push local 1
eq


I believe the or command should switch with the  line below it. Why am I wrong?
Reply | Threaded
Open this post in threaded view
|

Re: jack compiler not compiling or correctly?

WBahn
Administrator
Are you sure the line you compiled has the parens exactly as shown?