cordic_yong_cos_sin:
.int 0x0000,0x4000,0x2D41,0x2D41,0x3B20,0x187D,0x3EC5,0x0C7C,0x3FB1,0x0645,0x3FEC,0x0323,0x3FFB,0x0192,0x3FFE,0x00C9,0x3FFF,0x0064,0x3FFF,0x0032,0x3FFF,0x0019,0x3FFF,0x000C,0x3FFF,0x0006,0x3FFF,0x0003,0x3FFF,0x0001,0x3FFF,0x0000
__atan2_ji_suan:
@入口R0=实部,R1=虚部,结果=R0
push {r2-r7,lr}
mov r2, r8
push {r2}
ldr r3, = cordic_yong_cos_sin
movs r2, # 10
muls r0, r0, r2
muls r1, r1, r2
movs r2, # 0
mov r8, r2
ldr r4, = 9000
lsls r4, r4, # 15
__cordic_atan2_xun_huan:
__du_cos_sin:
ldr r5, [r3] @cos
adds r3, r3, # 4
mov r7, r5
ldr r6, [r3] @sin
adds r3, r3, # 4
mov r2, r6
muls r5, r5, r0 @x*cos
muls r2, r2, r0 @x*sin
muls r6, r6, r1 @y*sin
muls r7, r7, r1 @y*cos
movs r1, r1
bpl __ni_shi_zhen_zhuan
__shun_shi_zhen_zhuan:
subs r5, r5, r6
adds r7, r7, r2
mov r6, r8
adds r6, r6, r4
mov r8, r6
b __xuan_zhuan_wan
__ni_shi_zhen_zhuan:
adds r5, r5, r6
subs r7, r7, r2
mov r6, r8
subs r6, r6, r4
mov r8, r6
__xuan_zhuan_wan:
ldr r6, = cordic_yong_cos_sin
movs r2, # 32
lsls r2, r2, # 2
adds r6, r6, r2
asrs r5, r5, # 14
asrs r7, r7, # 14
mov r0, r5
mov r1, r7
lsrs r4, r4, # 1 @旋转
cmp r3, r6
bne __cordic_atan2_xun_huan
mov r0, r8
mvns r0, r0
adds r0, r0, # 1
asrs r0, r0, # 15
mov r2, r8
pop {r2}
pop {r2-r7,pc}
软件 cordic 了解一下