title: Find the total number of elements in an array of 8-bit integers that are larger than 20, using for-loop looping construct
body: <p>(Find the total number of elements in an array of 8-bit integers that are larger than 20, using for-loop looping construct)  I am coding in assembly language and not sure how to go about this for homework assignment. I have the basic outline, just not sure how to set up the floop for this. (avr assembly)</p>
  
  <pre><code>counter:
  .equ as = 10
  .def loopcount = r16
  .def count = r17
  .cseg
  .org 0x00
  jmp start
  .org 0xF6
  
  start:
  ldi ZL,low(array&lt;&lt;1)
  ldi ZH,high(array&lt;&lt;1)
  ldi count,0
  ldi loopcount,as
  
  loop:
  cpi 
  
  next:
  dec loopcount
  brne loop
  
  done:
  rjmp done
  
  array:
  .db 15, 24, 124, 17, 64, 27, 67, 97, 4, 19
  </code></pre>