text: Q:
  
  Pythagorean triple test, yasm x64
  
  I'm using the yasm assembler on 64-bit Linux. The following program prints "False", while I think it should print "True":
  section .data
      a   db  3
      b   db  4
      c   db  5
      succ    db  "True", 0x0A
      fail    db  "False", 0x0A
  
  section .text
   global _start
  
  _start:
      mov eax, [a]
      mov ebx, [b]
      mov ecx, [c]
  
      imul eax, eax   ;eax now contains a^2
      imul ebx, ebx   ;ebx now contains b^2
      imul ecx, ecx   ;ecx now contains c^2
  
      add  eax, ebx   ;eax now contains a^2 + b^2
      sub  eax, ecx   ;eax now contains (a^2 + b^2) - c^2
      cmp  eax, 0
      jne  failure
  
  success:
      mov  eax, 1     ;write call
      mov  edi, 1     ;stdout
      mov  esi, succ
      mov  edx, 5     ;write 5 bytes
      syscall
      jmp end
  
  failure:
      mov  eax, 1     ;write call
      mov  edi, 1     ;stdout
      mov  esi, fail
      mov  edx, 6     ;write 6 bytes
      syscall
  
  end:
      mov  eax, 60    ;64-bit exit call
      mov  edi, 0
      syscall 
  
  Is there a problem with the flags? Apparently "not equal" is evaluating to true.
  
  A:
  
  Your variables are byte sized but you load 4 bytes from each. Use movzx to sign-extend, such as:
  movzx eax, byte [a]
  movzx ebx, byte [b]
  movzx ecx, byte [c]
  
  PS: learn to use a debugger.
  
  