count_iter_21.sa

来自「dsp6713开发板的许多例程.对入门特别有用」· SA 代码 · 共 18 行

SA
18
字号
        .global _count_loop_iterations_count_loop_iterations .cproc count        .reg    i, iters        MVK     -1,     iters       ; Loop executes exactly 1 extra iteration,                                    ; so start with the iteration count == -1.        SUB     count,  1,  i       ; Force "count==0" to iterate exactly once.loop:   .trip   1                   ; This loop is guaranteed to iterate at                                     ; least once.        ADD     iters,  1,  iters   ; iters++        BDEC    loop,   i           ; while (i-- >= 0);        .return iters               ; Return our number of iterations.        .endproc

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?