Email or username:

Password:

Forgot your password?
Top-level
Ken Shirriff

Some hardware helps the microcode. Latches remember the "repeat" prefix. Hardware lets the microcode test conditions, e.g. is CX zero, is there a repeat prefix, is the loop exit condition satisfied, is there an interrupt. Photo shows the chip circuitry for 16 conditions.

5 comments
Ken Shirriff

Arithmetic and logic instructions use the ALU (Arithmetic/Logic Unit). But incrementing/decrementing the memory pointers doesn't use the ALU. Instead, it uses a special adder that calculates memory addresses. A "Constant ROM" holds the values (-6 to +2) that need to be added.

Ken Shirriff

For more about the implementation of the 8086's string instructions, including a detailed walkthrough of the microcode, see my blog post:
righto.com/2023/04/8086-microc

Greg Kemp

@kenshirriff Fun with MOVS: x86 supports self-modifying code, but what about self-modifying _instructions_? Turns out with MOVS you could do self-modifying instructions.

Amand Tihon

@kenshirriff Thank you! I love your articles on the 8086! Just one remark: the 20 bit address bus gives access to 1 megabyte, not 4.

Go Up