title: Error while reversing string in 8086
body: <p>I have this code to reverse a string using 8086 ALP. But the code does not work as intended and gets into a infinite loop or prints some random charecter.</p>
  
  <pre><code>.model small
  .stack 100h
  .data
  String1 DB "Assembly Language Program$"
  Length dw $-String1-1
  
  .code
  Main proc
  MOV AX, @data
  MOV DS, AX
  
  MOV SI, Offset String1
  MOV CX, Length  
  ADD SI, CX
  
  Back: MOV DL, [SI]
  MOV AH, 02H
  INT 21H
  DEC SI
  LOOP Back  
  
  MOV AH, 4CH
  INT 21H
  Main endp
  End main
  </code></pre>