Home »
Embedded Systems
Show Masking of Lower and Higher Nibbles of 8-bit Number in 8085 Microprocessor
In this tutorial, we will learn how to show masking of lower and higher nibbles of 8-bit number in 8085 Microprocessor?
By Diksha Tewari Last updated : May 14, 2023
8085 Program to Show Masking of Lower and Higher Nibbles of 8-bit Number
Given an 8-bit number, write a program to show the masking of lower and higher nibbles of it in 8085 Microprocessor.
Algorithm
- Load the content of accumulator A with an 8bit number.
- Copy the content of accumulator to the register B.
- Perform AND operation on the content of accumulator with 0F.
- Store the result in a memory location.
- Copy the content of register B to the register accumulator.
- Perform AND operation on the content of accumulator with F0.
- Perform RLC operation 4 times.
- Terminate the program.
Program
LDA 2051
MOV B, A
ANI 0F
STA 2052
MOV A, B
ANI F0
RLC
RLC
RLC
RLC
STA 2053
HLT
Observation
INPUT:
2051:16
OUTPUT:
2052:06
2053:01
Hence, we successfully masked the lower and higher nibble of 8-bit number.