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
model small
stack h
data
num db
msg db 'Enter one number : $ ;this is a prompt to ask the user to enter a number
num db
msg db 'Enter one number : $ ;this is a prompt to ask the user to enter a number
result db
msg db 'The result is : $ ;
result db
carry db
msg db 'The result is : $ ;
msg db 'The carry is : $ ;
code
;INPUT
mov ax@data
mov dsax
lea dx msg
mov ahh
int h
mov ah
int h
mov numal
lea dx msg
mov ahh
int h
mov ah
int h
mov numal
;MULTIPLICATION
mov alnum
sub al
mov blnum
sub bl
mul bl ; multiply val and val
add al
mov result,al
lea dx msg
mov ahh
int h
mov ah
mov dl result
int h
;DIVISION
mov al num
sub al
mov bl num
sub bl
div bl ; al will store result, ah will store reminder
add al
mov result al
add ah
mov carry, ah
lea dx msg
mov ahh
int h
mov ah
mov dl result
int h
lea dx msg
mov ahh
int h
mov ah
mov dl carry
int h
;END
mov ahch
int h
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
