I thiiink I understand that
movzbl (%rdi, %rcx, 1) , %ecx
means "move zero-extended byte to long" and is saying to extend ecx into 32 bits, but I'm not entirely sure what the syntax (%rdi, %rcx, 1) refers to.
I've seen somewhere that that syntax refers to
(Base, Index, Scale)
but I can't find any resources that say what that means exactly. I'm guessing it means to move whatever info is at (%rdi, %rcx, 1) to %ecx so that
(long) %ecx = (%rdi, %rcx, 1)
but how do I figure out what location that is? is there some sort of arithmetic involved to find an address or something?
also isn't ecx implicitly 32 bits already? Why would it need to be extended into 32 bits?
edit for clarification:
I understand that the syntax (%rdi, %rcx, 1) means that I have to add those three things together, but I don't understand how that results in an answer.
What am I adding, the contents of the registers? The address of the register? If it's the address, how do I figure out what the address is and add it together?
All I'm finding online is telling me what the syntax means but not how to use it with examples.