Write the following code in ARM 64 bit assembly. Be sure to follow C calling conventions.

Part 1


long strlen(char *s) {
    long len = 0;
    while (*s) {
        ++len;
        ++s;
    }
    return len;
}

Part 2


char toupper(char ch) {
    if (ch >= 'a' && ch <= 'z')
        return ch - 'a' + 'A';
    return ch;
}

char *toupper_s(char *s) {
    char *ret = s;

    while (*s) {
        *s = toupper(*s);
        ++s;
    }

    return ret;
}
Submission link

Dos and Dont's