delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/03/12:16:37

Message-Id: <3.0.6.32.19990303121608.0092fc00@pop.globalserve.net>
X-Sender: derbyshire AT pop DOT globalserve DOT net (Unverified)
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Wed, 03 Mar 1999 12:16:08 -0500
To: djgpp AT delorie DOT com
From: Paul Derbyshire <pderbysh AT usa DOT net>
Subject: Re: Generating Machine Code on the fly
In-Reply-To: <36D97D05.C4440EED@unb.ca>
References: <7b6qpv$39t$1 AT news8 DOT svr DOT pol DOT co DOT uk>
<199902261912 DOT OAA24117 AT envy DOT delorie DOT com>
<7b7gra$5nh$1 AT news4 DOT svr DOT pol DOT co DOT uk>
<199902270142 DOT UAA26915 AT envy DOT delorie DOT com>
<7b80qg$qm3$1 AT news8 DOT svr DOT pol DOT co DOT uk>
<36d80527 DOT 13423287 AT 158 DOT 152 DOT 254 DOT 68>
<7b9el1$mi9$1 AT news7 DOT svr DOT pol DOT co DOT uk>
<7b9vu9$1fp$1 AT news6 DOT svr DOT pol DOT co DOT uk>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

At 01:29 PM 2/28/99 -0400, you wrote:
>char *codehere;     /*void*, char* or what*/
>codehere=(char *)malloc(100);    /* 100 bytes of code memory */
>codehere[0]=0xc3;    /*just perform a ret operation for now*/
>asm(
>    "call %%ebx"    /* no comma after this */
>    : /*no ouputs*/
>    : b (codehere)   );

Why %ebx? Why not let the compiler choose?

And won't this clobber %eax with output if the "codehere" code returns a
value?

-- 
   .*.  "Clouds are not spheres, mountains are not cones, coastlines are not
-()  <  circles, and bark is not smooth, nor does lightning travel in a
   `*'  straight line."    -------------------------------------------------
        -- B. Mandelbrot  |http://surf.to/pgd.net
_____________________ ____|________     Paul Derbyshire     pderbysh AT usa DOT net
Programmer & Humanist|ICQ: 10423848|

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019