There is a need to write a program which computes the cube of the number entered...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
There is a need to write a program which computes the cube of the number entered from the keyboard. The number can be any number between 0 and 9. For example, if the number entered from the keyboard is 4, the result should be computed as 43=64. If the entered character is not in between 0 and 9, the program should recheck the key press. The computation should be based on the LOOK-UP TABLE approach. The program should also store the result into the data segment area with variable named as "Output", Interrupt services 01 and 00 should be used to check key press and get the character, respectively. The ASCII codes of numbers 0, 1, ..9 are 30H, 31H, 39H, respectively. Service 00: Service 01: MOV AH, 01 MOV AH, 00 INT 16H INT 16H Service 01: When a key is pressed, ZF=0. Otherwise, ZF=1. Service 00: The ASCII code of key is stored into AL. Complete the following program to achieve this task. .MODEL SMALL .DATA DATA1 DB DATA2 DW 0, 1, 8, 27, 64, 125, 216, 343, 512, 729 OUTPUT DB MOV AX, @DATA MOV DS, AX Again: INT 16H JZ Again MOV AH, O JB Again CMP AL, 39H Lut: MOV BX, CX CMP AL, [BX + Offset DATA1] JAE Exit Exit: MOV AX, [BX + Offset DATA2] MOV AH, 4CH 10 DUP (?) CMP AL, 30H MOV OUTPUT, AX LOOP Lut JA Again MOV AH, 01 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 INT 16H .CODE SUB AL, 30H MOV CX, 9 There is a need to write a program which computes the cube of the number entered from the keyboard. The number can be any number between 0 and 9. For example, if the number entered from the keyboard is 4, the result should be computed as 43=64. If the entered character is not in between 0 and 9, the program should recheck the key press. The computation should be based on the LOOK-UP TABLE approach. The program should also store the result into the data segment area with variable named as "Output", Interrupt services 01 and 00 should be used to check key press and get the character, respectively. The ASCII codes of numbers 0, 1, ..9 are 30H, 31H, 39H, respectively. Service 00: Service 01: MOV AH, 01 MOV AH, 00 INT 16H INT 16H Service 01: When a key is pressed, ZF=0. Otherwise, ZF=1. Service 00: The ASCII code of key is stored into AL. Complete the following program to achieve this task. .MODEL SMALL .DATA DATA1 DB DATA2 DW 0, 1, 8, 27, 64, 125, 216, 343, 512, 729 OUTPUT DB MOV AX, @DATA MOV DS, AX Again: INT 16H JZ Again MOV AH, O JB Again CMP AL, 39H Lut: MOV BX, CX CMP AL, [BX + Offset DATA1] JAE Exit Exit: MOV AX, [BX + Offset DATA2] MOV AH, 4CH 10 DUP (?) CMP AL, 30H MOV OUTPUT, AX LOOP Lut JA Again MOV AH, 01 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 INT 16H .CODE SUB AL, 30H MOV CX, 9
Expert Answer:
Answer rating: 100% (QA)
MODEL SMALL DATA DATA1 DB 0123456789 DATA2 DW 0182764125216343512729 OUTPUT DB DUP CODE MOX AX D... View the full answer
Related Book For
Posted Date:
Students also viewed these computer engineering questions
-
There is a need to write a program which computes the cube of the number entered from the keyboard. The number can be any number between 0 and 9. For example, if the number entered from the keyboard...
-
There is a need to write a program which computes the cube of the number entered from the keyboard. The number can be any number between 0 and 9. For example, if the number entered from the keyboard...
-
There is a need to develop a software for tracking library loan records. Library barrowers may barrow library items once they have registered to the system by providing their name. address and phone...
-
Paige buys a tool shed priced at $5990, but pays $6289.50 with tax. What is the tax rate where Paige lives?
-
For students who graduated from high school in 2013, their SAT math scores were approximately normally distributed with a mean of 514 points and a standard deviation of 118 points (Source: College...
-
Ollies Olive Oil began business in 2010, during which it produced 104,000 quarts of olive oil. In 2010, the company sold 100,000 quarts of olive oil. Costs incurred during the year were as follows:...
-
Monroe Bradstad borrowed \($100,000\) from his aunt, Jeanne Garland, to purchase farmland. Both parties subsequently signed a promissory note stipulating that interest would be accrued prior to or on...
-
According to a payroll register summary of Frederickson Company, the amount of employees gross pay in December was $850,000, of which $80,000 was not subject to FICA tax and $750,000 was not subject...
-
Problem 2 o is the fitted value or predicted value of the response when the predictor is xo. 1) Derive the variance of o, o2 {0}, in a Simple Linear Regression setting when there is only one...
-
Jack Tasker opened his Auto Repair Shop in November 2023. The balance sheet at November 30, 2023, prepared by an inexperienced part-time bookkeeper, is shown below. Required Prepare a correct balance...
-
Determine the exact value of the ff. Find the exact value of cos .
-
Given that the cost of capital in Australia is 5% and the annual inflation rates of 1.5% and 2.8% in Australia and Singapore, respectively. Find the Singapore cost of capital?
-
I would like assistance with completing these methods. All of them must be completed recursively. 10 import static org.junit.Assert.*; 2 import org.junit.Test; 3 4 public class PublicTests { 50 @Test...
-
If the distribution of income in country C is (1, 2, 2, 3, 5) and the poverty line is 2.5, what is the average poverty gap?
-
Give the difference between the Modigliani and Miller M-M hypothesis capital structure theory and the Net Operating Income approach capital structure theory and explain what happens to the cost of...
-
If Domino's Pizza and Little Caesar's Pizza united to become the new company of Emperor's Pizza, what type of transaction would create the new company? Horizontal merger Vertical acquisition...
-
Concerning Procurement, which of the following statements are true? Select all correct answers. Lowering the complexity of the item and consolidating the buy allow a company to reduce risk and...
-
In the current year, the City of Omaha donates land worth $500,000 to Ace Corporation to induce it to locate in Omaha and create an estimated 2,000 jobs for its citizens. a. How much income, if any,...
-
In converting from polar coordinates to rectangular coordinates, what formulas will you use?
-
Find the exact value of expression. tan cot cot 3
-
Solve the equation. |3x - 1| = 2
-
How much money would have to be deposited today to accumulate a. $10,000 after 6 years if the investment earns 5%/year compounded annually. b. $6,500 after 4 years if the investment earns 8...
-
What will be the amount accumulated by each of the following present investments? a. $3,000 invested for 7 years at 14 percent compounded annually b. $1,600 invested for 17 years at 12% compounded...
-
On August 1, 1958, first-class postage for a 1-ounce envelope was 4. On August 1, 2007, a first-class stamp for the same envelope cost 41. What was the annual compound increase in the cost of...
Study smarter with the SolutionInn App