Mail Archives: djgpp/2000/04/02/11:36:35
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 -