Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Assembly X86 Intel: Direct Addressing, Input, and ASCII Code. Please leave comments on code. Lab #4: Direct Addressing, Input, and ASCII code Purpose: The

Using Assembly X86 Intel:

Direct Addressing, Input, and ASCII Code.

Please leave comments on code.image text in transcribed

image text in transcribed

Lab #4: Direct Addressing, Input, and ASCII code Purpose: The purpose of this lab assignment is to further familiarize the student with the basic input and output mechanisms of the MS-DOS Operating System, the INT instruction, as well as the conversion of ASCII decimal digits received from the keyboard to a binary number to be used in a computation. The conversion of the binary result to ASCII decimal digits to be displayed on the screen was covered in the last lab. This lab is mostly about ASCII to binary conversion and it builds on the previous lab. You have up to two weeks to complete this lab Introduction: This lab is a modification of the previous lab in the sense that instead of input variables X and Y being hard coded by assigning them inside the program, we want to make the program flexible. We do so by letting a user type in the values of the variables from the keyboard. We will assume the numbers are decimal. Since the number typed from the keyboard consists of ASCII decimal digits it has to be converted to decimal and eventually converted to binary before it can be used in computation. There are a number of algorithms that can be used for this conversion but let us look at one example Suppose we want to convert the ASCII string 4096. Let us assume AX will be used keep track of the binary value. AX is initialized to zero. As each ASCII digit is read, we multiply AX by 10 and the digit's binary value is added to AX. After all digits have been read, Ax contains the binary value of the number 4096. Note that the most significant digit is typed first. The following table describes the algorithm. AX (before) New Digit AX (after) 0 *10+ Lab #4: Direct Addressing, Input, and ASCII code Purpose: The purpose of this lab assignment is to further familiarize the student with the basic input and output mechanisms of the MS-DOS Operating System, the INT instruction, as well as the conversion of ASCII decimal digits received from the keyboard to a binary number to be used in a computation. The conversion of the binary result to ASCII decimal digits to be displayed on the screen was covered in the last lab. This lab is mostly about ASCII to binary conversion and it builds on the previous lab. You have up to two weeks to complete this lab Introduction: This lab is a modification of the previous lab in the sense that instead of input variables X and Y being hard coded by assigning them inside the program, we want to make the program flexible. We do so by letting a user type in the values of the variables from the keyboard. We will assume the numbers are decimal. Since the number typed from the keyboard consists of ASCII decimal digits it has to be converted to decimal and eventually converted to binary before it can be used in computation. There are a number of algorithms that can be used for this conversion but let us look at one example Suppose we want to convert the ASCII string 4096. Let us assume AX will be used keep track of the binary value. AX is initialized to zero. As each ASCII digit is read, we multiply AX by 10 and the digit's binary value is added to AX. After all digits have been read, Ax contains the binary value of the number 4096. Note that the most significant digit is typed first. The following table describes the algorithm. AX (before) New Digit AX (after) 0 *10+

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

Oracle Databases On The Web Learn To Create Web Pages That Interface With Database Engines

Authors: Robert Papaj, Donald Burleson

11th Edition

1576100995, 978-1576100998

More Books

Students also viewed these Databases questions

Question

=+2 Why are so many countries bothered by their brain drains?

Answered: 1 week ago