0% found this document useful (0 votes)
13 views

ARM Problem Sheet

Uploaded by

2024eem005.tarun
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

ARM Problem Sheet

Uploaded by

2024eem005.tarun
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Department of Electrical Engineering

Indian Institute of Engineering Science and Technology, Shibpur

ARM Assembly Language Programming Exercises

1. Addition/Subtraction of two byte/half word/word numbers. It is assumed that the


first number is stored in memory location ALPHA and the second number in BETA.
The result of the addition will be stored in GAMMA.

2. Evaluate (A + 8B + 7C - 27)/4 where A, B, C are three 32 bit numbers stored in


consecutive memory locations starting from ALPHA. The result will be stored in the
next memory space.

3. Addition of 10(D) 16 bit numbers stored in consecutive memory locations starting


from ALPHA. Store the result in R0.

4. Determine the number of negative numbers in a block of 32-bit signed binary


numbers. The length of the block is in memory location 0x4000 and the block itself
starts from location 0x4100. Store the number of negative and positive (including zero)
numbers in memory locations 0x4010 and 0x4020 respectively.

5. Determine the largest number in a block of 32-bit signed binary numbers. The
length of the block is in memory location 0x4000 and the block itself starts from
location 0x4100. Store the largest number in memory location 0x4010.

6. Count the number of ‘1’ and ‘0’ bits in the 32 bit number stored in memory location
0x1000. Store the number of ‘1’ bits in memory location 0x1001 and ‘0’ bits in
memory location 0x1002.

7. Find the factorial of a 8 bit number stored in register R0. Store the result in R1.

8. Find the parity of a 32 bit number stored in memory location ALPHA. Store 01 in
R0 if the parity is even, otherwise store 00 in the same register.

9. Consider two arrays of 32 bit numbers stored in consecutive memory locations starting
from ALPHA and BETA respectively. The length of the arrays is stored in R2.
Compare the two arrays to check whether they are the same. Store 01 in R0 if the
two arrays match, otherwise store 00 in the same register.

10. Consider two arrays (X and Y) of 32 bit numbers stored in consecutive memory
locations starting from ALPHA and BETA respectively. The length of the arrays is stored
in R2. Evaluate  XiYi. Store the result in R4.

You might also like