Skip to content

VLSIFacts

Let's Program the Transistors

  • Home
  • DHD
    • Digital Electronics
    • Fault Tolerant System Design
    • TLM
    • Verification
    • Verilog
    • VHDL
    • Xilinx
  • Embedded System
    • 8085 uP
    • 8086 uP
    • 8051 uC
  • VLSI Technology
    • Analog Electronics
    • Memory Devices
    • VLSI Circuits
  • Interview
    • Interview Experience
    • Training Experience
    • Question Bank
  • Notifications
  • QUIZ
  • Community
  • Job Board
  • Contact Us

Assembly Language Program for Unpacking the Packed BCD number in 8085 Microprocessor

Posted on August 29, 2016July 1, 2025 By vlsifacts No Comments on Assembly Language Program for Unpacking the Packed BCD number in 8085 Microprocessor

Binary coded decimal (BCD) is a way to express each of the decimal digits with a binary code. This means that each decimal digit, 0 through 9, is represented by a binary code of four bits.

Eg: 98 => 10011000

Unpacking the BCD number is separating each BCD digit.

Eg: 98 can be separated as 09 and 08. So we can say 10011000 [98] is packed and 00001001 [09] & 00001000 [08] are unpacked.


You might like to go through Step by step Process to add two packed BCD Numbers


Assembly language program to unpack the packed BCD number

// Manually store the packed BCD number [eg: 98 in this case] in the memory locations 3000H
// Store the result i.e, the unpacked numbers in the memory locations 3001H and 3002H
// For this Example result will be 09 and 08
// 3000<-09, 3001<-08

#ORG 0000H
#BEGIN 0000H

    LDA 3000H  //Get the packed BCD number from the memory
    MOV B,A
    MVI C,04
    ANI F0     // A = 90H

L1: RRC        // Need to be rotated right for 4 times to get A = 09H
    DCR C
    JNZ L1

    STA 3001
    MOV A,B
    ANI 0F     // A = 08H
    STA 3002
    HLT

#ORG 3000H
#DB 98H

Now when you would run the program it would give you the memory locations with the following values:

Unpacking BCD Number

Note: The above Hex codes have been assembled and simulated on Jubin’s 8085 Simulator.

Hope the post would help you. If any doubt, please mention the same in the comment section, we would revert back to you.

 

Spread the Word

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print

Like this:

Like Loading...

Discover more from VLSIFacts

Subscribe to get the latest posts sent to your email.

Related posts:

  1. Binary Coded Decimal
  2. Addition of 8-bit Numbers in 8085
  3. Addition of 16-bit Numbers in 8085
  4. Multiplication of 8-Bit Numbers in 8085 Microprocessor: Illustration of 3 Different Cases
8085 uP, Embedded System Tags:Binary Coded Decimal, Packed BCD numbers, Unpacked BCD Numbers

Post navigation

Previous Post: Interview Experience – Qualcomm (On Campus)
Next Post: India Innovation Challenge with support from Texas Instruments India, DST and IIMB

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top Posts & Pages

  • VLSI ROADMAP (2026 Ready) — From Beginner to Job-Ready
  • NAND and NOR gate using CMOS Technology
  • ASCII Code
  • AND and OR gate using CMOS Technology
  • What is Design for Debug (DFD)

Copyright © 2026 VLSIFacts.

Powered by PressBook WordPress theme

%d