adijo wrote
What does the following code snippet taken from the Hack machine language to sum up 1 to 100 do?
@i
M = 1
@sum
M = 0
When an undefined symbol is first used, a RAM location is automatically assigned to it. The automatic assignments begin at address 16, so this code is equivalent to
@16
M = 1 // Stores 1 in RAM[16]
@17
M = 0 // Stores 0 in RAM[17]
(This automatic assignment is explained in 4.2.4 which is a forward reference in the text since this example is in 4.2.2.)
--Mark