01 .cpu cortex-m4 23 chk_nodup:
02 .syntax unified 24 push {r1, lr}
25 mov r0, r1
03 .text 26 mov r3, #0
04 .global main 27 chk_loop:
05 main: 28 cmp r0, #0
06 mov r0, #0 29 it eq
07 loop: 30 popeq {r1, pc}
08 bl next_perm
31 mov r2, #10
09 // show register 0 32 udiv r1, r0, r2
33 mul r1, r2
10 b loop 34 sub r1, r0, r1
35 udiv r0, r2
11 next_perm:
12 push {lr} 36 mov r2, #1
13 next_loop: 37 lsl r2, r1
14 add r0, #1 38 mov r1, r2
15 mov r1, r0 39 and r2, r3
16 bl chk_nodup
17 eor r0, r1 40 cmp r2, #0
18 eor r1, r0 41 itt ne
19 eor r0, r1 42 movne r0, #1
43 popne {r1, pc}
20 cmp r1, #1
21 beq next_loop 44 orr r3, r1
22 pop {pc} 45 b chk_loop