RP2040 汇编编程:浮点运算与多处理器编程
1. 浮点运算
在程序中添加浮点运算所需的所有元素都已具备。值得查看函数表中提供快速批量内存和位计数/操作功能的函数。
1.1 浮点程序示例
以下是一个用于将两个浮点数相加、打印总和,然后计算总和的平方根并打印该结果的程序:
@
@ Examples of the floating point routines.
@
#include "pico/bootrom/sf_table.h"
.thumb_func @ Necessary because sdk uses BLX
.global main @ Provide program starting address
to linker
.EQU datatable, 0x16
.EQU helperfn, 0x18
main: BL stdio_init_all @ initialize uart or usb
MOV R3, #datatable @ Load data table
LDRH R0, [R3] @ Address of the data table
LDRH R1, code @ Load the code SF for software float
MOV R5, #helperfn @ address of the helper function
LDR R5, [R5]
超级会员免费看
订阅专栏 解锁全文
1828

被折叠的 条评论
为什么被折叠?



