Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model small
- .stack
- .data
- n dw 23
- f1 dw 1
- f2 dw 1
- p dw ?
- .code
- main:
- mov ax,@data
- mov ds,ax
- mov ax,n
- sub ax,2
- mov n,ax
- mov cx, 0
- petlja:
- cmp cx,n
- je done
- mov ax,f1
- mov bx,f2
- add ax,bx
- mov f1,bx
- mov f2,ax
- inc cx
- jmp petlja
- done:
- mov ax,f2
- mov bx,0
- mov cx,10
- stampa:
- cmp ax, 0
- je kraj_stampa
- mov dx,0
- div cx
- push dx
- inc bx
- jmp stampa
- kraj_stampa:
- cmp bx, 0
- je kraj
- pop dx
- add dx, '0'
- mov ah, 2
- int 21h
- dec bx
- jmp kraj_stampa
- kraj:
- mov ah,4ch
- int 21h
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement