.model small
.data
tmp db 5 dup(0)
ten db 10
eght db 8
cntr db 0
ans dw ?
tmp1 db 5 dup(?)
.code
mov ax,@data
mov ds,ax
mov al,71
mov BX,0000
LEA SI,tmp
L1:
mov ah,00
div ten
mov tmp[BX],ah
add cntr,1
add BX,1
cmp al,00
jne L1
mov BX,0000
sub cntr,1
mov ah,00
mov al,tmp[BX]
mov ans,ax
L2:
inc BX
mov ax,1
mov cx,bx
pow:
mul eght
Loop pow
mul tmp[BX]
add ans,ax
sub cntr,1
cmp cntr,0
jg L2
mov ax,ans
mov BX,0000
mov cntr,0
L3:
div ten
mov tmp[BX],ah
add cntr,1
add BX,1
mov ah,00
cmp al,00
jne L3
mov ch,00
mov Cl,cntr
mov dh,00
mov bl,cntr
mov bh,00
L4:
sub bl,1
add tmp[BX],30h
mov ah , 02h
mov dl,tmp[BX]
int 21h
Loop L4
mov ax,4C00h
int 21h
end