My code (on GitHub) builds and runs, but doesn't return the correct result from a function implemented in assembly.
This is the code running on the ULP-RISC-V:
Code: Select all
#include "ulp_riscv/ulp_riscv.h"
#include "ulp_riscv/ulp_riscv_utils.h"
extern int add(int x, int y);
volatile int result_s;
volatile int result_c;
int main(void)
{
result_s = add(1, 2);
result_c = 1 + 2;
}
If I comment out the call to the external assembly function add()
Code: Select all
//result_s = add(1, 2);
result_c = 1 + 2;
The add function is implemented as add.S:
Code: Select all
.section .text
.global add
.type add, @function
add:
add a0, a0, a1
ret
Everything builds and flashes to the chip fine. Any help getting this to work is appreciated!