taking double digit input and add with double digit number in assembly language 8086

Viewed 18

I facing a problem is i set a number1 is 50 and I ask user input a two digit number(e.g 20) and I need to add or sub them together.I try to direct sub num1 and user input but cannot work,but num1 and user input not same as string? why cannot sub together? here the code



EnterBal DB  13, 10,'  Enter Deposit Amount : ','$'


Bal1 DB 50
REM DB 0
REM1 DB 0
DOLLAR DB 0
nw db 13,10 ,'$'

input LABEL BYTE
MAX_LEN DB 3
ACT_LEN DB ?
KB_data db 3 dup('')
num1 DB '$'
num2 DB ?



.CODE 
MAIN PROC FAR 

MOV AX,@DATA 
MOV DS,AX 

;clear AH to use for reminder
MOV ah,00
MOV AL,Bal1
MOV bl,10
div bl
;move reminder to rim
mov REM,ah
;to print (al) we move al to dl
mov dl,al
add dl,48
mov ah,02h
int 21h
;to print the reminder
mov dl,REM
add dl,48
mov ah,02h
int 21h
;//////////
MOV DL,DOLLAR
MOV DL,24H
MOV AH,02H
INT 21H
;Print balance
LEA DX,EnterBal
MOV AH,09H
INT 21H 
;Enter Value Here
mov ah,0ah
lea dx,input
int 21h

;ADD VALUE
sub bal1,input

0 Answers
Related