home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,899 of 4,255   
   wolfgang kern to Robert Pengelly   
   Re: Does a PS/2 mouse get detected if pl   
   12 Nov 23 15:07:02   
   
   From: nowhere@never.at   
      
   On 12/11/2023 14:08, Robert Pengelly wrote:   
   ...   
   > ps2_wait_input:   
   >   
   >      push    ax   
   >      mov     cx,     HEX (FFFF)   
   >   
   > ps2_wait_input.loop:   
      
      
      
   >      xor     ax,     ax   
   this isn't needed at all   
      
      
   >      in      al,     HEX (64)   
   >   
   >      and     al,     0b00000010   
   >      jz      ps2_wait_input.done   
   >   
   >      loop    ps2_wait_input.loop   
   >   
   > ps2_wait_input.done:   
   >   
   >      pop     ax   
   >      ret   
      
   it may return too early if your PC is faster than 12MHZ :)   
   I'd use the DOS timer variable (can't remember it's at 40:xxxx ?)   
      
   push ax   
   push cx   
   push es   
   push 0x40      ;or use the longer MOV AX,0x0040 |MOV ES,AX   
   pop es   
   mov cx,[es:dostick]   
   add cx,2   
   L1:   
   IN   AL,0x64   
   TEST AL,2   
   jz DONE   
   cmp cx,[es:dostick]   
   jb L1   
   done:   
   pop,,,, ret   
   __   
   wolfgang   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca