MIPS instructions - PowerPoint PPT Presentation

About This Presentation
Title:

MIPS instructions

Description:

MIPS instructions – PowerPoint PPT presentation

Number of Views:63
Avg rating:3.0/5.0
Slides: 4
Provided by: Zhen67
Learn more at: http://www.cs.fsu.edu
Category:

less

Transcript and Presenter's Notes

Title: MIPS instructions


1
MIPS instructions
2
Writing a bubble sort code
3
The code we wrote in the class
.data array .word 12, 34, 67, 1, 45, 90, 11,
33, 67, 19 msg_done .asciiz "bubble sort
done\n" .text .globl main main la s7,
array li s0, 0 i li s6, 9 N-1 li s1, 0
j loop sll t7, s1, 2 add t7, s7, t7
got the address of Aj lw t0, 0(t7) t0 is
Aj lw t1, 4(t7) t1 is Aj1 sub t2,
t0, t1 bgtz t2, noordoneswap sw t1, 0(t7)
t0 is Aj sw t0, 4(t7) t0 is
Aj1 noordoneswap addi s1, s1, 1 sub
s5, s6, s0 s3 is N-i-1 bne s1, s5,
loop addi s0, s0, 1 li s1, 0 j bne s0,
s6, loop done li v0,4 la
a0,msg_done syscall jr ra
Write a Comment
User Comments (0)
About PowerShow.com