user6952065
user6952065

Reputation:

Assembly x86 ADD command

I'm trying to learn Assembly as I feel it will be helpful when I start my CS courses that deal with lower level languages and material down the road (C is the lowest I've learned so far).

To do this, I'm using CE and looking at memory addresses and Assembly commands from some older, simple games. Basically learning Assembly by hacking old games.

There's one command that looks like this:

add [eax], ecx

From my understanding add will add the two arguments together and store them into the first argument and [ ] essentially acts as a deference.

So will it add the value of eax and the address of ecx and store them into eax, or will it store them into the address that eax is holding?

If it will help here are the addresses:

eax =   00EFA188
ecx =   00000014

Upvotes: 1

Views: 5049

Answers (1)

prl
prl

Reputation: 12434

It reads the value in memory at 00EFA188, adds 14 to that value, and stores the sum back into memory at 00EFA188.

Upvotes: 5

Related Questions