1
\$\begingroup\$

When each address in memory(RAM) stores 8bits of data. 8086 have access to 2^20 address locations making it as (2^20)*8 = 1MB. When it has 16bit data bus and accessing only 8bit data then what is the use of 16bit data bus.

Q1) Does it access two address locations and increment IP(instruction pointer) by two.

Q2) Can it use two banks of memory simultaneously and increment IP by one as shown in below image.

enter image description here Is it true if not why

\$\endgroup\$
4
\$\begingroup\$

The memory is byte addressable, and the 16-bit bus transfers two bytes at a time.

But the total capacity is still just 1 MB.

The diagram is a bit misleading in this regard — it should show only A19-A1 going to both banks. A "bank" refers to 8-bit wide memory, and one or both banks are accessed as described in the table. They're trying to show that the left bank (D15-D8) is enabled only when BHE- is low, and the right bank (D7-D0) is enabled only when A0 is low.

So yes, when stepping through memory (such as when prefetching instructions), the bus address increments by two.

However, note that 8086 instructions are anywhere from 1 to 6 bytes long, and that's what determines the actual IP increment. The 8086 reads instructions from a 6-byte prefetch buffer (4 bytes on the 8088), and the logic that fills that buffer uses its own address register that is distinct from the IP.

\$\endgroup\$
  • 1
    \$\begingroup\$ Including prefixes, 8086 instructions are unlimited in length. (But prefixes are only decoded one at a time, in a different cycle from opcode + modrm + disp16 + imm16 or whatever: 8086 instructions can be 6 bytes long with no prefixes, e.g. mov word [si + 1234], 1234). Later CPUs impose a 15 byte limit, otherwise taking a #UD undefined instruction exception. \$\endgroup\$ – Peter Cordes Nov 10 '19 at 15:14
  • 1
    \$\begingroup\$ Fun fact: if you fill a whole 64k cs: segment with prefixes, 8086 will wrap around IP and keep trying to decode forever, never reaching the end of this "infinite" instruction. \$\endgroup\$ – Peter Cordes Nov 10 '19 at 15:22
  • \$\begingroup\$ @PeterCordes: Interesting, but completely irrelevant to the question. \$\endgroup\$ – Dave Tweed Nov 10 '19 at 15:44
  • \$\begingroup\$ True, my edit got a bit carried away. \$\endgroup\$ – Peter Cordes Nov 10 '19 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.