delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/02/11:36:35

Date: Sun, 2 Apr 2000 09:48:13 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Alexei A. Frounze" <alex DOT fru AT mtu-net DOT ru>
cc: djgpp AT delorie DOT com
Subject: Re: keyboard interrupt
In-Reply-To: <38DFE93D.342DB577@mtu-net.ru>
Message-ID: <Pine.SUN.3.91.1000402094745.9367S-100000@is>
MIME-Version: 1.0
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

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019