Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- ori $4, $0, 30
- ori $5, $0, 15
- jal subroute
- ori $4, $0, 25
- ori $5, $0, 35
- jal subroute
- ori $4, $0, 210
- ori $5, $0, 28
- jal subroute
- ori $4, $0, 49
- ori $5, $0, 42
- jal subroute
- ori $4, $0, 17
- ori $5, $0, 3
- jal subroute
- ori $4, $0, 17
- ori $5, $0, 51
- jal subroute
- j exit #ends programm
- subroute:
- or $2, $0, $5
- ori $3, $0, 1
- #start of the algorithm
- beq $4, $0, end
- gt5:
- beq $5, $0, gt9
- slt $1, $5, $4 #r4 > r5
- beq $1, $3, ins1
- j ins2
- avoidgt10:
- j end #jump to end
- gt9
- or $2, $0, $4
- ins1:
- sub $4, $4, $5
- j gt5
- ins2:
- sub $5, $5, $4
- end:
- jr $ra
- exit:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement