这似乎应该工作,但显然没有。当我尝试计算字符串的长度时,它会返回一些疯狂的长整数。当我一步一步的程序,它工作正常,但打印出错误的数字。有人能让我回到正轨,以便我可以在下一个功能上工作吗?我只需要弄清楚什么是摆脱计数 ############################################
# Program Name: strings.s
# Programmer: David
我正在编写一个程序,询问用户他们有哪个温度,然后接受该输入并转换并输出所有四种温度。我需要帮助让我的用户输入读入,以便它可以在我的分支beq中工作。我无法让它识别输入'f'等于存储的版本。 .data
temptype: .asciiz "Enter temperature type i.e. f, c, k, r: "
tempdegree: .asciiz "\n Enter degre
我试图将C代码转换为MIPS代码。 int main() {
int a;
int b;
int result = 0;
if (a != b)
result = test(a, b);
else
result = a + b;
return result;
}
int test(int a, int b) {
我们正在研究MIPS汇编(我想这个问题可以适用于装配虽然在一般),老师向我们介绍了帧指针。 如果我有一个函数序言,我用来直接做堆栈指针: addiu $sp, $sp, -8 ; alloc 2 words in the stack
sw $s0, 4($sp) ; save caller function $s0 value in the stack
sw $ra, ($sp) ; sa
所以我使用QtSpim来为我的学校运行我的mips程序。我基本上做了一个工作程序,但现在我不断收到异常错误。我试着减少我的代码,所以这里是错误现在开始的地方。 .text
.globl main
main:
.data
message1: .asciiz "The maximum is "
message2: .asciiz "The summation is "