caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Adrien <camaradetux@gmail.com>
Cc: Caml Mailing List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Binding C libraries which use variable arguments (stdarg.h)
Date: Sun, 1 Nov 2009 20:06:48 +0000	[thread overview]
Message-ID: <20091101200648.GB15428@annexia.org> (raw)
In-Reply-To: <666572260911010658r2eb8bdfbl9b06222079869c7b@mail.gmail.com>

On Sun, Nov 01, 2009 at 03:58:47PM +0100, Adrien wrote:
> Unfortunately I don't know much about asm, I tried to check but failed
> (couldn't find what "leaq" meant).

The 'q' just means it's a Long Mode instruction (ie. x86-64's 64 bit
mode).  The instruction itself is "Load Effective Address" - it means
it does an address calculation as if you were going to load/store
something at that address, but instead puts the address itself (result
of that calculation) in the target register.

If I remember my rusty x86 assembler correctly, then:

  movl 4(%ebx),%eax ; load 4 bytes of data from address %ebx + 4, put in %eax
  lea 4(%ebx),%eax  ; add %ebx + 4 and put that in %eax

Rich.

-- 
Richard Jones
Red Hat


  reply	other threads:[~2009-11-01 20:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-28 22:07 Adrien
2009-10-28 22:45 ` Basile STARYNKEVITCH
2009-10-29  8:55   ` Goswin von Brederlow
2009-10-29 21:37     ` Adrien
2009-10-29 23:31       ` Goswin von Brederlow
2009-10-29 21:18   ` Adrien
2009-10-30  9:35     ` Xavier Leroy
2009-11-01  9:31       ` Adrien
2009-11-01 11:07         ` Florian Weimer
2009-11-01 12:12           ` Adrien
2009-11-01 12:16             ` Florian Weimer
2009-11-01 14:58               ` Adrien
2009-11-01 20:06                 ` Richard Jones [this message]
2009-11-03 19:33                 ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091101200648.GB15428@annexia.org \
    --to=rich@annexia.org \
    --cc=camaradetux@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).