when the question said, “implement indirect addressing mode using Index addressing mode.. and vice versa..” I got a bit confused because there is no addressing mode called indirect. But every addressing mode has a direct and an indirect version to it.
like,
direct register addressing mode, EA = R, where R is a register.
indirect register addressing mode EA = [R]
direct absolute mode, EA = LOC, where LOC is a memory location.
indirect absolute mode, EA = [LOC]
So, I just wrote direct and indirect versions of the index addressing mode, where the direct index addressing mode uses the indirect register mode.