MIPS, wie zum speichern der Benutzer-Eingabe und drucken Sie es aus

was soll ich tun das problem ist, ich brauche zum speichern dieser Wert, und drucken Sie eine matrix, die ein Benutzer bittet um Eingabe der Anzahl der Zeilen, Spalten und den Wert der Elemente , die ich jetzt gar nicht wissen, ob ich das drucken/speichern Teil Recht, ich habe versucht, drucken Sie eine einzelne Zeichenfolge, die eingegeben, aber es funktioniert nicht

    .text
    .globl main

main:
addi $v0, $0, 4   
la   $a0, str1 
syscall             #printing str1 
addi $v0, $0, 5   
syscall 
la $t1, M1_1
sw $v0, 0($t1)      #reading and storing the number of rows 

addi $v0, $0, 4   
la   $a0, str2 
syscall             #printing str2 
addi $v0, $0, 5   
syscall 
la $t2, M1_2
sw $v0, 0($t2)      #reading and storing the number of columns   

addi $v0, $0, 4   
la   $a0, str3 
syscall             #printing str3 
addi $v0, $0, 5   
syscall 
la $t3, M1_3
sw $v0, 0($t3)      #reading and storing the value of element   


    .data


str1:.asciiz "\“Please enter the number of rows in the matrix\n"
str2:.asciiz "\“Please enter the number of columns\n"
str3:.asciiz "\“Please enter the elements of the matrix\n"
.align 2
M1:.space 256 
M1_1:.space 4
M1_2:.space 4
M1_3:.space 4
M2:.space 256 
M2_2:.space 4
Hast du einen debugger oder emulator, um zu versuchen, den code aus?

InformationsquelleAutor user2247155 | 2013-04-25

Schreibe einen Kommentar