Article View: comp.sys.atari.st
Article #41432Re: Calling callgulam from TC
From: Jwahar R. Bammi
Date: Thu, 01 Mar 1990 09:38
Date: Thu, 01 Mar 1990 09:38
29 lines
1932 bytes
1932 bytes
In article <11368@etana.tut.fi> av74381@korppi.tut.fi (Vesterinen Arto) writes:
> Unfortunately have not been able to call gulam from a Turbo-C
> program. I have tried out Michal Jaegermann's method for
> MWC but it does not work out for TC. If anyone has figured out
> how to call gulam from TC, please e-mail me how to do it.
>
> I just do not understand why my example works for MWC but not
> with TC, it gives me two warning messages when I compile it:
your example is correct. the reason it does'nt work from Turbo C
is that Turbo C passed the arguements in registers by default, while
gulam is expecting them to be on the stack (like the normal C stack
frame conventions). (is there a option in TC to do this??)
on a related note: the correct way to check Gulam's magic
number is to get the long at addr (*shell_p - 10), mask out the upper nibble
of the long with 0x00FFFFFFL, and compare the value against
0x00420135L. The reason for this discrepancy is that there seem to be
two flavors of gulam: one with magic # 0x86420135L and one with 0x00420135L.
This way should be a little more reliable than testing just the second
half of the magic number by testing the short value at addr (*shell_p - 8).
hope that helps,
--
--
bang: {any internet host}!dsrgsun.ces.CWRU.edu!bammi jwahar r. bammi
domain: bammi@dsrgsun.ces.CWRU.edu
GEnie: J.Bammi
Technical Details
Message-ID:
<BAMMI.90Mar1044130@dsrgsun.ces.CWRU.Edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!usenet.INS.CWRU.Edu!bammiReferences:
<11368@etana.tut.fi>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!usenet.INS.CWRU.Edu!bammi From: bammi@dsrgsun.ces.CWRU.Edu (Jwahar R. Bammi) Newsgroups: comp.sys.atari.st Subject: Re: Calling callgulam from TC Message-ID: <BAMMI.90Mar1044130@dsrgsun.ces.CWRU.Edu> Date: 1 Mar 90 09:38:30 GMT References: <11368@etana.tut.fi> Sender: news@usenet.ins.cwru.edu Organization: Case Western Reserve University Lines: 29 In-reply-to: av74381@korppi.tut.fi's message of 28 Feb 90 11:11:16 GMT