Show masking of lower and higher nibbles of 8-bit number | 8086 Microprocessor

In this tutorial, we will learn how to show masking of lower and higher nibbles of 8-bit number using 8086 Microprocessor? By Akash Kumar Last updated : May 22, 2023

Problem Statement

To show masking of lower and higher nibbles of 8-bit number using 8086 Microprocessor.

Assumption

  • Number is stored at memory location 0600.
  • Result will be stored at memory location 0601 and 0602.

Algorithm

  1. Load first number to the register AL.
  2. Move the content of register AL to register BL.
  3. Apply AND operation on register AL with 0F.
  4. Now Apply AND operation on register BL with F0.
  5. Rotate the content of register BL 4 times.
  6. Now move the content of register AL to memory location [0601].
  7. Now move the content of register BL to memory location [0602].
  8. Terminate the program.

Program

MOV     AL, [0600]
MOV     BL, AL
AND     AL, 0F
AND     BL, F0
MOV     CL, 04
ROR     BL, CL
MOV     [0601], AL
MOV     [0602], BL
HLT

Observation

INPUT:
0600: 12

OUTPUT:
0601:02
0602:01

Hence, we successfully masked the higher and lower nibble of an 8-bit number using 8086 Microprocessor.





Comments and Discussions!

Load comments ↻






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