MicroProcessor Exp1
MicroProcessor Exp1
Theory:
Architecture of 8086
The 8086 microprocessor, developed by Intel in 1978, is a 16-bit processor that uses a segmented
memory model and follows the CISC (Complex Instruction Set Computer) architecture. It has a
16-bit data bus, which allows it to transfer 16 bits of data at a time, and a 20-bit address bus,
enabling it to access up to 1 MB of memory. The architecture of the 8086 can be divided into two
main units:
The BIU is responsible for interfacing with memory and I/O devices. It includes the following
components:
● General Purpose Registers: AX, BX, CX, DX (each divided into AH/AL, BH/BL,
CH/CL, and DH/DL for byte-level access).
● Index Registers: SI (Source Index) and DI (Destination Index).
● Pointer Registers: BP (Base Pointer) and SP (Stack Pointer).
● Flag Register: Contains flags that indicate the state of the processor (e.g., Zero Flag,
Carry Flag).
● Arithmetic Logic Unit (ALU): Performs arithmetic and logical operations.
MICROPROCESSOR LAB CLASS: SE CMPN C
NAME: JIBIN SAJU JOSEPH ROLL NO: 07
The programmer's model provides an abstraction of the 8086 architecture that focuses on
registers and flags. These are the main components:
Registers:
2. ADD (Addition):
Adds the source operand to the destination operand and stores the result in the destination.
3. SUB (Subtraction):
Subtracts the source operand from the destination operand and stores the result in the destination.
4. MUL (Multiplication):
5. DIV (Division):
DEBUG is a DOS utility for examining and manipulating memory, I/O ports, and registers.
Some common DEBUG commands are:
1. ? (Help):
○ Displays a list of available commands and their usage.
○ Example: ? displays a brief description of commands.
2. R (Registers):
○ Displays or modifies the processor’s registers.
○ Example:
■ R shows the current values of all registers.
■ R AX allows modifying the value of the AX register.
3. A (Assemble):
○ Converts assembly language instructions into machine code and stores them in
memory.
○ Example:
■ A 0100 starts assembling instructions at memory location 0100H.
4. T (Trace):
○ Executes one instruction at a time, showing the updated register and memory
states.
○ Example: T executes the next instruction and updates the display.
These commands are powerful tools for learning low-level programming and debugging
assembly code on the 8086.
MICROPROCESSOR LAB CLASS: SE CMPN C
NAME: JIBIN SAJU JOSEPH ROLL NO: 07
● Setting Up The Debug:
● Current Details
MICROPROCESSOR LAB CLASS: SE CMPN C
NAME: JIBIN SAJU JOSEPH ROLL NO: 07
Conclusion
● From this experiment, we gain a deep understanding of the internal working of the 8086
microprocessor and its debugging process. The experiment involves utilizing the DOS
DEBUG utility to interact with the 8086 architecture, enabling users to analyze and
manipulate memory, registers, and instructions in real time. This process reinforces the
fundamental concepts of assembly programming and the execution flow within the
microprocessor.
● The debugging process in 8086 is conducted through a series of steps:
1. Launching the DEBUG utility in the DOS environment.
2. Using commands like R to view and modify registers, A to write assembly
instructions, and T to trace the execution of these instructions.
3. Observing how changes in the registers and memory locations reflect the
microprocessor's operation, thereby providing insights into the behavior of
various instructions.
● The advantages of using DEBUG are numerous:
○ Educational Value: DEBUG serves as an excellent tool for learning assembly
language programming and understanding the inner workings of the 8086
microprocessor. By manually entering instructions and observing their effects,
students and programmers gain valuable hands-on experience.
○ Error Identification: The step-by-step execution of instructions allows for
precise identification and correction of errors in code.
○ Memory and Register Manipulation: Users can directly manipulate memory
and register values, which is invaluable for testing and debugging low-level
programs.
○ Interactive Learning: The interactive nature of DEBUG encourages
experimentation, which helps in mastering complex concepts like segmentation,
addressing modes, and instruction execution.
● In conclusion, the 8086 DEBUG experiment provides a practical and interactive approach
to learning microprocessor architecture and assembly language programming. By
mastering this tool, one develops a strong foundation in low-level programming, which is
essential for understanding modern computing systems.