title: NASM Assembly converting from ASCII to decimal
body: <p>I know you can add 48 to convert from decimal to ascii or subtract 48 to convert from ascii to decimal, but why does the following code also perform this same conversion?</p>
  
  <pre><code>; moving the first number to eax register and second number to ebx
  ; and subtracting ascii '0' to convert it into a decimal number
  mov eax, [number1]
  sub eax, '0'
  </code></pre>
  
  <p>and</p>
  
  <pre><code>; add '0' to to convert the sum from decimal to ASCII
  add eax, '0'
  </code></pre>