www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/04/17:38:19

From: nikki AT gameboutique DOT co (nikki)
Newsgroups: comp.os.msdos.djgpp
Subject: interrupts and unknown opcodes
Date: 4 Feb 1997 20:30:50 GMT
Organization: GameBoutique Ltd.
Lines: 47
Message-ID: <5d869q$3br@flex.uunet.pipex.com>
NNTP-Posting-Host: www.gameboutique.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

i'm trying to convert a keyboard handler (which someone gave to me in pascal)
to be used with djgpp. would i be better hooking the realmode interrupt to do
this or the protected mode one? any suggestions from the field here :)
also, the code is pretty badly written, in one place he missed the opcodes out
and i'm trying to figure out what they are. the code is below.
it doesn't strike me as particularly efficient and i have no idea what the
$d6 opcode is. the first 3 would appear to be bt di,bx at a guess.
can anyone improve on this and/or suggest a reasonable implementation under
djgpp? 

regards,
nik

procedure KeybHandler; interrupt;
begin
  asm
    xor ax, ax
    in al, 60h
    mov di, ax
    and di, 0FF7Fh
    mov bx, 7
  end;

  inline(
    $0F/$A3/$D8/                 (* cf=bit 7 *)
    $D6                          (* if cf=0, al=0. if cf=1, al=0FFh *)
  );

  asm
    not al
    lea bx, Pressed
    mov [bx+di], al
    mov al, 020h
    out 020h, al
  end;
end;

procedure InstallKeybHandler;
begin
  GetIntVec($9,SaveInt09);
  SetIntVec($9,@KeybHandler);
end;


-- 
Graham Tootell           
nikki AT gameboutique DOT com  

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019