Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!husc6!hao!oddjob!gargoyle!ihnp4!laidbak!guardian From: guardian@laidbak.UUCP (Harry Skelton) Newsgroups: comp.lang.c Subject: Re: Turbo C and TSR's Message-ID: <1082@laidbak.UUCP> Date: Wed, 1-Jul-87 10:04:58 EDT Article-I.D.: laidbak.1082 Posted: Wed Jul 1 10:04:58 1987 Date-Received: Sat, 4-Jul-87 03:27:47 EDT References: <1041@killer.UUCP> Reply-To: guardian@laidbak.UUCP (Harry Skelton(E)) Followup-To: 1041@killer.UUCP Organization: LAI Chicago Lines: 44 Keywords: TSR Turbo C Summary: Boardland....another glitch... In article <1041@killer.UUCP> toma@killer.UUCP (Tom Armistead) writes: > >One complaint: > I don't like the way the inline assembly stuff works, you must > have MASM (3.0 or greater) to use this feature. I'll be damned You could download WASM to do your assembler or the new MASM. Check a few chicago BBS's for it (that's where I got my copy). FREE!! > >One question: > Has anyone written any TSR's in Turbo C, they give you this > nice function called keep() for terminatiing and staying > resident, but, you must give keep() the number of paragraphs > of memory used by you pgm and they don't document how to get > that value. I called Borland's tech supp. and they don't really >Tom Armistead Borland has a support group to handle the calls so they could not answer you fully. I would first check a few things. First, do you (m)alloc memory? If so you'll have to just buffer your own. You could do a malloc, get the address and then de-(m)alloc memory, take the address and set it to the next paragraph. give dos the paragraph to use as a next loader and int27 or whatever out of your program. For now, don't trust keep. Another thing is to make a .asm program to load under a system() call and exit with the paragraph point that it was loaded (up to 255 paragraphs). If Turbo C has the 'size' utility then that could tell you how large your program is. If not...download it from a bbs. The other thing is to start the program as assembler with orig 100 or 0 and make a loader for it. Last hack would be to system out to command.com /p and let dos worry about things. Yes I know these are HACKS to the problem, but I found that a TSR in 'C' is best done by a system() command to the SHELL (command.com) and make it fixed in memory. Sort of a fork() under dos! Don't trust Turbo 'C' untill version 5 or so.. :-) Harry Skelton guardian@laidbak.UUCP