所以這是我迄今爲止我不知道從哪裏去分支或只是打印出答案。我試圖打印出來的消息,但無濟於事。有沒有辦法使用slt和分支? .data
message1: .asciiz "The number is less than. :"
message2: .asciiz "/nThe number is greater than. :"
.text
main:
a
我想了解我的CS類的MIPS彙編語言。我正努力在語法上試圖編寫這個程序。我看了我的教授給我們的另一個例子,我緊緊跟隨它。我在我的分支上遇到了一個不對等的錯誤。代碼如下。 # Main program that will call subroutine fib to calculate the fibonacci and
# print the result
.text
.globl main
我能夠獲得用戶輸入,如我的代碼所示,但我絕望地無法獲得最小的數字。 非常感謝... 下面是對此的說明。 「編寫一個彙編程序,從用戶讀取三個32位有符號整數,確定這三個數中最小的一個並顯示此結果,不要使用循環,提示用戶輸入每個整數。 .data
Msg1: .asciiz "Enter the first integer: "
Msg2: .asciiz "Enter the second in
我試圖將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) {