Cooper, CoryW7 LabCS-206 Exercise 1: 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...

1 answer below »
will upload in chat


Cooper, CoryW7 LabCS-206 Exercise 1: 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. NEED EXPLANATION OF THE CODES FOR BOTH EXERCISES ALONG WITH SCREENSHOTS OF THE KEIL SIMULATOR LIKE THE PREVIOUS TWO WEEKS. THE TEMPLATE IS BELOW THIS EXERCISE.   Exercise 2:  Write an ARM assembly language program to determine whether a string of characters with an odd length is a palindrome, for example, mom, under the following constraints: 1. The string of ASIC‐encoded characters is stored in memory. 2. At the start of the program, register r1 contains the address of the first character in the string and r2 contains the address of the last character. On exit from the program, register r0 contains a 0 if the string is not a palindrome and 1 if it is. BELOW IS THE LAST WEEK’S COMPLETED WORK. NEED IT SIMILAR TO THIS. - explanation of code -screenshots Exercise 1 Write ARM code to implement the following C operation. int s = 0; for ( i = 0; i < 10; i++) { s = s + i*i;)   solution: area is used to assemble sumsquares2, code and readwrite then there is entry to use as entry point to the instructions using mov to r0 register to preset to 9 setting mov to r1 register to preset to 0 mla multiplies the values from r0 and r0, adds the value from r1, and stores the product in r1. so the result is a square of r0 is stored in r1 subs r0, r0 subtracts a value from itself with the result bne is used to 'jump' out of the loop end signifies end of the program 10;="" i++)="" {="" s="s" +="" i*i;)=""  ="" solution:="" area="" is="" used="" to="" assemble="" sumsquares2,="" code="" and="" readwrite="" then="" there="" is="" entry="" to="" use="" as="" entry="" point="" to="" the="" instructions="" using="" mov="" to="" r0="" register="" to="" preset="" to="" 9="" setting="" mov="" to="" r1="" register="" to="" preset="" to="" 0="" mla="" multiplies="" the="" values="" from="" r0="" and="" r0,="" adds="" the="" value="" from="" r1,="" and="" stores="" the="" product="" in="" r1.="" so="" the="" result="" is="" a="" square="" of="" r0="" is="" stored="" in="" r1="" subs="" r0,="" r0="" subtracts="" a="" value="" from="" itself="" with="" the="" result="" bne="" is="" used="" to="" 'jump'="" out="" of="" the="" loop="" end="" signifies="" end="" of="" the="">
Answered 3 days AfterMar 03, 2021

Answer To: Cooper, CoryW7 LabCS-206 Exercise 1: Write an ARM assembly language program that scans a string...

Gaurav answered on Mar 06 2021
144 Votes
Cooper, Cory    W7 Lab    CS-206
Exercise 1:
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.
NEED EXPLANATION OF THE CODES FOR BOTH EXERCISES ALONG WITH SCREENSHOTS OF THE KEIL SIMULATOR LIKE THE PREVIOUS TWO WEEKS. THE TEMPLATE IS BELOW THIS EXERCISE.
 
Explanation
AREA is used to assemble data as readwrite and code as read only
Set up labels to allow PC to initialize to starting point of code
Create an address pointer to source string, use R0 for this
Create an address pointer to destination string, use R1 for this
Read a byte from source string pointer and increment pointer to next location
Store the byte to destination string pointer and increment pointer to next location
If read byte is end of string then terminate process else continue
END signifies END of the program
Output screenshot
Exercise 2: 
Write an ARM assembly language...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here