Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .intel_syntax noprefix ;# polecenia sterujące zaczynają się od '.'
  2. .global  main ;# Ktore symbole/dyrektywy sa widoczne na zewnatrz
  3. # program dzielimy na dane i na kod programu
  4. .text ;# Kod programu
  5.  
  6.     main:
  7.         mov eax, offset x
  8.         push eax
  9.         mov eax, offset formatin
  10.         push eax
  11.         call scanf
  12.         add esp, 8
  13.  
  14.  
  15.         mov eax, x
  16.         shl eax, 1
  17.         push eax
  18.         mov eax, offset formatout
  19.         push eax
  20.         call printf
  21.         add esp, 8
  22.         xor eax, eax
  23.  
  24.  
  25.         ret
  26.  
  27.    
  28. .data ;# dane
  29.     x: .int 0
  30.     formatin: .asciz "%d"
  31.     formatout: .asciz "%d\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement