Path: utzoo!utgpu!watmath!att!rutgers!ucsd!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!xadmx!MATHRICH@umcvmb.missouri.edu From: MATHRICH@umcvmb.missouri.edu (Rich Winkel UMC Math Department) Newsgroups: comp.lang.pascal Subject: chaining interrupts Message-ID: <21471@adm.BRL.MIL> Date: 17 Nov 89 01:24:50 GMT Sender: news@adm.BRL.MIL Lines: 29 I've done this many times with assembler, but not pascal. Are you sure of the condition of the stack when you do the jump? If you're doing this inside a TP INTERRUPT procedure, you need to read about what TP does with the stack before your inline code gets control. Basically it pushes ALL the registers except CS, SS, IP, SP and the flags register. You'll need to pop everything and then execute the jump. See page 222 of the TP 5.0 manual. Are you sure you're doing a far jump? Are you using the jump seg & offset properly? If the seg & offset of the target routine is: aabb:ccdd then the jump could be coded as: $EA/$dd/$cc/$bb/$aa (immediate-operand form of far jump) or $FF/$2E/variable assuming 'variable' is a four byte variable in the data segment (it must be a global variable to be in the data seg). The variable should have the contents: $dd $cc $bb $aa. One way to load it would be: var intvec:longint absolute $0:yyyy; saveintvec:longint; ... saveintvec:=intvec; {save the old int vector} Where yyyy is 4 times the interrupt number. To be on the safe side, you should do a CLI before the jump (if you've done an STI in your procedure). Rich