

- 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 separate (or split) a byte into two nibbles
Here we will see how to split two nibbles of an 8-bit number.
Problem Statement
Write 8085 Assembly language program to split two nibbles of an 8-bit number. Number is stored at F050, we will store result at F051 and F052.
Discussion
To get the nibbles separately, at first we are taking number into B register as a copy. Now mask upper nibble to get lower nibble and store it, then take the number from B again, mask lower nibble to get upper nibble, then rotate it four times to make it lower order nibble, after that store it to another location.
Input
Address | Data |
---|---|
F050 | 35 |
Address | Data |
---|---|
F050 | BE |
Flow Diagram
Program
Address | HEX Codes | Labels | Mnemonics | Comments |
---|---|---|---|---|
F000 | 3A, 50 F0 | | LDA F050 | Take the number from memory to Accumulator |
F003 | 47 | | MOV B,A | Store the number Acc to B |
F004 | E6, 0F | | ANI 0F | AND Acc with 0F to get lower nibble |
F006 | 32, 52, F0 | | STA F052 | Store lower nibble to memory |
F009 | 78 | | MOV A,B | Load main number from B to A |
F00A | E6, F0 | | ANI F0 | AND Acc and F0 to get upper nibble |
F00C | 07 | | RLC | Rotate Acc to left |
F00D | 07 | | RLC | Rotate Acc to left |
F00E | 07 | | RLC | Rotate Acc to left |
F00F | 07 | | RLC | Rotate Acc to left |
F010 | 32, 51, F0 | | STA F051 | Store upper nibble at F051 |
F013 | 76 | | HLT | Terminate the program |
Output
Address | Data |
---|---|
F051 | 03 |
F052 | 05 |
Address | Data |
---|---|
F051 | 0B |
F052 | 0E |
- Related Questions & Answers
- 8085 Program to Subtract two multi-Byte numbers
- 8085 Program to Add two multi-byte BCD numbers
- Java Program to Split a list into Two Halves
- Program to Add two multi-byte numbers in 8085 Microprocessor
- Split keys and values into separate objects - JavaScript
- 8085 program to check whether both the nibbles of 8 bit number are equal or not
- 8085 program to perform AND operation in nibbles of 8 bit number
- 8085 Program to Check the fourth bit of a byte
- Java Program to compare two Byte Arrays
- 8085 program to show masking of lower and higher nibbles of 8-bit number
- Program to check a string can be split into three palindromes or not in Python
- Python program to split the even and odd elements into two different lists.
- Java program to split the Even and Odd elements into two different lists
- Java Program to split into a number of sub-strings
- 8085 Program for subtraction of multi-Byte BCD numbers
Advertisements