Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sub main() {
  2.     return if !(3 % 3) and 0 4 % 4
  3.            else if 0 and 0 >= 1 2 + 7
  4.            else if 0 or 2 < 3 3 + 5
  5.            else if 0 and 2 <= 2 5 - 2
  6.            else 6 * 2
  7. }
  8.  
  9. turns...
  10.  
  11. section .text
  12.  
  13. ; main() > Integer
  14. global main:function (main.end - main)
  15.  
  16. main:
  17.     mov rax, 3
  18.     push rax
  19.     mov rax, 3
  20.     pop rbx
  21.     xor rdx, rdx
  22.     idiv rbx
  23.     mov rax, rdx
  24.     cmp rax, 0
  25.     je .neg1
  26.     mov rax, 0
  27.     jmp .negfinal1
  28.  
  29. .neg1:
  30.     mov rax, 1
  31.  
  32. .negfinal1:
  33.     cmp rax, 0
  34.     jne .and2clause1
  35.     xor rax, rax
  36.     jmp .andend1
  37.  
  38. .and2clause1:
  39.     mov rax, 0
  40.     cmp rax, 0
  41.     jne .andsuccess1
  42.     xor rax, rax
  43.     jmp .andend1
  44.  
  45. .andsuccess1:
  46.     mov rax, 1
  47. .andend1:
  48.     cmp rax, 0
  49.     je .iffalse1
  50.  
  51.     mov rax, 4
  52.     push rax
  53.     mov rax, 4
  54.     pop rbx
  55.     xor rdx, rdx
  56.     idiv rbx
  57.     mov rax, rdx
  58.     jmp .iffinal1
  59.  
  60. .iffalse1:
  61.     mov rax, 0
  62.     cmp rax, 0
  63.     jne .and2clause2
  64.     xor rax, rax
  65.     jmp .andend2
  66.  
  67. .and2clause2:
  68.     mov rax, 0
  69.     push rax
  70.     mov rax, 1
  71.     pop rbx
  72.     cmp rbx, rax
  73.     jge .comparativetrue2
  74.     xor rax, rax
  75.     jmp .comparativeend2
  76.  
  77. .comparativetrue2:
  78.     mov rax, 1
  79.  
  80. .comparativeend2:
  81.     cmp rax, 0
  82.     jne .andsuccess2
  83.     xor rax, rax
  84.     jmp .andend2
  85.  
  86. .andsuccess2:
  87.     mov rax, 1
  88. .andend2:
  89.     cmp rax, 0
  90.     je .iffalse2
  91.  
  92.     mov rax, 2
  93.     push rax
  94.     mov rax, 7
  95.     pop rbx
  96.     add rax, rbx
  97.     jmp .iffinal2
  98.  
  99. .iffalse2:
  100.     mov rax, 0
  101.     cmp rax, 0
  102.     je .or2clause3
  103.     mov rax, 1
  104.     jmp .orend3
  105.  
  106. .or2clause3:
  107.     mov rax, 2
  108.     push rax
  109.     mov rax, 3
  110.     pop rbx
  111.     cmp rbx, rax
  112.     jl .comparativetrue3
  113.     xor rax, rax
  114.     jmp .comparativeend3
  115.  
  116. .comparativetrue3:
  117.     mov rax, 1
  118.  
  119. .comparativeend3:
  120.     cmp rax, 0
  121.     je .orfail3
  122.     mov rax, 1
  123.     jmp .orend3
  124.  
  125. .orfail3:
  126.     mov rax, 0
  127. .orend3:
  128.     cmp rax, 0
  129.     je .iffalse3
  130.  
  131.     mov rax, 3
  132.     push rax
  133.     mov rax, 5
  134.     pop rbx
  135.     add rax, rbx
  136.     jmp .iffinal3
  137.  
  138. .iffalse3:
  139.     mov rax, 0
  140.     cmp rax, 0
  141.     jne .and2clause4
  142.     xor rax, rax
  143.     jmp .andend4
  144.  
  145. .and2clause4:
  146.     mov rax, 2
  147.     push rax
  148.     mov rax, 2
  149.     pop rbx
  150.     cmp rbx, rax
  151.     jle .comparativetrue4
  152.     xor rax, rax
  153.     jmp .comparativeend4
  154.  
  155. .comparativetrue4:
  156.     mov rax, 1
  157.  
  158. .comparativeend4:
  159.     cmp rax, 0
  160.     jne .andsuccess4
  161.     xor rax, rax
  162.     jmp .andend4
  163.  
  164. .andsuccess4:
  165.     mov rax, 1
  166. .andend4:
  167.     cmp rax, 0
  168.     je .iffalse4
  169.  
  170.     mov rax, 5
  171.     push rax
  172.     mov rax, 2
  173.     pop rbx
  174.     sub rax, rbx
  175.     jmp .iffinal4
  176.  
  177. .iffalse4:
  178.     mov rax, 6
  179.     push rax
  180.     mov rax, 2
  181.     pop rbx
  182.     imul rax, rbx
  183.  
  184. .iffinal4:
  185.  
  186. .iffinal3:
  187.  
  188. .iffinal2:
  189.  
  190. .iffinal1:
  191.     ret
  192. .end:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement