Mail Archives: djgpp/1996/12/03/21:52:44
Chris Gouldie wrote:
>
> Listen, I apologize if this is sort of a beginner question. I need to
> find out how to return a value from an asm procedure. I'm using o2c (the
> obj to coff converter), so this is for tasm.
>
> Also, how do I set up the prototype in my c++ program? Can I return
> structs etcetera, or only pointers to them? Here is a sample:
>
> p386
> ideal
> model flat,c
>
> extern malloc: proc
>
> virt dd ?
>
> public makevirt
> proc makevirt
> push 64000
> push 0
> call malloc
> pop virt
> ;I want to return virt to the c++ program
> ret
> endp makevirt
> end
>
> /* C++ program */
>
> void main ()
> { unsigned char * virtscreen = makevirt ();
> }
>
> So my question is, what do I add to make this compile?
>
> All help greatly appreciated,
>
> Chris Gouldie
I don't know in this particular example but usually you return values to
C/C++ in AX
--
tudor 'at' cam 'dot' com
http://www.cam.org/~tudor - last 'updated' 4 months ago...
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d(-)@>-- s-()>+:(+)>- a--- C+(++)>+++>$ ULC(+)@>++++
P+(+)>++++>$
L(+)>+++++>$ E-(--)?>++ W++(++)>+++>$ N(+)@>+++ o(-)?>+
K---(----)?>-
w(---)@>-- !O--(----)>++ !M(+)>- V--(-)?>-- PS--(-)?>+++ !PE(+)>-
Y(+)>++>$ PGP+(++)>++++>$ t---(+++)@>+++ !5(-)>-- X++(+++)>$>++++
R+()>+++>$ tv(+)@>++ b+(++)?>+++ DI-(--)?>--- !D(+)>+++ G++(+)@
e-()>++++>$ h(--)?>++ !r(--)?>+++ !y(--)>+++++@
------END GEEK CODE BLOCK------
- Raw text -