arkansascontrols
Lifetime Supporting Member
Believe it or not I've nearly got this thing completed, but I have two remaining functions that I've still yet to complete. I only had a little while to test on the CPU today, but I've got an issue with a function that has got me stumped and was hoping for a little help.
The function is 7 full pages long so I won't burden you with the entire thing, unless you're a masochist and ask for it. So here's the pertinent code and the area where things are breaking.
L #NumElements;
begn: T #LoopCounter;
//MUCH CODE HERE that is working fine;
L #LoopCounter;
LOOP begn;
If I monitor the routine, everything works well up to the end of the loop where the routine seems to stick and the value of the Loop counter never decrements. I've tried the T #LoopCounter before the label and after the label. I've tried manually decrementing the Loopcounter value prior to the LOOP begn; statement and it resulted in CPU STOP. I have several other routines that loop but not with a LOOP statement, In my other routines I've just manually incremented the loopcounter and then checked for a valid range and executed a JC back to the label, but I thought I would try to implement this as it presented some challenges in the code due to the reverse action of the loop and I thought it would be a good learning experience. I can't test my function beyond the loop statment but I'm fairly certain I can make it work as I want.
So I'm not asking anyone to troubleshoot 7 pages of code, I can make this work, I'd just like to make the LOOP statement work without resorting to my tried and true method.
Thanks in advance.
Eric
The function is 7 full pages long so I won't burden you with the entire thing, unless you're a masochist and ask for it. So here's the pertinent code and the area where things are breaking.
L #NumElements;
begn: T #LoopCounter;
//MUCH CODE HERE that is working fine;
L #LoopCounter;
LOOP begn;
If I monitor the routine, everything works well up to the end of the loop where the routine seems to stick and the value of the Loop counter never decrements. I've tried the T #LoopCounter before the label and after the label. I've tried manually decrementing the Loopcounter value prior to the LOOP begn; statement and it resulted in CPU STOP. I have several other routines that loop but not with a LOOP statement, In my other routines I've just manually incremented the loopcounter and then checked for a valid range and executed a JC back to the label, but I thought I would try to implement this as it presented some challenges in the code due to the reverse action of the loop and I thought it would be a good learning experience. I can't test my function beyond the loop statment but I'm fairly certain I can make it work as I want.
So I'm not asking anyone to troubleshoot 7 pages of code, I can make this work, I'd just like to make the LOOP statement work without resorting to my tried and true method.
Thanks in advance.
Eric