Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- .align 4
- res: .long 0,0,0,0,0,0,0,0,0,0,0
- .text
- .globl main
- main:
- mov $0,%eax #; temporary
- mov $0,%esi #; counter (n)
- mov %eax,res(,%esi,4) #; res[n] = 0
- add $1,%esi
- mov $1,%eax
- mov %eax,res(,%esi,4) #; res[n+1] = 1
- add $1,%esi
- mov $1,%edx #; %ebx = n-1
- mov $0,%ecx #; %ecx = n-2
- L1:
- cmp $11,%esi
- je L2
- mov $0,%eax
- add res(,%edx,4),%eax
- add res(,%ecx,4),%eax
- mov %eax,res(,%esi,4)
- add $1,%esi
- add $1,%edx
- add $1,%ecx
- jmp L1
- L2:
- mov $0,%ebx
- mov res(,%edx,4),%ebx
- call stop
Add Comment
Please, Sign In to add comment