Question: I need help with the following code. Right now it takes the input of 3 numbers and places them in numeric order with no spaces.

I need help with the following code. Right now it takes the input of 3 numbers and places them in numeric order with no spaces. So for example:

Input: 4 9 3

Output: 3 4 9

I want the output to be the following to be more clear: Smallest 3, Medium 4, Largest 9

Here is the code written in assembly in Pep8:

BR main

n1: .BLOCK 2 ;#2d

n2: .BLOCK 2 ;#2d

n3: .BLOCK 2 ;#2d

;

main: DECI n2,d

DECI n3,d

LDA n2,d

CPA n3,d

BRLT L1

DECI n1,d

LDA n1,d

CPA n3,d

BRLT L7

BR L6

STA n3,d

L1: DECI n1,d

LDA n2,d

CPA n1,d

BRLT L5

DECO n1,d

DECO n2,d

L2: DECO n3,d

STOP

L3: DECO n2,d

DECO n3,d

BR L9

L4: DECO n1,d

DECO n2,d

STOP

STA n1,d

L5: LDA n3,d

CPA n1,d

BRLT L3

DECO n2,d

DECO n1,d

BR L2

L6: DECO n3,d

LDA n1,d

CPA n2,d

BRLT L4

BR L8

L7: DECO n1,d

DECO n3,d

DECO n2,d

STOP

L8: DECO n2,d

L9: DECO n1,d

STOP

.END

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!