И напишу, а на АРМе вы соврали в 25 раз Байтиков тут немного больше, разика в три(ну вы уж сами посчитайте, у вас жутко считает калькулятор...), но зато 440 тактов в худшем случае... Даже не смотря на полнокровное 32 битное деление. Ну а оскорблять зачем? Может я скачал, и запустил в эвал моде. Почем вам знать?
C:\temp\t\main.c
1 char strn[10];
\ strn:
\ 00000000 DS8 12
2
\ In segment CODE, align 4, keep-with-next
3 void atoi(char *rslt,unsigned int val)
4 {
\ atoi:
\ 00000000 00B5 PUSH {LR}
\ 00000002 0200 MOVS R2,R0
\ 00000004 0B00 MOVS R3,R1
5 int len=5;
6
7 rslt[len]=0;
\ 00000006 0020 MOVS R0,#+0
\ 00000008 5071 STRB R0,[R2, #+5]
8 while((--len)>=0)
9 {
10 rslt[len]=(val % 10)+'0';
\ 0000000A 1800 MOVS R0,R3
\ 0000000C 0A21 MOVS R1,#+10
\ 0000000E ........ _BLF ??divu32_t,??rT??divu32_t
\ 00000012 3030 ADDS R0,R0,#+48
\ 00000014 1071 STRB R0,[R2, #+4]
11 val /=10;
\ 00000016 1800 MOVS R0,R3
\ 00000018 0A21 MOVS R1,#+10
\ 0000001A ........ _BLF ??divu32_t,??rT??divu32_t
\ 0000001E 0B00 MOVS R3,R1
\ 00000020 1800 MOVS R0,R3
\ 00000022 0A21 MOVS R1,#+10
\ 00000024 ........ _BLF ??divu32_t,??rT??divu32_t
\ 00000028 3030 ADDS R0,R0,#+48
\ 0000002A D070 STRB R0,[R2, #+3]
\ 0000002C 1800 MOVS R0,R3
\ 0000002E 0A21 MOVS R1,#+10
\ 00000030 ........ _BLF ??divu32_t,??rT??divu32_t
\ 00000034 0B00 MOVS R3,R1
\ 00000036 1800 MOVS R0,R3
\ 00000038 0A21 MOVS R1,#+10
\ 0000003A ........ _BLF ??divu32_t,??rT??divu32_t
\ 0000003E 3030 ADDS R0,R0,#+48
\ 00000040 9070 STRB R0,[R2, #+2]
\ 00000042 1800 MOVS R0,R3
\ 00000044 0A21 MOVS R1,#+10
\ 00000046 ........ _BLF ??divu32_t,??rT??divu32_t
\ 0000004A 0B00 MOVS R3,R1
\ 0000004C 1800 MOVS R0,R3
\ 0000004E 0A21 MOVS R1,#+10
\ 00000050 ........ _BLF ??divu32_t,??rT??divu32_t
\ 00000054 3030 ADDS R0,R0,#+48
\ 00000056 5070 STRB R0,[R2, #+1]
\ 00000058 1800 MOVS R0,R3
\ 0000005A 0A21 MOVS R1,#+10
\ 0000005C ........ _BLF ??divu32_t,??rT??divu32_t
\ 00000060 0800 MOVS R0,R1
\ 00000062 0A21 MOVS R1,#+10
\ 00000064 ........ _BLF ??divu32_t,??rT??divu32_t
\ 00000068 3030 ADDS R0,R0,#+48
\ 0000006A 1070 STRB R0,[R2, #+0]
12 }
13
14 }
\ 0000006C 01BC POP {R0}
\ 0000006E 0047 BX R0 ;; return
\ In segment CODE, align 4, keep-with-next
15 void main(void)
16 {
\ main:
\ 00000000 00B5 PUSH {LR}
17
18 atoi(strn,65535);
\ 00000002 0349 LDR R1,??main_0 ;; 0xffff
\ 00000004 0348 LDR R0,??main_0+0x4 ;; strn
\ 00000006 ........ BL atoi
19 }
\ 0000000A 01BC POP {R0}
\ 0000000C 0047 BX R0 ;; return
??divu32_t [0x4778] bx pc
000081ae [0x46c0] nop
??divu32_a [0xe92d000c] stmfd r13!,{r2,r3}
000081b4 [0xe3a0c000] mov r12,#0
000081b8 [0xeaffffff] b 0x81bc ; (??divu32_a + 0xc)
000081bc [0xe1b02001] movs r2,r1
000081c0 [0x0a000031] beq 0x828c ; (??divu32_a + 0xdc)
000081c4 [0xe3a03000] mov r3,#0
000081c8 [0xe1510820] cmp r1,r0,lsr #16
000081cc [0x91a01801] movls r1,r1,lsl #16
000081d0 [0xe1510420] cmp r1,r0,lsr #8
000081d4 [0x91a01401] movls r1,r1,lsl #8
000081d8 [0xe15100a0] cmp r1,r0,lsr #1
000081dc [0x8a000020] bhi 0x8264 ; (??divu32_a + 0xb4)
000081e0 [0xe1510120] cmp r1,r0,lsr #2
000081e4 [0x8a00001c] bhi 0x825c ; (??divu32_a + 0xac)
000081e8 [0xe15101a0] cmp r1,r0,lsr #3
000081ec [0x8a000017] bhi 0x8250 ; (??divu32_a + 0xa0)
000081f0 [0xe1510220] cmp r1,r0,lsr #4
000081f4 [0x8a000012] bhi 0x8244 ; (??divu32_a + 0x94)
000081f8 [0xe15102a0] cmp r1,r0,lsr #5
000081fc [0x8a00000d] bhi 0x8238 ; (??divu32_a + 0x88)
00008200 [0xe1510320] cmp r1,r0,lsr #6
00008204 [0x8a000008] bhi 0x822c ; (??divu32_a + 0x7c)
00008208 [0xe15103a0] cmp r1,r0,lsr #7
0000820c [0x8a000003] bhi 0x8220 ; (??divu32_a + 0x70)
00008210 [0xe1500381] cmp r0,r1,lsl #7
00008214 [0x20400381] subcs r0,r0,r1,lsl #7
00008218 [0xe0a33003] adc r3,r3,r3
0000821c [0xe1500301] cmp r0,r1,lsl #6
00008220 [0x20400301] subcs r0,r0,r1,lsl #6
00008224 [0xe0a33003] adc r3,r3,r3
00008228 [0xe1500281] cmp r0,r1,lsl #5
0000822c [0x20400281] subcs r0,r0,r1,lsl #5
00008230 [0xe0a33003] adc r3,r3,r3
00008234 [0xe1500201] cmp r0,r1,lsl #4
00008238 [0x20400201] subcs r0,r0,r1,lsl #4
0000823c [0xe0a33003] adc r3,r3,r3
00008240 [0xe1500181] cmp r0,r1,lsl #3
00008244 [0x20400181] subcs r0,r0,r1,lsl #3
00008248 [0xe0a33003] adc r3,r3,r3
0000824c [0xe1500101] cmp r0,r1,lsl #2
00008250 [0x20400101] subcs r0,r0,r1,lsl #2
00008254 [0xe0a33003] adc r3,r3,r3
00008258 [0xe1500081] cmp r0,r1,lsl #1
0000825c [0x20400081] subcs r0,r0,r1,lsl #1
00008260 [0xe0a33003] adc r3,r3,r3
00008264 [0xe1500001] cmp r0,r1
00008268 [0x20400001] subcs r0,r0,r1
0000826c [0xe0a33003] adc r3,r3,r3
00008270 [0xe1510002] cmp r1,r2
00008274 [0x81a01421] movhi r1,r1,lsr #8
00008278 [0x8affffe4] bhi 0x8210 ; (??divu32_a + 0x60)
0000827c [0xe1a01003] mov r1,r3
00008280 [0xe1b03f8c] movs r3,r12,lsl #31
00008284 [0x22611000] rsbcs r1,r1,#0
00008288 [0x42600000] rsbmi r0,r0,#0
0000828c [0xe8bd000c] ldmfd r13!,{r2,r3}
00008290 [0xe12fff1e] bx r14