nand2cy wrote
Why it is not pop pointer 0?
push local 0
push constant 2
add
pop pointer 1
push constant 19
pop that 0
"pop pointer 0" sets the base of the
this segment.
"pop pointer 1" sets the base of the
that segment.
This example could have used pointer 0 and
this, but the convention used by the Jack compiler is that the
that segment is used for accessing array elements.
Figure 7.11 shows the convention for accessing object fields (member variables) using pointer 0 and
this.
--Mark