Inha university tashkent


- YOU ARE REQUIRED TO PUT ALL THE FILES IN A FOLDER AND GIVE THE FOLDER NAME - YOUR ID FOLLOWED BY SPLABASSIGNMENT3 (EXAMPLE: U2010100_SPLABASSIGNMENT3)



Yüklə 78,46 Kb.
səhifə3/4
tarix23.12.2023
ölçüsü78,46 Kb.
#154629
1   2   3   4
U2010223 SPLABASSIGNMENT3

- YOU ARE REQUIRED TO PUT ALL THE FILES IN A FOLDER AND GIVE THE FOLDER NAME - YOUR ID FOLLOWED BY SPLABASSIGNMENT3 (EXAMPLE: U2010100_SPLABASSIGNMENT3).


- LATE SUBMISSIONS ARE NOT ENTERTAINED, ADHERE TO THE DEADLINE STRICTLY.

- READ THE QUESTIONS CORRECTLY & CAREFULLY



PART - A : X86-64 ASSEMBLY LANGUAGE PROGRAMMING ON LINUX PRACTICE QUESTIONS
ENTER THE FOLLOWING PROGRAMS USING gedit EDITOR, ASSEMBLE THEM USING GNU as ASSEMBLER, LINK THEM USING ld TO CREATE EXECUTABLE CODE AND EXECUTE THEM
1.Program to print Hello World


2. Program – nextascii.s



3. Program - echolines

4. Program - upper2lower.s

5. Program - prevascii.s


6. Program - arithxy.s



7. Program - fib.s



8. Program - fibio.s

PART - B : X86-64 ASSEMBLY LANGUAGE PROGRAMMING ON LINUX
PROGRAMMING QUESTIONS

Tulaganov Qobil, U2010223, 001. QUESTION NO. 9 ANSWERED BY ME


9. Write an X86-64 assembly language program to read a string of signed decimal number containing maximum 10 digits from the keyboard using system call routine sys_read and convert this to integer form and store it in a register %rax and print this using printf with format specifier %ld.

Tulaganov Qobil


, U2010223, 001. QUESTION NO. 10 ANSWERED BY ME
10. Write an X86-64 assembly language program to read a string of binary number containing maximum 64 bits from the keyboard using system call routine sys_read and convert this to integer form and store it in a register %rax and print this using printf with format specifier %ld.


Tulaganov Qobil


, U2010223, 001. QUESTION NO. 11 ANSWERED BY ME
11. Write an X86-64 assembly language program to read a string of characters of any length (maximum 1024 characters) from the keyboard and check whether the given string is a palindrome or not. If the given string is a palindrome then print that it is palindrome otherwise print it is not a palindrome (use System calls). Assemble using as assembler, link using ld linker and execute on linux system.

Tuganov Sarvar, U2010210, 002. QUESTION NO. 12 ANSWERED BY ME
12. Write an X86-64 assembly language program to read a message (string of characters of any length (maximum 1024 characters)) from the keyboard and perform the following: ENCRYPT the message by adding 10 to every character in the message and store this encrypted message in a separate memory area. Now print the original message and the encrypted message on the screen.


Tuganov Sarvar, U2010210, 002. QUESTION NO. 13 ANSWERED BY ME
13. Write an X86-64 assembly language program to read encrypted message generated in Q12) from the keyboard and perform the following: DECRYPT the message by subtracting 10 from every character in the message and store this decrypted message in a separate memory area. Now print the Encrypted message and the Decrypted message on the screen.




Tuganov Sarvar, U2010210, 002. QUESTION NO. 14 ANSWERED BY ME


14. Write an X86-64 assembly language program to implement Hamming code algorithm suggested by Hamming to detect and correct single bit errors in given Data. You are required to read a Data of M bits (M bits can be 8 to 16 bits). Length(number of bits) of the number must be read from the keyboard first and then read the number containing the specified bits. Your program should determine the number of Check bits (K) required, then compute the check bits values using the hamming code algorithm.

Shomuratov Javokhir, U2010277, 003. QUESTION NO. 15 ANSWERED BY ME


15. Write an X86-64 assembly language program to read a string of characters of any length (maximum 1024 characters) from the keyboard and count the number of alphabets, number of numerals, number of special characters (all characters including space - other than alphabets and numerals), total number of characters and total number of words in the string.









Shomuratov Javokhir, U2010277, 003. QUESTION NO. 16 ANSWERED BY ME


16. Write an X86-64 assembly language program to read a text (string of characters of any length (maximum 1024 characters)) from the keyboard and perform the following operations on the text:
a) Convert all the uppercase alphabets in the text to lowercase and print the output on the screen b) Convert all the lowercase alphabets in the text to uppercase and print the output on the screen c) Convert first letter of every word in the text to uppercase if it is in lowercase and all other letters in every word to lower case and print the output on the screen


Adam Saidov, U2010164, 001. QUESTION NO. 17 ANSWERED BY ME


17. Write an X86-64 assembly language program to find the factorial of a given number n. The input ‘n’ should be read from the keyboard and the output should be printed on the screen.

Adam Saidov, U2010164, 001. QUESTION NO. 18 ANSWERED BY ME


18. Write an X86-64 assembly language program to generate all prime numbers between 1 and n. The input ‘n’ should be read from the keyboard and the output should be printed on the screen.

Shavkatbekov Abdulaziz, U2010259, 003. QUESTION NO. 19 ANSWERED BY ME
19. Write an X86-64 assembly language program to read a list of ‘n’ integers from the keyboard. The input ‘n’ should be read from the keyboard, then read all the elements of the list one after another from the keyboard and store the list of integers in memory. After that display the list of ‘n’ integers in the memory on the screen. Use scanf in your assembly language program to read integers from the keyboard and use printf to display the list of integers.







Shavkatbekov Abdulaziz, U2010259, 003. QUESTION NO. 20 ANSWERED BY ME


20. You are given the following ‘C’ program containing recursive function to count the number of 1’s in a given number x. Write the equivalent recursive function in x86-64 assembly language and Run the program for different values of x and display the result on the screen.

Utkurkhujaev Ayubkhon, U2010224, 001. QUESTION NO. 21 ANSWERED BY ME


21. a) You are given the following ‘C’ program to find the sum and average of the given list of integers specified in the data segment. Also you are required to find the number of occurrences of a given key in the list. Translate the program to extended C (if – goto version) and then write the equivalent function in x86-64 assembly language. Run the program and display the result on the screen.



b) Modify the program in 21 a) to make it a general program which reads the size of the list n, ‘n’ number of elements in the list and key to be searched in the list from the keyboard and print the results for different values of n, different values of elements in the list and different value of key in each case.





Yüklə 78,46 Kb.

Dostları ilə paylaş:
1   2   3   4




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©www.genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə