🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3284

Re: Calling assembly routines from C

#3284
From: Steve Resnick
Date: Mon, 03 Dec 1990 18:19
26 lines
1796 bytes
In article <1990Dec1.050322.15678@wpi.WPI.EDU> jhall@wpi.WPI.EDU (John Clinton Hall) writes:
>
>I am writing a program to be separately assembled to be linked with a C
>program.  The assembly part prints a string using the undocumented INT 29h
>function call (I do know the dangers of using an undocumented function call).
>
>The Microsoft Mixed Language Programming Guide states, "By default, C
>parameters are passed by value, except for arrays, which are passed by
>reference."  I will assume that C will pass the "reference" of the array to the
>function.  What exactly does it mean by "reference?"  Is it a word pointing
>into the data segment, or a segment address with a word pointing into the
>segment?

Passing by reference means the address of the object (pointer) is placed on
the stack rather than copying the object (by value). If you want to pass
an array by value, there's a trick to do it. You define the array as being
a single member in a struct, then pass the struct.

Hope this helps....
Steve

-- 
----------------------------------------------------------------------------
steve.resnick@f105.n143.z1.FIDONET.ORG - or - apple!camphq!105!steve.resnick
Flames, grammar errors, spelling errrors >/dev/nul
The Asylum OS/2 BBS - (408)263-8017 IFNA 1:143/105.0
Technical Details
Message-ID: <1990Dec3.181906.25989@Octopus.COM>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ames!vsi1!octopus!stever
References: <1990Dec1.050322.15678@wpi.WPI.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ames!vsi1!octopus!stever
From: stever@Octopus.COM (Steve Resnick )
Newsgroups: comp.os.msdos.programmer
Subject: Re: Calling assembly routines from C
Message-ID: <1990Dec3.181906.25989@Octopus.COM>
Date: 3 Dec 90 18:19:06 GMT
References: <1990Dec1.050322.15678@wpi.WPI.EDU>
Reply-To: stever@octopus.UUCP (Steve Resnick )
Organization: Octopus Enterprises, Cupertino CA
Lines: 26