8086 Microprocessor Assignment 1
8086 Microprocessor Assignment 1
Instructions:
Try all questions neatly, illegible and ambiguous answers will be unmarked.
Copying will result on cancelation of your result/mark.
A) B)
I. On the above codes, locate the memory addresses where F2 H & FF H are to be
stored.
II. What will be the value of Zero Flag (ZF) in both cases after line number 05 is
executed?
III. What are the respective values to be stored on the addresses 5000:2000 and
5000:2000 in both codes after line number 05 is being executed?
IV. Would the above codes result in different output from its earlier one in case line
number 4 is changed into, MOV [SI], 1234H in both A & B?
V. If lines number 04 in both codes (A&B) are replaced with; MOV [SI], 1234H, What
would be the respective values to be stored on the addresses 5000:2000 and
5000:2000 after line number 05 is being executed in both codes.
2. What is the difference between the following instructions, and identifying their respective
addressing modes?
4. Find the sum and flag values for AF, SF, ZF, CF, OF, PF after adding 5439H and 456AH
5. Please trace this program manually and answer the following questions:
5. Please trace this program manually and answer the following questions:
6. Given that;
After the following instructions are executed, what will be the value of the registers AX,
BX, CX, and DX? DS is a segment register for all instructions.
7. Programs
1. Write a program to store two immediate values into respective offset addresses of
0500H & 0600H in 2000H data segment to and add these values and then store the
result at 0700H in the same segment.
2. Write a program to move the contents of the memory location 0500H to register BX
and also to CX. Add immediate byte 05H to the data residing in memory location,
whose address is computed using DS=2000H and offset=0600H. Store the result of the
addition in 0700H. Assume that the data is located in the segment specified by the data
segment register which contain 2000H. (Assume that the immediate values stored in
offset addresses of 0500H & 0600H in 2000H data segment are those immediate values
from question 1.)
3. Write a program to exchange two memory variables using MOV and XCHG
instruction. Can you do it with just XCHG?
4. Write a program for addition of two numbers using directives.
5. Write a program to multiply two unsigned numbers
6. Write a program to calculate factorial of a number.
7. Write a program to generate Fibonacci series.
8. Write a program to demonstrate block transfer
9. Write a program to demonstrate block exchange.
10. Write a program to convert a BCD number (45H) into its ASCII equivalent (3435H).
11. Load a byte string, 14-bytes long, into an offset address starting from 0200H in 7000H
data segment and Move this string to an offset address starting from 0300H in 9000H
extra segment. ( can be solved with 2 ways )
12. Write a procedure named SQUARE that computes 𝑌 = (𝐴𝐿)2 + (𝐴𝐻)2 + (𝐷𝐿)2 ,
assume that Y doesn’t exceed of 16 bit.
13. Write a program to find arithmetic mean of n numbers.
14. Write a program for the addition of a series of 8-bit numbers. The series contains 100
numbers.
15. A program to find out the largest number from a given unordered array of 8-bit
numbers, stored in the locations starting from a known address.
16. A program to find out the number of even and odd numbers from a given series of 16-
bit hexadecimal numbers.
17. Write a program to find out the number of positive numbers and negative numbers from
a given series of signed numbers.
18. Write an assembly language program to arrange a given series of hexadecimal bytes in
ascending order.
19. Decide whether the parity of a given number is even or odd. If parity is even set DL to
00H; else, set DL to 01H. The given number may be a multibyte number.
20. Write a program for the addition of two 3 x 3 matrices. The matrices are stored in the
form of lists (row wise). Store the result of addition in the third list.
21. Write a program to find out the product of two matrices. Store the result in the third
matrix. The matrices are specified as in the above program.
22. Write a program to transpose a matrix.
23. Write a program to multiply two multi byte numbers and store the results as the third
number
24. Repeat the above program using procedure/ subroutine concept
25. Write a program for reversing a given string.
26. Write a program to compare two strings
27. Write a program to read a character from keyboard (with Echo)
28. Write a program to read a character without Echo
29. Write a program to read a string of 10 characters into a buffer from keyboard
30. Write a program to display a character
31. Write a program to display a character string 5 times
32. Write a program demonstrate string input
33. Write a program to convert a Hexadecimal number into its binary equivalent.
34. Write a program find HCF and LCM of two numbers.
35. Write a program to convert ASCII number into decimal digit.
36. Write a program to count the number of 1’s in a given number
37. Write a Program, which takes the input of 4-digit number, and display the sum of square
of digits.
38. Write a program to convert a string in upper case to lower case or lower case to upper
case.
39. Write a program to determine a given string is a palindrome. If 'Yes' output the message
“The given string is a palindrome”. If 'No' output the message “No, it is not a
palindrome”.
40. Write a program to search for a character in a given string and calculate the number of
occurrences of the character in the given string.
41. Write a program, which will produce 2 ms delay.
42. Write a program to display the current system time using DOS INT 21H, function 4CH.
43. Write a procedure, which takes one character from console at 10-second intervals, and
stores each character in one array of characters.
44. Write a procedure, which takes one number from an array, calculates the square and
stores each square number in another array.
45. Write a program to print alphabets from a to z in both the case.
46. Write a program to swap contents of two registers without using the XCHG instruction.
47. Write an assembly language program to count number of vowels in a given string.
48. Write a program that will ask for a temperature in Fahrenheit and display in Celsius.
49. Write a program to exchange the content of memory location
50. Right shift data within 16-bit register
51. Left shift within 16-bit register
52. Write a program to search a character in a string
53. Write a program to compare two strings.
54. Write a program to display string “Electrical and Computer Engineering” for
8086.
55. Read two strings, store them in location STR1 and STR2 check whether they
are equal or not.
56. Write a program to read the current time from the system and display it in the
standard format on the screen.
57.