Write assembly language programs for the following using MASAM.
1. Write assembly language programs to evaluate the expressions:
i) a = b + c –d * e
ii) z = x * y + w – v +u / k
a. Considering 8-bit, 16 bit and 32 bit binary numbers as b, c, d, e.
b. Considering 2 digit, 4digit and 8 digit BCD numbers.
Take the input in consecutive memory locations and results also. Display the results by using “int xx” of 8086. Validate program for the boundary conditions.
2. Write an ALP of 8086 to add two exponential numbers which are in IEEE 754 notationDisplay the results by using “int xx” of 8086. Validate program for the boundary conditions.
3. Write an ALP of 8086 to take N numbers as input. And do the following operations on them.
a) Arrange in ascending and Descending order.
b) Find max and minimum
c) Find average Considering 8-bit, 16 bit binary numbers and 2 digit, 4digit and 8 digit BCD numbers.Display the results by using “int xx” of 8086. Validate program for the boundary conditions.
4. Write an ALP of 8086 to take a string of as input (in ‘C' format)and do the following Operations on it.
a) Find the length b) Find it is Palindrome or not
c) Find whether given string substring or not.
d) Reverse a string e) Concatenate by taking another sting
Display the results by using “int xx” of 8086.
5. Write the ALP to implement the above operations as procedures and call from the main procedure.
6. Write an ALP of 8086 to find the factorial of a given number as a Procedure and call from the mainprogram which display the result.
7. Write an assembly language program to encrypt digits as shown below:
Input digit : 0 1 2 3 4 5 6 7 8 9
Encrypted digit : 4 6 9 5 0 3 1 8 7 2
Your program should accept a string consisting of digits. The encrypted string should be displayedusing “int xx” of 8086.
8. Write a procedure to locate a character in a given string. The procedure receives a pointer to a string and character to be located. When the first occurrence of the character is located , its position is returned to main. If no match is found , a negative value is returned. The main procedure requests a character string and a character to be located and displays the result.
9. Write an assembly language program to read a string of characters from the user and that prints the vowel count . Display the results by using “int xx” of 8086. ex. Input : Advanced Programming in UNIX
Out put:
Vowel count
a or A 3
e or E 1
i or I 3
o or O 1
u or U 1
10. A computer uses RAM chips of 1024 X 1 capacity.
a) How many chips are needed, and how should their address lines be connected to provide a memory capacity of 1024 bytes?
b) How many chips are needed to provide a memory capacity of 16K bytes?
11. A computer employs RAM chips of 256X8 and ROM chips of 1024 X 8. The computer needs 2K bytes of RAM, 4K bytes of ROM, and four interface units, each with four registers. A memory-mapped I/O configuration is used. The two highest-order bits of the address bus are assigned 00 for RAM, 01 for ROM, 10 for interface registers.
a. How many RAM and ROM chips are needed?
b. Draw a memory-address map for the system.
c. Give the address range in hexadecimal for RAM, ROM and interface.
12. Obtain the complement function for the match logic of one word in an associative memory. Draw the logic diagram for it and compare with the actual match logic diagram.
13. A two-way set associative cache memory uses blocks of four words. The cache can accommodate a total of 2048 words from main memory. The main memory size is 128K X 32.
a. Formulate all pertinent information required to construct the cache memory.
b. What is the size of the cache memory?
14. A digital computer has a memory unit of 64K X 16 and a cache memory of 1K words. The cache uses direct mapping with a block size of four words.
a. How many bits are there in each word of cache, and how are they divided into functions? Include a valid bit.
b. How many bits are there in the tag, index, block, and word fields of the address format?
c. How many blocks can the cache accommodate?
15. An address space is specified by 24 bits and the corresponding memory space by 16 bits.
a. How many words are there in the address space?
b. How many words are there in the memory space?
c. If a page consists of 2K words, how many pages and blocks are there in the system.
16. A virtual memory has a page size of 1K words. There are eight pages and four blocks. The associative memory page table contains the following entries. Make a list of all virtual addresses(in decimal) that will cause a page fault.
Page Block
0 3
1 1
4 2
6 0