Question: Study Questions ( Chapter 0 3 Part E ) 1 . Question 3 . 1 5 on page 2 2 4 : Write an ARM

Study Questions (Chapter 03 Part E)
1. Question 3.15 on page 224: Write an ARM assembly language routine to count the number of 1s in a 32bit
word in r0 and return the result in r1.
2. Question 3.16 on page 224: A word consists of the bytes b4, b3, b2, b1. Write an ARM assembly language
function to reorder (transpose) these bytes in the order b1, b3, b2, b4.
3. Question 3.22 on page 224: Write ARM code to implement the following C operation.
int s =0;
for ( i =0; i <10; i++){
s = s + i*i;)
4. Question 3.39 on page 225: Write an ARM assembly language program that scans a string terminated by
the null byte 0x00 and copies the string from a source location pointed at by r0 to a destination pointed at
by r1.
5. Write an ARM assembly language program to count the number of characters in a nullterminated string
(STRING1) and store the result in memory at the location identified by label length.
You may want to define the data of the program as follow:
STRING1 DCB "This is a test string1" ;String1
EoS1 DCB 0x00 ;end of string1
length DCD 0x00 ;to store the calculated string length
6. Write an ARM assembly language program to concatenate two nullterminated strings (STRING1 and STRING2)
and store the result in another nullterminated STRING3. Assume that the length of STRING1+ the length of
STRING2<=255.
You may want to define the strings as follow:
STRING1 DCB "This is a test string1" ;String1
EoS1 DCB 0x00 ;end of string1
STRING2 DCB "This is a test string2" ;String
EoS2 DCB 0x00 ;end of string2
STRING3 space 0xFF

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!