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 EMU
8086.
.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

Step: 3

blur-text-image

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

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

Are there diff erent kinds of memory?

Answered: 1 week ago

Question

3. How old are they? (children, teens, adults, seniors)

Answered: 1 week ago

Question

4. Where do they live? (city or town, state, country)

Answered: 1 week ago