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,915 of 4,255   
   Robert Pengelly to wolfgang kern   
   Re: COM1 interrupt for 16-bit OS   
   12 Nov 23 16:01:16   
   
   From: robertapengelly@gmail.com   
      
   On Sunday, 12 November 2023 at 23:55:27 UTC, wolfgang kern wrote:   
   > On 12/11/2023 23:14, Robert Pengelly wrote:   
   > ...   
   > > Also, how do I scale down a number in assembly?   
   > SHR 3 ;aka divide by 8   
   > SHR 4 ;aka divide by 16   
   > both rounds down, but who cares?   
   >   
   > odd divide values can perform with a combination of SHR and MUL or even   
   > with the famous awful slow DIV instruction.   
   >   
   > __   
   > wolfgang   
   So I was doing it right.  I have:   
      
   xor     ax,     ax   
       xor     dx,     dx   
       xor     cx,     cx   
      
       mov     al,     [buffer]   
       and     al,     HEX (0C)   
      
       mov     dl,     [buffer]   
       and     dl,     HEX (03)   
      
       mov     cl,     4   
       shl     ax,     cl   
      
       mov     cl,     6   
       shl     dx,     cl   
      
       mov     cl,     [bx + 2]   
       or      ax,     cx   
       add     ax,     [mouse_y]   
      
       mov     cl,     4   
       shr     ax,     cl   
      
       mov     cl,     [bx + 1]   
       or      dx,     cx   
       add     dx,     [mouse_x]   
      
       mov     cl,     3   
       shr     dx,     cl   
      
       mov     [mouse_x],      dx   
       mov     [mouse_y],      ax   
      
   but I'm getting weird results, am I shifting in the right place?   
      
   --- 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