![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
|
What's the difference between mov and movl?
After reading through some of Programming from the Ground Up, I can't help but notice that the author uses 'movl'. In the Tajga Tutorial, the author uses 'mov'. What does the 'l' stand for and is there a difference between the two instructions? In this wikibook page, it shows some other mov's with different endings, but not the one with the 'l' even though it uses it in it's sample. Is the 'movl' instruction specific to GAS?
|
|
|
|
|
|
#2 |
|
King of Portal
|
There is no movl instruction, all you have to do is check the Intel docs at the Intel website and you'll see that such an opcode is not supported. Most likely it is something specific to GAS. The closest opcode to the one you're describing is MOVLHPS which is move packed single-precision floating-point values low to high. It could also be a typo, perhaps he meant to type mov al which is to move some value into the al register.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#3 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 742
Rep Power: 3
![]() |
I seem to remember something about some commands having l at the end but having no particular performance changes. Take it with the usual disclaimer though, as it's really a vague recollection.
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
#4 |
|
Programmer
|
In GAS syntax, instruction sizes are usually explicitly defined. You use movl here because you're dealing with 32-bit values:
movl %eax, %ebx movw %ax, %bx mov $someVar, %edx In NASM syntax, however, instruction size is inferred by the operands, so you deal with a syntax that is a lot closer to the machine code. |
|
|
|
|
|
#5 |
|
Professional Programmer
![]() Join Date: Sep 2005
Posts: 419
Rep Power: 3
![]() |
>Is the 'movl' instruction specific to GAS?
It's specific to assemblers with AT&T syntax. The l is a size suffix that tells you you're working with dwords. To change the size, you change the suffix (b, w, l, q for byte, word, dword, and qword). [edit: gah, beaten]
__________________
Even if the voices aren't real, they have some pretty good ideas. |
|
|
|
|
|
#6 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4
![]() |
(gah, beaten twice, and by miles...)
![]()
__________________
"I'm not a genius. Why do I have to suffer?" |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|