Date: Sun, 2 Apr 2000 09:48:13 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: "Alexei A. Frounze" cc: djgpp AT delorie DOT com Subject: Re: keyboard interrupt In-Reply-To: <38DFE93D.342DB577@mtu-net.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 28 Mar 2000, Alexei A. Frounze wrote: > stack_area resb 4096 Is this 4096 bytes? If so, it's probably too small for any serious C code. For comparison, the wrapper functions in the DJGPP library allocate a 32KB-long stack. > _IRQ1_ISR: > cli > push ds > push es > push fs > push gs > pushad > > mov ax, [cs:___djgpp_ds_alias] > mov ds, ax > mov es, ax > mov fs, ax > mov gs, ax > > mov [o_ESP], esp > mov word [o_SS], ss > > mov ss, ax > mov esp, stack_top > > cld > call _irq1_isr Isn't it better to enable interrupts before calling the user-defined handler? Why limit the user to non-reentrant operation? Also, your wrapper lacks a label at the end, which is required in order to lock it. Without locking, this code will crash in some cases.