Guest User

Untitled

a guest
Aug 13th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %include "io.inc"
  2. section .bss
  3. a resd 15
  4. exist resd 15
  5. n resd 1
  6. m resd 1
  7. k resd 1
  8.  
  9. section .text
  10. global CMAIN
  11.  
  12. CMAIN:
  13. push ebp
  14. mov ebp,esp
  15. GET_UDEC 4, dword[n]
  16. GET_UDEC 4, dword[k]
  17. GET_UDEC 4, dword[m]
  18.  
  19. xor edx, edx; cur = edx
  20. xor edi, edi
  21. push edi
  22. call GEN
  23. xor eax, eax
  24. pop ebp
  25. ret
  26.  
  27. GEN:
  28. push ebp
  29. mov ebp,esp
  30.  
  31. mov eax,[ebp + 8]
  32. cmp dword[k], eax
  33. jne L
  34.     inc edx
  35.     cmp edx, dword[m]
  36.     jne .2
  37.         xor ecx, ecx
  38.         .4:
  39.         cmp ecx, dword[k]
  40.         jae .3
  41.             inc dword[a + 4 * ecx]
  42.             mov ebx, dword[a + 4 * ecx]
  43.             PRINT_UDEC 4, ebx
  44.             inc ecx
  45.             jmp .4
  46.             .3:
  47.             NEWLINE
  48.         .2:
  49.         pop ebp
  50.         ret
  51. L:
  52. xor ecx, ecx
  53. cmp ecx, dword[n]
  54. jae .5
  55.     .6:
  56.     cmp dword[exist + 4 * ecx], 0
  57.     jne .5
  58.         mov dword[exist + 4 * ecx], 1
  59.         mov dword[a + 4 * ecx], ecx
  60.         inc eax
  61.         mov edi, eax
  62.         push edi
  63.         call GEN
  64.         mov dword[exist + 4 * ecx], 0
  65.         inc ecx
  66.         jmp .6
  67.     .5:
  68.     pop ebp
  69.     ret
Add Comment
Please, Sign In to add comment