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,347 of 4,255   
   Joe Monk to All   
   Re: segmentation   
   23 Oct 22 02:32:52   
   
   From: joemonk64@gmail.com   
      
   > Or are you saying that it is easier for a CPU to shift 4 bits than    
   > 5 bits because 4 is a power of 2?    
   >    
   > I'm not familiar with the hardware, so maybe that is true.    
   >    
   > But I am familiar with SHL and SHR, and I know those    
   > instructions take the same amount of time to execute    
   > regardless of whether you are shifting 4 bits or 5 bits.    
   >    
   > But segment shifting may be different.    
   >    
   > So maybe you're right.    
   >    
      
   The hardware does not execute shift instructions to generate a physical memory   
   address.   
      
   A physical memory address is 20-bits wide. A segment register is 16 bits wide.   
   So there are 4 more bits in the physical memory address than in the 16 bit   
   segment register.    
      
   So, the hardware has to transfer (i.e. move) the segment register to the   
   physical memory address generator. It does a left aligned move for this. The   
   segment address is unchanged. This leaves 4 unused bits on the right of the 20   
   bit memory address. To    
   get this, the hardware then adds the 16 bit offset (right-aligned) to the   
   physical memory address generator to generate the 20-bit physical memory   
   address.   
      
   "It is useful to think of every memory location as having two kinds of   
   addressses, physical and logical. A physical address is the 20-bit value that   
   uniquely identifies each byte location in the megabyte memory space. Physical   
   addresses may range from 0H    
   to FFFFFH. All exchanges between CPU and memory components use this physical   
   address."   
      
   Joe   
      
   --- 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