I am trying to write a program that receives two six-digit decimal numbers and shows their addition, but in 16 bit 8086 I defined the numbers as a double word and put LO in WORD 1 and HO in word 2. similar to the code below but I have no idea what to do next , can any body offer me an algorithm for the following operations? Thnx
x dd(?)
next_no:
mov cl,2
mov ch,4
two_bit:
getch
sub al,30h
mov bl,10
mul bl
mov di,ax
add word ptr x+2,di
dec cl
jnz two_bit
fourbit:
getch
sub al,30h
mov bl,10
mul bl
mov di,ax
add word ptr x,di
dec ch
jnz fourbit
in this program, di is the place to store the number made through the loop when the user enters the number di will be a multiple of 10, and the new digit will add di like: get 28 di = 0 * 10 + 2 = 2 di = 2 * 10 * + 8 = 28
source
share