Article View: comp.lang.modula2
Article #4387Re: Interlanguage access
From: Alex Bewley
Date: Sun, 21 Aug 1988 17:20
Date: Sun, 21 Aug 1988 17:20
20 lines
1108 bytes
1108 bytes
> This is about accessing C routines from Logitech Modula-2
You need version 3.0. There is a SYSTEM routine called EXTCALL, and you
can use that to access other language routines. But all parameter passing must
be done using CODE statements before the call. For example:
(* call a 'C' routine *)
SETREG(AX,10);
CODE(PushAX);
SETREG(BX,20);
CODE(PushBX);
EXTCALL("_larger"); (* let's say returns -1 if a<b,0 if a=b, 1 if a>b *)
GETREG(AX,Result);
IF (Result # 0) THEN
...
The routine is linked in with all the other modules at link-time.
Alex
Technical Details
Message-ID:
<INFO-M2%88082113345518@UCF1VM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!ucbvax!vm.uoguelph.ca!BOTCHAIRReferences:
<hpda!hpcupt1!hpisoa1!vandys@UCBVAX.BERKELEY.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!ucbvax!vm.uoguelph.ca!BOTCHAIR From: BOTCHAIR@vm.uoguelph.ca (Alex Bewley) Newsgroups: comp.lang.modula2 Subject: Re: Interlanguage access Message-ID: <INFO-M2%88082113345518@UCF1VM> Date: 21 Aug 88 17:20:49 GMT References: <hpda!hpcupt1!hpisoa1!vandys@UCBVAX.BERKELEY.EDU> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Info-Modula2 Distribution List <INFO-M2%UCF1VM.bitnet@jade.berkeley.edu> Organization: The Internet Lines: 20