igaloly wrote
Why can we write RAM[A]?
Why couldn't or shouldn't we?
It is nothing more than a convention.
Why can we write D or A? Because it is agreed (meaning that the authors defined it this way) that when we write D we are referring to the contents of the D register, while when we write A it is agreed we are referring to the contents of the A register. The same for PC with regards to the contents of the program counter.
So when we write RAM[135] it is agreed that we are referring to the contents of the Memory that is at location 135. From there it's natural, even inevitable, to talk about RAM[A] as referring to the contents of the Memory that is at the location whose value is stored in the A register, since if A = 135, then
RAM[A] = RAM[135]
It is further agreed that the M 'register' refers to RAM[A].
To be sure, we "could" write RAM[D] and understand that to be the contents of the Memory at the location whose address is currently in the D register. As an abstraction or shorthand, it might even have some utility (in the same sense that RAM[base+offset] would have), but we have to recognize that we have no way, with the Hack architecture, of accessing RAM[D] directly.