Answered step by step
Verified Expert Solution
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started