Question

Write and run following programs using 8086 assembly language.

(a) Write and run an Assembly language program that converts a packed 4 digit BCD number that has been stored in two consecutive byte locations in the memory, into an equivalent binary number. The output should be stored in DX register. For example, if two consecutive byte locations have BCD values (12) and (34) then output will be binary equivalent of (1234)to which is (0000 0100 1101 0010)2. This binary value will be stored in DX register.

(b) Write and run (using appropriate calling program) a near procedure in 8086 assembly language that checks if the input parameter has a value less than 5. If the value is less than 5 then subroutines displays the line "Parameter value is less than 5" else it displays "Parameter value is >-5".

(c) Write and run an 8086 assembly language program that finds the factorial of the value stored in BH register. You may assume that BH register will store a maximum value 8. Thus, you need not handle the overflow.

 

29 May 2025
Answer :
Word Count : 569
We are solving manually, without Python, and we will write the 8086 assembly programs step by step for each part. I will show exact assembly logic, explain, and give the numerical conversion results where needed. --- ### (a) Convert 4-digit Packed BCD to Binary and Store in DX Example Input: Memory: ``` [2000H] = 12H ; high 2 BCD digits → 1 and 2 [2001H] = 34H ; low 2 BCD digits → 3 and 4 ``` Equivalent Decimal: 1234 Equivalent Binary: 0000 0100 1101 0010 (4D2H) Program: ```assembly ORG 1000H MOV SI, 2000H ; SI points to memory where BCD digits are stored MOV AL, [SI] ; AL = first byte (12H) MOV AH, AL ; Copy to AH for splitting AND AL, 0FH ; AL = lower nibble = 2 SHR AH, 4 ; AH = upper nibble = 1 MOV BL, 10 ; multiplier for decimal MUL BL ; AL * 10 -> AX = 1*10 = 10 ADD AL, AH ; Add lower nibble -> 10 + 2 = 12 MOV CL,
___ __________ ____ _______ _____ _______ ________.
_________ ____ ______ ___ ________ _______.
___ ____ _______ ___ ____ ________ ________.
_________ _______ _________ _________ _________ _______ ________ _________ ____ ______ _____.
______ ________ ________ _____ _________ ______.
_______ ____ __________ _________ ______ _____ ____ ___.
_____ ______ ________ ______ _____ ______ ______ _______.
______ _____ ______ ____ ______ ________ ________ ____ ___ __________ _____.
________ _________ __________ ______ ____ ___ _________ _______.
_________ _________ ____ _______ __________ _____.
___ ________ _________ ___ _____ _________ _______.
___ ________ _____ _________ _____.
___ _______ _______ ______ ___ ______ ________ _________ _______.
____ ____ _______ ___ _________ ____ _______ _______ _____ _______ __________ ________.
____ ______ ____ ___ ______ _________ _________ _______ ________ ________ _________.
______ ______ _____ ____ ____ _____ ___ _____ _____ __________ ________.
__________ __________ _________ _____ _________ _______.
____ _________ ______ ________ ___ ____.
____ ____ ______ ____ ___ _______ _________ _________ _______.
_______ ___ _________ ____ ___ _________ _________ ____ _______ _______ _________ _______.
___ ______ ___ ________ _________ _______ __________.
____ ______ __________ __________ ________ ______.
__________ _________ _________ _______ ___ ____ _________ ___ _______ _________ ____ ______.
_________ ___ _________ ___ _______ _____ ___ ______ ____.
__________ ______ _______ __________ ______ ____ __________ _______ _____ ________ __________.
____ __________ ________ ____ _________ ______ ___ _____ _____.
____ _____ ____ ________ ___.
______ __________ _______ _____ ____ ______ ______ _______ ________ ______ ____.
__________ _______ ___ _____ _______ ____ ______ _____ _____ _____ ___ _________.
_______ ____ ____ ________ _________ _________ _____ _______.
_____ _______ _______ _________ _______ _____ ______ _____ ________ __________ ________ _________.
_______ _____ ________ _________ ______ ___ ___.
_______ _____ _______ __________ _______.
___ _______ _______ _____ __________ _________ _________ ________ _________ __________ _______ _______.
__________ __________ __________ _______ _______ ___ ____ _______ ______ ____.
______ ______ _________ _____ _______ __________.
________ _________ ____ ______ ________ ________ ________ _____ ______ ______ ___.
____ ____ ___ __________ ________ ___ _____ ______ ________ _______ ______.
________ ______ ______ _____ __________ ___ ______ ________ _________ ___ ________ ______.
_________ __________ __________ _______ _________ _______ _____ _____ _________ ____ __________ ___.
___ ________ __________ ________ _____ ______ _____ ________ _________ _________.
________ ________ _____ _______ ______ ___ _______ ____ ________ _______ _______ _________.
________ _________ ____ _____ _______ _________ ____ ____.
___ ____ _____ ____ ___ _________ ______ ________.
__________.
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 BCSL 22 2024 2025 - Write and run following programs using 8086 assembly language.(a) | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→