Vous êtes sur la page 1sur 5

1

  TEXTBOOK SOLUTIONS EXPERT Q&A Search  

home / study / engineering / computer science / computer science questions and answers / 1. write a mips assembly language program that asks …

Question: 1. Write a MIPS assembly language program that asks the use… Post a question
Answers from our experts for your toug
homework questions

1. Write a MIPS assembly language program that asks the user for 20 integers, bubblesorts them, and then Enter question
prints them out in ascending order.
2. When printing you will need to add a space between each number printed.

Continue to post
Expert Answer 10 questions remaining

gaurav answered this


Was this answer helpful? 0 0
247 answers

Mips:
My Textbook Solutions
$LC0:

.ascii "Enter 20 integers\000"

$LC1:

.ascii "%d\000"
Computer... A Practical Elect
$LC2: Guide to... Mach
5th Edition 3rd Edition 2nd E
.ascii "Sorted list in ascending order: \000" (50)

View all solutions


$LC3:

.ascii "%d \000"

main: Computer Science Cheg


addiu $sp,$sp,-448 tutors who can help righ
sw $31,444($sp) now
sw $fp,440($sp)
Swati J.
RGPV University
move $fp,$sp

lui $2,%hi($LC0) Dhiraj K.


Birla Institute of Tec…
addiu $4,$2,%lo($LC0)

jal puts Derek R.


Florida Atlantic Univ…
nop

sw $0,24($fp) Find me a tutor


$L3:

lw $2,24($fp)

nop

slt $2,$2,21

beq $2,$0,$L2

nop

addiu $3,$fp,36

lw $2,24($fp)

nop

sll $2,$2,2

addu $2,$3,$2

move $5,$2

lui $2,%hi($LC1)

addiu $4,$2,%lo($LC1)

jal scanf

nop

lw $2,24($fp)

nop
addiu $2,$2,1

sw $2,24($fp)

b $L3

nop

$L2:

sw $0,24($fp)

$L8:

lw $2,24($fp)

nop

slt $2,$2,20

beq $2,$0,$L4

nop

sw $0,28($fp)

$L7:

li $3,20 # 0x14

lw $2,24($fp)

nop

subu $3,$3,$2

lw $2,28($fp)

nop

slt $2,$2,$3

beq $2,$0,$L5

nop

lw $2,28($fp)

nop

sll $2,$2,2

addiu $3,$fp,24

addu $2,$3,$2

lw $3,12($2)

lw $2,28($fp)

nop

addiu $2,$2,1

sll $2,$2,2

addiu $4,$fp,24

addu $2,$4,$2

lw $2,12($2)

nop

slt $2,$2,$3

beq $2,$0,$L6

nop

lw $2,28($fp)

nop

sll $2,$2,2

addiu $3,$fp,24

addu $2,$3,$2

lw $2,12($2)

nop

sw $2,32($fp)

lw $2,28($fp)
nop

addiu $2,$2,1

sll $2,$2,2

addiu $3,$fp,24

addu $2,$3,$2

lw $3,12($2)

lw $2,28($fp)

nop

sll $2,$2,2

addiu $4,$fp,24

addu $2,$4,$2

sw $3,12($2)

lw $2,28($fp)

nop

addiu $2,$2,1

sll $2,$2,2

addiu $3,$fp,24

addu $2,$3,$2

lw $3,32($fp)

nop

sw $3,12($2)

$L6:

lw $2,28($fp)

nop

addiu $2,$2,1

sw $2,28($fp)

b $L7

nop

$L5:

lw $2,24($fp)

nop

addiu $2,$2,1

sw $2,24($fp)

b $L8

nop

$L4:

lui $2,%hi($LC2)

addiu $4,$2,%lo($LC2)

jal printf

nop

sw $0,24($fp)

$L10:

lw $2,24($fp)

nop

slt $2,$2,21

beq $2,$0,$L9

nop

lw $2,24($fp)

nop
sll $2,$2,2

addiu $3,$fp,24

addu $2,$3,$2

lw $2,12($2)

nop

move $5,$2

lui $2,%hi($LC3)

addiu $4,$2,%lo($LC3)

jal printf

nop

lw $2,24($fp)

nop

addiu $2,$2,1

sw $2,24($fp)

b $L10

nop

$L9:

move $2,$0

move $sp,$fp

lw $31,444($sp)

lw $fp,440($sp)

addiu $sp,$sp,448

j $31

nop


View comments (1)

Practice with similar questions

Q: 1.Write a MIPS assembly language program that asks the user for 20 integers, bubblesorts them, and then prints them
out in ascending order. 2. When printing you will need to add a space between each number printed.

A: See answer 100% (2 ratings)

Q: 1.Write a MIPS assembly language program that asks the user for 20 integers, bubblesorts them, and then prints them
out in ascending order. 2. When printing you will need to add a space between each number printed.

A: See answer 100% (1 rating)

Show more 
ABOUT CHEGG LEGAL CHEGG PRODUCTS AND SERVICES CHEGG NETWORK CUSTOMER SERVICE

Become a Tutor Advertising Choices Cheap Textbooks Online Tutoring CareerMatch Customer Service
Chegg For Good Cookie Notice Chegg Coupon Sell Textbooks Easybib Give Us Feedback
College Marketing General Policies Updated Chegg Play Solutions Manual Internships.com Help with Chegg Tutors
Corporate Development Intellectual Property Rights Chegg Study Help Study 101 Studyblue Help with eTextbooks
Investor Relations International Privacy Policy College Textbooks Test Prep Help to use EasyBib Plus
Jobs Terms of Use Updated eTextbooks Textbook Rental Manage Chegg Study
Join Our Affiliate Program Chegg Tutors Terms of Chegg Math Solver Used Textbooks Subscription

Media Center Service Mobile Apps Digital Access Codes Return Your Books

Site Map US Privacy Policy Textbook Return Policy


Your CA Privacy Rights

© 2003-2019 Chegg Inc. All rights reserved.

Vous aimerez peut-être aussi