[comp.os.msdos.programmer] need help with interrupts

mark@hpwin052.HP.COM (Mark Bailey) (02/07/91)

I need some help from some of you experienced programmers out there...

I have a programme that sits in a loop reading the keyboard untill there is
a hardware interrupt on IRQ3, when it goes to an ISR. The ISR updates some
variables, reads some data, increments the count of times entered and sets a    flag to say its been called. The loop checks for the flag to say there has     
an interrupt, if there has it writes the updated variables to the screen
using routines based on the write char with attribute service call of BIOS
INT 010.

The ISR PUSH's all used registers on entry and POP's before IRET.

The problem is this, if an IRQ occurs while data is being written to the
screen, after the IRET, the write does not continue properly, random chars 
are written at a random location. I have tried inserting CLI and STI in 
various positions to bracket the write but it seems to be interrupted 
regardless.
 
This is my first real attempt at pc programming in assembly, am I doing
something basically wrong or stupid?

I have kept this brief but if interested parties need more info, just mail
me.

BTW, its an 80286 processor, DOS 3.3, the interrupting hardware is a lan card.

Thanks,


        +-------------------------------------------------------------+
        |    Mark Bailey, Hewlett Packard Response Centre, England    |
        |    Mark Bailey / HP8000 / SA  +-----------------------------+
        |    mark@hpwin051.uksr.hp.com  |   DARK IN HERE ISN'T IT...  |
        +-------------------------------+_____________________________+