daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Mar 21st, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %include "io.inc"
  2.  
  3. section .bss
  4.     res resd 1
  5.     n resd 1
  6.     k resd 1
  7.     m resd 1
  8.     r resd 1
  9.     i resd 1
  10.     Cres resd 1
  11.     Ck resd 1
  12. section .text
  13. global CMAIN
  14. CMAIN:
  15.         GET_UDEC 4, [n]
  16.         GET_UDEC 4, [k]
  17.    
  18.         cmp dword [k], 32       ;if (k > 32)
  19.         jna l1
  20.         mov dword [res], 0      
  21.         PRINT_UDEC 4, 0
  22.         NEWLINE
  23.         jmp exit
  24.    
  25.     l1:
  26.             cmp dword [n], 2    ;if (n < 2)
  27.             jnb l2
  28.             cmp dword [k], 1    ;k > 1 ?
  29.             jna IfNot
  30.             PRINT_UDEC 4, 0
  31.             NEWLINE
  32.             jmp exit
  33.         IfNot:
  34.             mov ebx, [k]
  35.             xor [n], ebx
  36.             xor ebx, ebx
  37.             PRINT_UDEC 4, [n]
  38.             NEWLINE
  39.             jmp exit
  40.    
  41.     l2:
  42.         mov dword [m], 0    ;m = 0
  43.         mov ebx, [n]        
  44.         mov [i], ebx        ;i = n
  45.         ;...
  46.     exit:
  47.         xor eax, eax
  48.         ret
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top