title: x86 ASM Linux - Using the .bss Section
body: <p>I hope these questions is rather simple: (NASM Compiler, Linux, x86 Intel Syntax)</p>
  
  <p>PART 1:</p>
  
  <p>I am trying to figure out how to use the .bss section of an Assembly program to find a way to store values, like a value from an operation (+ - * /), to an declared variable. For example:</p>
  
  <pre><code>section .bss
  
  variable:  resb 50                                       ;Imaginary buffer
  
  section .text
  
  add 10,1                                                 ;Operation
  ;move the result into variable
  </code></pre>
  
  <p>So, I know it is possible to do this with the kernel intterupt for reading user input (but that involves strings, but is there a way to copy this value into the <em>variable</em> variable so that it can be used later? This would be much easier than having to push and pop two things on and off the stack.</p>
  
  <p>PART 2:</p>
  
  <p>Is there a way to remove the value of the variable in the .bss section? In other words, if I want to store a new value in the .bss variable, how could I do it without the characters/values already in the variable not getting compounded with the new value(s)?</p>
  
  <p>Thanks</p>