You are right. The reference to ">0" is actually only in the source of example BasicLoop.vm
push argument 0
if-goto LOOP_START <b>// If counter > 0, goto LOOP_START</b>
That comment confused me. Factually it is not correct, since the if-goto will jump to LOOP_START if counter != 0, so also if counter happens to become negative - which would happen in this example if the input was given as 0.
Both the book and the lecture correctly indicate that if-goto jumps if the value popped is anything else than zero.
Like I said, the test produces an incorrect result if the input is passed as 0: the program goes into an infinite loop (until the test stops it after the set number of ticktocks).
The proper way should be to compare the result of the decremented counter with 0 and use that result to stop when the counter becomes 0 or negative, like this:
push constant 0
pop local 0 // initialize sum = 0
push argument 0
label LOOP_START
push local 0
add
pop local 0 // sum = sum + counter
push argument 0
push constant 1
sub
pop argument 0 // counter--
push argument 0
push constant 0
gt
if-goto LOOP_START // If counter > 0, goto LOOP_START
push local 0
The code is slightly longer but now works correctly also when the input is zero.
Still the trick used in this example may deserve a little elaboration, since we are actually using the result of a calculation to feed the if-goto instead of a proper boolean value. I used that trick for the loop that initializes the local variables.