Question

We would like to create an Assembly program whose executable is called division.exe and that behaves...

We would like to create an Assembly program whose executable is called division.exe and that behaves as follows:  It requests a positive number from the user.  Once it gets the user input, it divides the number by 5 without using the DIV instruction in assembly  It outputs the Quotient and the Remainder As an example, if a user runs the assembly program division.exe and provides a value 34 as an input, the display should show the following: 34 Divided by 5 = 6 and Remainder is 4 As a programmer, you need to check on the input provided by the user and make sure it is valid (e.g. the user input is positive and the input is a number, etc). Make sure that you have comments explaining the purpose of your instructions and what you are trying to achieve using it. Please submit only the code (.asm file)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

org 100h
include 'emu8086.inc'
.model small
.data

;scanning numbers from user

;scanning dividend

call scan_num
val1 db cx

;scanning divisor

call scan_num
val2 db cx
.code
    mov bx,val1
    mov si,0
start:
  
    mov al,val2
    sub bx,al         ;subtract from divisor from dividend and the dividend is updated

   inc si                ;increment si
    cmp al,bx         ;compare divisor and dividend
    jge start
    jle exit
exit:

    mov ax,si          ;the value stored in si is quotient

    print "quotient"
    print 0ah

    mov ax,bx        ;the value stored in bx is reminder

    print "reminder"

   print 0ah
    print "successs"
   ret

Add a comment
Know the answer?
Add Answer to:
We would like to create an Assembly program whose executable is called division.exe and that behaves...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please create an x64 Assembly project (Linux and Ubuntu). It should include at least 4 outputs...

    Please create an x64 Assembly project (Linux and Ubuntu). It should include at least 4 outputs and 2 user inputs. The outputs should incorporate the user input. Example: Output: What is your name? Input: Matthew Output: Nice to meet you Matthew Output: Where are you from? Input: Germany Output: No way! I am also from Germany Be creative! Make sure to upload the .asm file

  • Wrote a program called ExceptionalDivide that asks the user for 2 integer values and displays the...

    Wrote a program called ExceptionalDivide that asks the user for 2 integer values and displays the quotient of the first value divided by the second value. Make sure the your program reads in the two input values as ints. Your program must catch either of two exceptions that might arise and crash your program java.util.InputMismatchException //wrong data type inputted java.lang.ArithmeticException //divide by zero error Once you catch these exceptions, your program must print out a message explaining what happened and...

  • Complete the following Intel assembly language program which determines whether the byte sized operand stored in...

    Complete the following Intel assembly language program which determines whether the byte sized operand stored in memory location 'number' is prime or not. The program will write the value of 0 into the memory location 'answer' if the number is not prime, otherwise the initial value of '1' will be left unmodified (indicating that the number is prime). The program makes use of the DIV instruction to determine the value of quotient and remainder when dividing the number by 2,3,4,......

  • Complete the following Intel assembly language program which determines whether the byte sized operand stored in...

    Complete the following Intel assembly language program which determines whether the byte sized operand stored in memory location 'number' is prime or not. The program will write the value of 0 into the memory location 'answer' if the number is not prime, otherwise the initial value of '1' will be left unmodified (indicating that the number is prime). The program makes use of the DIV instruction to determine the value of quotient and remainder when dividing the number by 2,3,4,......

  • Write a C program as follows: Single source code file Requests the user to input two...

    Write a C program as follows: Single source code file Requests the user to input two integer numbers Requests the user to make a choice between 0 (add), 1 (subtract), or 2 (multiply) Declares three separate functions Uses a pointer to these three functions to perform the requested action Outputs the result to the screen Submit your program source code file to this assignment. Sample Output Enter first integer number: 15 Enter second integer number: 10 Enter Choice: 0 for...

  • MIPS ASSEMBLY PROGRAM: PLEASE Write in MIPS Assembly language. Take strings as input and calculate and...

    MIPS ASSEMBLY PROGRAM: PLEASE Write in MIPS Assembly language. Take strings as input and calculate and print a simple checksum for each string. Make your string long enough to hold 50 characters. Don't forget to leave space for the null byte. Our checksum algorithm will produce a value which you can print with the syscall for printing a character. Stop reading strings when the user enters ".". The syscall to read a string (sycall code 8) adds a newline to...

  • unctions with No Parameters Summary In this lab, you complete a partially prewritten Python program that...

    unctions with No Parameters Summary In this lab, you complete a partially prewritten Python program that includes a function with no parameters. The program asks the user if they have preregistered for art show tickets. If the user has preregistered, the program should call a function named discount() that displays the message "You are preregistered and qualify for a 5% discount." If the user has not preregistered, the program should call a function named noDiscount() that displays the message "Sorry,...

  • This is a C++ Program!!! Define a class called Rational that would represent rational numbers. Write...

    This is a C++ Program!!! Define a class called Rational that would represent rational numbers. Write a constructor that would accept two integers and initialize the numerator and denominator of the object to their values. Also include a default constructor that would initialize the numerator to 0 and denominator to 1. Implement the member functions add, sub, mul, div, less, and equal to carry out the operations +, -, *, /, <, and == (i.e., a + b would be...

  • Task 4: Integer and Floating Point Division Open Division.java and write code to solve the following...

    Task 4: Integer and Floating Point Division Open Division.java and write code to solve the following problem: 1. prompts for and reads in an integer (on the same line) 2. Outputs: i) the value of the number divided by 100 as a floating point value ii) the remainder when the number is divided by 100 iii) the number of times 100 divides the integer iv) outputs the digits of the integer in reverse order; i.e., each digit must be extracted...

  • Java programming for ticket price calculator.  It should ask the user if they would like to process...

    Java programming for ticket price calculator.  It should ask the user if they would like to process another ticket order. They should indicate their selection with a Y or N. If they indicate yes, then it should repeat the entire program with the exception of the welcome screen. If they indicate no, it should show the final thank you message and end the program. If they indicate an invalid answer, it should display an error and re-prompt them for a Y...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT