title: NASM addition program
body: <p>I am a developer who uses high level languages, learning assembly language in my spare time.  Please see the NASM program below:</p>
  
  <pre><code>section .data
  
  section .bss
  
  section .text
  global main
  main:
      mov eax,21
      mov ebx,9
      add eax,ebx
      mov ecx,eax
      mov eax,4
      mov ebx,1
      mov edx,4
      int 0x80
  push ebp
  mov ebp,esp
  
  mov esp,ebp
  pop ebp
  ret
  </code></pre>
  
  <p>Here are the commands I use:</p>
  
  <p>ian@ubuntu:~/Desktop/NASM/Program4$ nasm -f elf -o asm.o SystemCalls.asm
  ian@ubuntu:~/Desktop/NASM/Program4$ gcc -o program asm.o
  ian@ubuntu:~/Desktop/NASM/Program4$ ./program</p>
  
  <p>I don't get any errors, however nothing is printed to the terminal.  I used the following link to ensure the registers contained the correct values: <a href="http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html" rel="nofollow">http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html</a></p>