×

Embedded Systems Tutorial

AVR Microcontroller

8051 Microcontroller

8085 Microprocessor

8086 Microprocessor

8255 Microprocessor

Embedded Systems Practice

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

  1. Load the content of accumulator A with an 8bit number.
  2. Copy the content of accumulator to the register B.
  3. Perform AND operation on the content of accumulator with 0F.
  4. Store the result in a memory location.
  5. Copy the content of register B to the register accumulator.
  6. Perform AND operation on the content of accumulator with F0.
  7. Perform RLC operation 4 times.
  8. 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.




Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.