You're not as lost as you may think.
moobles wrote
RAM[3] holds address of the base of THIS. But where should RAM[3] point?
You've answered your own question here, but let's clarify. RAM[3] has a handy nickname:
THIS. The
THIS register stores the base address of the
this memory segment. Hence,
THIS points to
this.
If you have programmed with object-oriented languages, you should be able to infer that
THIS really is a pointer to an object, and the
this segment does indeed represent the memory occupied by that object.
THAT and
that are similar, but these are used by the Jack language for arrays.
Note that the
that segment does not necessarily come right after the
this segment on the heap. They can be anywhere in the heap.
If
THIS points to address 3000, and the object stored there has three member variables, how big is the
this memory segment? What addresses does it occupy?