Assembly language - the physical address of the segment address = x16 + offset address detection point 2.2

First, why the physical address of the segment address = x16 + offset address?

 

  PS: At first hours, I do not understand why it is stupid to N th power, we will address the physical as digital, digital computer is by a number of 0 or 1 free combination, and each one is either 0 either 1, only these two cases, it can be composed of an N-bit number N th power of 2 addresses the

  8086CPU address bus is 20 (bits) , and therefore can be 104 to 8576 (1M) a memory unit address number, and registers and data bus are 16-bit , 16-bit corresponding to 6 5536 (64K), so that waste all sorts of memory space, ah, supposed to? So smart people had a whole address adder, an address adder doing manual labor is the 16-bit segment address by 16, why did it have to be 16? I let you do things: you put the numbers 68 left one is how much you tell me 680, yes, you put up 68 zeros behind is actually multiplied by 10, I let you put the hex 38H the left one just like you still do that later make up a 0 is 380H, but it is still multiplied by 10H, and 10H correspond here 16,1 decimal digit hexadecimal corresponds to four binary, the segment address is multiplied by a decimal 16, which is equivalent to the back of a 16-bit binary number complement a 4 0, wow this is not to make up a 20, avoiding the waste of memory, multiplied by 16 to get a complete first address (start address / foundation address), the first address as a start address plus a binary 16-bit offset address, the offset address is offset 0H ~ FFFFH (since the maximum 16-bit binary number is FFFFH), so that the maximum segment size is 64K ( FFFFH), we can later access memory space on the memory requires a logical segmentation based on.

Second, the segment address is a multiple of a 16 x16

A look at the title this is not bullshit you. . . Wang Shuang until you see the teacher "assembly language" detection point 2.2, deepened the understanding of this sentence

We do a minimum number, according to the formula it is easy to think, when the maximum offset address FFFFH time address SA is certainly the smallest ah

①SAx16+FFFFH=20000H

②SAx16=20000H-FFFFH=10001H

③SA=10001H/16(10H)=1000H

This is too simple, right, take a look at Baidu right answer, the answer ye Nani is 1001H, where's the ah? Am I wrong? ? ? Forget the good times are 1000H, ah, Editor's Note?

  We note SAx16 = FFFFH = 20000H- 10001H , we look at a multiple of Title II, 10001H = 65537 is clearly not 16, ah, then we'll be replaced before use FFFF FFFF-1, FFFF-2, FFFF-3. .. until the test has been FFFF-F = 16 fold and when the correct answer FFF0H fits. However, doing so tired ah, one by one test, so fast approach is the other way round: I want to ensure that the first address is a multiple of 16, from the perspective of the hex is to ensure that the end was a 0,

Therefore 20000H -? = 0 is a number of end, with a back apparently FFF can be obtained with 0 corresponding to 0 at the end of subtraction 20000H end is a number of 0.

  Summary: Memory in some memory cells can not as a segment of the first address (segment address x16), as a multiple of some of the physical address is not 16 (10H), but the segment address can be any address because it is multiplied by 16, whether the address is how much can be , I note here that the segment address is not the address in memory, because the segment address is a 16-bit physical memory address is 20, said earlier the first address (at offset 0 at) can be seen as the middle memory the starting physical address, this does not mean that the memory unit can not be done less than the first address of the access, since the physical address of a memory cell can have a variety of compositions in accordance with the address and the segment offset address to access it.

If wrong, please correct me comment, thank you!

Guess you like

Origin www.cnblogs.com/yxddj/p/11802249.html