Real mode interrupt vectors

Martijn van Oosterhout kleptog at
Thu Apr 3 12:04:15 EST 2003

On Thu, Apr 03, 2003 at 08:14:30AM +1000, Michael Still wrote:
> Now I want to install the interrupt handler. I'm after interrupt 6, so I
> do:
> 		lea	bad_opcode, %si
> 		mov	%si, 0x1A
> 		mov	%cs, 0x18
> This bit doesn't seem to work. My understanding that interrupt 6 should
> occupy bytes 24 - 27 in the ineterrupt vector, which is at the start of
> memory. Obviously I am wrong.

As the other guy said, you need you DS (or some segment)  to be set. I only
know Intel syntax off the top of my head so bear with me:

  push es
  lea si, [bad_opcode]    ; or mov si, bad_opcode
  xor ax,ax
  mov es, ax
  mov es:[6*4], si
  mov es:[6*4+2], cs
  pop es

Translate as appropriate.

Hope this helps,

Martijn van Oosterhout   <kleptog at>
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
>   - Samuel P. Huntington
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url :

More information about the linux mailing list