Question: How would this C program be written in ARM assembly? #include lpc17xx.h int8_t stringcmp (const uint8_t *s1, const uint8_t *s2) { while ((*s1 != '0')

How would this C program be written in ARM assembly?

#include "lpc17xx.h" int8_t stringcmp (const uint8_t *s1, const uint8_t *s2) { while ((*s1 != '\0') && (*s2 != '\0')) { if (*s1 != *s2) { break; } else { s1++; s2++; } } return (int8_t)( (int16_t)*s1 - (int16_t)*s2 ); }

I understand that the character comparisons would be done by subtracting the ASCII values with each other, but other than that I am not sure what to do.

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!