Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!ASYLUM.SF.CA.US!romkey From: romkey@ASYLUM.SF.CA.US (John Romkey) Newsgroups: comp.protocols.tcp-ip.ibmpc Subject: Turbo C and Packet Drivers Message-ID: <9104111202.AA08768@asylum.sf.ca.us> Date: 11 Apr 91 19:02:38 GMT References: <9104111614.AA09977@ftp.com> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: romkey@asylum.sf.ca.us Organization: The Internet Lines: 21 Date: Thu, 11 Apr 91 12:14:35 -0400 From: "James B. Van Bokkelen" Reply-To: jbvb@ftp.com Our protocol stacks use a small ASM routine to save the registers and switch to a stack of their own, and then call C to do the bulk of the work. You can probably use a compiler's "interrupt" function mechanism to make it work, but you'll be relying on the driver leaving you enough stack. I don't have experience with Turbo's "interrupt" functions, and while I know MSC can do them, I've never found the place in the manual where they're explained. Declaring a function as 'interrupt' probably won't work properly. 'interrupt' functions do indeed save and restore all the registers, but they also expect the stack frame to be the same format as an interrupt stack frame, which means the flags register is pushed on the stack and popped off it on return. The packet drivers won't have left the flags register on the stack, so the stack will get screwed up. - john romkey Epilogue Technology USENET/UUCP/Internet: romkey@asylum.sf.ca.us voice/fax: 415 594-1141