Write and run following programs using 8086 assembly language.
(a) Write and run a 8086 Assembly language program that converts a three digit ASCII number stored in three consecutive byte locations in the memory, into a binary number. The output should be stored in DX register. For example, if three consecutive byte locations contain '345' (please note they are three ASCII digits), then the DX should get binary equivalent of decimal number 543, which is (0000 0010 0001 1111)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, which is passed a single parameter by the calling program. The procedure checks if the input parameter has a value zero or not. If the value of input parameter is zero then procedure/program is terminated, otherwise a value of 1 is returned to the calling program, which then continue to execute the remaining program. Make and state suitable assumptions, if any.
(c) Write and run a 8086 assembly language program that finds the sum of first N natural numbers. The value of N is input to the assembly program. The sum is stored in DX register. Assume the value of N between 1 and 10 only.
Sure, I can provide you with assembly language code for each of the tasks you've mentioned. Below are the programs for each task:
(a) Convert ASCII to Binary:
```assembly
ORG 100h ; Set the origin of the program to 100h
MOV SI, 0000h ; Initialize SI to point to the start of the ASCII digits
MOV CX, 03h ; Set the loop counter to 3 (three digits)
MOV DX, 0000h ; Clear DX to store the result
ConvertLoop:
MOV AL, [SI] ; Load the _________ ______ _______ ________ _____ ___ __________ ______ _______ _______ ________.
_____ ____ ____ ___ _____ _________ _____ ____ _____ __________ ___ ______.
____ _______ ________ ________ __________.
______ ___ ______ _____ _______ _________ _________ ___.
_________ ______ _________ _________ __________ ______ ____ ________ __________ _________ __________ _____.
____ _______ _________ __________ _______ _______ ____ _________.
____ _____ ____ ______ ________ ________ _______ ____ ___ _____ _________ _____.
_____ ___ _______ __________ ________ ______ _________ __________ ____ ____ _______ _________.
_________ __________ ______ _____ _____ ______ _______ _________ _________.
__________ ___ ___ ________ ________ __________ ___ _________.
_____ __________ _________ ___ _____.
_____ _____ ________ ____ ___.
_____ _____ _______ ______ _____ ___ ______ __________ __________.
____ _______ ___ ______ ____ _________.
___ _________ ______ _______ ___ ___ ________.
_____ _____ ____ ________ ____ ______ _____ _____ __________ ________ __________ _______.
_________ ____ ____ ____ ___ __________ _____ ______ ______.
___ _______ ____ _______ ______ ____ _______ ________ _______ ___ ____ _______.
_________ ______ _________ _____ ________ ___ __________ ______ __________ _________ ________ _____.
_________ ______ ________ ______ _____ __________ _______.
_____ ____ ______ ______ ____ _________ _________ _________ _______ ______.
_________ _______ _______ _________ _________ ________ _______.
_____ ______ ___ ____ ________ ______ _______ ____.
____ _________ ____ ______ __________ ______ __________.
___ _______ ________ _____ _______ _______ _________ __________ _______ _____ ____ _________.
_____ ___ _______ ____ ________ _______ _______ _______ ______ __________ ________ ____.
_______ _________ _________ _________ ________ ________ ________ ___ _____ __________.
___ _________ ________ ____ __________ __________ _________ _______.
________ ____ ____ ______ ___ _______ _______.
______ ____ _____ ____ _________ _________ ___.
_______ _________ ___ ______ ______ _______ _______ ____ __________.
_____ ____ ___ _____ ______ _________ _____ _________ ____.
_______ _____ ______ ____ ___ ________ _________ ___ _____.
____ _________ _____ ______ ___ ______ ________ ___ ______ ________.
_____ ___ ___ ____ _______ ________ _____ ________.
____ ___ _____ ___ _____ ___ _____.
_____ ________ ____ _____ ___ ____ _____ _____ ________ ___ ___.
____ ___ _______ ___ _____ ______ ___ _______ _______.
_________ __________ ____ ______ ________ _________ _____ _______ ____ ___.
______ ______ _____ _______ _____.
_________ ____ ______ _____ _________ _________ _______.
__________ ____ _________ _____ ___ _________ _____ __________.
__________ _________ _______ ________ __________ _______ ___ _______ ___ ____ _____.
___ ___ ________ ____ ____.
______ _________ _______ _______ ________ ___ _________ ____.
__________ _______ _______ _______ ____ _______ ____ _____ ________ ___ ________ _________.
_________ ______ ___ _________ ___.
________ _________ _____ ________ _________.
_____ _______ ___ __________ __________ _________ _____ ___ ___ _______.
_______ _________ __________ __________ ______ _____ ________ _________.
_____ ______ __________ _______ __________.
___ ______ ____ ________ _____ _______ _________ _______ _______ _____ __________ _______.
________ _______ _________ ___ ________ _____ _______.
_________ ____ ________ __________ ___ ____ _____ _______ _________.
_______ _____.
Get Full Answer on WhatsApp