I wouldn't say "random", but rather that they are set to known values for testing purposes.
For example, BasicTest.tst set them this way
set RAM[0] 256,
set RAM[1] 300,
set RAM[2] 400,
set RAM[3] 3000,
set RAM[4] 3010,
After the test ASM code runs, the test then checks RAM locations that should have been set to specific values.
|RAM[256]|RAM[300]|RAM[401]|RAM[402]|RAM[3006|RAM[3012|RAM[3015|RAM[11] |
| 472 | 10 | 21 | 22 | 36 | 42 | 45 | 510 |
You can look at the BasicTest.vm code to see where it should write.
// Executes pop & push commands using the virtual memory segments.
push constant 10
pop local 0 RAM[300+0]
push constant 21
push constant 22
pop argument 2 RAM[400+2]
pop argument 1 RAM[400+1]
push constant 36
pop this 6 RAM[3000+6]
...
--Mark