DATA SEGMENT
Y DB 10 DUP(0)
DATA ENDS
STACK SEGMENT PARASTACK 'STACK'
STA DB 100 DUP(0)
TOP EQU LENGTH STA
STACK ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:STACK,ES:DATA
START PROC FAR
PUSH DS
XOR AX,AX
PUSH AX
MOV AX,DATA
MOV DS,AX
LEA SI,Y
MOV DL,AH
MOV AH,02
MOV DL,'S'
INT 21H
MOV DL,'='
INT 21H
MOV BX,1
MOV AX,0
XOR CH,CH
MOV CL,100
LOP:
ADD AX,BX
INC BX
LOOP LOP
MOV BX,00AH
LOP1:
XOR DX,DX
DIV BX
MOV [SI],DL
INC SI
CMP AX,00AH
JAE LOP1
MOV [SI],AL
MOV [SI+1],DL
LOP2:
MOV DL,[SI]
CALL DISP
DEC SI
CMP SI,0
JGE LOP2
MOV AH,4CH
INT 21H
DISP PROC NEAR
MOV AH,2
OR DL,30H
INT 21H
RET
DISP ENDP
START ENDP
CODE ENDS
ENDSTART
Y DB 10 DUP(0)
DATA ENDS
STACK SEGMENT PARASTACK 'STACK'
STA DB 100 DUP(0)
TOP EQU LENGTH STA
STACK ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:STACK,ES:DATA
START PROC FAR
PUSH DS
XOR AX,AX
PUSH AX
MOV AX,DATA
MOV DS,AX
LEA SI,Y
MOV DL,AH
MOV AH,02
MOV DL,'S'
INT 21H
MOV DL,'='
INT 21H
MOV BX,1
MOV AX,0
XOR CH,CH
MOV CL,100
LOP:
ADD AX,BX
INC BX
LOOP LOP
MOV BX,00AH
LOP1:
XOR DX,DX
DIV BX
MOV [SI],DL
INC SI
CMP AX,00AH
JAE LOP1
MOV [SI],AL
MOV [SI+1],DL
LOP2:
MOV DL,[SI]
CALL DISP
DEC SI
CMP SI,0
JGE LOP2
MOV AH,4CH
INT 21H
DISP PROC NEAR
MOV AH,2
OR DL,30H
INT 21H
RET
DISP ENDP
START ENDP
CODE ENDS
ENDSTART