I'm wondering if anyone here is willing to provide me an example usage of 'index addressing'. I have a SLC5/04 OS400 and it doesn't support indirect addressing. This leave me with no other option but to use index addressing instead.
My current programme requires me to do a count and to store a minimum 5 previous counts. These 5 counts + the latest count will be displayed on the PanelView. FIFO will work but the control register has been used somewhere in the programme and I don't want to change it. Indirect addressing as I said, does not work with my SLC.
I haven't used index addressing before but I understand that it's a tricky little thing cause many other instructions are using it too. I figure out that as long as I'm using 2 variable registers (one to keep the original S:24 value and another to keep my programme count) and moving+interchanging them at the beginning and at the end of my programme, I'll be able to keep track with the exact S:24 value that I require without affecting other instructions that might use the index register.
My question is what is the best way to create the stack for the count using index addressing? I would appreciate if someone is willing to share a sample programme or tips and discuss it with me.