title: Comparing variables in NASM Assembly
body: <p>Serious trouble trying to get this working .. just starting NASM assembly so sorry if this is a noob of an issue, but any help is appreciated thankyou!</p>
  
  <p>Trying to get the two variables to render equal so the jump after cmp works. This is frustrating me greatly, as the direct values ( if a mov eax and ebx to be "5" ) it works so is it an address problem? I'm not sure.</p>
  
  <pre><code>section .data
  
      str_equal   db      "Equal!", 0xA
      len_equal   equ     $ - str_equal
  
      str_number_a    db      "5"
      str_number_b    db      "5"
  
  section .text
  
      global _start
  
  _start:
  
      mov     eax,        [ str_number_a ]
      mov     ebx,        [ str_number_b ]
  
      cmp     eax,        ebx
      je      _Equal
      jmp     _Exit
  
  ret
  
  
  _Equal:
  
      mov     eax,        4                       ; syscall - write()
      mov     ebx,        1                       ; stdout
      mov     ecx,        str_equal
      mov     edx,        len_equal
      int     0x80                                ; Call dat Kernel
  
      jmp     _Exit
  
  ret
  
  
  _Exit:
  
      mov     eax,        1
      mov     ebx,        0
      int     0x80
  
  ret
  </code></pre>