Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Alain Frisch <alain@frisch.fr>
To: David LONY <david.lony@pragmadev.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Interface between Ocaml and Assembler
Date: Fri, 04 Jan 2008 10:43:35 +0100	[thread overview]
Message-ID: <477DFFC7.8@frisch.fr> (raw)
In-Reply-To: <477DFF6C.1070409@pragmadev.com>

David LONY wrote:
> Is it possible to interface assembler code with an Ocaml code ? I 
> mean..is it possible to call a Ocaml function from an assembler code by 
> using the asm instruction "call my_function" (gas asm)?

Yes, you can call an OCaml function from assembler using the same method 
as from C, that is through caml_callback* functions (see Section 18.7.1 
in the OCaml manual). However, dealing with the GC properly in assembler 
is tricky: you'll have to reproduce the behavior of the CAMLlocal and 
CAMLparam macros.

-- Alain


  reply	other threads:[~2008-01-04  9:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-04  9:42 David LONY
2008-01-04  9:43 ` Alain Frisch [this message]
2008-01-04 16:45   ` [Caml-list] " David LONY
2008-01-04 16:58     ` Xavier Leroy

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=477DFFC7.8@frisch.fr \
    --to=alain@frisch.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=david.lony@pragmadev.com \
    /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