Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %include "io.inc"
- section .bss
- a resd 15
- exist resd 15
- n resd 1
- m resd 1
- k resd 1
- section .text
- global CMAIN
- CMAIN:
- push ebp
- mov ebp,esp
- GET_UDEC 4, dword[n]
- GET_UDEC 4, dword[k]
- GET_UDEC 4, dword[m]
- xor edx, edx; cur = edx
- xor edi, edi
- push edi
- call GEN
- xor eax, eax
- pop ebp
- ret
- GEN:
- push ebp
- mov ebp,esp
- mov eax,[ebp + 8]
- cmp dword[k], eax
- jne L
- inc edx
- cmp edx, dword[m]
- jne .2
- xor ecx, ecx
- .4:
- cmp ecx, dword[k]
- jae .3
- inc dword[a + 4 * ecx]
- mov ebx, dword[a + 4 * ecx]
- PRINT_UDEC 4, ebx
- inc ecx
- jmp .4
- .3:
- NEWLINE
- .2:
- pop ebp
- ret
- L:
- xor ecx, ecx
- cmp ecx, dword[n]
- jae .5
- .6:
- cmp dword[exist + 4 * ecx], 0
- jne .5
- mov dword[exist + 4 * ecx], 1
- mov dword[a + 4 * ecx], ecx
- inc eax
- mov edi, eax
- push edi
- call GEN
- mov dword[exist + 4 * ecx], 0
- inc ecx
- jmp .6
- .5:
- pop ebp
- ret
Add Comment
Please, Sign In to add comment