[A83] Re: Checking how long a key is pressed


[Prev][Next][Index][Thread]

[A83] Re: Checking how long a key is pressed




> From: <Darkfire139@aol.com>
>
> Alright, I am writing a program that increases a number, based on how long
a
> key is pressed.  I have a loop that starts with increasing the number,(as
> long as its below a certain value) then checking if the key is pressed. If
> the key is pressed, then it jumps back to the loop, if it is not pressed,
> (using nz) then it jumps to the label that analyzes the increased number.
> This is not working for me! How do I check how long a key is pressed, or
if
> it is not pressed at all?

    ld    hl,0
loop:
    inc   hl
    ld    a,$FF
    out   (1),a
    ld    a,[group]
    out   (1),a
    in    a,(1)
    cp    [keyvalue]
    jr    z,loop
  [..analyze HL here..]






References: