Date: Thu, 6 Jan 2000 12:02:18 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Martin Str|mberg cc: DJGPP Subject: Re: The endless int31 hooking debugging continued In-Reply-To: <200001051413.PAA28425@father.ludd.luth.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 5 Jan 100, Martin Str|mberg wrote: > Is it ok to just overwrite the values that was in ds, es and ss? No, you need to save and restore them. > I've > tried pushing things to be able to restore them, but then I've got > some _really_ strange crashes (Invalid opcode, Stack fault, EIP > pointing into the middle of an instruction)! I don't think it's because of the pushing, but please show the code which did that. Once again, I suggest to look at the function _i31_hook in dbgcom.c, it shows several examples of code that hooks Int 31h and *works*. > /* Restore segments to valid DJGPP state. */ > movw %cs:_my_ds, %ds > movw _my_ds, %es > movw _my_ds, %ss I don' think you can move values into segment registers directly, I think you need to use AX as intermediary.