[comp.sys.ibm.pc] Help needed with MASM and Interrupts

gw@sickkids.UUCP (CFI/Graham Wilson ) (09/01/87)

I am writing an interrupt handler and have run into a snag with MASM.
The solution may be obvious, but I can't seem to figure it out.

The situation is as follows.  The clock tick (IRQ0) has been speeded up
by a factor of 32, and IRQ0 (INT 8) jumps to my routine.  Every 32 interrupts,
control passes to the BIOS INT 8 handler when my routine is done.  The
problem is that I can't figure out how to pass control to the BIOS routine.

I tried saving the offset and segment values from the interrupt table
before changing to my address.  These values are saved as *CODE SEGMENT*
variables jmpoff and jmpseg respectively (in that order).  If control
is to pass through to BIOS, I execute the command:

	jmp	FAR [cs:jmpoff]

Which I had assumed would work.  The first two bytes of the opcode
generated by MASM are 0xff and 0x26.  To the best of my knowledge,
they should be 0xff and 0x3e.  Does anyone know how to correctly set
up the jump?  Any help is greatly appreciated.

Thanks bunches in advance.

Graham Wilson              |      ...allegra   ...decvax
CyberFluor Inc             |            \            \  
179 John St., Suite 400    | ...linus!utcrsi!utzoo!sickkids!cfi!graham
Toronto, Ontario, M5T 4B1  |            /            /
(416) 977-5450             |      ...watmath   ...ihnp4

yingda@vms.macc.wisc.edu (Ying-Da Lee) (09/03/87)

In article <69@sickkids.UUCP> gw@sickkids.UUCP (CFI/Graham Wilson (977-5450) [RI7921Z]) writes:
>I am writing an interrupt handler and have run into a snag with MASM.
>The solution may be obvious, but I can't seem to figure it out.
>
>The situation is as follows.  The clock tick (IRQ0) has been speeded up
>by a factor of 32, and IRQ0 (INT 8) jumps to my routine.  Every 32 interrupts,
>control passes to the BIOS INT 8 handler when my routine is done.  The
>problem is that I can't figure out how to pass control to the BIOS routine.
>
>I tried saving the offset and segment values from the interrupt table
>before changing to my address.  These values are saved as *CODE SEGMENT*
>variables jmpoff and jmpseg respectively (in that order).  If control
>is to pass through to BIOS, I execute the command:
>
>	jmp	FAR [cs:jmpoff]
>

What you need is

	jmp	dword ptr cs:jmpoff

Alternatively, you could define an additional label, e.g.,

old_int8	equ	dword ptr $
jmpoff		dw	?
jmpseg		dw	?

then a simple

	jmp	cs:old_int8

will do.