[comp.lang.pascal] help me or i'll kill you

kai@kaiki.toppoint.de (Kai Voelcker) (05/17/91)

tpehrson@javelin.sim.es.com (Tim Clinkenpeel) writes:

> sorry about the grouchy title; however, i'm getting frustrated.  i've been
> trying to solve this dilema for several weeks now.  please help me if you
> have the knowledge (it's as easy as pressing "f")
> 
> here's the scenario:
> 
> function keypressed:boolean;
>  var regs:registers;
>   begin
>   with regs do begin ah:=$01; intr($16,regs); keypressed:=(fzero and flags)=$
>   end; end;

set keypressed:=not fzero
> 
>  1. importantstuffineedtodowhenakeyisnotpressed is never happening
>  2. i have to press a key twice for it to be read by the (readkey).  i was to
>     readkey would just pull the last key out of the buffer (if there is one).

examine the output of int 16h and use it as You would do in assembler.
 ________________________________________________________________________
 | Kai Voelcker, Kappelner Str 18, D-2300 Kiel 1, voice: +49 431 335605 |
 | kai@kaiki.toppoint.de    interests: 386asm, c, pascal; OR algorithms |
 |   >>>  polite notice: I have to pay for incoming mail. Thanks  <<<   |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~