Question: 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

 Exercise 1: Write an ARM assembly language program that scans a

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 rO to a destination pointed at by r1 AREA scan, CODE, READWRITE Entry ADR r0, Stringl ADR rl, String2 :r0 points to the source string :rl points to the dest string r2, [r01,#1 r2, [r1],#1 r2 , #0x00 Copy #0x123456 ; read a byte and update pointer ; copy the byte and update ptr ; test for terminator repeat until terminator found ; stop Copy LDRB STRB CMP BNE SVC Stringl DCB "this is a string", 0x00 String2 SPACE 20 : dummy string ireserve 20 bytes for copy END 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 rO contains a 0 if the string is not a palindrome and 1 if it is 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 rO to a destination pointed at by r1 AREA scan, CODE, READWRITE Entry ADR r0, Stringl ADR rl, String2 :r0 points to the source string :rl points to the dest string r2, [r01,#1 r2, [r1],#1 r2 , #0x00 Copy #0x123456 ; read a byte and update pointer ; copy the byte and update ptr ; test for terminator repeat until terminator found ; stop Copy LDRB STRB CMP BNE SVC Stringl DCB "this is a string", 0x00 String2 SPACE 20 : dummy string ireserve 20 bytes for copy END 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 rO contains a 0 if the string is not a palindrome and 1 if it is

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!