testh 发表于 2012-06-09 08:57

实模式下8086的寻址

本帖最后由 testh 于 2012-06-09 08:59 编辑

8086是20位地址线,物理内存的寻址能力是1MB,现有一个疑问,按照段基地址左移4位+偏移地址的方法,且限制每个段最大64KB,这样计算,1MB的内存总共才只能有16个段?

folklore 发表于 2012-06-09 09:48

no............

testh 发表于 2012-06-09 09:49

folklore 发表于 2012-06-09 09:48 static/image/common/back.gif
no............
我觉得也是no,但是可否指出这样想错在哪里了

folklore 发表于 2012-06-09 09:50

folklore 发表于 2012-06-09 09:48 static/image/common/back.gif
no............

seg0
end seg0
seg1
end seg1

...

seg1000
end seg1000

start:
move ax,seg0
move ds,ax
...
;access seq0
......

move ax,seg1
move ds,ax
...
;access seq1
......
......
......

move ax,seg1000
move ds,ax
...
;access seq1000
......

end start

testh 发表于 2012-06-09 09:51

或者是划分64K个段,每个段16字节?

folklore 发表于 2012-06-09 09:56

回复 5# testh


    no.......

you can do that:

{0}||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||{1M}
+------Seg 0-----------+
                         +---------Seg 1-------------+
+--------------------------------------Seg 2------------------------------------+

testh 发表于 2012-06-09 09:56

本帖最后由 testh 于 2012-06-09 09:58 编辑

folklore 发表于 2012-06-09 09:50 static/image/common/back.gif
seg0
end seg0
seg1

求中文解释 or english is good

sanbiangongzi 发表于 2012-06-09 10:00

REALMODE下使用SEG:OFFSET访问地址A, 只要 (SEG<<4 + OFFSET) == A 就行, 你说对一个地址有多少种SEG OFFSET的组合?

研究多少个段没有意思, 怎样组织代码和数据, 少用几个段保持编程时头脑清晰才是硬道理

folklore 发表于 2012-06-09 10:23

回复 7# testh

declare a series of segments in psudo code
   seg0   ; segment 0 start
   end seg0 : segment 0 end
... etc
like this in asm
   segment seg0   ; segment 0 start
         STR DS "ABC"
         NDW 3
   end segnebt : segment 0 end
... etc

testh 发表于 2012-06-09 10:45

folklore 发表于 2012-06-09 09:56 static/image/common/back.gif
回复 5# testh



就是说各个段之间可以互相覆盖,不必彼此的地址独立?
页: [1] 2
查看完整版本: 实模式下8086的寻址