Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 22nd, 2006, 11:30 PM   #1
purpleorange
Newbie
 
purpleorange's Avatar
 
Join Date: Oct 2006
Location: Oh gosh, where I live. This is all so sudden.
Posts: 7
Rep Power: 0 purpleorange is on a distinguished road
Send a message via AIM to purpleorange
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?
purpleorange is offline   Reply With Quote
Old Nov 23rd, 2006, 1:16 AM   #2
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 394
Rep Power: 3 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
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
grimpirate is offline   Reply With Quote
Old Nov 23rd, 2006, 2:15 AM   #3
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 742
Rep Power: 3 Jimbo is on a distinguished road
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>
Jimbo is offline   Reply With Quote
Old Nov 23rd, 2006, 9:36 AM   #4
niteice
Programmer
 
niteice's Avatar
 
Join Date: Aug 2005
Posts: 98
Rep Power: 3 niteice is on a distinguished road
Send a message via AIM to niteice
In GAS syntax, instruction sizes are usually explicitly defined. You use movl here because you're dealing with 32-bit values:
movl %eax, %ebx
However, you would use movw for a different size:
movw %ax, %bx
Generally, the instruction size can be inferred, but suppose you have a variable:
mov $someVar, %edx
How does GAS know the size?

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.
niteice is offline   Reply With Quote
Old Nov 23rd, 2006, 9:38 AM   #5
Narue
Professional Programmer
 
Narue's Avatar
 
Join Date: Sep 2005
Posts: 419
Rep Power: 3 Narue is on a distinguished road
>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.
Narue is offline   Reply With Quote
Old Dec 1st, 2006, 4:16 PM   #6
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4 mackenga is on a distinguished road
(gah, beaten twice, and by miles...)
__________________
"I'm not a genius. Why do I have to suffer?"
mackenga is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:44 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC