Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that will input two numbers from the keyboard and execute each o

ID: 3631702 • Letter: W

Question

Write a program that will input two numbers from the keyboard and execute each of the signed and unsigned multiply and divide instructions. For each instruction, the program should display output that clearly shows the result of the instructions. Test and submit with data that shows the use of the edx register and the results with combinations of negative and positive values. Note that it is useful to use small negative numbers to create large unsigned values.

can you provide notes with the answer please

Explanation / Answer

prompt1: .ascii "Enter two integers : "
prompt2: .ascii "Multiplication : "
prompt3: .ascii "Division : "
main:

    la $a0, prompt1
    li $v0, 4
    syscall         # Display prompt.
    li $v0, 5
    syscall         # Get integer response for num1
     li $v1, 5
    syscall         # Get integer response for num2.
    # miving to temporary registers
    move    $eax, $v0    # Move x to temp $t0.
    move    $ebx, $v1    # Move y to temp $t1.
    #perform multiplication and division
     move $eax,$edx
     mul $edx,$ebx
     la $a0, prompt2
    li $v0, 4
    syscall         # Display prompt.
     move $edx, $v0
     li $v0, 1
     syscall         # Print integer result.
     move $eax,$edx
     iDiv   $edx,$ebx
    la $a0, prompt3
    li $v0, 4
    syscall         # Display prompt.
     move $edx, $v0
     li $v0, 1
     syscall         # Print integer result.

    la $a0, endl
    li $v0, 4
    syscall         # Print endl.

Hope this will help you

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote