Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!