Hello All,
My 18X chip program uses the following code below many times through out the program. I'm wondering if I could some how use a For - Next loop to tidy this up and save a bit of code space. The contents of Eeprom 101 must go into B0, 102 must go into B1 etc. etc.
As an example, what happens if I needed to READ 12 consecutive Eeprom locations into B1 – B12. Certainly it can be done with out READing 12 separate times! But using one READ statement and looping and incrementing everything 12 times? And wouldn’t that save some code space too?
Here it is:
Read 101, B0
Read 102, B1
Read 103, B2
Read 104, B3
Read 105, B4
Read 106, B5
For b7 = 101 TO 106
Read b7, (B?)
How do I increment the variables B0 to B5? Or is it not possible?
I’m sure there is a simple solution, but I can’t seem to figure it out. Thanks.
My 18X chip program uses the following code below many times through out the program. I'm wondering if I could some how use a For - Next loop to tidy this up and save a bit of code space. The contents of Eeprom 101 must go into B0, 102 must go into B1 etc. etc.
As an example, what happens if I needed to READ 12 consecutive Eeprom locations into B1 – B12. Certainly it can be done with out READing 12 separate times! But using one READ statement and looping and incrementing everything 12 times? And wouldn’t that save some code space too?
Here it is:
Read 101, B0
Read 102, B1
Read 103, B2
Read 104, B3
Read 105, B4
Read 106, B5
For b7 = 101 TO 106
Read b7, (B?)
How do I increment the variables B0 to B5? Or is it not possible?
I’m sure there is a simple solution, but I can’t seem to figure it out. Thanks.