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 shoukd 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 01: MOv AH, 01 Service 00: 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 LOOP Lut MOV AH, 01 .CODE CMP AL, 30H SUB AL, 30H MOV OUTPUT, AX INT 16H MOV CX, 9 10 DUP (?) 0, 1, 2, 3, 4, 5, 6, 7, 8,9 JA Again 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 shoukd 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 01: MOv AH, 01 Service 00: 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 LOOP Lut MOV AH, 01 .CODE CMP AL, 30H SUB AL, 30H MOV OUTPUT, AX INT 16H MOV CX, 9 10 DUP (?) 0, 1, 2, 3, 4, 5, 6, 7, 8,9 JA Again
Expert Answer:
Answer rating: 100% (QA)
OUTPUT done this code with emu8086 emulator software emultor screen 8025 chars enter number 3 cube 27 model small macro for printing messages printmsg ... View the full answer
Related Book For
Posted Date:
Students also viewed these electrical 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...
-
Jerome Neeson is a shareholder in Gourmet Chefs Inc., a company that owns and operates a test kitchen in a large metropolitan area. The company is involved in a number of businesses, including...
-
A sample of 10 networking sites for a specific month has a mean of 26.1 and a standard deviation of 4.2. Find the 99% confidence interval of the true mean. Assume that all variables are approximately...
-
Find V0 in the network. 6V 12V 2mA
-
Titan Offroad Equipment uses the LIFO inventory method and values its inventory using the lower-of-cost-or-market^LCM) rule. Titan Offroad Equipment has the following account balances at December 31,...
-
Gonzalvo Corporations balance sheet at the end of 2013 included the following items. The following information is available for 2014. 1. Treasury stock was purchased at a cost of $13,200. 2. Cash...
-
One of the behavioral considerations associated with the budgeting process relates to the difficulty level embodied in the budget (i.e., how difficult or easy it is to achieve budgeted results)....
-
Through an analysis of the English court's rulings in recent environmental claims brought against Shell Plc (Okpabi and Others v Royal Dutch Shell plc UKSC 2021 3; and ClientEarth v Shell plc and...
-
What is the Internal Rate of Return (IRR) for the following investment? Cash Out Year $ (3,200,000) Cash In 012345 $ 700,000 810,000 920,000 1,030,000 1,140,000
-
Discuss what is meant by auditing having a shifting paradigm. How has this affected the objectives of the external company audit?
-
Evaluate the performance of each of MacLarens salespeople.
-
Describe the three main levels of audit services. What is the most common service? Why?
-
What is the difference between the condense-and-eliminate approach and the briefings? approach to writing an executive summary for an internal audit report?
-
Do you feel that Pages background in sales and marketing is the right kind of experience for this type of new venture? Might not a more technical background be more appropriate?
-
Give an example (in your opinion) of a product or service in each one of the 4 Product Life Cycle Stages. Introduction Growth Maturity Decline Please give correct answer don't copy from ai or any...
-
Nike manufactures shoes and sportswear. How has the Internet changed the way this company communicates with its suppliers and retail customers?
-
Create a rational function with the following characteristics: three real zeros, one of multiplicity 2; y-intercept 1; vertical asymptotes, x = -2 and x = 3; oblique asymptote, y = 2x + 1. Is this...
-
A farmer has 70 acres of land available for planting either soybeans or wheat. The cost of preparing the soil, the workdays required, and the expected profit per acre planted for each type of crop...
-
Use the properties of limits and the facts that where x is in radians, to find the limit. sin x cos x 1 lim lim sin x = 0 lim cos x = 1 lim 0 = 0 || sin? x + sin x(cos x 1) lim
-
What statutory and mandatory professional pronouncements require a review to be published?
-
List two items that may be found in the operating section and two items that may be found in the financial review section of an OFR.
-
What statutory and mandatory professional requirements require directors to submit a report to shareholders?
Study smarter with the SolutionInn App