Microprocessor Lab Experiment Complexity
Microprocessor Lab Experiment Complexity
these are the experiments of MICROPROCESSORS AND APPLICATION LAB so analyse these
experiments and list these in order from easiest to hardest
1. To write an assembly language program to perform the addition of two 8-bit numbers using
8086.
2. To Perform Subtraction Operation On 8-Bit Data
3. To perform an assembly language on16-Bit number for Multiplication.
4. To Perform division operation on 8-Bit data
5. To Perform an Assembly Language On 16-Bitnumber Addition of Two Numbers.
6. To Perform an assembly Language On 16-Bit Number (B)Subtraction Of Two Numbers
7. Write A program To Arrange Given Numbers In Ascending Order.
8. Write A program To Arrange Given Numbers In Descending Order.
9. Write An Assembly Language Program To Find the Largest Number From Series Of Number.
10. To interface Programmable Interval timer to 8086 and verify the operation of 8253 in six
different modes
11. Write a program to interface programmable peripheral interface (8255) with 8086 to interface
Eight Light emitting diode.
Here’s an analysis and categorization of the experiments based on their complexity, from easiest to
hardest:
Easiest to Hardest:
1. To write an assembly language program to perform the addition of two 8-bit numbers using
8086.
This involves basic arithmetic and is typically the starting point for learning assembly
language programming.
2. To perform subtraction operation on 8-bit data.
Similar to addition, subtraction is straightforward and involves basic use of arithmetic
instructions.
3. To perform an assembly language on 16-bit number addition of two numbers.
Extends the 8-bit addition to 16-bit data, requiring minimal additional understanding of
register pairs.
4. To perform an assembly language on 16-bit number subtraction of two numbers.
Similar to 16-bit addition, but involves subtraction instructions and handling of borrow.
5. To perform division operation on 8-bit data.
Slightly more complex than addition and subtraction, as division may involve remainder
handling.
6. To perform an assembly language on a 16-bit number for multiplication.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 1/15
Multiplication of 16-bit numbers involves slightly more complexity due to the handling of
larger results (32-bit).
7. Write a program to arrange given numbers in ascending order.
Requires looping, comparisons, and swapping logic, making it more complex than basic
arithmetic operations.
8. Write a program to arrange given numbers in descending order.
Similar to ascending order, but involves reversing the comparison logic.
9. Write an assembly language program to find the largest number from a series of numbers.
Involves looping and comparisons, but simpler than sorting as it doesn’t require reordering
the series.
10. Write a program to interface programmable peripheral interface (8255) with 8086 to
interface eight light-emitting diodes.
Requires understanding of hardware interfacing and control logic using the 8255 PPI.
11. To interface a programmable interval timer to 8086 and verify the operation of 8253 in six
different modes.
The most challenging, as it involves understanding the 8253 timer, multiple modes of
operation, and hardware interfacing.
Basic arithmetic (addition, subtraction) is easier than bit manipulation (multiplication, division).
Programs involving control flow (loops, conditions) are moderately difficult.
Hardware interfacing tasks are the hardest due to the need for understanding external devices
and communication protocols.
Let’s break down and understand your assembly language program for subtraction operation on 8-bit
data:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 2/15
Program Structure and Explanation:
AIM:
To subtract two 8-bit numbers stored in memory and perform the operation using the 8086 processor.
Code Analysis
This directive tells the assembler to associate the Code Segment (CS) with the label `CODE` and
the Data Segment (DS) with the label `DATA`.
These segments are used to hold program instructions and data.
2. DATASEGMENT
assembly
DATASEGMENT
NO1 DB 08H
NO2 DB 06H
DATA ENDS
`DATASEGMENT` declares a data segment, where the variables `NO1` and `NO2` are defined.
`NO1 DB 08H` means the first number (`NO1`) is 8H (Hexadecimal 8, equivalent to decimal 8).
`NO2 DB 06H` means the second number (`NO2`) is 6H (Hexadecimal 6, equivalent to decimal
6).
`DATA ENDS` ends the data segment.
3. CODESEGMENT
assembly
CODESEGMENT
START:
ORG 500H
`CODESEGMENT` declares the code segment, where the instructions are stored.
`START:` is the label where execution begins.
`ORG 500H` sets the starting address for the program to 500H (hexadecimal).
assembly
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 3/15
MOV DS, AX
assembly
`MOV AL, NO1`: Loads the first number (`NO1`) into the `AL` register.
`MOV BL, NO2`: Loads the second number (`NO2`) into the `BL` register.
6. SUB AL, BL
assembly
SUB AL, BL
7. INT 21H
assembly
INT 21H
This is a software interrupt used for terminating the program in some assembler environments.
Here, it simply signals the end of the program.
assembly
CODE ENDS
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 4/15
END START
RESULT:
there will be a viva that day so i was thinking if you can give me viva questions and answer
according to this experiment
Here is a list of potential viva questions and their answers based on your experiment "Subtraction
Operation on 8-bit Data":
Answer:
The purpose of this experiment is to perform the subtraction of two 8-bit numbers using assembly
language programming for the 8086 microprocessor and observe the result.
`MOV AX, DATA` loads the starting address of the data segment into the `AX` register.
`MOV DS, AX` initializes the data segment register (`DS`).
`MOV AL, NO1` and `MOV BL, NO2` load the operands into the `AL` and `BL` registers, respectively.
Answer:
The `SUB` instruction is used to perform subtraction. In this program, it subtracts the content of the `BL`
register (second number) from the `AL` register (first number) and stores the result in `AL`.
Answer:
The `INT 21H` instruction is a software interrupt that provides various DOS services. In this program, it is
used to terminate the execution of the program.
Answer:
The `ORG` directive (Origin) specifies the starting address of the code in memory. In this program, `ORG
500H` sets the starting address for the program to 500H.
Answer:
The `DS` register holds the base address of the data segment, which is where the program's variables
(`NO1` and `NO2`) are stored. This allows the microprocessor to access the data during execution.
Answer:
`DB` (Define Byte) reserves 1 byte of memory for storing an 8-bit value.
`DW` (Define Word) reserves 2 bytes of memory for storing a 16-bit value.
8. Why do we use registers like `AL` and `BL` for this program?
Answer:
Registers like `AL` and `BL` are used because they are part of the 8086 microprocessor's general-
purpose registers. They allow faster operations compared to working directly with memory.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 6/15
Answer:
If the result of the subtraction is negative, the Carry Flag (CF) will be set to 1, and the result will be
stored in two's complement form in the `AL` register.
10. How can we modify this program to store the result in memory?
Answer:
To store the result in memory, we can use the `MOV` instruction to transfer the value from the `AL`
register to a memory location, such as:
assembly
MOV RESULT, AL
Answer:
The 8086 processor requires the `DS` register to point to the base address of the data segment so it can
access variables stored in memory. Without initializing `DS`, the program might access incorrect
memory locations.
Answer:
8085: 8-bit microprocessor, single accumulator, simpler architecture, operates on 8-bit data.
8086: 16-bit microprocessor, supports segmented memory, has multiple general-purpose registers,
and operates on both 8-bit and 16-bit data.
13. What happens if both numbers (`NO1` and `NO2`) are equal?
Answer:
If both numbers are equal, the subtraction result will be zero, and the Zero Flag (ZF) will be set to 1.
Answer:
Flags affected by subtraction include:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 7/15
15. How can this program be extended to perform subtraction on 16-bit data?
Answer:
To handle 16-bit data:
These questions should help you confidently handle the viva. Let me know if you need further
clarification! 😊
now can you give me viva questions and answer for all the other experiments also from this subjetct
: MICROPROCESSORS AND APPLICATION
Here’s a comprehensive set of viva questions and answers for all the experiments in
MICROPROCESSORS AND APPLICATION LAB, categorized by each experiment:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 8/15
1. Which instruction is used for multiplication?
The `MUL` instruction is used for unsigned multiplication, and `IMUL` is used for signed multiplication.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 10/15
Experiment 11: Interfacing Programmable Peripheral Interface (8255) with 8086
AX, BX, CX, DX: Used for arithmetic, data transfer, and general operations.
SI, DI, BP, SP: Used for addressing and stack operations.
Here is a list of general viva questions and answers for the subject Microprocessors and
Applications. These questions cover various aspects of microprocessors, their architecture,
programming, and interfacing.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 11/15
Microprocessor Basics
1. What is a microprocessor?
A microprocessor is an integrated circuit (IC) that functions as the central processing unit (CPU) of a
computer. It performs arithmetic, logical, control, and data transfer operations.
2. What is the difference between a microprocessor and a microcontroller?
Microprocessor: Only the CPU, requires external peripherals for memory, I/O, etc. (e.g., 8086).
Microcontroller: Includes CPU, memory, and I/O ports on a single chip (e.g., 8051).
8085: 8-bit
8086: 16-bit
Pentium: 32-bit or 64-bit.
8086 Microprocessor
Bus Interface Unit (BIU): Handles memory addressing and data transfer.
Execution Unit (EU): Executes instructions.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 12/15
9. What are segment registers in 8086?
Segment registers hold the base addresses of segments:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 13/15
18. What is the function of the 8253 Programmable Interval Timer?
The 8253 generates precise time delays or frequencies using its three counters, which can operate in six
modes (e.g., square wave generation, rate generation).
19. What is the difference between memory-mapped I/O and I/O-mapped I/O?
Advanced Questions
24. What is the difference between a hardwired and microprogrammed control unit?
27. What happens if a program tries to access memory outside its segment?
The processor may generate an exception or access invalid data, depending on the configuration.
28. How do you debug an assembly language program?
Use tools like:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 14/15
Debuggers (e.g., DEBUG in DOS) to step through the program and monitor register/memory
values.
These questions provide a strong foundation for any viva related to Microprocessors and Applications.
Let me know if you need more questions or specific clarifications! 😊
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 15/15