@septicake I'm not at home right now, so I can only point you to things from google right now. Also we probably didn't need it for that assignment. But in the mean time is this helpful? https://www.nesdev.org/obelisk-6502-guide/addressing.html
You basically need to store the address within some region and point towards that address.
@septicake @agowa338 I learned 6502 assembly somewhat well when I worked on my NES assembler, so I can try to chime in a bit
Basic idea to summarize is when you do e.g. LDA ($40, X), this will read a 16-bit address starting at ($40 + X), then read the value at that address and store it in A
Concrete example:
@septicake @agowa338 as for why… that’s harder to answer. I think it could be useful for defining a table in memory. You’d load a table of addresses in your zero page, and you’d set the X register as an index into the table
I think NES Tetris uses some indirect addressing, and Displaced Gamers on YouTube showed some disassembled code using it (while explaining how to get ACE) if you want to see a real world example: https://youtu.be/QOES2XTqT74