I'm learning but sometimes I hit a brick wall, here is one of those walls.
This does not work as expected.
" dec r18 \n" " brne nextElement \n"
this does.
" dec r18 \n" " cpi r18,0 \n" " breq nextElement \n"
The expectation here is to branch when I hit 0 from a count down. I do load in 8 to my r18 but why do I have to use the compare? The brne should see the flag should it not? The later is either always branching, or never. I figured maybe its not my logic, maybe its my timing but this also does not work.
" nop \n" " dec r18 \n" " brne nextElement \n"
Both would count up to 3 instructions + jmp per loop?
I could be something else in my code and I'm determined to find it but I just need a sanity check here. Are my assumptions correct?