Question

.begin in first in second load first compare second jumplt outsecond out first jump done outsecond:...

.begin
in first
in second
load first
compare second
jumplt outsecond
out first
jump done
outsecond: out second
done: halt
first: .data 0
second: .data 0
.end

Modify the program so that it displays the larger of the two numbers, and test it until it behaves correctly.

Homework Answers

Answer #1

Note: Done accordingly. Please comment for any problem. Please Uprate. Thanks.

Everything will be same just we have to change checking condition and convert from less than to greater than.

Assembly

Equivalent c

in first

scanf(“%d”,&first)

in second

scanf(“%d”,&first)

load first

x=first;

compare second

If second>x{//outsecond

printf(“%d”,second)

}else{//outfirst

printf(“%d”,first)

}

jumpgt outsecond

out first

jump done

outsecond: out second

done: halt

return;

first: .data 0

second: .data 0

.end

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
.begin in counter while: load counter compare zero jumpeq done out counter decrement counter jump while...
.begin in counter while: load counter compare zero jumpeq done out counter decrement counter jump while done: halt counter: .data 0 zero: .data 0 .end Modify the program so that it checks to see that the input data is greater than zero before it starts the loop. If that's not the case, the program should halt with no output.
.begin in counter while: load counter compare zero jumpeq done out counter decrement counter jump while...
.begin in counter while: load counter compare zero jumpeq done out counter decrement counter jump while done: halt counter: .data 0 zero: .data 0 .end Modify the program so it checks to see that the input data is greater than zero before it starts the loop. If that's not the case, the program should halt without any output.
1.Write pseudocode for a program that allows the user to input two numbers (X and Y)...
1.Write pseudocode for a program that allows the user to input two numbers (X and Y) and a code C. If the code has value 1, the program should output the larger of X and Y and otherwise output the smaller. Now convert your pseudocode to an assembly language program. Enter the program into the lab software assembler. Assemble the program and execute it with different input data. 2. Write pseudocode for a program that allows the user to input...
You need to write a permute class that will take first and second strings to rearrange...
You need to write a permute class that will take first and second strings to rearrange letters in first, followed by second. For example, if the first is “CAT” string and second is “MAN” string, then the program would print the strings TACMAN, ATCMAN, CTAMAN, TCAMAN, ACTMAN, and CATMAN. The first and second strings can be any length of string or a null. The permute class uses a Node class as link list node to link all letters arrangement. The...
A non-inferiority test is carried out to compare a new drug that comes with a claim...
A non-inferiority test is carried out to compare a new drug that comes with a claim of fewer side effects to the existing standard of care drug for shoulder injuries. Two comparisons of efficacy are done: The first efficacy comparison is on how quickly complete motor function is restored (Fewer number of days=better). Given a pre-specified margin of acceptance of 2 days, which of the following confidence intervals (point estimate: mean number of days for new drug - mean number...
A non-inferiority test is carried out to compare a new drug that comes with a claim...
A non-inferiority test is carried out to compare a new drug that comes with a claim of fewer side effects to the existing standard of care drug for shoulder injuries. Two comparisons of efficacy are done: The first efficacy comparison is on how quickly complete motor function is restored (Fewer number of days=better). Given a pre-specified margin of acceptance of 2 days, which of the following confidence intervals (point estimate: mean number of days for new drug - mean number...
This problem is to be done in R. When computing the bootstrap, there are two extremes...
This problem is to be done in R. When computing the bootstrap, there are two extremes we talked about in class: either completely enumerating all of the possible cases (which is computationally infeasible most of the time), or drawing of a few samples at random with possibility of repetition. In between these is an algorithm known as the Balanced Bootstrap. The algorithm goes as follows: Generate a list of B repetitions of each of the observations in our original data...
A school counselor in a high school would like to try out a new conflict-resolution program...
A school counselor in a high school would like to try out a new conflict-resolution program to reduce aggressiveness in students. She first surveyed 16 students using a 20-item instrument to measure their levels of aggression (on a scale of 0 to 10, with higher numbers meaning higher aggression levels). One month after the conflict resolution program was implemented, the students were given the same survey. The data are listed in the table below. The school counselor/researcher has set the...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in Lab 2 to obtain a diameter value from the user and compute the volume of a sphere (we assumed that to be the shape of a balloon) in a new program, and implement the following restriction on the user’s input: the user should enter a value for the diameter which is at least 8 inches but not larger than 60 inches. Using an if-else...
Python programming Write a program that prompts the user to input the three coefficients a, b,...
Python programming Write a program that prompts the user to input the three coefficients a, b, and c of a quadratic equationax2+bx+c= 0.The program should display the solutions of this equation, in the following manner: 1. If the equation has one solution, display ONE SOLUTION:, followed by the solution, displayed with4 digits printed out after the decimal place. 2. If the equation has two real solutions, display TWO REAL SOLUTIONS:, followed by the two solutions, each displayed with4 digits printed...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT