Re: A basic question on asm
From: C (spamtrap_at_crayne.org)
Date: 09/24/04
- Previous message: wolfgang kern: "Re: IDE HDD control"
- In reply to: Percival : "Re: A basic question on asm"
- Next in thread: Grumble: "Re: A basic question on asm"
- Reply: Grumble: "Re: A basic question on asm"
- Reply: Percival : "Re: A basic question on asm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 24 Sep 2004 09:24:22 +0000 (UTC)
Percival wrote:
> Rong wrote:
>
>> I ran into this x86 sentence:
>> mov %eax,(%esp,1)
>> I am not sure what (%esp, 1) part mean.
>> And I could not find the explanation in x86 manual.
>> Can anyone explain a little?
>>
>> Thank you,
>>
>>
>
> It is AT&T syntax. I am not familiar with it, but possibly the gas
> manual or some sort should tell you what it means.
>
> My *GUESS*, and only a guess, is that it is mov [esp+1], [eax] in intel
> syntax.
>
> But it is only a guess. I need to learn at&T syntax soon.
>
> Percival
Close, your example would be "mov %eax, 1(%esp)" in gas.
"mov %eax, (%esp,1)" is "mov [esp], eax" the 1 being the scale
so "mov %eax,(%ebx,2)" is "mov [ebx*2], eax".
PS: If you are debugging with gdb you can do...
set disassembly-flavor intel
Which should switch to Intel style syntax. (Yes, flavour is
ment to be misspelled.)
C
2004-09-24
- Previous message: wolfgang kern: "Re: IDE HDD control"
- In reply to: Percival : "Re: A basic question on asm"
- Next in thread: Grumble: "Re: A basic question on asm"
- Reply: Grumble: "Re: A basic question on asm"
- Reply: Percival : "Re: A basic question on asm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|