I have a case that I want to automate my inline assembly inside a function.
regx
has 32 bits, and read
has 8 bits.
uint32_t *r(uint32_t regx){
uint32_t *read;
for(int i = 0; i<4; i ++){
__asm__ volatile("csrr %0, regx" : "=r"(read));
}
return read;
}
regx
is the argument that I want to change with different values (regx= 0x3A) for example.
I appreciate any suggestions.