Article View: comp.sys.atari.st
Article #5113Turbo C, Gulam and the stack
From: David
Date: Sat, 21 Oct 1989 12:14
Date: Sat, 21 Oct 1989 12:14
13 lines
1076 bytes
1076 bytes
Turbo C does use the stack strangely, but you can force a function to
use a normal ST stack with the keyword `cdecl' (also found in MSC and TC
on the IBM). For example, if you are trying to call Gulam from TC, use
a prototype for the function pointer like this:
int cdecl (*sysptr)(char * cmdline);
Then, whenever you call (*sysptr)(), it will place its argument on the
regular stack. Remember to get the value of sysptr from SHELL_P, and
that SHELL_P is in protected memory, so you will have to go into
supervisor mode to look at it.
David Megginson, Centre for Medieval Studies, Toronto
Technical Details
Message-ID:
<89Oct21.081817edt.57405@ugw.utcs.utoronto.ca>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!vm.epas.utoronto.ca!MEGGINReferences:
<INFO-ATARI16-REQUEST@WSMR-SIMTEL20.ARMY.MIL>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!vm.epas.utoronto.ca!MEGGIN From: MEGGIN@vm.epas.utoronto.ca (David) Newsgroups: comp.sys.atari.st Subject: Turbo C, Gulam and the stack Message-ID: <89Oct21.081817edt.57405@ugw.utcs.utoronto.ca> Date: 21 Oct 89 12:14:21 GMT References: <INFO-ATARI16-REQUEST@WSMR-SIMTEL20.ARMY.MIL> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 13