Q:

Strcmp() function realization on C

I need to make an strcmp function by myself, using operations with pointers. That's what I got: 
int mystrcmp(const char *str1, const char *str2) {
    while ('\0' != *str1 && *str1 == *str2) {
        str1 += 1;
        str2++;
    }
    int result1 = (uint8_t)(*str2) - (uint8_t)(*str1); // I need (uint8_t) to use it with Russian symbols.
    return result1;
}

But my tutor told me that there are small mistake in my code. I spend really lot of time making tests, but couldn't find it.

A:

Does this answer the question of what you're doing wrong?
#include <stdio.h>
#include <stdint.h> 
#include <string.h>

int mystrcmp(const char *str1, const char *str2);

int main(void)
{
    char* javascript = "JavaScript";
    char* java = "Java";

    printf("%d\n", mystrcmp(javascript, java));
    printf("%d\n", strcmp(javascript, java));
    return 0;
}

int mystrcmp(const char *str1, const char *str2) {
    while ('\0' != *str1 && *str1 == *str2) {
        str1 += 1;
        str2++;
    }
    int result1 = (uint8_t)(*str2) - (uint8_t)(*str1); // I need (uint8_t) to use it with Russian symbols.
    return result1;
}

Output:
-83
 83

I'll propose a quick fix:  
Change  
int result1 = (uint8_t)(*str2) - (uint8_t)(*str1);

To  
int result1 =  (uint8_t)(*str1) - (uint8_t)(*str2);

And why you were wrong:
The return values of strcmp() should be:

if Return value < 0 then it indicates str1 is less than str2.
if Return value > 0 then it indicates str2 is less than str1.
if Return value = 0 then it indicates str1 is equal to str2.

And you were doing exactly the opposite.

A:

@yLaguardia well answered the order problem.
int strcmp(const char *s1, const char *s2);

The strcmp function returns an integer greater than, equal to, or less than zero, accordingly as the string pointed to by s1 is greater than, equal to, or less than the string pointed to by s2. C11dr §7.24.4.2 3

Using uint8_t is fine for the vast majority of cases.  Rare machines do not use 8-bit char, so uint8_t is not available.  In any case, it is not needed as unsigned char handles the required unsigned compare.  (See below about unsigned compare.)
int result1 = 
    ((unsigned char)*str1 - (unsigned char)*str2);

Even higher portable code would use the following to handle when char range and unsigned range match as well as all other char, unsigned char, int, unsigned sizes/ranges.
int result1 = 
    ((unsigned char)*str1 > (unsigned char)*str2) - 
    ((unsigned char)*str1 < (unsigned char)*str2);

strcmp() is defined as treating each character as unsigned char, regardless if char is signed or unsigned.  

... each character shall be interpreted as if it had the type
  unsigned char ... C11 §7.24.1 3

Should the char be ASCII or not is not relevant to the coding of strcmp().  Of course under different character encoding, different results may occur.  Example: strcmp("A", "a") may result in a positive answer (seldom used EBCDIC) with one encoding, but negative (ASCII) on another.

