pirateph 0 Newbie Poster

hi everyone...i need help in this code regarding the output.....the output is letter but it should be number.....here the code


.model small
.stack
.data
msg1 db "Enter 2 numbers:", "$"
first db "The sum is:","$"
second db "The difference is:","$"
menuA db "[A] Addition","$"
menuB db "[S] Subtraction","$"
choice db "Please select from the following arithmetic operations:A for Addition, S for subtraction and X for exit","$"
exit db "[E]Exit","$"
next db 13,10,"$"

.code
main proc
mov ax,@data
mov ds,ax

mov ah,09
lea dx,msg1
int 21h

mov ah,09
lea dx,next
int 21h

;first number

mov ah,01
int 21h

sub al,30h

mov bl,al

mov ah,09
lea dx,next
int 21h
;second number
mov ah,01
int 21h

sub al,30h

mov ah,09
lea dx,choice
int 21h

mov ah,09
lea dx,next
int 21h

mov ah,09
lea dx,menuA
int 21h

mov ah,09
lea dx,next
int 21h

mov ah,09
lea dx,menuB
int 21h

mov ah,09
lea dx,next
int 21h

mov ah,09
lea dx,exit
int 21h

mov ah,01
int 21h

or al,20h
mov cl,al

;jump starts here

cmp cl,'a'
je dispA

cmp cl,'s'
je dispS

cmp cl,'x'
je dispX
;;;;;;;;;;;;;;;;;;;
dispA:
add bl,al

mov ah,09
lea dx,next
int 21h

mov ah,09
lea dx,first
int 21h


add bl,30h

mov dl,bl

mov ah,02
int 21h

mov ax,4c00h
int 21h

;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dispS:
sub bl,al

mov ah,09
lea dx,next
int 21h

mov ah,09
lea dx,second
int 21h


add bl,30h

mov dl,bl

mov ah,02
int 21h


mov ax,4c00h
int 21h

dispX:
mov ax,4c00h
int 21h

mov ax,4c00h
int 21h

main endp
end main

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.