title: Did the low register and high register swap places?
body: <pre><code>IDEAL
  MODEL small
  STACK 100h
  jumps
  p186
  DATASEG
  
  array dw 312, 340, 311, 300
  
  CODESEG
  proc example
      pusha
      mov al ,4 ;number of elements in array
      mov bl, 0 ;index
      label1:
      mov cx, [array + bx] ;here, every second element ch and cl are swapped
      inc bl
      cmp bl, al
      jb label1
      popa
      ret
  endp example
  
  start:
      mov ax, @data
      mov ds, ax
      
      call example
  exit:
      mov ax, 4c00h
      int 21h
  END start
  </code></pre>
  <p>In my assembly code, <code>cx</code> is okay in the 1st and 3rd iterations but in the 2nd and 4th ones for some reason <code>cl</code> and <code>ch</code> swapped their values with each other. I'm really overwhelmed with this and I would appreciate some help, thanks!</p>