Re: A86: Problem reading ports


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

Re: A86: Problem reading ports




In a message dated 1/19/00 6:52:50 PM Mountain Standard Time, 
neophile_17@hotmail.com writes:

> This is a read key loop except the loop is broken as if exit was pressed 
>  when it wasn't.  I think this is because the mask is          %10111111 
and 
>  bit six is already missing but I don't know how to fix it if it is.
>  
>   ld a,$BF
>   out (1),a
>   bit 5,a
>   jr z,Second
>   bit 6,a
>   jp z,Exit   ;heres where it breaks
>  
>  Any help would be appreciated. Thanx.
>                                          ~neophile_17

Someone probably answered this (too many of those off-topic posts...), but 
you need to do a < in a,(1)> to get what keys are currently down for the 
particular key group you want.  Also, might wanna put a few < nop>s between 
the 'out' and the 'in', as that's what the TI-OS does:

 ld a,$BF
 out (1),a
 nop
 nop
 nop
 nop
 in a,(1)
 bit 5,a
 jr z,Second
 bit 6,a
 jp z,Exit

JayEll