Im having trouble with arrays.
I also found this:
Code:
Im wondering why it does any good to load a into c if c is used for nothing in the code.
I also found this:
Code:
array_base .EQU $8000
element_size .EQU 3
LD A, (array_base+(4*element_size))
LD C, A
LD A, 3 ; Put index in A
LD B, A ; Multiply by element size
ADD A, A
ADD A, B
LD D, 0
LD E, A ; Put A in DE
LD HL, array_base ; Add index to base
ADD HL, DE
LD C, (HL)
Im wondering why it does any good to load a into c if c is used for nothing in the code.