问题
I am unable to understand the different starting addresses of Physical Address generated by CS:IP
in 8085-86. Is this because of Stack? I think the concept of Stack was present before 8085. Please help out. Thanks.
回答1:
There are 3 reasons I can think of that a particular value could be used for the powerup IP:
- convention - other processors in the same family/brand use the same location, and they want to give their customers a sense of familiarity
- compatibility
- certain areas are restricted or enhanced for certain purposes. The 6502 for example has special faster instructions for accessing the first 256 bytes of memory from 0x00 to 0xff. On that CPU it makes sense to have the CPU start somewhere else. (I don't think the 8086 treats any area of memory specially however.)
compatibility and convention issues aside, the value that the instruction pointer gets when the processor powers up is largely arbitrary. For most models, the IP is intially either very close to the top of its address space (with enough room for a far JMP call to get it to where the real init code is) or at the very bottom (ie 0).
The wikipedia articles state that the 8086 was designed so that assembly source code from previous processors was easily converted to work with the 8086, but that's all. Apart from that there was no attempt to make it compatible with previous models.
回答2:
I think the answer lies in the Interrupt Vector Table (IVT). The IVT was introduced in the 8086 processor. The 8085 (which's design is based on the 8080 processor) uses a different method for handling interrupts. On the 8086/8088 the IVT takes up the first 1024 bytes of memory (256 interrupt vectors consisting of 4 bytes each). For this reason there cannot be any executable code in that region. Starting with the 80286, x86/x64 processors have an Interrupt Descriptor Table register (IDTR) which can be changed so that software can relocate the interrupt vector table anywhere in the processor's address space where it's convenient.
So technically: - The 8085 does not have a CS register and its address space is limited to 64KiB - Execution on the 8085 starts at address 0x0000 after power-on - Execution on the x86 and x64 family of processors starts at the last 16 bytes of addressable memory. So on 16-bit processors with 20 address lines this would be linear address 0xFFFF0. On 32-bit processors it's address 0xFFFFFFF0, and on 64-bit processors it's 0xFFFFFFFFFFFFFFF0. The system ROM must be wired to the memory bus in such a way that it will respond to these addresses.
Check out the Intel processor manuals for the official explanation.
回答3:
1)In 8085 , upon reset the value of pc is 0000h. Therefore the wake up program should be written at 0000h location and can't be kept empty.
2) In 8086, reset values of CS & lP are FFFFH & 0000h resp. So 20 bit physical address will be FFFF0+0000=FFFF0H. It shouldn't be kept empty. Wake up program(code) is always in ROM and there for the ROM should be interfaced at last to cover FFFF0H.
来源:https://stackoverflow.com/questions/10380388/why-does-8085-start-from-00000-while-8086-from-ffff0