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,906 of 4,255   
   wolfgang kern to Robert Pengelly   
   Re: COM1 interrupt for 16-bit OS   
   12 Nov 23 16:18:40   
   
   From: nowhere@never.at   
      
   On 12/11/2023 15:34, Robert Pengelly wrote:   
   ...   
   >>>> the mouse sends a sequence of bytes where every byte causes in IRQ.   
   >>>> so you first need to fill a buffer with the gotten bytes before you can   
   >>>> calculate/scale/interpret the values. mouse IRQs can easy come out of   
   >>>> sync, so checking always for the first byte mark is a good idea.   
   >>> Oh I thought you had to get them all at the same time when the interrupt   
   was fired. As for filling the buffer how would I tell the interrupts apart? I   
   can test for 0x40 and 0x01 (which I'm already doing) I'm just a little   
   confused how I would know    
   whether it's the 1st, 2nd and 3rd bytes.   
   >> there is a mark for the first byte (reread the RBIL I posted)   
   >> I use one variable for count down (easier than count up) and use this   
   >> with BX as an index into my buffer.   
   >> and when the buffer is filled I adjust all my mouse-variables which I   
   >> later use on my mSec timer-base schedule to update cursor and act on   
   >> buttons.   
      
   > Yeah, there's bit 6 for the initial bit, I weren't sure if there's anything   
   identifying the others.  So basically have two variables one being a counter   
   and just write to the buffer until I get three (or if it's counting down then   
   it would be until I    
   hit zero)?   
      
   yes.   
      
   As for:   
   >> I use one variable for count down (easier than count up) and use this   
   >> with BX as an index into my buffer.   
      
   > How do you use it for the buffer if your counting down?  If you were   
   counting up you could shl by 8 and add that to the buffer offset.   
      
   no shift required here at all:   
      
   push ...ds,ax,bx,cx,dx   
   ... ds become ptr to my data   
   IN   AL,port   
   TEST AL,0x40   
   jz skip_init   
      xor bx,bx   
      MOV CX,3       ;(or eight in my case)   
      MOV [count],cl   
      MOV [index].bx   
   skip_init:   
      MOV BX,[index]   
      MOV [BX+buffer],AL   
      INC word[index]     ;or: INC BX |MOV [index],BX   
      DEC byte[count]   
   pop ... dx,cx,bx   
      MOV AL,0x20   
      out 0xA0,AL   
   jnz done_it   
   got_all:   
      ;store/modify, update only variables, actions are done in idle queue.   
   done_it:   
      pop ax   
      pop ds   
      iret   
   __   
   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