I received a PM from one of our forum viewers inquiring about the use of S:40 in an indirect address in the program I posted earlier in this thread. Without getting into the specifics of a private message, I still wanted to post this here for the benefit of others who might have a similar question.
The forum member was asking about rung 2:2
MOV C5:0.ACC N11:[S:40]
He apparently interpreted the rung that the rung moved the timer accumulator value to the S:40 register. I explained indirect addressing.
The value is not being moved to the status file. The S:40 inside the brackets indicate that it is an indirect address, and the value of the counter accumulator is moved to the word in file N11 that is pointed to by S:40. That is, when S:40 = 0 the address is N11:0. When S:40 = 1 the address is N11:1, when S:40 = 2 the address is N11:2, etc. File N11 has 24 words in it, one for each hour. The counter accumulator is continuously moved to each of the words that corresponds to the current hour. When the hour changes then the place to which the counter accumulator is copied changes.
I hope that helps.