Why data exist in multiple locations in 8086 in the same physical memory? -
in 8086 more 1 logical addresses (segment:offset) can have same physical address (001f:000f , 000f:010f same address ,like 001f:000f = 01f0+000f = 01ff in same way 000f:010f = 01ff).in physical memory ,any program sees logical memory address.so more 1 program can have data (byte) same physical address (though logical addresses different) position.why don't collide each other ? why don't lose data ???
the 8086 can address 1mb of memory, requiring 20 bits specify address of particular byte. since 8086's registers hold 16 bits, segment model developed gives each of 1m addresses many different names. number 4
can named 0+4
, 1+3
, 2+2
, etc., address 12345
can expressed 1234:0005
, 1233:0015
, 1230:0045
, , on.
in other words, each physical address has 64k different logical addresses. means if 1 program accessing 1234:0005
, program accessing 1233:0015
, 2 programs accessing exact same memory address.
so how prevent different programs "colliding" each other? first of all, recognize modern computers not use 8086es anymore. if have multiple programs running on actual 8086, cooperating each other, sharing address space knowingly.
modern cpus not run in 1mb segmented mode (called "real mode") anymore. if run os windows or linux, cpu uses called virtual memory, each program has own mapping of logical addresses physical addresses. in mode, programs typically use logical addresses 32 or 64 bits, , programs have no knowledge of how given logical address maps physical address. number of programs can use same set of logical addresses , there no overlap of physical addresses unless programs arrange so.
Comments
Post a Comment