
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
8085 program to perform AND operation in nibbles of 8 bit number
Here we will see how to AND two nibbles of an 8-bit number.
Problem Statement:
Write 8085 Assembly language program to perform AND operation of two nibbles of an 8-bit number. Number is stored at F050, we will store result at F051.
Discussion
To get the nibbles, we have to mask at first. So we need to mask the lower nibble and upper nibble and store them into different registers. The upper nibble will be shifted to the right four bits to make it lower nibble. Then we can perform the AND operation, and store it to the memory location F051.
Input
Address | Data |
---|---|
F050 | 35 |
Address | Data |
---|---|
F050 | BE |
Flow Diagram
Program
Address | HEX Codes | Labels | Mnemonics | Comments |
---|---|---|---|---|
F000 | 3A, 50 F0 | | LDA F050 | memory element of F050 |
F003 | 47 | | MOV B, A | Load A into B |
F004 | E6, 0F | | ANI 0F | Mask upper nibble |
F006 | 4F | | MOV C, A | Load C with A |
F007 | 78 | | MOV A, B | Load A with B |
F008 | E6, F0 | | ANI F0 | Mask lower nibble |
F00A | 07 | | RLC | Rotate A to the left |
F00B | 07 | | RLC | Rotate A to the left |
F00C | 07 | | RLC | Rotate A to the left |
F00D | 07 | | RLC | Rotate A to the left |
F00E | A1 | | ANA C | AND Acc and C |
F00F | 32, 51, F0 | | STA F051 | Store result at F051 |
F012 | 76 | | HLT | Terminate the program |
Output
Address | Data |
---|---|
F051 | 01 |
Address | Data |
---|---|
F051 | 0A |
- Related Questions & Answers
- 8085 program to show masking of lower and higher nibbles of 8-bit number
- 8086 program to reverse 8 bit number using 8 bit operation
- 8085 program to check whether both the nibbles of 8 bit number are equal or not
- 8085 program to reverse 8 bit number
- 8086 program to reverse 16 bit number using 8 bit operation
- 8085 program to find square of a 8 bit number
- 8085 program to find sum of digits of 8 bit number
- 8085 Program to Divide a 16-bit number by an 8-bit number
- 8085 program to count number of once in the given 8-bit number
- 8085 program to convert an 8 bit number into Grey number
- 8085 program to find minimum value of digit in the 8 bit number
- 8085 program to convert 8 bit BCD number into ASCII Code
- 8085 Program to Add two 8 Bit numbers
- 8085 Program to Subtract two 8 Bit numbers
- 8085 Program to Divide two 8 Bit numbers
Advertisements