Click to See Complete Forum and Search --> : Difference between mov $0x8,%edx and mov 0x8,%edx
suryasantu
February 18th, 2006, 12:52 AM
Hi All,
I saw the following two instructions in the objdump of a C Program.
mov $0x8,%edx
mov 0x8,%edx
What is the difference between the two instructions.
Does $ have any significance?
My understanding for mov 0x8,%edx is moving the value 8 into edx register.
Thanks in Advance
Regards
Surya Santosh
Hobson
February 18th, 2006, 06:05 AM
I am not very familiar with AT&T syntax, so I hope that following info is correct:
mov $0x8,%edx - here $ means that following value is a numeral. Tis instruction moves value of 8 into edx register
mov 0x8,%edx - here 0x8 is not a literal, its an address. This instruction moves value stored at memory location 0x8 (of default data segment) into register edx.
Hope this helps
Hob
philkr
February 18th, 2006, 11:16 AM
My understanding for mov 0x8,%edx is moving the value 8 into edx register.
Isn't this supposed to be "mov edx, 8h". And I think addressed are placed into square brackets like this [8h]. But it's only a guess.
Hobson
February 18th, 2006, 11:31 AM
Isn't this supposed to be "mov edx, 8h". And I think addressed are placed into square brackets like this [8h]. But it's only a guess.
It is, but when using Intel assembly syntax. AT&T syntax (A.K.A. GAS assembly syntax) is quite different
Regards,
Hob
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.