Answered step by step
Verified Expert Solution
Question
1 Approved Answer
There is a need to write a program which computes the cube of the number entered from the keyboard. The number can be any
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 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 DS, AX Time left 0:46:17 Again: INT 16H JZ Again MOV AH, O JB Again CMP AL, 39H
Step by Step Solution
★★★★★
3.45 Rating (168 Votes )
There are 3 Steps involved in it
Step: 1
MODEL SMALL DATA DATA1 DB 0123456789 DATA2 DW 01827641252163435...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started