gs99 wrote
Q1. What does “pop pointer 1” do?
pop pointer only has two legal arguments: 0 and 1.
pop pointer 0 pops the top of stack into the THIS pointer which is RAM[3].
pop pointer 1 pops the top of stack into the THAT pointer which is RAM[4].
It appears twice – commands 1 and 20.
When command 1 runs (one-time), the value 3000 is popped to RAM[4], called THAT.
Segment That is not affected.
This sets the THAT pointer to 3000 so the That segment displays the content of RAM starting at 3000.
When command 20 runs, two results occur: RAM[4] as done in command 1.
But segment That is also affected:
Iteration:1
THAT after:3001
That[0,1,2]before:011
That[0,1,2]after:110
Before: THAT is 3000 so That[0..2] displays RAM[3000..3002].
After: THAT is 3001 so That[0..2] displays RAM[3001..3003].
Q2.”End of script – Comparison ended successfully” appears after the final command runs.
View Output:
RAM[3000]0
RAM[3001]1
RAM[3002]1
RAM[3003]2
RAM[3004]3
RAM[3005]5
This is the correct series for 6 elements. How does this output compare with the final values in segment That?
At the end of the test, THAT is 3004 so That[0..2] displays RAM[3004..3006].
--Mark