d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Assembly Help > X86
Add Reply New Topic New Poll
Member
Posts: 1,748
Joined: Jun 20 2006
Gold: 2,306.00
Sep 14 2012 09:04pm
I'm working on debugging a project for my computer architecture course, something about a 6 phase binary bomb with a hidden 7th phase.

anyway, I'm walking through the disassembled code and came across this line,

Code
mov    %rdx,(%rsp,%rsi,2)


I've never seen a mov instruction like this, it looks similar to a lea instruction.
If anyone could give me a simple explanation that would great.
Thanks.
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Sep 14 2012 10:42pm
its taking the data from the memory address thats calculated in the brackets and putting it in rdx.

i forgot the correct name but rsp would be the base address and rsi would be the current index address that would be incremented or decremented that is added to the base address (rsp) and then it will store 2 bytes of data found at that address

ex:

if rsp = 10 and rsi = 3

rdx will hold data from memory addresses 13-15

edit:: i think its called indexed addressing mode or something

google programming from the ground up

the pdf document

read through it. its old, but it covers 32bit at&t syntax on linux

This post was edited by AbDuCt on Sep 14 2012 10:44pm
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Sep 15 2012 12:49am
fake edit:: yea i was right

little bit of reading for you so you can understand it

Member
Posts: 1,748
Joined: Jun 20 2006
Gold: 2,306.00
Sep 15 2012 01:54am
Awesome, thank you very much. This made much more sense then what i had found earlier.

This post was edited by jailhouse on Sep 15 2012 01:54am
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll