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
Get step-by-step solutions from verified subject matter experts
