Question & Answer: Assignment #4: add to code below ALL of this…..

Assignment #4: add to code below ALL of this

please do not answer with the same code i provided in this question. Need help with the storing of the user input then doing the sort.

Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: Assignment #4: add to code below ALL of this…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
Order Essay

need code added to accept multiple inputs from user and sort them after!!! ADD necesary code to code provided below

add the prompts for the user to input a number
add a loop for input to continue until zero is entered
sort the array
print out on the screen “Sorted Array”
print out the sorted array, one number per line. Note this will require conversion of binary integers to ASCII.
You will need to use various IO traps for this assignment.

so the output will look something like this

Enter a number <Program output>
3 <User input>
Enter a number <Program output>
2 <User input>
Enter a number <Program output>
5 <User input>
Enter a number <Program output>
0 <User input. Note: this will terminate input>
Sorted Array <Program output>
2
3
5

Thanks!

.ORIG x3000

AND R2,R2,#0

LD R3, FILE

COUNT LDR R0,R3,#0

BRz END_COUNT

ADD R3,R3,#1

ADD R2,R2,#1

BRnzp COUNT

END_COUNT ADD R4,R2,#0

BRz SORTED

OUTERLOOP ADD R4,R4,#-1

BRnz SORTED

ADD R5,R4,#0

LD R3,FILE

INNERLOOP LDR R0,R3,#0

LDR R1,R3,#1

NOT R2,R1

ADD R2,R2,#1

ADD R2,R0,R2

BRnz SWAPPED

STR R1,R3,#0

STR R0,R3,#1

SWAPPED ADD R3,R3,#1

ADD R5,R5,#-1

BRp INNERLOOP

BRnzp OUTERLOOP

SORTED HALT

FILE .FILL x7000

.END

Expert Answer

 

