Question: The stringcmp.c describes a MISRA - C compliant implementations on ARM LPC 1 7 xx processor. Please write an ARM assembly language to implement the

The stringcmp.c describes a MISRA-C compliant implementations on ARM LPC17xx processor. Please write an ARM assembly language to implement the code. If you use any registers other than r0-r3, you need to save them in the stack, (using instructions push {r4-r7}, for example to save registers r4, r5, r6, and r7, pop{r4-r7) is the instruction to restore them). In your main.c function, please run the stringcmp results for the following strings.
stringcmp("abc", "def")0
stringcmp("abc", "abcd")0// null character is less than 'd'
stringcmp("abc", "ABC")>0//'a'>'A' in ASCII
stringcmp("abc", "abc")==0
The C code in main.c looks like this,
printf("comparions abc def %4d
", stringcmp("abc","def"));
printf("comparions abc abcd %4d
", stringcmp("abc","abcd"));
printf("comparions abc ABC %4d
", stringcmp("abc","ABC"));
printf("comparions abc abc %4d
", stringcmp("abc","abc"));
 The stringcmp.c describes a MISRA-C compliant implementations on ARM LPC17xx processor.

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!