The document provides examples of 8086 assembly language programs (ALPs) to perform various tasks involving calculations, string manipulation, recursion, sorting, and using BIOS and DOS interrupts. It includes 6 sections with 1-5 problems in each section related to simple and complex mathematical calculations, string comparisons and manipulations, recursion, sorting arrays, using stacks, macros, and accessing functions of the BIOS and DOS. Accompanying some problems are short examples of 8086 ALP code to implement the given tasks.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
6K views5 pages
8086 Pgms Qns
The document provides examples of 8086 assembly language programs (ALPs) to perform various tasks involving calculations, string manipulation, recursion, sorting, and using BIOS and DOS interrupts. It includes 6 sections with 1-5 problems in each section related to simple and complex mathematical calculations, string comparisons and manipulations, recursion, sorting arrays, using stacks, macros, and accessing functions of the BIOS and DOS. Accompanying some problems are short examples of 8086 ALP code to implement the given tasks.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5
Part I: 8086 Programming
A. Programs for simple calculations
1. Write an 8086 ALP to find sum and average of ‘n’ integer numbers. 2. Write an 8086 ALP to find the factorial of a number. 3. Write an 8086 to find GCD of 4 unsigned 16-bit numbers. 4. Write an 8086 ALP to find LCM of 2, 16-bit unsigned numbers. 5. Write an 8086 ALP to print ‘n’ Fibonacci numbers. B. Programs using string instructions 1. Write an 8086 ALP to compare two strings using string instructions and display appropriate messages. 2. Write an 8086 ALP to reverse a given string. Display the reversed string and check whether it is a palindrome. 3. Write an 8086 ALP to search for the sub string in the given string, print the number of occurrences and positions of the sub string. 4. Write an 8086 ALP to search for the sub string in the given string, delete only the second occurrence and display the result. 5. Write an 8086 ALP to search for the sub string in the given string, replace all its occurrences with another string of same length as sub string and display the result. C. Programs using Procedure 1. Write an 8086 ALP to generate the first ‘n’ Fibonacci numbers using recursion. 2. Write an 8086 ALP program to find the largest and smaller number from the array of numbers. 3. Write an 8086 ALP to perform the following conversions: a. Decimal to Binary b. Decimal to Hexadecimal 2. Write an 8086 ALP that reads a list of numbers and makes a count of a. Even and Odd numbers. b. Numbers grater than 10. 5. Write an 8086 ALP to ‘n’ elements in a given array in ascending order using a. Selection Sort b. Bubble Sort c. Insertion Sort. D. Programs using Stack 1. Write an 8086 ALP to find the factorial on ‘n’. 2. Write an 8086 ALP to compare two strings without using string instructions and display appropriate messages. 3. Write an 8086 ALP that reads a list of numbers and makes a count of a. Even and Odd numbers. b. Numbers grater than 10. 2. Write an 8086 ALP to perform the following conversions: a. Decimal to Binary b. Decimal to Hexadecimal c. Decimal to Octal 5. Write an 8086 ALP to search for given key in an ‘n’ number of elements using linear search. E. Programs using macros 1. Write an 8086 ALP to find square of a number. 2. Write an 8086 ALP to multiply content of AX by 10 without using multiply instruction. 3. Write an 8086 ALP program to find the largest and smaller number from the array of numbers. 4. Write an 8086 ALP to perform the following conversions: (i) Binary to Decimal (ii) Binary to Octal (iii) Binary to Hexadecimal. 5. Write an 8086 ALP that reads a list of numbers and makes a count of (i) +ve and –ve numbers. F. Programs using BIOS and DOS interrupt 1. Write an 8086 ALP to display the horizontal and vertical position of the mouse. The positions are updated when the mouse is moved around. Program exits when the left mouse button is pressed or ‘q’ is pressed. 2. Write an 8086 ALP to read password and validate the user. For this there should be a file containing valid users and their passwords, the entry made by the user must be compared with this file. 3. Write an 8086 ALP to accept a file name, if present user should be allowed to rename, delete according to his choice. 4. Write an 8086 ALP to read your name from the keyboard and display it at a specified location on the screen in front of the message What is your name? You must clear the entire screen before display. 5. Write an 8086 ALP to read the current time and date from the system and display it in the standard format on the screen. 6. Write an 8086 ALP to get the screen width (no of cols) using BIOS interrupt, and calculate the no of rows from the appropriate word location in BIOS data area, and clear the screen using BIOS interrupt. 7. Using BIOS routine, write an 8086 ALP to find memory size of the PC you are using. Using appropriate message, the display should indicate memory size in Kilo bytes using 4 hex digits. Also check the result with the appropriate word in BIOS data area using debug/codeview. 8. Write an 8086 ALP to display the command line parameters, and the total length of the parameters using DOS interrupts. 9. Write an 8086 ALP which checks whether the printer is online. If it is online, print a message on the printer using DOS interrupt, else display printer status on CRT. 2. E.i Square of a word .MODEL SMALL .DATA Number DW 3h Ans DW 2 DUP (?) .CODE MOV AX,@DATA MOV DS, AX MOV DX, 00h MOV AX, Number MUL Number MOV Ans, AX MOV AH, 4Ch INT 21h END
2. E.ii Cube of a byte
.MODEL SMALL .DATA Number DB 2h Ans DW 2 DUP (0) .CODE MOV AX,@DATA MOV DS, AX MOV AX, 0000h MOV DX, 0000h MOV CX, 0000h MOV CL, Number MOV AL, CL MUL CL MUL CX MOV Ans, AX MOV AH, 4Ch INT 21h END