Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an assembly program that receives the variables X and Y from the keyboard instead of being hard coded in the program. They are used

Write an assembly program that receives the variables X and Y from the keyboard instead of being hard coded in the program. They are used in the following computation to determine W which is then printed on the screen. You may not use any library functions. Only low level software interrupt functions can be used.Your program should be able to handle up to 4 digit unsigned decimal numbers for X and Y.

----------------------- CODE STARTS

[ int W;

Lines of Code to input X from the Keyboard

Lines of Code to input Y from the Keyboard

W = Y * 160 + X * 2

Lines of code to output W to the screen.]

-----------------------CODE ENDS

NOTES:

*Declare variables for strings in the data area. For instance

inputX BYTE Input X=, $

inputY BYTE Input Y=, $

outputW BYTE Output W=, $

newline BYTE 0dh, 0ah, $

*Here are some detailed steps to help you input variable X from the keyboard based on above algorithm

  1. Initialize X=0
  2. Set loop counter to 4
  3. Multiply X by 10
  4. Get Digit from Keyboard (it will be in ASCII)
  5. Convert ASCII digit to a number (by subtracting 30h from it)
  6. Add Number to X
  7. Go to Step 3; You may use the LOOP instruction for this

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How do we untangle this complex knot of interacting variables?

Answered: 1 week ago