Advertisement
obernardovieira

[SASM] Get number add a value print again

Feb 6th, 2015
619
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;basic example using SASM software
  2.  
  3. %include "io.inc"
  4.  
  5. section .data
  6. myvalue:    equ 4    ;you also can use 0100b has binary or 4h has hexadecimal
  7. section .text
  8.     global CMAIN
  9. CMAIN:
  10.     ;write your code here
  11.     xor eax, eax    ;clear eax
  12.    
  13.     GET_DEC 4, eax  ;get the number from input
  14.    
  15.     add eax, myvalue    ;add 4
  16.    
  17.     PRINT_DEC 4, eax    ;print again
  18.    
  19.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement