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...
-
Recall that score son the Wechsler IQ test are normally distributed with mean 100 points and standard deviation 15 points. a. A students IQ is at the 87th percentile. Find the students IQ. Is it an...
-
Bowman Corporation reported the following information: Common stock , $3 par, 10,000 shares authorized 5,000 shares issued and outstanding. Required: What is the appropriate journal entry to record a...
-
Douglas Singletary purchased a mobile home from P&A Investments, Inc. d/b/a Andys Mobile Home and Land Sales. On November 17, 2007, Singletary entered in a sales agreement with Andys to purchase a...
-
Variable costing versus absorption costing The Mavis Company uses an absorption-costing system based on standard costs. Total variable manufacturing cost, including direct material cost, is $3 per...
-
Cash discounts are not taken on shipping costs. Group of answer choices True FalseThis factor is the difference between the net cost of merchandise and the retail selling price: Group of answer...
-
Burnard (1992) sent a questionnaire to a stratified sample of nursing tutors and students in Wales, to study what the tutors and students understood by the term experiential learning. The population...
-
GM will earn $120,000 a year in perpetuity if it pays out all its earnings as dividends (that is, no new investments). However, the firm plans to invest 25% of its earnings in projects that earn 13%...
-
On December 31, 2019, cash sales for the year were $3,300,000, credit sales for the year were $2,500,000. If credit losses are estimated at 2% of credit sales: On December 31, 2019, cash sales for...
-
Identify the correct statement.For financial reporting purposes, the manner in which costs are allocated is guided by which asset generated the cost.
-
Minicase CAPM After selling 16.5 million shares in Fin-Tech's IPO founder David Smith received $867m which he wishes to invest wisely. He has contacted three young and very eager investment managers...
-
Although I live with my parent right now, I decided to use this assignment to estimate living costs for when I move out. According to the EPI's estimation, it would cost about $3,444 a month for me...
-
Now apply this technique to the Salem City Council concerned about safety, Interested in job growth, and sensitive to Salem's educational needs. To show it is fiscally responsible, the council would...
-
Ricci sells Jefferson Corporation stock with an adjusted basis of $8,000 for $13,000. Which of the following statements is true? a. Ricci's realized gain is $4,000. If Ricci had sold the stock for...
-
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
-
If 25 women are randomly selected, find the probability that the mean of their red blood cell counts is less than 4.444. Assume that red blood cell counts of women are normally distributed with a...
-
Find the probability of an IQ less than 85.
-
What percentage of women have red blood cell counts in the normal range from 4.2 to 5.4? Assume that red blood cell counts of women are normally distributed with a mean of 4.577 and a standard...
Study smarter with the SolutionInn App