title: Is this assembly code sorting numbers in ascending order?
body: <p>I am trying to figure out what this assembly code is performing.</p>
  <pre><code>.equ        SIZE    =128
  .equ        TABLE_L =$60
  .equ        TABLE_H =$00
  
  .def    A   =r13
  .def    B   =r14
  .def    cnt2    =r15
  .def    cnt1    =r16
  .def    endL    =r17
  .def    endH    =r18
  
  Outer:
      mov ZL, endL
      mov ZH, endH
      mov cnt2, cnt1
  inner_loop: ld  A, Z
      ld  B, -Z
      cp  A, B
      brlo    L1
      st  Z, A
      std Z+1, B
  L1: dec cnt2
      brne    inner_loop
      dec cnt1
      brne    Outer
      ret
  
  table:  
  </code></pre>
  <p>I believe it may be sorting numbers in ascending order, but I am not sure. The table is left blank as I am not sure what values are stored there. I am trying to figure out what the code does based only on the code.</p>