Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model small
- .stack 100h
- .data
- s1 db 13,10,"Input limit: ","$"
- s2 db 13,10,"Sum series: ","$"
- .code
- main proc
- mov ax,@data
- mov dx,ax
- mov ah,09h
- lea dx,s1
- int 21h
- mobv bx,0
- read:
- mov ah,01h
- int 21h
- cmp al,0dh
- je next
- mov ah,0
- sub al,30h
- push ax
- mov ax,10d
- mul bx
- pop bx
- add bx,ax
- jmp read
- next:
- mov ax,bx
- mov cx,ax
- mov ax,0
- again:
- add ax,cx
- loop again
- push ax
- mov cx,0
- mov ah,09h
- lea dx,s2
- int 21h
- mov dx,0
- mob bx,10d
- pop ax
- displayed:
- mov dx,0
- div bx
- push dx
- inc cx
- or ax,ax
- jnz displayed
- print:
- mov dx,0
- mov ah,02h
- int 21h
- pop dx
- add dl,30h
- int 21h
- loop print
- mov ah,4ch
- int 21h
- main endp
- end main
Add Comment
Please, Sign In to add comment