main:
addiu $sp,$sp,-256
sw $31,252($sp)
sw $fp,248($sp)
move $fp,$sp
sw $0,24($fp)
lui $2,%hi($LC0)
addiu $5,$2,%lo($LC0)
lui $2,%hi(std::cout)
addiu $4,$2,%lo(std::cout)
jal std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
nop
addiu $2,$fp,240
move $5,$2
lui $2,%hi(std::cin)
addiu $4,$2,%lo(std::cin)
jal std::basic_istream<char, std::char_traits<char> >::operator>>(int&)
nop
lw $2,240($fp)
nop
beq $2,$0,$L14
nop
lw $3,240($fp)
lw $2,24($fp)
nop
sll $2,$2,2
addiu $4,$fp,24
addu $2,$4,$2
sw $3,16($2)
lw $2,24($fp)
nop
addiu $2,$2,1
sw $2,24($fp)
b $L4
nop
nop
$LBB2 = .
sw $0,28($fp)
lw $3,28($fp)
lw $2,24($fp)
nop
slt $2,$3,$2
beq $2,$0,$L5
nop
$LBB3 = .
$LBB4 = .
sw $0,32($fp)
lw $3,24($fp)
lw $2,28($fp)
nop
subu $3,$3,$2
lw $2,32($fp)
nop
slt $2,$2,$3
beq $2,$0,$L6
nop
lw $2,32($fp)
nop
sll $2,$2,2
addiu $3,$fp,24
addu $2,$3,$2
lw $3,16($2)
lw $2,32($fp)
nop
addiu $2,$2,1
sll $2,$2,2
addiu $4,$fp,24
addu $2,$4,$2
lw $2,16($2)
nop
slt $2,$2,$3
beq $2,$0,$L7
nop
addiu $3,$fp,40
lw $2,32($fp)
nop
sll $2,$2,2
addu $4,$3,$2
lw $2,32($fp)
nop
addiu $2,$2,1
addiu $3,$fp,40
sll $2,$2,2
addu $2,$3,$2
move $5,$2
jal void std::swap<int>(int&, int&)
nop
lw $2,32($fp)
nop
addiu $2,$2,1
sw $2,32($fp)
b $L8
nop
$LBE4 = .
$LBE3 = .
lw $2,28($fp)
nop
addiu $2,$2,1
sw $2,28($fp)
b $L9
nop
$LBE2 = .
lui $2,%hi($LC1)
addiu $5,$2,%lo($LC1)
lui $2,%hi(std::cout)
addiu $4,$2,%lo(std::cout)
jal std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
nop
$LBB5 = .
sw $0,36($fp)
lw $3,36($fp)
lw $2,24($fp)
nop
slt $2,$3,$2
beq $2,$0,$L10
nop
lw $2,36($fp)
nop
sll $2,$2,2
addiu $3,$fp,24
addu $2,$3,$2
lw $2,16($2)
nop
move $5,$2
lui $2,%hi(std::cout)
addiu $4,$2,%lo(std::cout)
jal std::basic_ostream<char, std::char_traits<char> >::operator<<(int)
nop
move $3,$2
lui $2,%hi(std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&))
addiu $5,$2,%lo(std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&))
move $4,$3
jal std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))
nop
lw $2,36($fp)
nop
addiu $2,$2,1
sw $2,36($fp)
b $L11
nop
$LBE5 = .
move $2,$0
move $sp,$fp
lw $31,252($sp)
lw $fp,248($sp)
addiu $sp,$sp,256
j $31
nop
$LFB1026 = .
void std::swap<int>(int&, int&):
addiu $sp,$sp,-24
sw $fp,20($sp)
move $fp,$sp
sw $4,24($fp)
sw $5,28($fp)
lw $2,24($fp)
nop
lw $2,0($2)
nop
sw $2,8($fp)
lw $2,28($fp)
nop
lw $3,0($2)
lw $2,24($fp)
nop
sw $3,0($2)
lw $2,28($fp)
lw $3,8($fp)
nop
sw $3,0($2)
nop
move $sp,$fp
lw $fp,20($sp)
addiu $sp,$sp,24
j $31
nop
$LFB1034 = .
__static_initialization_and_destruction_0(int, int):
addiu $sp,$sp,-32
sw $31,28($sp)
sw $fp,24($sp)
move $fp,$sp
sw $4,32($fp)
sw $5,36($fp)
lw $3,32($fp)
li $2,1 # 0x1
bne $3,$2,$L18
nop
lw $3,36($fp)
li $2,65535 # 0xffff
bne $3,$2,$L18
nop
lui $2,%hi(std::__ioinit)
addiu $4,$2,%lo(std::__ioinit)
jal std::ios_base::Init::Init()
nop
lui $2,%hi(__dso_handle)
addiu $6,$2,%lo(__dso_handle)
lui $2,%hi(std::__ioinit)
addiu $5,$2,%lo(std::__ioinit)
lui $2,%hi(std::ios_base::Init::~Init())
addiu $4,$2,%lo(std::ios_base::Init::~Init())
jal __cxa_atexit
nop
nop
move $sp,$fp
lw $31,28($sp)
lw $fp,24($sp)
addiu $sp,$sp,32
j $31
nop
$LFB1035 = .
_GLOBAL__sub_I_main:
addiu $sp,$sp,-32
sw $31,28($sp)
sw $fp,24($sp)
move $fp,$sp
li $5,65535 # 0xffff
li $4,1 # 0x1
jal __static_initialization_and_destruction_0(int, int)
nop
move $sp,$fp
lw $31,28($sp)
lw $fp,24($sp)
addiu $sp,$sp,32
j $31
nop

Grand Paper Writers
Order NOW For A 10% Discount!
Pages (550 words)
Approximate price: -

Our Advantages

Plagiarism Free Papers

All papers are written by the best professional writers to ensure 100% originality. We always provide plagiarism reports whenever we deliver completed papers.

Free Revisions

All papers by Grand Paper Writers are completed and submitted on time. This timely delivery of papers gives you time to go through the paper before the official deadline.

Title-page

As an additional service, we will provide a title page that precedes the contents of your paper. Here, you will provide your personal details.

Bibliography

We also ensure that we provide an extra page for the references or bibliographies following referencing rules.

Originality & Security

At Grandpaperwriters.com, we guarantee students for the provision of security and original work. All your personal information is handled with confidentiality and is not shared with third parties. Additionally, we ensure that we provide original content with accompanying plagiarism reports to show originality.

24/7 Customer Support

Our customer support team is always available 24/7 to provide instant responses to any queries raised by students.

Try it now!

Calculate the price of your order

We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Grandpaperwriters.com has the best professional essay writers for quality services.

Pricing

Flexible Pricing

Here, a Grandpaperwriters.com, we do not compromise on the time of our clients. We always deliver all completed papers on or before the deadlines.

Communication

Admission Help & Client-Writer Contact

Grandpaperwriters.com provides an interactive portal where students can communicate directly to their writers.

Deadlines

Paper Submission

Here, a Grandpaperwriters.com, we do not compromise on the time of our clients. We always deliver all completed papers on or before the deadlines.

Reviews

Customer Feedback

Grandpaperwriters.com appreciates feedback from our clients to help us improve the delivery of essay writing services. As such, we are constantly changing our policies to ensure maximum customer and writer satisfaction.