Xref: utzoo comp.lang.c:20244 alt.msdos.programmer:241 comp.sys.ibm.pc:32314 Path: utzoo!attcan!uunet!ginosko!rex!ames!vsi1!wyse!mips!blanier From: blanier@mips.COM (Brian Lanier) Newsgroups: comp.lang.c,alt.msdos.programmer,comp.sys.ibm.pc Subject: Re: interrupt type in Turbo C Summary: Use Assembly Message-ID: <24259@abbott.mips.COM> Date: 29 Jul 89 08:43:27 GMT References: <2388@pur-phy> Reply-To: blanier@mips.COM (Brian Lanier) Distribution: na Organization: MIPS Computer Systems, Sunnyvale, CA Lines: 38 In article <2388@pur-phy> murphy@pur-phy (William J. Murphy) writes: >I came across a type of variable which I know >nothing about. The program was written in Turbo C and TC uses a type >interrupt. I looked at the manual for TC and found that this is specific >to TC, so my question is how would I implement this in MicroSoft C 5.1? From what I have read, the way to accomplish this in MSC is to use the -S switch to generate the source listing and change "ret" to "iret". Of course, you then have to assemble/link that code in with the C. Alternately, you could use debug, find the address of the ret instruction and change it that way. (This is a real pain in the tuckus) (see note) To install the interrupt, use Function 35h to get the current vector (for later chaining, of course) and use Function 25h to set the new vector. This takes the place of Turbo C's getvect() and setvect(). (I thinks MSC 5.0 added dos_getvect and dos_setvect, but I'm not sure). I hope that's what you were asking for. Brian Lanier blanier@mips.com blanier@scueng.scu.edu note: if you feel you have to use the debug method (maybe you don't have a good assembler), the coding for ret is : 11000011 return within a segment 11000000 data-low data-high return within a segment with a pop value 11001011 intersegment return 11001010 data-low data-high intersegment return with a pop value I would be suprised if there was a pop value (if there is you have to code it out as iret won't let you have one.) The coding for iret is : 11001111 Just replace the right bit pattern. Use the u in debug to find the ret.