Question

Write a program in 8086 assembly language, which converts a four-digitpacked BCD number to ASCII digits and then prints them. Explain each step of the program.The program should take the BCD value from the memory

27 Apr 2023
Answer :
Word Count : 744

To write a program in 8086 assembly language that converts a four-digit packed BCD number to ASCII digits and then prints them, we'll go through the steps one by one:

Step 1: Load the BCD number from memory Step 2: Convert packed BCD to unpacked BCD Step 3: Convert unpacked BCD to ASCII digits Step 4: Print the ASCII digits

Let's write the program and explain each step in detail:

.MODEL SMALL
.STACK 100H

.DATA
    BCD_NUM DW 1234H    ; Replace '1234H' with your desired BCD number

.CODE
    MOV AX, @DATA       ; Initialize data segment
    MOV DS, AX

    ; Step 1: Load the BCD number from memory
    MOV AX, BCD_NUM     ; Load the packed BCD number into AX register

    ; Step 2: Convert packed BCD to unpacked BCD
    MOV BL, 10         ; BL will be used for unpacked BCD conversion
    AND AH, 0FH        ; Extract the lower digit of the high byte
    MUL BL             ; Multiply the high digit by 10
    ADD AL, AH         ; Add the low digit of the high byte to the result

    ; Step

____ ___ ___ ___ ____ _________ __________ ___ _____ ________.
_________ _________ _______ _______ ______.
______ ________ _____ __________ ________ ___ __________ _________.
____ _______ ______ __________ _______ ________ ___.
________ ___ ______ __________ ______ ____.
_______ _______ ________ ____ __________ _____ ___ _________ ________ ____.
__________ __________ _________ _____ _____ _________ ______ ___.
__________ ________ ____ __________ ________ _______ _______ _______ _______ ________.
_______ ____ __________ _______ _______ _________ ___.
_____ ____ _______ __________ ___ ____ ____ _______ _________ _______ ______ _______.
_________ ________ ______ ___ ___ _______ ________ ____.
_____ __________ _______ ________ ______ _________ _______.
________ ______ _____ _____ __________ ___ ______ _______ _________.
______ ______ __________ __________ ______ ___ _______ ________ _____ __________.
_____ _______ ________ _____ ____ _________ _______ ________ ___ ____.
_________ ______ _____ _____ _____ ___.
____ _________ _______ _____ _______ ______ _____ ______.
_______ ______ ______ _____ _______ _________ ___ ___ _____.
____ ___ ___ ____ _______ ___ ___.
___ __________ ____ _________ ___ ____ ________ ___ _____.
_____ __________ _____ _______ ______ __________ _______ __________ ________ ______ __________.
_____ ________ ____ ___ __________ _______ _____ _______ __________.
________ __________ __________ _________ ___ ________ ___ ___ ______.
______ _________ _____ __________ _______ ________ ___ ___ ______ ______ ___.
_______ __________ _______ _________ ________ ___ _______ ____ _____ _________.
___ ___ ____ _____ ____ ____ __________ ________ _______ _______ ________.
________ ___ ______ ____ _____ ___ __________ ______ __________ ______ __________ ____.
_____ ________ ____ ___ _______ __________ _______ _____ ___.
____ ________ ___ _________ ____ _____ ____ __________ ________.
____ ______ ___ ___ ____ _______ __________.
______ ______ ______ ___ ________ _____ _____ ____ _________.
______ __________ ______ _______ _________ _______ _______ ______ __________ ______ ____.
_________ ________ _______ ____ _____ ____ ___ ________ ___ _____ ______.
______ ____ ______ __________ _____.
___ __________ ____ ________ ____ ____ ________ ____ ______ _______ _________ ________.
___ ________ ________ ______ _______ ________ _________ ___ __________.
________ ________ ______ _________ ______ ______ __________.
___ __________ _______ _________ ___ __________ ______ _____ ________ _______.
____ _________ _________ ____ ____ ________ _______ ___ _________ _____ _____.
________ ________ ___ ___ _________ ________.
_____ ________ _______ ____ _________ _________ _________ _____ ______ ______ ____ _______.
_____ ________ _________ ______ _____ ___ _____ _________ _________.
________ ____ ________ ___ __________ ____ _____ ______ _________ _____ _______.
_________ ___ _____ _______ ______ _________ ______ ____ ______.
______ _________ ______ ____ __________ __________ _______.
____ _______ ________ __________ ___ ________ _______ _________ ____ _______ _____.
_________ ________ _________ __________ _______ _______ ______ _________.
___ ________ ______ _____ ___.
___ _______ ___ _______ ____ _________ ___ _______ ____ _______.
_____ ______ _______ _______ __________.
______ ____ ____ _______ _______ _____ __________ ____.
________ __________ __________ ____ ____ __________ ____ ____ __________.
____ ___ ________ _____ ___ ____ _____ ___ __________ __________ _______ __________.
__________ _________ _______ _______ ________ _________ _______ ______ ___ _________.
__________ _______ ____ ______ _______ ______ ________.
__________ _____ _______ _______ ________ _______ ___.
____ __________ _________ _____ _________ _____.
_____ ____ _____ ____ ______ ___ ________ _______ _____ ____ _______ _________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MCS 202 2022 2023 - Write a program in 8086 assembly language, which converts a four-digit | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→