SoylentNews
SoylentNews is people
https://soylentnews.org/

Title    How the 8086 Processor Determines the Length of an Instruction
Date    Saturday March 11, @12:18PM
Author    janrinok
Topic   
from the dept.
https://soylentnews.org/article.pl?sid=23/03/09/1532251

owl writes:

https://www.righto.com/2023/02/how-8086-processor-determines-length-of.html

The Intel 8086 processor (1978) has a complicated instruction set with instructions ranging from one to six bytes long. This raises the question of how the processor knows the length of an instruction.1 The answer is that the 8086 uses an interesting combination of lookup ROMs and microcode to determine how many bytes to use for an instruction. In brief, the ROMs perform enough decoding to figure out if it needs one byte or two. After that, the microcode simply consumes instruction bytes as it needs them. Thus, nothing in the chip explicitly "knows" the length of an instruction. This blog post describes this process in more detail.

[...] The 8086 uses a 6-byte instruction prefetch queue to hold instructions, and this queue will play an important role in this discussion.3 Earlier microprocessors read instructions from memory as they were needed, which could cause the CPU to wait on memory. The 8086, instead, read instructions from memory before they were needed, storing them in the instruction prefetch queue. (You can think of this as a primitive instruction cache.) To execute an instruction, the 8086 took bytes out of the queue one at a time. If the queue ran empty, the processor waited until more instruction bytes were fetched from memory into the queue.


Original Submission

Links

  1. "owl" - https://soylentnews.org/~owl/
  2. "Original Submission" - https://soylentnews.org/submit.pl?op=viewsub&subid=58867

© Copyright 2023 - SoylentNews, All Rights Reserved

printed from SoylentNews, How the 8086 Processor Determines the Length of an Instruction on 2023-05-26 13:18:31