Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you fix the below code. Ive been struggling to make the output for multiply, division and its carry. Language used Assembly to be run

Can you fix the below code. Ive been struggling to make the output for multiply, division and its carry. Language used Assembly to be run on EMU8086.
.model small
.stack 100h
.data
num1 db ?
msg1 db 'Enter one number : $' ;this is a prompt to ask the user to enter a number
num2 db ?
msg3 db 'Enter one number : $' ;this is a prompt to ask the user to enter a number
result db ?
msg5 db 'The result is : $' ;
result2 db ?
carry db ?
msg6 db 'The result is : $' ;
msg7 db 'The carry is : $' ;
.code
;INPUT
mov ax,@data
mov ds,ax
lea dx, msg1
mov ah,09h
int 21h
mov ah,01
int 21h
mov num1,al
lea dx, msg3
mov ah,09h
int 21h
mov ah,01
int 21h
mov num2,al
;MULTIPLICATION
mov al,num1
sub al,48
mov bl,num2
sub bl,48
mul bl ; multiply val1 and val2
add al,48
mov result,al
lea dx, msg5
mov ah,09h
int 21h
mov ah,2
mov dl, result
int 21h
;DIVISION
mov al, num2
sub al,48
mov bl, num1
sub bl,48
div bl ; al will store result, ah will store reminder
add al,48
mov result2, al
add ah,48
mov carry, ah
lea dx, msg6
mov ah,09h
int 21h
mov ah,2
mov dl, result2
int 21h
lea dx, msg7
mov ah,09h
int 21h
mov ah,2
mov dl, carry
int 21h
;END
mov ah,4ch
int 21h
end

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_2

Step: 3

blur-text-image_3

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 Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions

Question

What are the objectives of Human resource planning ?

Answered: 1 week ago

Question

Explain the process of Human Resource Planning.

Answered: 1 week ago

Question

Prepare for a successful job interview.

Answered: 1 week ago

Question

Describe barriers to effective listening.

Answered: 1 week ago

Question

List the guidelines for effective listening.

Answered: 1 week ago