Arwen P.

asked • 10/31/22

Hello, please help me with this problem

.model small
.data
msg1 db 10,13,"Enter first no.$"
msg2 db 10,13,"Enter second no.$"
msg3 db 10,13,"Result is:$"
.code
start:
mov ax,@data
mov ds,ax
lea dx,msg1
mov ah,09H
int 21H
mov ah,01H
int 21H
sub al,30H
cmp al,09H
JBE L1
sub al,07H
L1: mov cl,04H
ROL al,cl
mov bl,al
mov ah,01H
int 21H
sub al,30H
cmp al,09H
JBE L2
sub al,07H
L2: ADD bl,al
lea dx,msg2
mov ah,09H
int 21H
mov ah,01H
int 21H
sub al,30H
cmp al,09H
JBE L3
sub al,07H
L3: mov cl,04H
ROL al,cl
mov bh,al
mov ah,01H
int 21H
sub al,30H
cmp al,09H
JBE L4
sub al,07H
L4: ADD bh,al
ADD bl,bh
lea dx,msg3
mov ah,09H
int 21H
mov ch,02H
mov cl,04H
L5: ROL bl,cl
mov bh,bl
AND bl,0FH
cmp bl,09H
JBE L6
ADD bl,07H
L6: ADD bl,30H
mov dl,bl
mov ah,02H
int 21H
mov bl,bh
dec ch
JNZ L5
mov ah,4ch
int 21H
sub al,0
end start


I need to rework the above code. I need to ask the user to enter the 3rd number. Then that 3rd number needs to be subtracted from the sum of the first 2 numbers.


PLEASE CAN SOMEONE HELP


1 Expert Answer

By:

Jerrell G. answered • 07/23/23

Tutor
4.8 (36)

Professional Tutor Specializing in Information Technology

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.