首页 > 解决方案 > 带有数组的 MIPS while 循环

问题描述

如何将此 c++ 代码转换为 MIPS 汇编代码?

bool isPalindrome(char str[], int n) {
    for (int i = 0; i < n / 2; i++) {
        // compare the two ends of the string
        if (str[i] == str[n - 1 - i])
            continue; // if they are the same, check the next pair
        else
            return false; // if they are different, return false

    }
    return true;
}

标签: assemblymips

解决方案


推荐阅读