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...
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...
WRITE C++ PROGRAM FOR 1,2,3,4 PARTS of question, DO ADD COOMENTS AND DISPLAY THE OUTPUT OF...
WRITE C++ PROGRAM FOR 1,2,3,4 PARTS of question, DO ADD COOMENTS AND DISPLAY THE OUTPUT OF A RUNNING COMPILER QUESTION: 1) Fibonacci sequence is a sequence in which every number after the first two is the sum of the two preceding ones. Write a C++ program that takes a number n from user and populate an array with first n Fibonacci numbers. For example: For n=10 Fibonacci Numbers: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 2): Write...
Please use C++. You will be provided with two files. The first file (accounts.txt) will contain...
Please use C++. You will be provided with two files. The first file (accounts.txt) will contain account numbers (10 digits) along with the account type (L:Loan and S:Savings) and their current balance. The second file (transactions.txt) will contain transactions on the accounts. It will specifically include the account number, an indication if it is a withdrawal/deposit and an amount. Both files will be pipe delimited (|) and their format will be the following: accounts.txt : File with bank account info...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT