PRINT_INT = 1 PRINT_STR = 4 READ_INT = 5 READ_STR = 8 PRINT_CHAR = 11 N_ROWS = 6 N_COLS = 12 # int row, col; # outer_loop_init: # row = 0; # outer_loop_cond: # if(row >= N_ROWS) # goto end_outer_loop; # inner_loop_init: # col = 0; # inner_loop_cond: # if (col >= N_COLS) # goto end_inner_loop; # inner_loop_body: # printf("%c", flag[row][col]); # inner_loop_inc: # col++; # goto inner_loop_cond; # end_inner_loop: # printf("\n"); # row++; # goto outer_loop_cond; # end_outer_loop: # return (0); .text main: out_loop_init: li $t0, 0 outer_loop_cond: inner_loop_init: li $t1, 0 inner_loop_cond: inner_loop_body: #offset = row * N_COLS+ col inner_loop_inc: end_inner_loop: end_out_loop: li $v0, 0 # jr $ra # return 0; .data flag: .byte '#', '#', '#', '#', '#', '.', '.', '#', '#', '#', '#', '#', .byte '#', '#', '#', '#', '#', '.', '.', '#', '#', '#', '#', '#', .byte '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', .byte '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', .byte '#', '#', '#', '#', '#', '.', '.', '#', '#', '#', '#', '#', .byte '#', '#', '#', '#', '#', '.', '.', '#', '#', '#', '#', '#' # char flag[N_ROWS][N_COLS] = { # {'#', '#', '#', '#', '#', '.', '.', '#', '#', '#', '#', '#'}, # {'#', '#', '#', '#', '#', '.', '.', '#', '#', '#', '#', '#'}, # {'.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'}, # {'.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'}, # {'#', '#', '#', '#', '#', '.', '.', '#', '#', '#', '#', '#'}, # {'#', '#', '#', '#', '#', '.', '.', '#', '#', '#', '#', '#'} # };