[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'go32' (#rtl)

set_pm_interrupt

Set protected mode interrupt handler

Declaration

Source position: go32.pp line 122

function set_pm_interrupt(

  vector: Byte;

  const intaddr: tseginfo

):Boolean;

Description

Sets the address of the protected mode handler for an interrupt.

Parameters:

vector
number of protected mode interrupt to set.
intaddr
selector:offset address to the interrupt vector.

Return values: True if successful, False otherwise.

Remark: The address supplied must be a valid selector:offset protected mode address.

Errors

Check the int31error variable.

See also

get_pm_interrupt

  

Return protected mode interrupt handler

set_rm_interrupt

  

Set real mode interrupt handler

get_rm_interrupt

  

Get real mode interrupt vector

Example

uses
        crt,
        go32;

const
        int1c = $1c;

var
        oldint1c : tseginfo;
        newint1c : tseginfo;

        int1c_counter : Longint;

        int1c_ds : Word; external name '___v2prt0_ds_alias';

procedure int1c_handler; assembler;
asm
   cli
   pushw %ds
   pushw %ax
   movw %cs:int1c_ds, %ax
   movw %ax, %ds
   incl int1c_counter
   popw %ax
   popw %ds
   sti
   iret
end;

var i : Longint;

begin
     newint1c.offset := @int1c_handler;
     newint1c.segment := get_cs;
     get_pm_interrupt(int1c, oldint1c);
     Writeln('-- Press any key to exit --');
     set_pm_interrupt(int1c, newint1c);
     while (not keypressed) do begin
           gotoxy(1, wherey);
           write('Number of interrupts occured : ', int1c_counter);
     end;
     set_pm_interrupt(int1c, oldint1c);
end.
The latest version of this document can be found at lazarus-ccr.sourceforge.net.