title: Logic Expression in 68000 assembly
body: <p>I posted earlier inquiring how to define hex constants for this program, which someone helped me out with, and now I'm trying to figure out if this program is running correctly.</p>
  
  <p>The program is intended to compute the logic expression X'Y + X'Z + YZ and put the result into D0. I need to show the contents of D0 in binary when the program completes. Here's what I have (alignment got a bit jumbled here, but it's aligned in the assembler (EASy 68K)):</p>
  
  <pre><code>START:  MOVE    X,D0
      NOT D0
      MOVE    D0,D1
      MOVE    Y,D2
      AND D2,D0
      AND Z,D1
      AND Z,D2
      OR  D1,D0
      OR  D2,D0
  EXIT:   BRA EXIT
  X:  DC  $000F
  Y:  DC  $0033
  Z:  DC  $0055
  </code></pre>
  
  <p>This is what I end up with in the respective data registers:</p>
  
  <p>D0: 00000071
  D1: 00000050
  D2: 00000011</p>
  
  <p>Ignoring the fact that the result is supposed to be shown in binary...being that this is a logic expression, and I use only AND and OR, shouldn't the result in D0 be either 1 or 0? Because X, Y, and Z are all non-zero constants, the expression evaluates to 1 (YZ=1)...have I made an error in the program? Or is my understanding off?</p>
  
  <p>Thanks</p>