Question: Write program for Assembly x86 intel 3: Direct Addressing, Output, and ASCII code 1. Set a counter to zero 2. Get number into the dividend

Write program for Assembly x86 intel 3: Direct Addressing, Output, and ASCII code 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 if its zero 9. No then go to step 3 10. Yes print the digits from the stack one by one. (Use POP operation and Output char system call.) Although you don't necessarily have use it in this assignment, I would like to point out that the algorithm for converting the number to Hex is similar except that we divide by 16 and we also check for letters ( for numbers 10 or more) Procedure a) Write an assembly program which computes the following: int W, X, Y, loc, sum X=40 Y = 24 loc Y 160 + X* 2 Y = 2000 Y-Y-1 Sum = loc /16 + Y +Y/4 Y/200 W= Sum 90 7+5 Output the number W on the screen Note: This program is similar to the last lab. Sum should be modified and value of W must be modified and output to the screen. Note: You may not use any library functions. Only DOS/BIOS functions can be used. You can use the following code to Write a single ASCII character to the screen. It assumes that register AL contains the ASCII character to be printed mov ah,06h; DOS code for output or input mov dl, al; display char on soreen int 21h Write program for Assembly x86 intel 3: Direct Addressing, Output, and ASCII code 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 if its zero 9. No then go to step 3 10. Yes print the digits from the stack one by one. (Use POP operation and Output char system call.) Although you don't necessarily have use it in this assignment, I would like to point out that the algorithm for converting the number to Hex is similar except that we divide by 16 and we also check for letters ( for numbers 10 or more) Procedure a) Write an assembly program which computes the following: int W, X, Y, loc, sum X=40 Y = 24 loc Y 160 + X* 2 Y = 2000 Y-Y-1 Sum = loc /16 + Y +Y/4 Y/200 W= Sum 90 7+5 Output the number W on the screen Note: This program is similar to the last lab. Sum should be modified and value of W must be modified and output to the screen. Note: You may not use any library functions. Only DOS/BIOS functions can be used. You can use the following code to Write a single ASCII character to the screen. It assumes that register AL contains the ASCII character to be printed mov ah,06h; DOS code for output or input mov dl, al; display char on soreen int 21h
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
