Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.

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 3 Enter a number 2 Enter a number 5 Enter a number 0 Sorted Array 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Identify communication barriers and describe ways to remove them.

Answered: 1 week ago