Hello Nigel
I looked at your delay subroutine in one of your tutorials. Below please find snippet:
Delay movlw d'250' ;delay 250 ms (4 MHz clock)
movwf count1
d1 call ChkKeys ;check the keys
movlw 0xC7 ;delay 1mS
movwf counta
movlw 0x01
movwf countb
Delay_0
decfsz counta, f
goto $+2
decfsz countb, f
goto Delay_0
decfsz count1 ,f
goto d1
I believe I understand the concept behind it, however that is not what I am looking for. Your variables count1, counta, and countb resemble the variables I, J, K I had in mind.
However your routine covers all permutations of count1, a,b in the 3 nested loops. That is not what I had in mind. I only need selected ones.
I need to initialize count1 as you did with d'50' and start that loop. Now counta and counb are dependent of count1. If we start count1 at 50 then counta needs to start at 50 and decrement, while at the same time countb is incrementing from 1 to 50 simultaneously. That means the permutations will be count1=50 (main loop), counta=50, countb=1. Then counta=49, countb=2, and so on until counta=1 and countb=50 simultaneously. Do you have any other examples or suggestions? Regards, Rom