0% found this document useful (0 votes)
5 views

MicroProcessor Exp1

The document outlines an experiment focused on basic arithmetic operations using the 8086 microprocessor and the DOS DEBUG utility. It explains the architecture of the 8086, including its Bus Interface Unit and Execution Unit, and details the programmer's model with various registers and instructions. The conclusion emphasizes the educational value of using DEBUG for learning assembly programming and understanding microprocessor operations.

Uploaded by

Aniket Ugale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

MicroProcessor Exp1

The document outlines an experiment focused on basic arithmetic operations using the 8086 microprocessor and the DOS DEBUG utility. It explains the architecture of the 8086, including its Bus Interface Unit and Execution Unit, and details the programmer's model with various registers and instructions. The conclusion emphasizes the educational value of using DEBUG for learning assembly programming and understanding microprocessor operations.

Uploaded by

Aniket Ugale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

MICROPROCESSOR LAB​ ​ ​ ​ ​ CLASS: SE CMPN C

NAME: JIBIN SAJU JOSEPH​ ​ ​ ​ ​ ​ ROLL NO: 07


EXPERIMENT NO 1
Aim: To perform basic arithmetic operations (8-bit and 16-bit) using debug.

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:

1. Bus Interface Unit (BIU):

The BIU is responsible for interfacing with memory and I/O devices. It includes the following
components:

●​ Segment Registers: CS (Code Segment), DS (Data Segment), SS (Stack Segment), and


ES (Extra Segment). These registers divide the memory into segments of up to 64 KB
each.
●​ Instruction Pointer (IP): Holds the offset address of the next instruction to be executed
within the current code segment.
●​ Queue: A 6-byte instruction queue is used for prefetching instructions to speed up
execution.
●​ Address Generation: Combines the segment and offset addresses to form the 20-bit
physical address.

2. Execution Unit (EU):

The EU is responsible for executing instructions. It includes:

●​ 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

Programmer's Model of 8086

The programmer's model provides an abstraction of the 8086 architecture that focuses on
registers and flags. These are the main components:

Registers:

1.​ General Purpose Registers:


○​ AX (Accumulator): Used for arithmetic, logical, and data transfer operations.
○​ BX (Base): Often used as a base register in addressing modes.
○​ CX (Count): Used in loop and string operations.
○​ DX (Data): Used in multiplication, division, and I/O operations.
2.​ Segment Registers:
○​ CS: Points to the code segment.
○​ DS: Points to the data segment.
○​ SS: Points to the stack segment.
○​ ES: Points to the extra segment, often used in string operations.
3.​ Index and Pointer Registers:
○​ SI and DI: Used for indexed addressing and string operations.
○​ BP and SP: BP is used to access data on the stack, and SP points to the top of the
stack.
4.​ Instruction Pointer (IP):
○​ Holds the address of the next instruction within the code segment.
5.​ Flag Register:
○​ Contains status flags (e.g., Zero Flag, Sign Flag, Carry Flag, Overflow Flag) and
control flags (e.g., Direction Flag, Interrupt Flag).

Instructions: MOV, ADD, SUB, MUL, DIV

8086 instructions have a specific format:

Opcode op1, op2

●​ Opcode: Specifies the operation to be performed.


●​ op1: The destination operand (register or memory).
●​ op2: The source operand (register, memory, or immediate value).
MICROPROCESSOR LAB​ ​ ​ ​ ​ CLASS: SE CMPN C
NAME: JIBIN SAJU JOSEPH​ ​ ​ ​ ​ ​ ROLL NO: 07
1. MOV (Move Data):

Transfers data from the source to the destination.

●​ Syntax: MOV destination, source


●​ Example:
○​ MOV AX, BX (Copies the contents of BX into AX).
○​ MOV [5000H], AX (Moves the contents of AX to memory location 5000H).

2. ADD (Addition):

Adds the source operand to the destination operand and stores the result in the destination.

●​ Syntax: ADD destination, source


●​ Example:
○​ ADD AX, BX (Adds BX to AX).
○​ ADD AL, 05H (Adds 5 to AL).

3. SUB (Subtraction):

Subtracts the source operand from the destination operand and stores the result in the destination.

●​ Syntax: SUB destination, source


●​ Example:
○​ SUB AX, BX (Subtracts BX from AX).
○​ SUB AL, 03H (Subtracts 3 from AL).

4. MUL (Multiplication):

Performs unsigned multiplication.

●​ Syntax: MUL operand


●​ Example:
○​ MUL BX (Multiplies the contents of AX by BX, result stored in DX:AX).

5. DIV (Division):

Performs unsigned division.

●​ Syntax: DIV operand


●​ Example:
○​ DIV BX (Divides the contents of DX:AX by BX; quotient in AX, remainder in
DX).
MICROPROCESSOR LAB​ ​ ​ ​ ​ CLASS: SE CMPN C
NAME: JIBIN SAJU JOSEPH​ ​ ​ ​ ​ ​ ROLL NO: 07

DOS Debug Commands

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:​

●​ Instruction Set (Set of Commands)

●​ Current Details​
MICROPROCESSOR LAB​ ​ ​ ​ ​ CLASS: SE CMPN C
NAME: JIBIN SAJU JOSEPH​ ​ ​ ​ ​ ​ ROLL NO: 07

●​ Addition of 2 Numbers (8 Bit)

●​ Addition of 2 Numbers (16 Bit)


MICROPROCESSOR LAB​ ​ ​ ​ ​ CLASS: SE CMPN C
NAME: JIBIN SAJU JOSEPH​ ​ ​ ​ ​ ​ ROLL NO: 07

●​ Subtraction of 2 Numbers (8 Bit)

●​ Subtraction of 2 Numbers (16 Bit)


MICROPROCESSOR LAB​ ​ ​ ​ ​ CLASS: SE CMPN C
NAME: JIBIN SAJU JOSEPH​ ​ ​ ​ ​ ​ ROLL NO: 07

●​ Multiplication Of 2 Numbers (8 Bit)

●​ Multiplication Of 2 Numbers (16 Bit)


MICROPROCESSOR LAB​ ​ ​ ​ ​ CLASS: SE CMPN C
NAME: JIBIN SAJU JOSEPH​ ​ ​ ​ ​ ​ ROLL NO: 07

●​ Division Of 2 Numbers (8 Bit)

●​ Division Of 2 Numbers (16 Bit)


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.

You might also like