این برنامه دوتا عدد بزرگ میگیره به صورت اسکی جمع میکنه بعد تو یه ارایه قرار میده.
DATA SEGMENT
H_1 DB 0H
H_2 DB 0H
NUM DB 100 DUP(0)
NUM2 DB 100 DUP(0)
NEL DB 0AH,"$"
CR1 DB 101 DUP(0);CARRY NUMBER
CP2 DB 101 DUP(0);CARRY NUMBER
D_1 DB ?
D_2 DB ?
FIN DB DUP 151 DUP(0)
ENDS
STACK SEGMENT
DW 128H DUP(0)
ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
MOV ES,AX
LEA SI,NUM
LABEL1:
MOV AH,1
INT 21H
CMP AL,8
JE LABEL2
CMP AL,20H
JE LABEL1
CMP AL,0DH
JE LABEL3
INC H_1
MOV CL,H_1
MOV [SI],AL
INC SI
JMP LABEL1
LABEL2:
CMP H_1,0
JE LABEL1
DEC H_1
JMP LABEL1
LABEL3:
LEA DX,NEL
MOV AH,9
INT 21H
LEA SI,NUM2
LABEL4:
MOV AH,1
INT 21H
CMP AL,8
JE LABEL5
CMP AL,20H
JE LABEL4
CMP AL,0DH
JE LABEL6
INC H_2
MOV CL,H_2
MOV [SI],AL
INC SI
JMP LABEL4
LABEL5:
CMP H_2,0
JE LABEL4
DEC H_2
JMP LABEL4
LABEL6:
LEA DX,NEL
MOV AH,9
INT 21H
DARK1:
MOV DL,H_1
MOV D_1,DL
LEA SI,CR1
ADD SI,100
LEA DI,NUM
MOV BX,0
MOV BL,H_1
ADD DI,BX
DEC DI
DARK2:
MOV AL,[DI]
MOV [SI],AL
DEC SI
DEC DI
DEC D_1
CMP D_1,0
JNE DARK2
DARK3:
MOV DL,H_2
MOV D_2,DL
LEA SI,CP2
ADD SI,100
LEA DI,NUM2
MOV BX,0
MOV BL,H_2
ADD DI,BX
DEC DI
DARK4:
MOV AL,[DI]
MOV [SI],AL
DEC SI
DEC DI
DEC D_2
CMP D_2,0
JNE DARK4
MOV AL,H_1
MOV CL,H_2
CMP AL,CL
JE CHAOS1
JA CHAOS2
JL CHAOS3
CHAOS1:
MOV D_1,AL
LEA SI,CR1
LEA DI,CP2
ADD SI,100
ADD DI,100
LEA BP,FIN
ADD BP,150
CHAOS1_1:
MOV DX,0
ADD DX,[SI]
ADD DX,[DI]
MOV [BP],DL
DEC SI
DEC DI
DEC BP
DEC D_1
CMP D_1,0
JE FINISHEM
JMP CHAOS1_1
CHAOS2:
MOV D_1,AL
LEA SI,CR1
LEA DI,CP2
ADD SI,100
ADD DI,100
LEA BP,FIN
ADD BP,150
CHAOS1_2:
MOV DX,0
ADD DX,[SI]
ADD DX,[DI]
MOV [BP],DL
DEC SI
DEC DI
DEC BP
DEC D_1
CMP D_1,0
JE FINISHEM
JMP CHAOS1_2
CHAOS3:
MOV D_1,CL
LEA SI,CR1
LEA DI,CP2
ADD SI,100
ADD DI,100
LEA BP,FIN
ADD BP,150
CHAOS1_3:
MOV DX,0
ADD DX,[SI]
ADD DX,[DI]
MOV [BP],DL
DEC SI
DEC DI
DEC BP
DEC D_1
CMP D_1,0
JE FINISHEM
JMP CHAOS1_3
FINISHEM:
MOV AX, 4c00H
INT 21H
ENDS
END START