View Single Post
Old Nov 23rd, 2006, 9:36 AM   #4
niteice
Programmer
 
niteice's Avatar
 
Join Date: Aug 2005
Posts: 98
Rep Power: 4 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