Question: Please draw flowcharts for the following question. Thanks 2) Write a Little Man program that accepts three values as input and outputs them in order
Please
draw flowcharts for the following question. Thanks
2) Write a Little Man program that accepts three values as input and outputs them in order of size, largest to smallest. (draw flowchart INP//Read the 1st value STA 91// store INP// Read the 2nd value STA 92//store INP // Read in the 3rd value STA 93//store LDA 92// LOOP 1 and STEP 1 SUB 91 // BRP STEP2// if both the r91 and r92 are in order, then don't swap them LDA 92 // start with swapping registers STA 99//temp r92 LDA 91 STA 92/ / r92= r91 LDA 99 STA 91//r91-temp STEP2 LDA 93// LOOP 1 and STEP 2 SUB 92 BRP STEP3// If both the r92 and r93 are in order,then don't swap them LDA 93//start swapping registers STA 99//temp r93 LDA 92 STA 93//r93 r92 LDA 99 STA 92//r92-temp STEP3 LDA 92// LOOP 2 and STEP 1 SUB 91 BRP STEP4 // if both r91 and r92 are in order, then don't swap thenm LDA 92 //start swapping registers STA 99//temp r92 LDA 91 STA 92//r92 r91 LDA 99 STO 91 // r91 = temp STEP4 LDA 91// please Write the sorted values OUT LDA 92 OUT LDA 93 OUT HLT// over/finish 2) Write a Little Man program that accepts three values as input and outputs them in order of size, largest to smallest. (draw flowchart INP//Read the 1st value STA 91// store INP// Read the 2nd value STA 92//store INP // Read in the 3rd value STA 93//store LDA 92// LOOP 1 and STEP 1 SUB 91 // BRP STEP2// if both the r91 and r92 are in order, then don't swap them LDA 92 // start with swapping registers STA 99//temp r92 LDA 91 STA 92/ / r92= r91 LDA 99 STA 91//r91-temp STEP2 LDA 93// LOOP 1 and STEP 2 SUB 92 BRP STEP3// If both the r92 and r93 are in order,then don't swap them LDA 93//start swapping registers STA 99//temp r93 LDA 92 STA 93//r93 r92 LDA 99 STA 92//r92-temp STEP3 LDA 92// LOOP 2 and STEP 1 SUB 91 BRP STEP4 // if both r91 and r92 are in order, then don't swap thenm LDA 92 //start swapping registers STA 99//temp r92 LDA 91 STA 92//r92 r91 LDA 99 STO 91 // r91 = temp STEP4 LDA 91// please Write the sorted values OUT LDA 92 OUT LDA 93 OUT HLT// over/finish
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
