Program 8bit
Program 8bit
Program 4
1. Aim
Write an Assembly language program for subtraction of two 8-bit numbers.
2. Introduction
Microprocessor: A silicon chip that contains a CPU. In the world of personal computers,
the terms microprocessor and CPU are used interchangeably. A microprocessor
(sometimes abbreviated µP) is a digital electronic component with miniaturized
transistors on a single semiconductor integrated circuit(IC).
3. Theory
1.ORG Addr. Directive reserves the starting address for Program Code or data in
specified memory array,
2. LXI H (LOAD REGISTER PAIR IMMEDIATELY) loads 16 bit data in register pair
designated by operand.
3. LHLD Addr. (LOAD HL PAIR DIRECT) loads 16 bit data from specified address to
4. Flow Chart
5. Code
6. Simulation
7. Result
8. Questionnaire
Q1. What is the use of ALE?
Q2. Explain the signals HOLD, READY and SID.
Q3. What is the use of bidirectional buffer?
Program 5
Department of Electronics & Instrumentation
EI-37006 Microprocessor Systems- Lab work 2022
1. Aim:
2. Introduction:
Interrupt Service Routine (ISR):-A small program or a routine that when executed
services the corresponding interrupting source is called as an ISR.
Execution of Interrupts:-
When there is an interrupt requests to the Microprocessor then after accepting the
interrupts Microprocessor send the INTA (active low) signal to the peripheral. The
vectored address of particular interrupt is stored in program counter. The processor
executes an interrupt service routine (ISR) addressed in program counter.
4. Flow chart
Department of Electronics & Instrumentation
EI-37006 Microprocessor Systems- Lab work 2022
5. Procedure
1. Write the program code on editor file window.
2. Store some input data at specified Memory Array.
3. Click on the option Assemble for simulation.
4. Write the starting address of the program to simulate option.
Department of Electronics & Instrumentation
EI-37006 Microprocessor Systems- Lab work 2022
5. Simulation of entire code could be run at a time or step by step.
6. Execution results can be checked through the Register, Memory and Device
environment window.
6. Note down updated register and memory content value for verification of result.
6.Code
7. Simulation
8. Result
9. Questionnaire
Program no. 6
1.Aim -
Write an assembly language program to multiply two 8-bit numbers
2.Introduction-
Department of Electronics & Instrumentation
EI-37006 Microprocessor Systems- Lab work 2022
The 8085 has no multiplication operation. To get the result of multiplication, we should use the
repetitive addition method.
After multiplying two 8-bit numbers it may generate 1-byte or 2-byte numbers, so we have to use two
registers to hold the result.
3.Theory –
1) MVI (MOVE IMMEDIATE DATA) - Moves immediate value to
specified register.
2) ADD M (ADDTION) - Adds the contents of memory to accumulator
3) JNC Addr.(JUMP IF NO CARRY) - Instruction jump the execution to the
specified Address if carry flag is reset.
4) INR R(INCREMENT REGISTER) - Increment the specified register
content by 1.
5) STA addr. (STORE ACCUMULATOR DIRECT) - Copies the contents
of the accumulator to the memory location specified in the instruction
6) JNZ (CONDITIONAL JUMP) The program sequence is transferred to a
particular level or a 16-bit address if Z=0 (or zero flag is 0)
7) MOV A, M - Copies the data byte into accumulator from the memory
specified by the address in H-L pair.
8) DCR C - Used to decrement value at C register by one
9) LXI ,H (LOAD REGISTER PAIR IMMEDIATELY) - Loads 16 bit data
in register pair designated by operand.
4. Flow chart -
5. Code -
6.Simulation -
Questionnaire -
Program no. 7
1.Aim -
Determine largest number in an array of n elements. Value of n is stored at address
2050 and array starts from address 2051. Result is stored at address 3050. Starting
address of program is taken as 2000.
2. Introduction-
Algorithm-
3.Theory –
1) LXI H (LOAD REGISTER PAIR IMMEDIATELY) - Loads 16 bit data
in register pair designated by operand.
2) MOV C, M (MOVE M TO C) - Copies the data byte into C from the
memory specified by the address in H-L pair.
3) INX H (INCREMENT REGISTER PAIR) - Increments the contents of
the register pair by one.
4) MOV A, M (MOVE M TO A) - Copies the data byte into accumulator
from the memory specified by the address in H-L pair.
5) MOV B, M (MOVE M TO B) - Copies the data byte into B from the
memory specified by the address in H-L pair.
6) CMP B - Subtracted the contents of register B from the accumulator
Department of Electronics & Instrumentation
EI-37006 Microprocessor Systems- Lab work 2022
content A and the result store in A.
7) DCR C - Used to decrement value at C register by one
8) JNZ - Stands for jump if not zero.
9) MOV M, r - Will copy 8-bit value from the register r to the memory
location as pointed by HL register pair
4.Flow chart
5.Code:
6.Simulation -
Questionnaire
Q1) What is Tri-state logic?
Program no. 8
1.Aim -
Determine smallest number in an array of n elements. Value of n is stored at address 2060
and array starts from address 2061. Result is stored at address 3060. Starting address of
program is taken as 2000.
2.Theory –
1) LXI H (LOAD REGISTER PAIR IMMEDIATELY) - Loads 16 bit data
in register pair designated by operand.
2) MOV C, M (MOVE M TO C) - Copies the data byte into C from the
memory specified by the address in H-L pair.
3) INX H (INCREMENT REGISTER PAIR) - Increments the contents of
the register pair by one.
4) MOV A, M (MOVE M TO A) - Copies the data byte into accumulator
from the memory specified by the address in H-L pair.
5) DCR C - Used to decrement value at C register by one
6) MOV B, M (MOVE M TO B) - Copies the data byte into B from the
memory specified by the address in H-L pair.
7) CMP B - Subtracted the contents of register B from the accumulator
content A and the result store in A.
8) DCR C - Used to decrement value at C register by one
9) JNZ - Stands for jump if not zero.
10) MOV M, r - Will copy 8-bit value from the register r to the memory
location as pointed by HL register pair
11) HLT - Is used to terminate the program
3.Flow chart -
4.Code –
5.Simulation -
7. Questionnaire
Q1. Explain data-width
Q2. While handling interrupt instructions in 8086, what are the internal
operations carried out by stack?
Q3. What is BHE?
Q4. Discuss branch related addressing modes in 8086
Q5. Give the significance of instruction pointer
Program no. 9
1. Aim -
Write an Assembly language program to convert BCD to binary
2.Introduction -
Binary Coded Decimal, or BCD, is another process for converting decimal numbers into
their binary equivalents.
It is a form of binary encoding where each digit in a decimal number is represented in the
form of bits.
This encoding can be done in either 4-bit or 8-bit (usually 4-bit is preferred).
It is a fast and efficient system that converts the decimal numbers into binary numbers as
compared to the existing binary system.
These are generally used in digital displays where is the manipulation of data is quite a
task.
Thus BCD plays an important role here because the manipulation is done treating each
digit as a separate single sub-circuit.
3.Theory-
1. Load the BCD number in the accumulator
2. Unpack the 2 digit BCD number into two separate digits. Let the left digit be BCD and
1
If the 2 digit BCD number is 72, then its binary equivalent will be
7 x OAH + 2 = 46H + 2 = 48H
Steps:
1. Load the BCD number from the memory location (201FH, arbitrary choice) into the
accumulator
2. Temporarily store the accumulator’s value in B
3. Obtain BCD by ANDing the accumulator with 0FH and store it in C
2
4. Restore the original value of the accumulator by moving the value in B to A. AND the
accumulator with F0H
Department of Electronics & Instrumentation
EI-37006 Microprocessor Systems- Lab work 2022
5. If the value in the accumulator equals 0, then BCD is the final answer and store it in the
2
BCD by 0AH
1
7. Multiplication: Move BCD to D and initialise E with 0AH as the counter. Clear the
1
5.Code –
6.Simulation -