Assembly Language: + vs add

I am a student student learning assembly language at one time. I noticed that although there are instructions like add and mul, arithmetic operators are often used in instructions. For instance:

mov eax,[ebx+ecx]

Is the following equivalent ?

add ebx,ecx
mov eax,[ebx]

(ignoring ebx content change)

+3
source share
3 answers

- , . , , [ebx + ecx] ebx . , . x86 , , , , .

, , (ARM, thumb, mips, msp430, avr ..). , , , . , , , . , , , , , , , .

+1

... ([ebx + ecx] ) - . ebx , ecx - . , , . , . relase ( , ), .

+3

, . , . , , . ebx, .

Update: I just saw your last suggestion to ignore the change ... If you want to ignore this, then yes, I think the two fragments are equivalent.

+2
source

Source: https://habr.com/ru/post/1780636/


All Articles