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.
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) __________ __________ __________ ____ ___ _________.
____ _________ _______ ____ ___ ____ _____ ______.
_________ _____ ________ ______ ____.
___ ___ ________ _________ ______ _________ ________ ______ __________ ______ _______ ____.
___ _______ _____ ___ ______.
_____ _________ __________ _______ ________ _________ _________ ___ ___ _________.
_________ ________ ______ _____ ___ ___ ____ _____ _____ ______ ______.
______ _________ __________ _______ ______ ______ ______ _____ ________ ___ ______.
______ _______ ___ __________ _______.
________ ___ ________ _____ _________ ___.
____ _____ _______ _________ ________ _________ __________.
__________ _________ ____ ____ __________ ______ __________ _________ __________.
_______ _________ _________ ___ _________ ________ ____ __________ _______ ____ __________ _______.
________ ______ _____ _______ ________ _________ ______ _________ ___.
__________ _______ ________ ______ ___ _____ ______ _____ ___ ____ ________ __________.
______ ___ ________ _____ _______ _______ __________.
____ ___ _________ _____ ______ _______ ______ _________ ___.
_________ _____ __________ ________ _____ _______ _________ ____ __________ ____ _______ _________.
_______ _______ _____ _________ _______.
_________ __________ _______ ______ __________ _________ ___ _________ _______ ______ _____ _____.
___ ____ _____ _________ ___ ____ ___ ___ _______ _____ ________.
_____ __________ _______ ________ __________ _____ ____.
__________ _________ ________ __________ ______ __________ _________ _________ ____ _________.
___ ____ ______ _________ ______ ____ _____ _______ _______ ________.
___ ______ ______ ________ _______ _________ ____ _______ ____ _______.
__________ _______ ________ __________ ________ __________.
_____ ______ ______ __________ ________ ________ ______.
_____ ____ _______ ________ ______ __________ ______ _______ ___ _______ __________ ________.
________ ________ __________ ______ ________ ______ _______ ________ _____ ________ __________ _______.
__________ __________ _______ _______ ___ _____ __________ __________.
________ _______ ______ ______ ____ ______.
___ ________ _________ ______ _______ _____ ____ ____ _______ ___.
___ ___ _____ ___ __________ ______ _________.
_________ ________ _________ ____ _________ ____ ________ ______ ____ ______ ______.
____ ____ ________ _________ _____ ____ _________ ________ _______ ______.
_________ _________ _____ _________ _____ _______ _____.
_______ ____ _____ _________ _____ _________ _____ ____ ______ _____.
____ _____ ____ __________ _________ ________ __________ _____ _______ _____ _________.
______ _______ ________ ___ _______ ________ ___ __________ _________.
__________ _______ __________ _____ _________.
____ __________ ____ _________ _________ ______ ___ ______ __________ _________.
______ _____ __________ _________ ___.
__________ __________ ___ ___ ___ _________ ________.
________ ____ _______ ___ ______ ______ _______ _________ _________.
_____ ____ ________ _____ __________ _________ __________ ________ _______.
____ _____ _____ ______ _____ ________ ____ _______ ______.
_____ _____ _____ ______ _______.
_______ ____ _______ _______ ______ ____ ______ ___ ________ ___ _________ ____.
___ ______ ___ _____ ___ ___ __________ ___ __________.
________ ___ ____ _____ _________ _______ _______ _________ _________.
______ ___ _______ ___ _________.
____ __________ __________ _____ ______ _______ ______ ______ ________ _______ ______.
______ ______ _________ ___.
Get Full Answer on WhatsApp