Question: This program uses ASSEMBLY X86 INTEL Lab #3: Direct Addressing, output, and ASCII code Purpose: The purpose of this lab assignment is to further familiarize
This program uses ASSEMBLY X86 INTEL


Lab #3: Direct Addressing, output, and ASCII code Purpose: The purpose of this lab assignment is to further familiarize the student with the basic output mechanism of the MS-DOS Operating Sstem, the INT instruction, as well as the conversion of internal binary number, a printable decimal number and display it on the video screen, usingASCIT code, DOSBlos functions. Introduction In the following assignment you are going to print the mumber "W on the screen in decimal. The number can be onlybe printed on the screen as ASCII digits, in this case ASCII decimal digits. Since the number Win the binary we have to convert it to decimal, convert, each decimal digit to ASCII and then print it. The following algorithm should help you. ALGORITHM FOR CONVERTING A BINARY NUMBER (eg. IN A REGISTER OR MEMORY INTO ASCII DIGITS FOR PRINTING ON SCREEN In general, the algorithm for converting a number in one base into a new base is to repeatedly divide the number by the new base and writing down the remainders (which will be the digits). The answer is the remainder in reverse order (this was the first week lecture). Now for this lab we need to convert to the new base of 10 (decimal. Here is the algorithm for converting to Decimal 1. Set a counter to zero. 2. Get number into the dividend registers for proper size. 3- Divide the dividend by the 16 bit divisor of 10. 4. Add ASCII value of 0x30 to the remainder digit. This is how to convert to ASCII 5. Save remainder digit on stack. (use PUSH instruction) 6. Add to counter of digits saved on stack 7. Zero out remainder register. 8. Test the quotient (next dividend to see ifits zero
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
