Fortune Telling Collection - Comprehensive fortune-telling - Error in assembling two multi-digit decimal number addition programs, please help me.

Error in assembling two multi-digit decimal number addition programs, please help me.

. Small model

. pile

. data

. password

. start

mov ah,0 1h

int 2 1h; Enter the ten digits of the first number, get the ASCII value corresponding to this number, and store it in al.

mov bl,al

The second bl, 30h obtains the corresponding number from the ASCII code of the number and stores it in BL.

int 2 1h; Enter one digit of the first number to get the corresponding ASCII value.

sub al,30h

mov bh,al; Obtain the corresponding number from the ASCII code of the number and store it in BH. So far, BL stores the ten digits of the first number, and BH stores the single digits of the first number.

mov al, 10

Multiply mul bl ten digits by 10, and the result is saved in AL.

Add al, BH; Add a number, and the first data entered so far is saved in AL.

mov cl,al; Save the contents of AL in CL, that is, the first data is stored in CL.

mov ah,02h

Mov dl, 0Dh returns

int 2 1h

Mov dl, 0ah newline

int 2 1h

mov ah,0 1h

int 2 1h; Enter the second ten digits, get the ASCII vALue corresponding to this number, and store it in al.

mov bl,al

The second bl, 30h obtains the corresponding number from the ASCII code of the number and stores it in BL.

int 2 1h; Enter the single digits of the second number to get the corresponding ASCII value.

sub al,30h

mov bh,al; Obtain the corresponding number from the ASCII code of the number and store it in BH. At this point, BL stores the second ten digits and BH stores the second single digits.

mov al, 10

Multiply mul bl ten digits by 10, and the result is saved in AL.

Add al, BH; Add a number, and the second data entered so far is saved in AL.

Adding cl and al; The first data is added to the second data, and the sum is stored in the CL register.

mov ah,02h

mov dl,0Dh

int 2 1h; return

mov dl,0ah

int 2 1h; line feed

mov al,cl; Transfer the sum of two data to a 1.

mov ah,0

mov bl, 100

Div bl divides the sum by 100 to get the hundred digits of the sum, which are stored in AL, and the remainder, that is, the corresponding ten digits and one digit, is stored in AH.

mov cl,al; Send hundreds of digits to CL.

Add cl, and get the ASCII code corresponding to the hundred digits for 30h.

mov al,ah; Transfer ten digits and one digit to AL.

mov ah,0

mov bl, 10

Div bl is divided by 10 to get the ten digits of the sum, which is stored in AL, and the remainder is the corresponding single digits, which is stored in AH.

Add aluminum, and get the ASCII code corresponding to ten digits in 30h.

Ah, get the ASCII code corresponding to the unit number in 30h.

mov bx,ax; The ASCII code corresponding to ten digits is stored in BL, and the ASCII code corresponding to one digit is stored in BH.

mov ah,2

mov dl,cl

int 2 1h; Output percentile

mov dl,bl

int 2 1h; Output ten digits

Mov dl gmbh

int 2 1h; Output a single digit

. Exit 0

end

I wrote this note myself. I don't know if the latter one will work.