(a) Write a program using 8086 assembly Language (with proper comments) that accepts four different digits input from the keyboard. Each digit is first converted to binary equivalent and then smallest of these digits is put in AL register. This AL register is to be added in each value of a byte array of size 9, which is stored in the memory. You may assume the byte array has the value 01h, 03h 02h, 03h, 00h, 01h, 02h, 01h, 04h. Make suitable assumptions, if any.
(b) Write a NEAR subroutine using 8086 assembly Language (with proper comments) that returns the largest value in a byte array of length 4-bytes. All the four values of the byte array are passed to the subroutine in a stack. You should write both the calling program and subroutine.
(c) Explain the following in the context of 8086 Microprocessor :
(i) Use of segment registers with the help of example (ii) Interrupt handling in 8086 micro-processor
(iii)Any four bit manipulation instructions in 8086 micro-processor
(a)
Here is the 8086 assembly program to accept four different digits input from the keyboard, convert them to binary, find the smallest digit and add it to each value of a byte array of size 9 stored in memory:
DATA SEGMENT
NUMS DB 01h, 03h, 02h, 03h, 00h, 01h, 02h, 01h, 04h
;byte array of size 9
SMALLEST DB 0 ;variable to store smallest digit
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA
START:
MOV AX, DATA
MOV DS, AX ;initialize data segment
;accept four different digits input from the keyboard
MOV AH, 01h ;function to read character from keyboard
INT 21h ;interrupt to read character from keyboard
SUB AL, 30h ;convert character to digit
MOV BL, AL ;store digit in BL
MOV AH, 01h
INT 21h
SUB AL, 30h
MOV CL, AL ;store digit in CL
MOV AH, 01h
INT 21h
SUB AL, 30h
MOV DL, AL ;store digit in DL
MOV AH, 01h
INT 21h
SUB AL, 30h
MOV DH, AL ;store digit in DH
;convert each digit to binary and find the smallest digit
MOV AL, BL
MOV BL, 2
MUL BL ;multiply by 2 to convert to binary
MOV BH, AL _______ ________ ______ ___ ______ _________ ___ _____ ________ _______ ______ ______.
___ __________ _____ _____ _________ ______ _______ ________ ____.
_________ ___ ________ ________ ________ _________ __________ __________ __________ _________.
___ ____ ____ ________ __________ _____ ___ ___ ________ ________.
___ _______ ____ __________ ________ _________ ______.
___ ______ _____ ________ ___ _________ _______ ______ __________ ___ ___.
____ ___ ________ _______ _____ ________ __________ _____.
___ ___ ______ __________ _______ ______ ____ ____ ______ ____ ________ __________.
__________ __________ ____ _____ ______ ___ _____ ___.
________ _____ ______ __________ ___ ___ ____ ____.
___ _______ __________ ________ _________ ____.
______ ___ _______ _______ _____ ___ ________ _____ ___ __________.
___ ____ ___ __________ _____ _______ _____ ________ ________.
_________ __________ ____ _________ ______ _______ __________ _________ ____ ___ ________.
_____ ____ ________ _______ __________ __________ __________.
__________ ________ __________ _______ _______.
___ _________ _________ _____ _________.
________ _________ ______ _______ ______ ______ _____.
_____ ________ _______ ________ _________ ___ ___ ______ __________.
_________ ________ ______ ____ _____.
________ ____ ______ _____ _________ ________.
_______ ____ _____ _________ ___ ____.
____ _________ _____ _______ __________ ______ ___ _______ _______ ________ ___ _________.
____ _________ _____ ________ __________ __________ ______ ________ ____.
________ ________ ____ _______ ___ ____.
___ _______ _______ ________ _________ _________ ____ ________ _____ _________ _____.
______ ______ ______ _______ ____ _____ ______ ____ ______ _________ ___ ______.
______ ___ ______ ____ ________ ____ _______ __________ ______ ____.
_________ ____ ___ ________ __________ __________ _____ _____ ___.
_________ _______ ___ ____ __________ _______ _______ ______.
_______ ______ ___ ______ ________.
________ ____ ________ ______ _________ ____.
__________ ________ _______ __________ _________ __________ _______ __________ __________.
__________ ______ ___ _________ _______.
______ ____ _________ _________ ___ _____ ______ ______ ________ ____ _____.
________ _____ _______ _________ _________ _______.
__________ _____ _________ _________ _________ _______ ___ ___ _______ ________ ________.
__________ _______ _________ ____ __________ ______ __________ ________ __________ ___ _____ ________.
______ _______ __________ ____ _____ ___ _______ _________.
____ __________ _________ ___ ________ _______ ____ _________ ____ _________.
_______ ________ _______ ____ __________ _________ ______.
___ _____ ____ __________ ___ ________ _______ _____.
________ __________ ________ __________ ______ ______ ___ _______.
_______ _____ _______ ___ _____ _______ _____ ______ _______ ____ ___ __________.
_______ _________ _____ _______ __________ _______ _____ __________ _____ _____ ___.
____ ___ ______ __________ _____ ________ __________ ________ ___.
_______ ___ _______ ____ ________ ____ __________ _________ ________ _________.
______ ____ _________ ____ ___ ______ ___ _____.
________ ________ _______ _________ _______ ______ ________ ___ _____.
_______ __________ ____ ________ ______ ____.
______ _____ _______ _______ __________ ____ ___ _____ ____ _________.
__________ ______ ___ ______ ___ _______ _____ ______ _____ __________ ______.
___ _______ __________ ____ ____ ______ ___ __________.
______ ____ _________ ______ _______ __________ ____.
_______ _____ ___ _________ __________ __________ _______ _____ _______ ___.
__________ _________ ________ __________ ______ __________ ____ __________ ____.
___ _______ ________ ________ _________ _____ ______ ________.
__________ ______ __________ ____ __________.
_______ _________ _______ _____ ______ __________ _________ ______ ____ _____.
______ __________ ________ _______ _____ ____ _______ ________ _________ _____.
______ _____ _________ ___ ______ _____ _______ _______ ___ ________ _____ _______.
__________ _______ _________ ___ __________ ________ ______.
_____ ______ ___ _____ ____.
______ ______ _____ ___ _______ _______ _________ __________ ________.
___ _________ _____ _________ ______ ____ __________ ___ ________.
___ ______ _____ _______ _________ _________ ______ ________.
________ ____ _________ ______ _________ _________.
__________ ___ ____ _________ ___ ______ _____ _________ _______ _____.
_________ ___ _________ ____ _________ ____ ________ ___ __________ _____ __________ ________.
_________ ______ _____ _______ ____ ___ _______ ______ ___ _______ __________ ___.
____ _____ ________ _______ ________ ___ _______ __________ ________.
_____ ____ _____ ___ _______ ______ __________ _____ _________ __________ ________ __________.
_______ ___ ____ _________ _______ ______ _____ _______ ___.
_____ ____ ____ ____ ___ ________ ____.
_______ ___ ______ ___ _____ ___.
____ ______ _____ _______ ________ _______ _________.
_________ ____ ________ __________ ________ _________ ______ ___ ___ __________ _________ ________.
_______ __________ ________ ______ ____ ____ ________ ___ _____ _________.
__________ _________ _______ ________ _____.
_______ __________ ______ _______ _____ ___ __________ __________.
__________ ___ __________ ______ ___ _________ _____ _______ _________ __________ ____.
___ _____ _________ ___ __________ ______ ______ __________ ______ __________ _______ ________.
_____ _______ _______ _______ ____ _______ __________ __________ ______.
__________ ______ ______ ____ ________ ___ ____ _______ __________ ___ _________.
__________ ____ _______ __________ _________ ______ ____ _____ __________.
___ _________ ____ _______ ______ __________.
____ ______ _________ ___ _________ _______ _______ ___ _____ ______ ____ ___.
________ _______ ____ _______ ____ ____.
_________ _______ ________ _______ ____ _____ ___ ______ ____ ______ ________ _____.
__________ _____ ____ _______ ___ _________ __________ _______ ___ __________ ___.
____ ____ _________ _________ ____ _______ ______ ____ _________.
______ ______ ____ _________ ______ _________ ______.
______ _____ _____ _________ _________.
___ ___ __________ __________ _______ __________.
______ ____ _______ ____ ______ _______ ____ ____ ____ ___ ___.
______ ___ ________ ___ __________.
_______ __________ ______ ___ _____ _____ _________ ________.
_________ _______ ______ _______ ________ _______ ________ ____ ______.
__________ ______ __________ ___ ______ ___ ________ _________ _______ __________ ______.
____ _____ _______ ____ _________.
_____ _________ _________ ______ _____ _____ ___ _______ ______ __________ _______.
_________ _______ __________ ___ ________ ____ ___ __________ _______ _______ ____.
_____ ____ _________ _______ ___ ___ _____ _____ __________ __________ ______.
________ ___ _______ ________ ______ __________ ________.
___ __________ _______ _____ _________ __________ ____ ___ _____ ______ _____ _____.
________ ________ ______ _____ ______ _______.
_________ _______ ___ _______ _______ ___ ___ ________ _________ ________ ____.
___ ___ __________ _______ ______ ___ _______.
_________ _________ _________ ___ ______ _______ _________ ________ _____ ________ __________ __________.
_______ _________ _______ _______ ___ ___.
________ ________ ______ _________ _____ ________ ___ __________ _____.
________ _________ ____ _______ ____ ____ ____ ________.
__________ ___ ________ __________ _____ _______ _________ ____ ____ ___ ____.
___ _____ ___ ________ ______ ______ ____ ____ ______ _______ _______.
______ ________ ______ ______ _____ _____ _______.
__________ ____ ____ _____ _______ ________ _____ _______.
___ _____ ______ ________ ___ ________ __________ ______ __________ __________.
__________ ______ ______ ________ ______.
_________ _______ _____ _______ ___ __________ ______ __________ ________ _______.
_________ __________ _________ ________ _______ ____ ____ _________ ________ ___ _____.
__________ ________ __________ ___ __________ ____ ____ ______.
______ __________ ___ ____ _______ ____.
__________ ________ _______ ______ __________ ______ ______ _____ ___ _____ _________ ________.
______ _______ _________ _________ ______ ____.
_________ _________ ______ _________ ________ ______ ______ ______ __________ ______ _____ ______.
__________ ________ ____ _____ ___ __________.
___ __________ _________ ________ ____ __________ _____ _____ _____ ________.
______ ________ ____ __________ _________ _____ ____ _______ ______ _________ _________.
___ ____ ________ _________ _______ _____.
__________ ______ ________ __________ _________ ____ ___ ______ _________ _______ ___ _______.
______ ______ ___ __________ _________ ___.
___ ________ _____ ________ __________ __________ ________ ________ __________.
_________ ___ ___ ____ ____ ______ _________ ___ __________ ______ __________.
______ ____ _____ ____ _________ ________ ______ _______ _________.
_____ ____ _________ _________ _____ ________ ____ ________.
______ ___ ____ ____ ___ _____ _________ _______ _________.
__________ ____ _________ _______ _______ ___ __________ __________ _________ _____ ______.
_____ ______ ________ __________ ________ _______ ___ _____.
______ ___ _________ _____ _______ _________ _______.
________ ____ ______ ______ ______ ____ ____.
___ _____ _______ _______ _____ _____ __________ _____.
_______ ___ ________ _____ ____ _____.
____ _________ ________ _________ _______ ___ _____ ______ ______.
_________ _________ _______ ______ ___ _____.
______ ____ ________ _________ ________ _______.
___ _________ _______ _______ ______ ___ __________ _____ ___.
______ ______ _____ _________ ____ ____.
________ _______ ____ ____ _________.
_________ __________ ______ ___ _________.
_______ _______ ________ _______ _________ __________ _____ ___.
______ ____ ____ ___ ___ ____ ___ ____ _______ __________ ___ ________.
_________ ___ ____ _________ ____ _________ _________ _________.
________ ___ _______ _______ _________ ________ ___.
_____ _______ __________ ________ _____ _________ ____ _____ __________ _______.
____ ___ __________ ______ _____.
________ _______ ______ _________ _____ _________.
________ ______ _____ ________ ___ _________ _____ __________ _______ ________.
______ _________ __________ _________ _____ _________ _________.
_____ _________ ____ _________ ______ __________.
__________ ______ ________ ___ __________.
Get Full Answer on WhatsApp