CASE2:
la $t9, ARRAY # Load base address of array into $t9
li $t8, 36 # Initialize loop counter to 36
LOOP:
la $a0, Prompt2 # Load Prompt2 string into $a0.
li $v0, 4 # system call to print string Prompt2.
syscall
li $v0, 12 # read character input.
syscall
move $t8($t9), $v0 # move input character to an array element.
la $a0, $t8($t9) # load array element into $a0.
li $v0, 11 # system call to print array element.
syscall
addi $t8, $t8, -4 # decrement loop counter.
bgtz $t8, LOOP
la $a0, MSG2 # load MSG2 string into $a0.
li $v0, 4 # system call to print MSG2 string.
syscall
LOOP2:
la $a0, $t8($t9) # load element of array into $a0.
li $v0, 11 # system call to print char.
addi $t8, $t8, 4 # increment $t8.
blt $t8, 36, LOOP2 # branch if $t8 is less than 36
j EXIT # when $t8 reaches 36 jump to EXIT.
.data
Prompt2:.asciiz "\nEnter a character: "
ARRAY: .space 10 # 10 bytes of storage to hold an array of 10 characters
この配列を機能させるのに問題があります。入力から10文字を読み取り、読み取った直後に印刷してから、配列を逆方向に印刷するとします。どんな助けでもいただければ幸いです。