RE: mov instruction

Robert Plantz <[email protected]> Fri, 8 Feb 2013 20:30:42 +0000
Newsgroups org.kernel.vger.linux-assembly
Message-ID <6E3CF6FDA48EC747AAAE0EAEDF16EFF802C63F18@coronet.solar.sonoma.edu>

________________________________________
From: [email protected] [[email protected]] on behalf of horseriver [[email protected]]
Sent: Wednesday, February 06, 2013 8:32 PM
To: Hendrik Visage
Cc: [email protected]
Subject: Re: mov instruction

On Thu, Feb 07, 2013 at 03:57:37PM +0200, Hendrik Visage wrote:
> On Thu, Feb 7, 2013 at 5:57 AM, horseriver <[email protected]> wrote:
> > hi:)
> >
> >   Is here a suitable place to post topics about hardware technology?
> >
> >   I am curious about how mov work.
> >   Why it can not move data from a mem adress to another adress  in one instruction.
> >   in this form : mov (eax), (ebx)
>
> That is what the (rep) movs(b/w) etc. operation(s) are designed for
> these "string copy" operations. the old 8086 had those running between
> es:di and ds:si as the registers for this.
  Yeah! I remember that.
  But why this can not work : mov (eax), (ebx)  ?  just curious .

Because the x86 architecture will not allow you to move (or do arithmetic) from memory to memory. You can only move to/from a register from/to memory. For example,

mov (eax), ecx
mov ecx, (ebx)

(assuming AT&T syntax)

--Bob