assembly question

RichieZ

Diamond Member
Jun 1, 2000
6,551
40
91
lets say register %eax currenlty holds 0x6, and %edx is 0 and %ebx is 0x804a9a0

and the next instruction is
mov (%edx,%ebx,1),%al

al should be (%ebx*1)+0 but its so small to hold it yes?

after this %eax is now 0x73

from what i understand %al is the lowest byte of %eax, but i don't understand how this mov is working
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
I believe that's doing a load or store. I think it's accessing memory location edx + (ebx*1) and loading it into al (or storing al into that memory location - different assemblers have different syntax... some put the destination on the right and some on the left).

edit: Anyway, if eax was 0x6, setting al to anything would set eax to the same value (because 6 fits in the lowest byte). If eax had meaningful data in higher bits, those bits wouldn't be modified.