title: 8051 Bubble Sort Issue
body: <p>I'm trying to code bubble sort on assembler 8051. This is what I managed to do so far, it sorts in ascending order, but it is also moving the elements leaving a blank space in the first position when it finishes.</p>
  
  <p>looking through the execution step by step I noticed that SUBB isn't changing the value of C making the instruction JC SKIP useless.</p>
  
  <pre><code> DEFSEG     INICIO1,ABSOLUTE
              SEG INICIO1
              JMP INICIO
  
              ORG 100H
      INICIO: MOV R1,#05H  
      EXT: MOV A,R1
              MOV R2,A
              MOV R0,#30H
              MOV A,@R0
      IN: INC R0
              MOV B,@R0
              CLR C
              SUBB A,B 
              JC SKIP
              MOV B,@R0
              DEC R0
              MOV A,@R0
              MOV @R0,B
              INC R0
              MOV @R0,A
      SKIP: DJNZ R2,IN                
              DJNZ R1,EXT
      STOP: SJMP STOP
              JMP FIN
      FIN:
              END
  </code></pre>