Convert C++ to MIPS assembly

后端 未结 3 1382
说谎
说谎 2021-01-21 12:06

This code is about to find maximum element from an array i want to convert this code into MIPS assembly code can anyone help me...Or just tell me how to initialize an array in M

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-21 12:18

        .data   # variable decleration follow this line
    
    array1: .word   2, 3, 421, 4, 32, 4, 3, 1, 4, 5 #10 element array is declared
    max:    .word   2
    
    la  $t0, array1         #load base address of array1
    main:                       #indicated the start of the code
    #to access an array element ($t0), 4($t0), 8($t0)..........
    

提交回复
热议问题