I'm new to assembly and am trying to iterate over a string stored in memory. I'm able to get the address of the string using lea
(load effective address) instruction but I want to now use that address stored in a register.
Is there an analog to lw
which could be used as follows:
lea string, %edx ; Load effective address of string into edx
lw %edx, %eax ; Load eax with the value stored where edx points
...
string:
.string "Hello"
"mov" is what you're looking for, with indirect addressing (which has some register restrictions based on whichever mode you're in)