pgubook-readers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pgubook-readers] Issue With 1st Example


From: Cian Synnott
Subject: Re: [Pgubook-readers] Issue With 1st Example
Date: Wed, 10 Feb 2010 21:11:09 +0000

Hi Wesley,

On Wed, Feb 10, 2010 at 4:19 PM,  <address@hidden> wrote:
> exit.s:25: Error: no such instruction: `mov1 $1,%eax'
> exit.s:29: Error: no such instruction: `mov1 $0,%ebx'
>
This looks like a font issue - you've got mov1 here rather than movl -
i.e. the number 1 rather than the letter lowercase-L.

See the third bullet point at
http://sourceware.org/binutils/docs-2.20/as/i386_002dSyntax.html for
details of why you have to use these funny suffixes:

"In AT&T syntax the size of memory operands is determined from the
last character of the instruction mnemonic. Mnemonic suffixes of `b',
`w', `l' and `q' specify byte (8-bit), word (16-bit), long (32-bit)
and quadruple word (64-bit) memory references. Intel syntax
accomplishes this by prefixing memory operands (not the instruction
mnemonics) with `byte ptr', `word ptr', `dword ptr' and `qword ptr'.
Thus, Intel `mov al, byte ptr foo' is `movb foo, %al' in AT&T syntax."

Cian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]